From owner-svn-src-head@freebsd.org Sun Jan 29 00:05:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 354A0CBB213; Sun, 29 Jan 2017 00:05:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F2F1C45; Sun, 29 Jan 2017 00:05:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0T05oBh059457; Sun, 29 Jan 2017 00:05:50 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T05nbo059451; Sun, 29 Jan 2017 00:05:49 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701290005.v0T05nbo059451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 29 Jan 2017 00:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312939 - in head/sys/dev: mmc sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 00:05:51 -0000 Author: marius Date: Sun Jan 29 00:05:49 2017 New Revision: 312939 URL: https://svnweb.freebsd.org/changeset/base/312939 Log: Fix overly long lines, whitespace and other bugs according to style(9). Modified: head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcsd.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/mmc/mmc.c Sun Jan 29 00:05:49 2017 (r312939) @@ -259,7 +259,7 @@ mmc_suspend(device_t dev) err = bus_generic_suspend(dev); if (err) - return (err); + return (err); mmc_power_down(sc); return (0); } @@ -980,10 +980,14 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); - csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; - csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; - csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; - csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; + csd->vdd_r_curr_min = + cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; + csd->vdd_r_curr_max = + cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; + csd->vdd_w_curr_min = + cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; + csd->vdd_w_curr_max = + cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; m = mmc_get_bits(raw_csd, 128, 62, 12); e = mmc_get_bits(raw_csd, 128, 47, 3); csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; @@ -1008,8 +1012,8 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); - csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + 1) * - 512 * 1024; + csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + + 1) * 512 * 1024; csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); @@ -1307,18 +1311,21 @@ mmc_discover_cards(struct mmc_softc *sc) break; } newcard = 1; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) + if ((err = device_get_children(sc->dev, &devlist, + &devcount)) != 0) return; for (i = 0; i < devcount; i++) { ivar = device_get_ivars(devlist[i]); - if (memcmp(ivar->raw_cid, raw_cid, sizeof(raw_cid)) == 0) { + if (memcmp(ivar->raw_cid, raw_cid, sizeof(raw_cid)) == + 0) { newcard = 0; break; } } free(devlist, M_TEMP); if (bootverbose || mmc_debug) { - device_printf(sc->dev, "%sard detected (CID %08x%08x%08x%08x)\n", + device_printf(sc->dev, + "%sard detected (CID %08x%08x%08x%08x)\n", newcard ? "New c" : "C", raw_cid[0], raw_cid[1], raw_cid[2], raw_cid[3]); } @@ -1370,7 +1377,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); /* Get card switch capabilities (command class 10). */ if ((ivar->scr.sda_vsn >= 1) && - (ivar->csd.ccc & (1<<10))) { + (ivar->csd.ccc & (1 << 10))) { mmc_sd_switch(sc, SD_SWITCH_MODE_CHECK, SD_SWITCH_GROUP1, SD_SWITCH_NOCHANGE, switch_res); @@ -1537,7 +1544,8 @@ mmc_rescan_cards(struct mmc_softc *sc) ivar = device_get_ivars(devlist[i]); if (mmc_select_card(sc, ivar->rca)) { if (bootverbose || mmc_debug) - device_printf(sc->dev, "Card at relative address %d lost.\n", + device_printf(sc->dev, + "Card at relative address %d lost.\n", ivar->rca); device_delete_child(sc->dev, devlist[i]); free(ivar, M_DEVBUF); @@ -1559,7 +1567,8 @@ mmc_delete_cards(struct mmc_softc *sc) for (i = 0; i < devcount; i++) { ivar = device_get_ivars(devlist[i]); if (bootverbose || mmc_debug) - device_printf(sc->dev, "Card at relative address %d deleted.\n", + device_printf(sc->dev, + "Card at relative address %d deleted.\n", ivar->rca); device_delete_child(sc->dev, devlist[i]); free(ivar, M_DEVBUF); @@ -1589,7 +1598,8 @@ mmc_go_discovery(struct mmc_softc *sc) mmc_idle_cards(sc); err = mmc_send_if_cond(sc, 1); if ((bootverbose || mmc_debug) && err == 0) - device_printf(sc->dev, "SD 2.0 interface conditions: OK\n"); + device_printf(sc->dev, + "SD 2.0 interface conditions: OK\n"); if (mmc_send_app_op_cond(sc, 0, &ocr) != MMC_ERR_NONE) { if (bootverbose || mmc_debug) device_printf(sc->dev, "SD probe: failed\n"); @@ -1599,13 +1609,15 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_set_mode(dev, mode_mmc); if (mmc_send_op_cond(sc, 0, &ocr) != MMC_ERR_NONE) { if (bootverbose || mmc_debug) - device_printf(sc->dev, "MMC probe: failed\n"); + device_printf(sc->dev, + "MMC probe: failed\n"); ocr = 0; /* Failed both, powerdown. */ } else if (bootverbose || mmc_debug) device_printf(sc->dev, "MMC probe: OK (OCR: 0x%08x)\n", ocr); } else if (bootverbose || mmc_debug) - device_printf(sc->dev, "SD probe: OK (OCR: 0x%08x)\n", ocr); + device_printf(sc->dev, "SD probe: OK (OCR: 0x%08x)\n", + ocr); sc->squelched--; mmcbr_set_ocr(dev, mmc_select_vdd(sc, ocr)); @@ -1622,7 +1634,8 @@ mmc_go_discovery(struct mmc_softc *sc) * one card on the bus. */ if (bootverbose || mmc_debug) - device_printf(sc->dev, "Current OCR: 0x%08x\n", mmcbr_get_ocr(dev)); + device_printf(sc->dev, "Current OCR: 0x%08x\n", + mmcbr_get_ocr(dev)); if (mmcbr_get_ocr(dev) == 0) { device_printf(sc->dev, "No compatible cards found on bus\n"); mmc_delete_cards(sc); @@ -1760,6 +1773,7 @@ mmc_read_ivar(device_t bus, device_t chi static int mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value) { + /* * None are writable ATM */ Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/mmc/mmcsd.c Sun Jan 29 00:05:49 2017 (r312939) @@ -113,7 +113,7 @@ static int mmcsd_probe(device_t dev); /* disk routines */ static int mmcsd_close(struct disk *dp); static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, - off_t offset, size_t length); + off_t offset, size_t length); static int mmcsd_open(struct disk *dp); static void mmcsd_strategy(struct bio *bp); static void mmcsd_task(void *arg); @@ -122,14 +122,14 @@ static int mmcsd_bus_bit_width(device_t static daddr_t mmcsd_delete(struct mmcsd_softc *sc, struct bio *bp); static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp); -#define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMCSD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define MMCSD_LOCK_INIT(_sc) \ +#define MMCSD_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "mmcsd", MTX_DEF) -#define MMCSD_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define MMCSD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define MMCSD_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define MMCSD_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define MMCSD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define MMCSD_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); static int mmcsd_probe(device_t dev) @@ -208,7 +208,7 @@ mmcsd_attach(device_t dev) sc->running = 1; sc->suspend = 0; sc->eblock = sc->eend = 0; - kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "%s: mmc/sd card", + kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "%s: mmc/sd card", device_get_nameunit(dev)); return (0); @@ -311,6 +311,7 @@ mmcsd_strategy(struct bio *bp) static const char * mmcsd_errmsg(int e) { + if (e < 0 || e > MMC_ERR_MAX) return "Bad error code"; return errmsg[e]; @@ -325,17 +326,18 @@ mmcsd_rw(struct mmcsd_softc *sc, struct struct mmc_request req; struct mmc_data data; device_t dev = sc->dev; - int sz = sc->disk->d_sectorsize; + int numblocks, sz; device_t mmcbr = device_get_parent(dev); + char *vaddr; block = bp->bio_pblkno; + sz = sc->disk->d_sectorsize; end = bp->bio_pblkno + (bp->bio_bcount / sz); while (block < end) { - char *vaddr = bp->bio_data + - (block - bp->bio_pblkno) * sz; - int numblocks = min(end - block, mmc_get_max_data(dev)); + vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; + numblocks = min(end - block, mmc_get_max_data(dev)); memset(&req, 0, sizeof(req)); - memset(&cmd, 0, sizeof(cmd)); + memset(&cmd, 0, sizeof(cmd)); memset(&stop, 0, sizeof(stop)); memset(&data, 0, sizeof(data)); cmd.mrq = &req; @@ -373,10 +375,11 @@ mmcsd_rw(struct mmcsd_softc *sc, struct } MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { - if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { + if (ppsratecheck(&sc->log_time, &sc->log_count, + LOG_PPS)) device_printf(dev, "Error indicated: %d %s\n", - req.cmd->error, mmcsd_errmsg(req.cmd->error)); - } + req.cmd->error, + mmcsd_errmsg(req.cmd->error)); break; } block += numblocks; @@ -407,7 +410,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str start = block + erase_sector - 1; /* Round up. */ start -= start % erase_sector; stop = end; /* Round down. */ - stop -= end % erase_sector; + stop -= end % erase_sector; /* We can't erase area smaller then sector, store it for later. */ if (start >= stop) { sc->eblock = block; @@ -475,8 +478,8 @@ mmcsd_delete(struct mmcsd_softc *sc, str } static int -mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, - off_t offset, size_t length) +mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, + size_t length) { struct disk *disk = arg; struct mmcsd_softc *sc = (struct mmcsd_softc *)disk->d_drv1; Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/sdhci/sdhci.c Sun Jan 29 00:05:49 2017 (r312939) @@ -96,8 +96,10 @@ static void sdhci_card_task(void *, int) /* * Broadcom BCM577xx Controller Constants */ -#define BCM577XX_DEFAULT_MAX_DIVIDER 256 /* Maximum divider supported by the default clock source. */ -#define BCM577XX_ALT_CLOCK_BASE 63000000 /* Alternative clock's base frequency. */ +/* Maximum divider supported by the default clock source. */ +#define BCM577XX_DEFAULT_MAX_DIVIDER 256 +/* Alternative clock's base frequency. */ +#define BCM577XX_ALT_CLOCK_BASE 63000000 #define BCM577XX_HOST_CONTROL 0x198 #define BCM577XX_CTRL_CLKSEL_MASK 0xFFFFCFFF @@ -122,7 +124,7 @@ slot_printf(struct sdhci_slot *slot, con va_list ap; int retval; - retval = printf("%s-slot%d: ", + retval = printf("%s-slot%d: ", device_get_nameunit(slot->bus), slot->num); va_start(ap, fmt); @@ -266,20 +268,25 @@ sdhci_set_clock(struct sdhci_slot *slot, /* If no clock requested - left it so. */ if (clock == 0) return; - + /* Determine the clock base frequency */ clk_base = slot->max_clk; if (slot->quirks & SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC) { - clk_sel = RD2(slot, BCM577XX_HOST_CONTROL) & BCM577XX_CTRL_CLKSEL_MASK; + clk_sel = RD2(slot, BCM577XX_HOST_CONTROL) & + BCM577XX_CTRL_CLKSEL_MASK; - /* Select clock source appropriate for the requested frequency. */ + /* + * Select clock source appropriate for the requested frequency. + */ if ((clk_base / BCM577XX_DEFAULT_MAX_DIVIDER) > clock) { clk_base = BCM577XX_ALT_CLOCK_BASE; - clk_sel |= (BCM577XX_CTRL_CLKSEL_64MHZ << BCM577XX_CTRL_CLKSEL_SHIFT); + clk_sel |= (BCM577XX_CTRL_CLKSEL_64MHZ << + BCM577XX_CTRL_CLKSEL_SHIFT); } else { - clk_sel |= (BCM577XX_CTRL_CLKSEL_DEFAULT << BCM577XX_CTRL_CLKSEL_SHIFT); + clk_sel |= (BCM577XX_CTRL_CLKSEL_DEFAULT << + BCM577XX_CTRL_CLKSEL_SHIFT); } - + WR2(slot, BCM577XX_HOST_CONTROL, clk_sel); } @@ -303,8 +310,8 @@ sdhci_set_clock(struct sdhci_slot *slot, if (clock >= clk_base) div = 0; else { - for (div = 2; div < SDHCI_300_MAX_DIVIDER; div += 2) { - if ((clk_base / div) <= clock) + for (div = 2; div < SDHCI_300_MAX_DIVIDER; div += 2) { + if ((clk_base / div) <= clock) break; } } @@ -312,7 +319,7 @@ sdhci_set_clock(struct sdhci_slot *slot, } if (bootverbose || sdhci_debug) - slot_printf(slot, "Divider %d for freq %d (base %d)\n", + slot_printf(slot, "Divider %d for freq %d (base %d)\n", div, clock, clk_base); /* Now we have got divider, set it. */ @@ -329,7 +336,7 @@ sdhci_set_clock(struct sdhci_slot *slot, while (!((clk = RD2(slot, SDHCI_CLOCK_CONTROL)) & SDHCI_CLOCK_INT_STABLE)) { if (timeout == 0) { - slot_printf(slot, + slot_printf(slot, "Internal clock never stabilised.\n"); sdhci_dumpregs(slot); return; @@ -555,7 +562,7 @@ sdhci_handle_card_present(struct sdhci_s SDHCI_UNLOCK(slot); } -static void +static void sdhci_card_poll(void *arg) { struct sdhci_slot *slot = arg; @@ -565,7 +572,7 @@ sdhci_card_poll(void *arg) callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS, sdhci_card_poll, slot); } - + int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { @@ -611,7 +618,7 @@ sdhci_init_slot(device_t dev, struct sdh /* Initialize slot. */ sdhci_init(slot); - slot->version = (RD2(slot, SDHCI_HOST_VERSION) + slot->version = (RD2(slot, SDHCI_HOST_VERSION) >> SDHCI_SPEC_VER_SHIFT) & SDHCI_SPEC_VER_MASK; if (slot->quirks & SDHCI_QUIRK_MISSING_CAPS) caps = slot->caps; @@ -621,7 +628,7 @@ sdhci_init_slot(device_t dev, struct sdh if (slot->version >= SDHCI_SPEC_300) freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; - else + else freq = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; if (freq != 0) @@ -634,7 +641,8 @@ sdhci_init_slot(device_t dev, struct sdh if (slot->max_clk == 0) { slot->max_clk = SDHCI_DEFAULT_MAX_FREQ * 1000000; device_printf(dev, "Hardware doesn't specify base clock " - "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); + "frequency, using %dMHz as default.\n", + SDHCI_DEFAULT_MAX_FREQ); } /* Calculate/set timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { @@ -642,8 +650,8 @@ sdhci_init_slot(device_t dev, struct sdh } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) { slot->timeout_clk = 1000; } else { - slot->timeout_clk = - (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + slot->timeout_clk = (caps & SDHCI_TIMEOUT_CLK_MASK) >> + SDHCI_TIMEOUT_CLK_SHIFT; if (caps & SDHCI_TIMEOUT_CLK_UNIT) slot->timeout_clk *= 1000; } @@ -687,7 +695,7 @@ sdhci_init_slot(device_t dev, struct sdh if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE) slot->opt |= SDHCI_NON_REMOVABLE; - /* + /* * Use platform-provided transfer backend * with PIO as a fallback mechanism */ @@ -825,7 +833,7 @@ sdhci_generic_update_ios(device_t brdev, } else { panic("Invalid bus width: %d", ios->bus_width); } - if (ios->timing == bus_timing_hs && + if (ios->timing == bus_timing_hs && !(slot->quirks & SDHCI_QUIRK_DONT_SET_HISPD_BIT)) slot->hostctrl |= SDHCI_CTRL_HISPD; else @@ -839,7 +847,7 @@ sdhci_generic_update_ios(device_t brdev, return (0); } -static void +static void sdhci_req_done(struct sdhci_slot *slot) { struct mmc_request *req; @@ -852,8 +860,8 @@ sdhci_req_done(struct sdhci_slot *slot) req->done(req); } } - -static void + +static void sdhci_timeout(void *arg) { struct sdhci_slot *slot = arg; @@ -868,7 +876,7 @@ sdhci_timeout(void *arg) slot_printf(slot, " Spurious timeout - no active command\n"); } } - + static void sdhci_set_transfer_mode(struct sdhci_slot *slot, struct mmc_data *data) @@ -970,7 +978,7 @@ sdhci_start_command(struct sdhci_slot *s flags |= SDHCI_CMD_TYPE_ABORT; /* Prepare data. */ sdhci_start_data(slot, cmd->data); - /* + /* * Interrupt aggregation: To reduce total number of interrupts * group response interrupt with data interrupt when possible. * If there going to be data interrupt, mask response one. @@ -994,6 +1002,8 @@ static void sdhci_finish_command(struct sdhci_slot *slot) { int i; + uint32_t val; + uint8_t extra; slot->cmd_done = 1; /* Interrupt aggregation: Restore command interrupt. @@ -1011,13 +1021,14 @@ sdhci_finish_command(struct sdhci_slot * if (slot->curcmd->flags & MMC_RSP_PRESENT) { if (slot->curcmd->flags & MMC_RSP_136) { /* CRC is stripped so we need one byte shift. */ - uint8_t extra = 0; + extra = 0; for (i = 0; i < 4; i++) { - uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 4); - if (slot->quirks & SDHCI_QUIRK_DONT_SHIFT_RESPONSE) + val = RD4(slot, SDHCI_RESPONSE + i * 4); + if (slot->quirks & + SDHCI_QUIRK_DONT_SHIFT_RESPONSE) slot->curcmd->resp[3 - i] = val; else { - slot->curcmd->resp[3 - i] = + slot->curcmd->resp[3 - i] = (val << 8) | extra; extra = val >> 24; } @@ -1056,7 +1067,7 @@ sdhci_start_data(struct sdhci_slot *slot current_timeout <<= 1; } /* Compensate for an off-by-one error in the CaFe chip.*/ - if (div < 0xE && + if (div < 0xE && (slot->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL)) { ++div; } @@ -1080,13 +1091,13 @@ sdhci_start_data(struct sdhci_slot *slot /* Load DMA buffer. */ if (slot->flags & SDHCI_USE_DMA) { if (data->flags & MMC_DATA_READ) - bus_dmamap_sync(slot->dmatag, slot->dmamap, + bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); else { memcpy(slot->dmamem, data->data, - (data->len < DMA_BLOCK_SIZE) ? + (data->len < DMA_BLOCK_SIZE) ? data->len : DMA_BLOCK_SIZE); - bus_dmamap_sync(slot->dmatag, slot->dmamap, + bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr); @@ -1101,8 +1112,8 @@ sdhci_start_data(struct sdhci_slot *slot /* Current data offset for both PIO and DMA. */ slot->offset = 0; /* Set block size and request IRQ on 4K border. */ - WR2(slot, SDHCI_BLOCK_SIZE, - SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512)?data->len:512)); + WR2(slot, SDHCI_BLOCK_SIZE, SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, + (data->len < 512) ? data->len : 512)); /* Set block count. */ WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512); } @@ -1123,12 +1134,12 @@ sdhci_finish_data(struct sdhci_slot *slo if (!slot->data_done && (slot->flags & SDHCI_USE_DMA)) { if (data->flags & MMC_DATA_READ) { size_t left = data->len - slot->offset; - bus_dmamap_sync(slot->dmatag, slot->dmamap, + bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE)?left:DMA_BLOCK_SIZE); + (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); } else - bus_dmamap_sync(slot->dmatag, slot->dmamap, + bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); } slot->data_done = 1; @@ -1187,9 +1198,10 @@ sdhci_generic_request(device_t brdev, de return (EBUSY); } if (sdhci_debug > 1) { - slot_printf(slot, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", - req->cmd->opcode, req->cmd->arg, req->cmd->flags, - (req->cmd->data)?(u_int)req->cmd->data->len:0, + slot_printf(slot, + "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", + req->cmd->opcode, req->cmd->arg, req->cmd->flags, + (req->cmd->data)?(u_int)req->cmd->data->len:0, (req->cmd->data)?req->cmd->data->flags:0); } slot->req = req; @@ -1270,6 +1282,8 @@ sdhci_cmd_irq(struct sdhci_slot *slot, u static void sdhci_data_irq(struct sdhci_slot *slot, uint32_t intmask) { + struct mmc_data *data; + size_t left; if (!slot->curcmd) { slot_printf(slot, "Got data interrupt 0x%08x, but " @@ -1304,17 +1318,17 @@ sdhci_data_irq(struct sdhci_slot *slot, /* Handle PIO interrupt. */ if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL)) { - if ((slot->opt & SDHCI_PLATFORM_TRANSFER) && + if ((slot->opt & SDHCI_PLATFORM_TRANSFER) && SDHCI_PLATFORM_WILL_HANDLE(slot->bus, slot)) { - SDHCI_PLATFORM_START_TRANSFER(slot->bus, slot, &intmask); + SDHCI_PLATFORM_START_TRANSFER(slot->bus, slot, + &intmask); slot->flags |= PLATFORM_DATA_STARTED; } else sdhci_transfer_pio(slot); } /* Handle DMA border. */ if (intmask & SDHCI_INT_DMA_END) { - struct mmc_data *data = slot->curcmd->data; - size_t left; + data = slot->curcmd->data; /* Unload DMA buffer... */ left = data->len - slot->offset; @@ -1322,7 +1336,7 @@ sdhci_data_irq(struct sdhci_slot *slot, bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE)?left:DMA_BLOCK_SIZE); + (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); } else { bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); @@ -1335,7 +1349,7 @@ sdhci_data_irq(struct sdhci_slot *slot, BUS_DMASYNC_PREREAD); } else { memcpy(slot->dmamem, (u_char*)data->data + slot->offset, - (left < DMA_BLOCK_SIZE)?left:DMA_BLOCK_SIZE); + (left < DMA_BLOCK_SIZE)? left : DMA_BLOCK_SIZE); bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } @@ -1363,7 +1377,6 @@ done: SDHCI_PLATFORM_FINISH_TRANSFER(slot->bus, slot); } else sdhci_finish_data(slot); - return; } } @@ -1371,7 +1384,7 @@ static void sdhci_acmd_irq(struct sdhci_slot *slot) { uint16_t err; - + err = RD4(slot, SDHCI_ACMD12_ERR); if (!slot->curcmd) { slot_printf(slot, "Got AutoCMD12 error 0x%04x, but " @@ -1387,7 +1400,7 @@ void sdhci_generic_intr(struct sdhci_slot *slot) { uint32_t intmask, present; - + SDHCI_LOCK(slot); /* Read slot interrupt status. */ intmask = RD4(slot, SDHCI_INT_STATUS); @@ -1407,7 +1420,7 @@ sdhci_generic_intr(struct sdhci_slot *sl SDHCI_INT_CARD_INSERT; WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); - WR4(slot, SDHCI_INT_STATUS, intmask & + WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); sdhci_handle_card_present_locked(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); @@ -1446,12 +1459,13 @@ sdhci_generic_intr(struct sdhci_slot *sl intmask); sdhci_dumpregs(slot); } - + SDHCI_UNLOCK(slot); } int -sdhci_generic_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) +sdhci_generic_read_ivar(device_t bus, device_t child, int which, + uintptr_t *result) { struct sdhci_slot *slot = device_get_ivars(child); @@ -1505,7 +1519,8 @@ sdhci_generic_read_ivar(device_t bus, de } int -sdhci_generic_write_ivar(device_t bus, device_t child, int which, uintptr_t value) +sdhci_generic_write_ivar(device_t bus, device_t child, int which, + uintptr_t value) { struct sdhci_slot *slot = device_get_ivars(child); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/sdhci/sdhci.h Sun Jan 29 00:05:49 2017 (r312939) @@ -130,7 +130,7 @@ #define SDHCI_STATE_DAT_MASK 0x00f00000 #define SDHCI_STATE_CMD 0x01000000 -#define SDHCI_HOST_CONTROL 0x28 +#define SDHCI_HOST_CONTROL 0x28 #define SDHCI_CTRL_LED 0x01 #define SDHCI_CTRL_4BITBUS 0x02 #define SDHCI_CTRL_HISPD 0x04 @@ -204,7 +204,7 @@ #define SDHCI_INT_NORMAL_MASK 0x00007FFF #define SDHCI_INT_ERROR_MASK 0xFFFF8000 -#define SDHCI_INT_CMD_ERROR_MASK (SDHCI_INT_TIMEOUT | \ +#define SDHCI_INT_CMD_ERROR_MASK (SDHCI_INT_TIMEOUT | \ SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX) #define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_CMD_ERROR_MASK) @@ -288,19 +288,19 @@ struct sdhci_slot { int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ uint32_t timeout_clk; /* Timeout freq */ - bus_dma_tag_t dmatag; - bus_dmamap_t dmamap; + bus_dma_tag_t dmatag; + bus_dmamap_t dmamap; u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ - struct timeout_task + struct timeout_task card_delayed_task;/* Card insert delayed task */ struct callout card_poll_callout;/* Card present polling callout */ struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ struct mmc_command *curcmd; /* Current command of current request */ - + uint32_t intmask; /* Current interrupt mask */ uint32_t clock; /* Current clock freq. */ size_t offset; /* Data buffer offset */ @@ -313,12 +313,14 @@ struct sdhci_slot { #define CMD_STARTED 1 #define STOP_STARTED 2 #define SDHCI_USE_DMA 4 /* Use DMA for this req. */ -#define PLATFORM_DATA_STARTED 8 /* Data transfer is handled by platform */ +#define PLATFORM_DATA_STARTED 8 /* Data xfer is handled by platform */ struct mtx mtx; /* Slot mutex */ }; -int sdhci_generic_read_ivar(device_t bus, device_t child, int which, uintptr_t *result); -int sdhci_generic_write_ivar(device_t bus, device_t child, int which, uintptr_t value); +int sdhci_generic_read_ivar(device_t bus, device_t child, int which, + uintptr_t *result); +int sdhci_generic_write_ivar(device_t bus, device_t child, int which, + uintptr_t value); int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num); void sdhci_start_slot(struct sdhci_slot *slot); /* performs generic clean-up for platform transfers */ @@ -327,7 +329,8 @@ int sdhci_cleanup_slot(struct sdhci_slot int sdhci_generic_suspend(struct sdhci_slot *slot); int sdhci_generic_resume(struct sdhci_slot *slot); int sdhci_generic_update_ios(device_t brdev, device_t reqdev); -int sdhci_generic_request(device_t brdev, device_t reqdev, struct mmc_request *req); +int sdhci_generic_request(device_t brdev, device_t reqdev, + struct mmc_request *req); int sdhci_generic_get_ro(device_t brdev, device_t reqdev); int sdhci_generic_acquire_host(device_t brdev, device_t reqdev); int sdhci_generic_release_host(device_t brdev, device_t reqdev); Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun Jan 29 00:05:49 2017 (r312939) @@ -77,7 +77,7 @@ static char *sdhci_ids[] = { struct sdhci_acpi_softc { u_int quirks; /* Chip specific quirks */ struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ + void *intrhand; /* Interrupt handle */ struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ @@ -97,7 +97,8 @@ sdhci_acpi_read_1(device_t dev, struct s } static void -sdhci_acpi_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +sdhci_acpi_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint8_t val) { struct sdhci_acpi_softc *sc = device_get_softc(dev); @@ -117,7 +118,8 @@ sdhci_acpi_read_2(device_t dev, struct s } static void -sdhci_acpi_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +sdhci_acpi_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint16_t val) { struct sdhci_acpi_softc *sc = device_get_softc(dev); @@ -137,7 +139,8 @@ sdhci_acpi_read_4(device_t dev, struct s } static void -sdhci_acpi_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +sdhci_acpi_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t val) { struct sdhci_acpi_softc *sc = device_get_softc(dev); @@ -237,7 +240,7 @@ sdhci_acpi_attach(device_t dev) sdhci_acpi_detach(dev); return (ENOMEM); } - + sc->slot.quirks = sc->quirks; err = sdhci_init_slot(dev, &sc->slot, 0); @@ -337,9 +340,9 @@ static device_method_t sdhci_methods[] = DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), /* mmcbr_if */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), - DEVMETHOD(mmcbr_request, sdhci_generic_request), - DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sat Jan 28 23:58:17 2017 (r312938) +++ head/sys/dev/sdhci/sdhci_pci.c Sun Jan 29 00:05:49 2017 (r312939) @@ -81,28 +81,28 @@ static const struct sdhci_device { const char *desc; u_int quirks; } sdhci_devices[] = { - { 0x08221180, 0xffff, "RICOH R5C822 SD", + { 0x08221180, 0xffff, "RICOH R5C822 SD", SDHCI_QUIRK_FORCE_DMA }, - { 0xe8221180, 0xffff, "RICOH R5CE822 SD", + { 0xe8221180, 0xffff, "RICOH R5CE822 SD", SDHCI_QUIRK_FORCE_DMA | SDHCI_QUIRK_LOWER_FREQUENCY }, - { 0xe8231180, 0xffff, "RICOH R5CE823 SD", + { 0xe8231180, 0xffff, "RICOH R5CE823 SD", SDHCI_QUIRK_LOWER_FREQUENCY }, - { 0x8034104c, 0xffff, "TI XX21/XX11 SD", + { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, - { 0x05501524, 0xffff, "ENE CB712 SD", + { 0x05501524, 0xffff, "ENE CB712 SD", SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x05511524, 0xffff, "ENE CB712 SD 2", + { 0x05511524, 0xffff, "ENE CB712 SD 2", SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x07501524, 0xffff, "ENE CB714 SD", + { 0x07501524, 0xffff, "ENE CB714 SD", SDHCI_QUIRK_RESET_ON_IOS | SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x07511524, 0xffff, "ENE CB714 SD 2", + { 0x07511524, 0xffff, "ENE CB714 SD 2", SDHCI_QUIRK_RESET_ON_IOS | SDHCI_QUIRK_BROKEN_TIMINGS }, - { 0x410111ab, 0xffff, "Marvell CaFe SD", + { 0x410111ab, 0xffff, "Marvell CaFe SD", SDHCI_QUIRK_INCR_TIMEOUT_CONTROL }, - { 0x2381197B, 0xffff, "JMicron JMB38X SD", + { 0x2381197B, 0xffff, "JMicron JMB38X SD", SDHCI_QUIRK_32BIT_DMA_SIZE | SDHCI_QUIRK_RESET_AFTER_REQUEST }, { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", @@ -127,7 +127,7 @@ static const struct sdhci_device { struct sdhci_pci_softc { u_int quirks; /* Chip specific quirks */ struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ + void *intrhand; /* Interrupt handle */ int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; @@ -151,7 +151,8 @@ sdhci_pci_read_1(device_t dev, struct sd } static void -sdhci_pci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +sdhci_pci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint8_t val) { struct sdhci_pci_softc *sc = device_get_softc(dev); @@ -171,7 +172,8 @@ sdhci_pci_read_2(device_t dev, struct sd } static void -sdhci_pci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +sdhci_pci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint16_t val) { struct sdhci_pci_softc *sc = device_get_softc(dev); @@ -191,7 +193,8 @@ sdhci_pci_read_4(device_t dev, struct sd } static void -sdhci_pci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +sdhci_pci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t val) { struct sdhci_pci_softc *sc = device_get_softc(dev); @@ -346,7 +349,8 @@ sdhci_pci_attach(device_t dev) sc->mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res[i] == NULL) { - device_printf(dev, "Can't allocate memory for slot %d\n", i); + device_printf(dev, + "Can't allocate memory for slot %d\n", i); continue; } @@ -463,9 +467,9 @@ static device_method_t sdhci_methods[] = DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), /* mmcbr_if */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), - DEVMETHOD(mmcbr_request, sdhci_generic_request), - DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), From owner-svn-src-head@freebsd.org Sun Jan 29 00:12:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C1CFCBB4DF; Sun, 29 Jan 2017 00:12:08 +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 CFF52F1; Sun, 29 Jan 2017 00:12:07 +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 v0T0C6Il062911; Sun, 29 Jan 2017 00:12:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T0C6G9062910; Sun, 29 Jan 2017 00:12:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701290012.v0T0C6G9062910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 29 Jan 2017 00:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312940 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 00:12:08 -0000 Author: ngie Date: Sun Jan 29 00:12:06 2017 New Revision: 312940 URL: https://svnweb.freebsd.org/changeset/base/312940 Log: Remove non-existent ct(4) dependency for scsi_low.c ct(4) was removed with pc98 in r312910 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 29 00:05:49 2017 (r312939) +++ head/sys/conf/files Sun Jan 29 00:12:06 2017 (r312940) @@ -111,7 +111,7 @@ cam/ctl/ctl_error.c optional ctl cam/ctl/ctl_util.c optional ctl cam/ctl/scsi_ctl.c optional ctl cam/scsi/scsi_da.c optional da -cam/scsi/scsi_low.c optional ct | ncv | nsp | stg +cam/scsi/scsi_low.c optional ncv | nsp | stg cam/scsi/scsi_pass.c optional pass cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa From owner-svn-src-head@freebsd.org Sun Jan 29 00:24:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC18CBB935; Sun, 29 Jan 2017 00:24: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 3DAA9B0E; Sun, 29 Jan 2017 00:24:35 +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 v0T0OYYw067954; Sun, 29 Jan 2017 00:24:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T0OYaF067953; Sun, 29 Jan 2017 00:24:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701290024.v0T0OYaF067953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 29 Jan 2017 00:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312941 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 00:24:35 -0000 Author: ngie Date: Sun Jan 29 00:24:34 2017 New Revision: 312941 URL: https://svnweb.freebsd.org/changeset/base/312941 Log: Update MACHINE/MACHINE_ARCH examples to use arm64/aarch64 instead of i386/pc98 pc98 support was removed in r312910 Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Sun Jan 29 00:12:06 2017 (r312940) +++ head/usr.bin/man/man.1 Sun Jan 29 00:24:34 2017 (r312941) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2014 +.Dd January 28, 2017 .Dt MAN 1 .Os .Sh NAME @@ -242,20 +242,20 @@ environment variables. For example, if .Ev MACHINE_ARCH is set to -.Dq Li i386 +.Dq Li aarch64 and .Ev MACHINE is set to -.Dq Li pc98 , +.Dq Li arm64 , .Nm will search the following paths when considering section 4 manual pages in .Pa /usr/share/man : .Pp .Bl -item -offset indent -compact .It -.Pa /usr/share/man/man4/pc98 +.Pa /usr/share/man/man4/aarch64 .It -.Pa /usr/share/man/man4/i386 +.Pa /usr/share/man/man4/arm64 .It .Pa /usr/share/man/man4 .El From owner-svn-src-head@freebsd.org Sun Jan 29 00:45:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C09CBBEE8; Sun, 29 Jan 2017 00:45:53 +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 8CFA41456; Sun, 29 Jan 2017 00:45:53 +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 v0T0jqfa076162; Sun, 29 Jan 2017 00:45:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T0jqWW076161; Sun, 29 Jan 2017 00:45:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701290045.v0T0jqWW076161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 29 Jan 2017 00:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312942 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 00:45:53 -0000 Author: pfg Date: Sun Jan 29 00:45:52 2017 New Revision: 312942 URL: https://svnweb.freebsd.org/changeset/base/312942 Log: Remove GCC's __nonnull() attribute definition. While GCC's __nonnull__ attribute is generally useful to prevent misuse of some functions it also tends to do rather dangerous "optimizations". Now that we have replaced (r312934) all such uses with the clang nullability qualifiers, the GCC attribute is unnecessary. Remove the definition completely to prevent its use in system's headers. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jan 29 00:24:34 2017 (r312941) +++ head/sys/sys/cdefs.h Sun Jan 29 00:45:52 2017 (r312942) @@ -375,14 +375,6 @@ #define __noinline #endif -#if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) -#define __nonnull_all __attribute__((__nonnull__)) -#else -#define __nonnull(x) -#define __nonnull_all -#endif - #if __GNUC_PREREQ__(3, 4) #define __fastcall __attribute__((__fastcall__)) #define __result_use_check __attribute__((__warn_unused_result__)) From owner-svn-src-head@freebsd.org Sun Jan 29 01:52:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1EAECC27E2; Sun, 29 Jan 2017 01:52:25 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sakura.ccs.furiru.org", Issuer "sakura.ccs.furiru.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A951788; Sun, 29 Jan 2017 01:52:25 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTPA id v0T1qLq4006936; Sun, 29 Jan 2017 10:52:23 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 29 Jan 2017 10:52:20 +0900 (JST) Message-Id: <20170129.105220.1181744779718930597.nyan@FreeBSD.org> To: yaneurabeya@gmail.com Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312917 - in head: share/man/man4 share/man/man4/man4.i386 sys/dev/pci sys/modules/ata/atacbus From: TAKAHASHI Yoshihiro In-Reply-To: References: <201701280958.v0S9w0ja004827@repo.freebsd.org> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 01:52:25 -0000 In article Ngie Cooper writes: >> On Jan 28, 2017, at 01:58, Takahashi Yoshihiro wrote: >> >> Author: nyan >> Date: Sat Jan 28 09:58:00 2017 >> New Revision: 312917 >> URL: https://svnweb.freebsd.org/changeset/base/312917 >> >> Log: >> Remove more pc98 support. > > Hello Yoshiro-San, > Have appropriate man pages and files been added to ObsoleteFiles.inc? Yes. But I found that there are some pc98 related files even now. I'll remove them and add to ObsoleteFiles.inc. Thank you for your recent work for pc98 removal. --- TAKAHASHI Yoshihiro From owner-svn-src-head@freebsd.org Sun Jan 29 02:17:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3549CC2F45; Sun, 29 Jan 2017 02:17:53 +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 830B71F7; Sun, 29 Jan 2017 02:17:53 +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 v0T2HqFR012355; Sun, 29 Jan 2017 02:17:52 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T2HqGM012354; Sun, 29 Jan 2017 02:17:52 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701290217.v0T2HqGM012354@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, 29 Jan 2017 02:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312943 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 02:17:53 -0000 Author: loos Date: Sun Jan 29 02:17:52 2017 New Revision: 312943 URL: https://svnweb.freebsd.org/changeset/base/312943 Log: Do not run the pf purge thread while the VNET variables are not initialized, this can cause a divide by zero (if the VNET initialization takes to long to complete). Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Jan 29 00:45:52 2017 (r312942) +++ head/sys/netpfil/pf/pf.c Sun Jan 29 02:17:52 2017 (r312943) @@ -129,6 +129,8 @@ VNET_DEFINE(int, pf_tcp_secret_init); #define V_pf_tcp_secret_init VNET(pf_tcp_secret_init) VNET_DEFINE(int, pf_tcp_iss_off); #define V_pf_tcp_iss_off VNET(pf_tcp_iss_off) +VNET_DECLARE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) /* * Queue for pf_intr() sends. @@ -1441,6 +1443,12 @@ pf_purge_thread(void *unused __unused) kproc_exit(0); } + /* Wait while V_pf_default_rule.timeout is initialized. */ + if (V_pf_vnet_active == 0) { + CURVNET_RESTORE(); + continue; + } + /* Process 1/interval fraction of the state table every run. */ idx = pf_purge_expired_states(idx, pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); From owner-svn-src-head@freebsd.org Sun Jan 29 03:34:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B924CC445F; Sun, 29 Jan 2017 03:34:50 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B29ECB0; Sun, 29 Jan 2017 03:34:50 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0T3Ynjb044873; Sun, 29 Jan 2017 03:34:49 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0T3YnjJ044872; Sun, 29 Jan 2017 03:34:49 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201701290334.v0T3YnjJ044872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 29 Jan 2017 03:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312944 - in head: . sys/dev/ic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 03:34:50 -0000 Author: nyan Date: Sun Jan 29 03:34:49 2017 New Revision: 312944 URL: https://svnweb.freebsd.org/changeset/base/312944 Log: - Remove i8255.h because it's pc98 device. - rsa.h is for both RSA-DV/S ISA and RSA-98III CBUS, but there is no RSA-DV/S support. So it can be removed. Deleted: head/sys/dev/ic/i8255.h head/sys/dev/ic/rsa.h Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jan 29 02:17:52 2017 (r312943) +++ head/ObsoleteFiles.inc Sun Jan 29 03:34:49 2017 (r312944) @@ -40,6 +40,8 @@ # 20170128: remove pc98 support OLD_FILES+=usr/include/dev/ic/i8251.h +OLD_FILES+=usr/include/dev/ic/i8255.h +OLD_FILES+=usr/include/dev/ic/rsa.h OLD_FILES+=usr/include/dev/ic/wd33c93reg.h OLD_FILES+=usr/include/sys/disk/pc98.h OLD_FILES+=usr/include/sys/diskpc98.h From owner-svn-src-head@freebsd.org Sun Jan 29 11:11:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35E16CC6999; Sun, 29 Jan 2017 11:11:58 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 0005F18CC; Sun, 29 Jan 2017 11:11:57 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (unknown [IPv6:2a02:c7f:1e13:cf00:4e34:88ff:fe5b:ab17]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id EFC8ED8506; Sun, 29 Jan 2017 11:06:24 +0000 (UTC) Date: Sun, 29 Jan 2017 11:11:17 +0000 From: Andrew Turner To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312938 - head/share/man/man7 Message-ID: <20170129111117.209bd639@zapp> In-Reply-To: <201701282358.v0SNwHo6055555@repo.freebsd.org> References: <201701282358.v0SNwHo6055555@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 11:11:58 -0000 On Sat, 28 Jan 2017 23:58:17 +0000 (UTC) Ngie Cooper wrote: > Author: ngie > Date: Sat Jan 28 23:58:17 2017 > New Revision: 312938 > URL: https://svnweb.freebsd.org/changeset/base/312938 > > Log: > Update TARGET/TARGET_ARCH examples to use arm64/aarch64 instead of > i386/pc98 > pc98 support was removed in r312910 > > Modified: > head/share/man/man7/build.7 > head/share/man/man7/release.7 > > Modified: head/share/man/man7/build.7 > ============================================================================== > --- head/share/man/man7/build.7 Sat Jan 28 23:51:03 > 2017 (r312937) +++ head/share/man/man7/build.7 Sat Jan > 28 23:58:17 2017 (r312938) @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 20, 2016 > +.Dd January 28, 2017 > .Dt BUILD 7 > .Os > .Sh NAME > @@ -517,10 +517,10 @@ This is analogous to the > .Dq Nm uname Fl m > output. > This is necessary to cross-build some target architectures. > -For example, cross-building for PC98 machines requires > -.Va TARGET_ARCH Ns = Ns Li i386 > +For example, cross-building for ARM64 machines requires > +.Va TARGET_ARCH Ns = Ns Li aarch64 > and > -.Va TARGET Ns = Ns Li pc98 . > +.Va TARGET Ns = Ns Li arm64 . That's not quite correct. Now pc98 has been removed TARGET_ARCH is enough to specify the hardware to support. TARGET can be used on many hardware platforms as it will have a default TARGET_ARCH to use, e.g. on arm64 TARGET=arm64 is enough as it implies TARGET_ARCH=aarch64, however to build armv6 you would need to set TARGET_ARCH=armv6 as TARGET=arm implies TARGET_ARCH=arm. Andrew From owner-svn-src-head@freebsd.org Sun Jan 29 11:52:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 713B2CC6951; Sun, 29 Jan 2017 11:52:37 +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 40D5B1056; Sun, 29 Jan 2017 11:52:37 +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 v0TBqaHL047758; Sun, 29 Jan 2017 11:52:36 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TBqaBY047757; Sun, 29 Jan 2017 11:52:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201701291152.v0TBqaBY047757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 29 Jan 2017 11:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312947 - head/sys/boot/mips/beri/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 11:52:37 -0000 Author: brooks Date: Sun Jan 29 11:52:36 2017 New Revision: 312947 URL: https://svnweb.freebsd.org/changeset/base/312947 Log: Remove "-Xassembler -G0" from CFLAGS. -G0 is sufficent except on old version of clang (<3.8) and such versions are unlikely to be generally useful on mips64. Reported by: sbruno Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/boot2/Makefile Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Sun Jan 29 10:36:43 2017 (r312946) +++ head/sys/boot/mips/beri/boot2/Makefile Sun Jan 29 11:52:36 2017 (r312947) @@ -52,7 +52,7 @@ CFLAGS= -ffreestanding \ -I${.CURDIR}/../../../.. \ -D_KERNEL \ -Wall \ - -G0 -Xassembler -G0 \ + -G0 \ -fno-pic -mno-abicalls \ -msoft-float \ -g From owner-svn-src-head@freebsd.org Sun Jan 29 12:31:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58004CC4E82; Sun, 29 Jan 2017 12:31:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27C5AACD; Sun, 29 Jan 2017 12:31:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TCVOgi063171; Sun, 29 Jan 2017 12:31:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TCVOqb063170; Sun, 29 Jan 2017 12:31:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701291231.v0TCVOqb063170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 29 Jan 2017 12:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312948 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 12:31:25 -0000 Author: trasz Date: Sun Jan 29 12:31:24 2017 New Revision: 312948 URL: https://svnweb.freebsd.org/changeset/base/312948 Log: Remove unused kern_sendfile() declaration. Modified: head/sys/sys/syscallsubr.h Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Jan 29 11:52:36 2017 (r312947) +++ head/sys/sys/syscallsubr.h Sun Jan 29 12:31:24 2017 (r312948) @@ -52,7 +52,6 @@ struct ogetdirentries_args; struct rlimit; struct rusage; union semun; -struct sendfile_args; struct sockaddr; struct stat; struct thr_param; @@ -197,8 +196,6 @@ int kern_semctl(struct thread *td, int s union semun *arg, register_t *rval); int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits); -int kern_sendfile(struct thread *td, struct sendfile_args *uap, - struct uio *hdr_uio, struct uio *trl_uio, int compat); int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg); int kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups); From owner-svn-src-head@freebsd.org Sun Jan 29 13:31:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4654FCC7653; Sun, 29 Jan 2017 13:31:58 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F8B165D; Sun, 29 Jan 2017 13:31:58 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TDVvkE089424; Sun, 29 Jan 2017 13:31:57 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TDVvP1089423; Sun, 29 Jan 2017 13:31:57 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201701291331.v0TDVvP1089423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 29 Jan 2017 13:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312949 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 13:31:58 -0000 Author: cognet Date: Sun Jan 29 13:31:56 2017 New Revision: 312949 URL: https://svnweb.freebsd.org/changeset/base/312949 Log: Correct the IT instruction in atomic_fcmpset_64(). Reported by: andrew Modified: head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Sun Jan 29 12:31:24 2017 (r312948) +++ head/sys/arm/include/atomic-v6.h Sun Jan 29 13:31:56 2017 (r312949) @@ -220,7 +220,7 @@ atomic_fcmpset_64(volatile uint64_t *p, "1: mov %[ret], #1 \n" " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" " teq %Q[tmp], %Q[_cmpval] \n" - " itee eq \n" + " ite eq \n" " teqeq %R[tmp], %R[_cmpval] \n" " bne 2f \n" " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n" From owner-svn-src-head@freebsd.org Sun Jan 29 16:54:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32983CC7E36; Sun, 29 Jan 2017 16:54:57 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0782317AA; Sun, 29 Jan 2017 16:54:56 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TGsuJr077440; Sun, 29 Jan 2017 16:54:56 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TGsus1077438; Sun, 29 Jan 2017 16:54:56 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201701291654.v0TGsus1077438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 29 Jan 2017 16:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312952 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 16:54:57 -0000 Author: jah Date: Sun Jan 29 16:54:55 2017 New Revision: 312952 URL: https://svnweb.freebsd.org/changeset/base/312952 Log: Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu) in the i386 pmap. The curcpu macro loads the per-cpu data pointer as its first step, so the remaining steps of pcpu_find(curcpu) are circular. get_pcpu() is already implemented for arm, arm64, and risc-v. My plan is to implement it for the remaining architectures and use it to replace several instances of pcpu_find(curcpu) in MI code. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9370 Modified: head/sys/i386/i386/pmap.c head/sys/i386/include/pcpu.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Jan 29 14:29:02 2017 (r312951) +++ head/sys/i386/i386/pmap.c Sun Jan 29 16:54:55 2017 (r312952) @@ -440,7 +440,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) * CMAP1/CMAP2 are used for zeroing and copying pages. * CMAP3 is used for the boot-time memory test. */ - pc = pcpu_find(curcpu); + pc = get_pcpu(); mtx_init(&pc->pc_cmap_lock, "SYSMAPS", NULL, MTX_DEF); SYSMAP(caddr_t, pc->pc_cmap_pte1, pc->pc_cmap_addr1, 1) SYSMAP(caddr_t, pc->pc_cmap_pte2, pc->pc_cmap_addr2, 1) @@ -4206,7 +4206,7 @@ pmap_zero_page(vm_page_t m) struct pcpu *pc; sched_pin(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); cmap_pte2 = pc->pc_cmap_pte2; mtx_lock(&pc->pc_cmap_lock); if (*cmap_pte2) @@ -4237,7 +4237,7 @@ pmap_zero_page_area(vm_page_t m, int off struct pcpu *pc; sched_pin(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); cmap_pte2 = pc->pc_cmap_pte2; mtx_lock(&pc->pc_cmap_lock); if (*cmap_pte2) @@ -4264,7 +4264,7 @@ pmap_copy_page(vm_page_t src, vm_page_t struct pcpu *pc; sched_pin(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); cmap_pte1 = pc->pc_cmap_pte1; cmap_pte2 = pc->pc_cmap_pte2; mtx_lock(&pc->pc_cmap_lock); @@ -4299,7 +4299,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offse int cnt; sched_pin(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); cmap_pte1 = pc->pc_cmap_pte1; cmap_pte2 = pc->pc_cmap_pte2; mtx_lock(&pc->pc_cmap_lock); @@ -5288,7 +5288,7 @@ pmap_flush_page(vm_page_t m) useclflushopt = (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0; if (useclflushopt || (cpu_feature & CPUID_CLFSH) != 0) { sched_pin(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); cmap_pte2 = pc->pc_cmap_pte2; mtx_lock(&pc->pc_cmap_lock); if (*cmap_pte2) Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sun Jan 29 14:29:02 2017 (r312951) +++ head/sys/i386/include/pcpu.h Sun Jan 29 16:54:55 2017 (r312952) @@ -76,6 +76,7 @@ extern struct pcpu *pcpup; +#define get_pcpu() (pcpup) #define PCPU_GET(member) (pcpup->pc_ ## member) #define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) #define PCPU_INC(member) PCPU_ADD(member, 1) @@ -196,6 +197,15 @@ extern struct pcpu *pcpup; } \ } while (0) +#define get_pcpu() __extension__ ({ \ + struct pcpu *__pc; \ + \ + __asm __volatile("movl %%fs:%1,%0" \ + : "=r" (__pc) \ + : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \ + __pc; \ +}) + #define PCPU_GET(member) __PCPU_GET(pc_ ## member) #define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val) #define PCPU_INC(member) __PCPU_INC(pc_ ## member) From owner-svn-src-head@freebsd.org Sun Jan 29 17:19:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58CE4CC78BD for ; Sun, 29 Jan 2017 17:19:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26345A1B for ; Sun, 29 Jan 2017 17:19:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id c80so12501805iod.1 for ; Sun, 29 Jan 2017 09:19:11 -0800 (PST) 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=QIYp/aEBEMdN1STA741IlSa8Xfj384cKLZLGjEjecR0=; b=sW4TizE2er0pQtCqGwhH7k7zJT82c2SKZpsXIucHVvYme4osBeh2fTQVWeTSa0da61 JLayyZHMsFA38RgsBsddS2kdcNipMsGInZIUaOTMML7i4jRhUDxRTafMDlFFcocbG4JN g8cG0L5tymCQ/nE381dm/QVjpyR0F9pZRVJ0DmEtqb6AVLDCdwg/2HMJeuyYtPAWe7ID SF1UlIylBIudsQtmixH4Edhv6BvZEltK41Fu2tADd2Wg/AljxpvdMKQNamwR1vOgQfBP CsE7xgpXB43Zd8aULgMMZCCukv7Z7HGp55KFUBw8BL5QkGDX5u5/I1QVUhWqMlZwKj0d 9tpA== 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=QIYp/aEBEMdN1STA741IlSa8Xfj384cKLZLGjEjecR0=; b=MWrNuqiSVUDsT2qSNTDLIqW86czAC2z8/pvjiZPrcRGBfE4eZT3E5w/GVo4XsdTNsV 7Ylo7aDfVmCk8wULg+HO4OWSeI1w8Xogy9y2bbjk7iLel7xlOPNAtdTov7K1HC7/AfHC m7d1mgQcTrlbOpI8ysK4Z28nOE9ou5et9DHO9aFEFHU3At9J7AggqAtxwy1qZ9YCiJNG 1PA59Sh4d07GGlE7nzfT9WtNoSRfk5U3rxG8gH4Hf4e7VCHesM8UrwzIHFS9//0rmGe9 aMSICYsKmywPzewUh26H1B6i9t9kby2VyEydy9zqm1TZl66MZaiD6exBFRgBuWT+mh0e iWLA== X-Gm-Message-State: AIkVDXKM3CDpPfEqdXgvxHgIa8D+yFX+O9gOv/zabBFmzCDBWQGI+2n7o0qgm7HZ7i4+gqwTGoQ3BkJstprzDg== X-Received: by 10.107.20.13 with SMTP id 13mr15586498iou.0.1485710350311; Sun, 29 Jan 2017 09:19:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Sun, 29 Jan 2017 09:19:09 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <20170129111117.209bd639@zapp> References: <201701282358.v0SNwHo6055555@repo.freebsd.org> <20170129111117.209bd639@zapp> From: Warner Losh Date: Sun, 29 Jan 2017 10:19:09 -0700 X-Google-Sender-Auth: LlwNXtdaZeM0SLXUbnH0k-rDaCc Message-ID: Subject: Re: svn commit: r312938 - head/share/man/man7 To: Andrew Turner 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 17:19:11 -0000 On Sun, Jan 29, 2017 at 4:11 AM, Andrew Turner wrote: > On Sat, 28 Jan 2017 23:58:17 +0000 (UTC) > Ngie Cooper wrote: > >> Author: ngie >> Date: Sat Jan 28 23:58:17 2017 >> New Revision: 312938 >> URL: https://svnweb.freebsd.org/changeset/base/312938 >> >> Log: >> Update TARGET/TARGET_ARCH examples to use arm64/aarch64 instead of >> i386/pc98 >> pc98 support was removed in r312910 >> >> Modified: >> head/share/man/man7/build.7 >> head/share/man/man7/release.7 >> >> Modified: head/share/man/man7/build.7 >> ============================================================================== >> --- head/share/man/man7/build.7 Sat Jan 28 23:51:03 >> 2017 (r312937) +++ head/share/man/man7/build.7 Sat Jan >> 28 23:58:17 2017 (r312938) @@ -24,7 +24,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd July 20, 2016 >> +.Dd January 28, 2017 >> .Dt BUILD 7 >> .Os >> .Sh NAME >> @@ -517,10 +517,10 @@ This is analogous to the >> .Dq Nm uname Fl m >> output. >> This is necessary to cross-build some target architectures. >> -For example, cross-building for PC98 machines requires >> -.Va TARGET_ARCH Ns = Ns Li i386 >> +For example, cross-building for ARM64 machines requires >> +.Va TARGET_ARCH Ns = Ns Li aarch64 >> and >> -.Va TARGET Ns = Ns Li pc98 . >> +.Va TARGET Ns = Ns Li arm64 . > > That's not quite correct. > > Now pc98 has been removed TARGET_ARCH is enough to specify the hardware > to support. TARGET can be used on many hardware platforms as it will > have a default TARGET_ARCH to use, e.g. on arm64 TARGET=arm64 is enough > as it implies TARGET_ARCH=aarch64, however to build armv6 you would > need to set TARGET_ARCH=armv6 as TARGET=arm implies TARGET_ARCH=arm. Correct. We no longer have any architectures where we have two kernel KPIs like we did on i386 with the radically different machines. This approach, however, has been a bit of a hassle. We inherited it from NetBSD when the pc98 port came in (NetBSD didn't have a pc98 port integrated into their tree, but had a boatload of m68k machines with different kernels). For a while we almost supported 3 different i386 architectures as there were efforts made to port to Sun's i386 roadrunner that never finished. It's unlikely, though not impossible, that we'll repeat this though. NetBSD did it to allow every MACHINE to have a GENERIC that will boot everywhere. Now that we've kinda swallowed that up into boot options and a tertiary loader that's different for different boot environments, it's less of a clear-cut case to have a separate MACHINE, especially since we've been moving to LINT and/or GENERIC on the MACHINE types that have multiple kernels. I'd recommend telling people to always set TARGET_ARCH with an aside saying its safer to set both TARGET and TARGET_ARCH to allow us the flexibility in the future to repeat this sort of situation should unforeseen circumstances warrant it. Since TARGET_ARCH is unique, for the moment and likely near term, that will be flexible enough for the developers and simple enough for the users. The safer advice will mean that the script writers will set them both. Warner From owner-svn-src-head@freebsd.org Sun Jan 29 18:41:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C60CC7E37; Sun, 29 Jan 2017 18:41:11 +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 EE2221199; Sun, 29 Jan 2017 18:41:10 +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 v0TIfA1q018510; Sun, 29 Jan 2017 18:41:10 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TIfANX018509; Sun, 29 Jan 2017 18:41:10 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701291841.v0TIfANX018509@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, 29 Jan 2017 18:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312953 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 18:41:11 -0000 Author: loos Date: Sun Jan 29 18:41:09 2017 New Revision: 312953 URL: https://svnweb.freebsd.org/changeset/base/312953 Log: The stf(4) interface name does not conform with the default naming convention for interfaces, because only one stf(4) interface can exist in the system. This disallow the use of unit numbers different than 0, however, it is possible to create the clone without specify the unit number (wildcard). In the wildcard case we must update the interface name before return. This fix an infinite recursion in pf code that keeps track of network interfaces and groups: 1 - a group for the cloned type of the interface is added (stf in this case); 2 - the system will now try to add an interface named stf (instead of stf0) to stf group; 3 - when pfi_kif_attach() tries to search for an already existing 'stf' interface, the 'stf' group is returned and thus the group is added as an interface of itself; This will now cause a crash at the first attempt to traverse the groups which the stf interface belongs (which loops over itself). Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/net/if_stf.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sun Jan 29 16:54:55 2017 (r312952) +++ head/sys/net/if_stf.c Sun Jan 29 18:41:09 2017 (r312953) @@ -202,10 +202,16 @@ stf_clone_match(struct if_clone *ifc, co static int stf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { - int err, unit; + char *dp; + int err, unit, wildcard; struct stf_softc *sc; struct ifnet *ifp; + err = ifc_name2unit(name, &unit); + if (err != 0) + return (err); + wildcard = (unit < 0); + /* * We can only have one unit, but since unit allocation is * already locked, we use it to keep from allocating extra @@ -229,7 +235,20 @@ stf_clone_create(struct if_clone *ifc, c /* * Set the name manually rather then using if_initname because * we don't conform to the default naming convention for interfaces. + * In the wildcard case, we need to update the name. */ + if (wildcard) { + for (dp = name; *dp != '\0'; dp++); + if (snprintf(dp, len - (dp-name), "%d", unit) > + len - (dp-name) - 1) { + /* + * This can only be a programmer error and + * there's no straightforward way to recover if + * it happens. + */ + panic("if_clone_create(): interface name too long"); + } + } strlcpy(ifp->if_xname, name, IFNAMSIZ); ifp->if_dname = stfname; ifp->if_dunit = IF_DUNIT_NONE; From owner-svn-src-head@freebsd.org Sun Jan 29 19:14:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E09DCC760B; Sun, 29 Jan 2017 19:14:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55A88367; Sun, 29 Jan 2017 19:14:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TJEm3t034444; Sun, 29 Jan 2017 19:14:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TJEml4034442; Sun, 29 Jan 2017 19:14:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701291914.v0TJEml4034442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 29 Jan 2017 19:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312954 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 19:14:49 -0000 Author: kib Date: Sun Jan 29 19:14:48 2017 New Revision: 312954 URL: https://svnweb.freebsd.org/changeset/base/312954 Log: Do not leave stale 4K TLB entries on pde (superpage) removal or protection change. On superpage promotion, x86 pmaps do not invalidate existing 4K entries for the superpage range, because they are compatible with the promoted 2/4M entry. But the invalidation on superpage removal or protection change only did single INVLPG with the base address of the superpage. This reliably flushed superpage TLB entry, and 4K entry for the first page of the superpage, potentially leaving other 4K TLB entries lingering. Do the invalidation of the whole superpage range to correct the problem. Note that the precise invalidation is done by x86 code for kernel_pmap only, for user pmaps whole (per-AS) TLB is flushed. This made the bug well hidden, because promotions of the kernel mappings require specific load. Reported and tested by: Jonathan Looney (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jan 29 18:41:09 2017 (r312953) +++ head/sys/amd64/amd64/pmap.c Sun Jan 29 19:14:48 2017 (r312954) @@ -1040,7 +1040,12 @@ pmap_bootstrap(vm_paddr_t *firstaddr) virtual_avail = va; - /* Initialize the PAT MSR. */ + /* + * Initialize the PAT MSR. + * pmap_init_pat() clears and sets CR4_PGE, which, as a + * side-effect, invalidates stale PG_G TLB entries that might + * have been created in our pre-boot environment. + */ pmap_init_pat(); /* Initialize TLB Context Id. */ @@ -3428,6 +3433,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e vm_paddr_t mptepa; vm_page_t mpte; struct spglist free; + vm_offset_t sva; int PG_PTE_CACHE; PG_G = pmap_global_bit(pmap); @@ -3464,9 +3470,9 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); - pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free, - lockp); - pmap_invalidate_page(pmap, trunc_2mpage(va)); + sva = trunc_2mpage(va); + pmap_remove_pde(pmap, pde, sva, &free, lockp); + pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" " in pmap %p", va, pmap); @@ -3608,11 +3614,23 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; /* - * Machines that don't support invlpg, also don't support - * PG_G. - */ - if (oldpde & PG_G) - pmap_invalidate_page(kernel_pmap, sva); + * When workaround_erratum383 is false, a promotion to a 2M + * page mapping does not invalidate the 512 4K page mappings + * from the TLB. Consequently, at this point, the TLB may + * hold both 4K and 2M page mappings. Therefore, the entire + * range of addresses must be invalidated here. In contrast, + * when workaround_erratum383 is true, a promotion does + * invalidate the 512 4K page mappings, and so a single INVLPG + * suffices to invalidate the 2M page mapping. + */ + if ((oldpde & PG_G) != 0) { + if (workaround_erratum383) + pmap_invalidate_page(kernel_pmap, sva); + else + pmap_invalidate_range(kernel_pmap, sva, + sva + NBPDR - 1); + } + pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); if (oldpde & PG_MANAGED) { CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME); @@ -3994,9 +4012,14 @@ retry: if (newpde != oldpde) { if (!atomic_cmpset_long(pde, oldpde, newpde)) goto retry; - if (oldpde & PG_G) - pmap_invalidate_page(pmap, sva); - else + if (oldpde & PG_G) { + /* See pmap_remove_pde() for explanation. */ + if (workaround_erratum383) + pmap_invalidate_page(kernel_pmap, sva); + else + pmap_invalidate_range(kernel_pmap, sva, + sva + NBPDR - 1); + } else anychanged = TRUE; } return (anychanged); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Jan 29 18:41:09 2017 (r312953) +++ head/sys/i386/i386/pmap.c Sun Jan 29 19:14:48 2017 (r312954) @@ -507,7 +507,14 @@ pmap_bootstrap(vm_paddr_t firstaddr) for (i = 1; i < NKPT; i++) PTD[i] = 0; - /* Initialize the PAT MSR if present. */ + /* + * Initialize the PAT MSR if present. + * pmap_init_pat() clears and sets CR4_PGE, which, as a + * side-effect, invalidates stale PG_G TLB entries that might + * have been created in our pre-boot environment. We assume + * that PAT support implies PGE and in reverse, PGE presence + * comes with PAT. Both features were added for Pentium Pro. + */ pmap_init_pat(); /* Turn on PG_G on kernel page(s) */ @@ -564,7 +571,10 @@ pmap_init_pat(void) pat_table[PAT_WRITE_PROTECTED] = 3; pat_table[PAT_UNCACHED] = 3; - /* Bail if this CPU doesn't implement PAT. */ + /* + * Bail if this CPU doesn't implement PAT. + * We assume that PAT support implies PGE. + */ if ((cpu_feature & CPUID_PAT) == 0) { for (i = 0; i < PAT_INDEX_SIZE; i++) pat_index[i] = pat_table[i]; @@ -2620,6 +2630,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t vm_paddr_t mptepa; vm_page_t mpte; struct spglist free; + vm_offset_t sva; PMAP_LOCK_ASSERT(pmap, MA_OWNED); oldpde = *pde; @@ -2640,8 +2651,9 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t va >> PDRSHIFT, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); - pmap_remove_pde(pmap, pde, trunc_4mpage(va), &free); - pmap_invalidate_page(pmap, trunc_4mpage(va)); + sva = trunc_4mpage(va); + pmap_remove_pde(pmap, pde, sva, &free); + pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x" " in pmap %p", va, pmap); @@ -2811,9 +2823,24 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t /* * Machines that don't support invlpg, also don't support * PG_G. - */ - if (oldpde & PG_G) - pmap_invalidate_page(kernel_pmap, sva); + * + * When workaround_erratum383 is false, a promotion to a 2M/4M + * page mapping does not invalidate the 512/1024 4K page mappings + * from the TLB. Consequently, at this point, the TLB may + * hold both 4K and 2M/4M page mappings. Therefore, the entire + * range of addresses must be invalidated here. In contrast, + * when workaround_erratum383 is true, a promotion does + * invalidate the 512/1024 4K page mappings, and so a single INVLPG + * suffices to invalidate the 2M/4M page mapping. + */ + if ((oldpde & PG_G) != 0) { + if (workaround_erratum383) + pmap_invalidate_page(kernel_pmap, sva); + else + pmap_invalidate_range(kernel_pmap, sva, + sva + NBPDR - 1); + } + pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE; if (oldpde & PG_MANAGED) { pvh = pa_to_pvh(oldpde & PG_PS_FRAME); @@ -3122,9 +3149,14 @@ retry: if (newpde != oldpde) { if (!pde_cmpset(pde, oldpde, newpde)) goto retry; - if (oldpde & PG_G) - pmap_invalidate_page(pmap, sva); - else + if (oldpde & PG_G) { + /* See pmap_remove_pde() for explanation. */ + if (workaround_erratum383) + pmap_invalidate_page(kernel_pmap, sva); + else + pmap_invalidate_range(kernel_pmap, sva, + sva + NBPDR - 1); + } else anychanged = TRUE; } return (anychanged); From owner-svn-src-head@freebsd.org Sun Jan 29 22:06:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C0BCC7E5D; Sun, 29 Jan 2017 22:06:53 +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 422A0117E; Sun, 29 Jan 2017 22:06:53 +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 v0TM6qX3004243; Sun, 29 Jan 2017 22:06:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TM6q8U004242; Sun, 29 Jan 2017 22:06:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701292206.v0TM6q8U004242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 29 Jan 2017 22:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312969 - head/sys/modules/dtb/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2017 22:06:53 -0000 Author: gonzo Date: Sun Jan 29 22:06:52 2017 New Revision: 312969 URL: https://svnweb.freebsd.org/changeset/base/312969 Log: [am335x] Fix DTB name in LINKS variable Fix apparent typo introduced by r312915, upstream DTBs are am335x-* not am3335x-* Modified: head/sys/modules/dtb/am335x/Makefile Modified: head/sys/modules/dtb/am335x/Makefile ============================================================================== --- head/sys/modules/dtb/am335x/Makefile Sun Jan 29 22:00:47 2017 (r312968) +++ head/sys/modules/dtb/am335x/Makefile Sun Jan 29 22:06:52 2017 (r312969) @@ -7,7 +7,7 @@ DTS= \ ufw.dts LINKS= \ - ${DTBDIR}/am3335x-bone.dtb ${DTBDIR}/beaglebone.dtb \ - ${DTBDIR}/am3335x-boneblack.dtb ${DTBDIR}/beaglebone-black.dtb + ${DTBDIR}/am335x-bone.dtb ${DTBDIR}/beaglebone.dtb \ + ${DTBDIR}/am335x-boneblack.dtb ${DTBDIR}/beaglebone-black.dtb .include From owner-svn-src-head@freebsd.org Mon Jan 30 01:11:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D092CC6C88; Mon, 30 Jan 2017 01:11:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4780ABA3; Mon, 30 Jan 2017 01:11:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U1BVW0081273; Mon, 30 Jan 2017 01:11:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U1BV6L081269; Mon, 30 Jan 2017 01:11:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701300111.v0U1BV6L081269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 30 Jan 2017 01:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312972 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 01:11:32 -0000 Author: adrian Date: Mon Jan 30 01:11:30 2017 New Revision: 312972 URL: https://svnweb.freebsd.org/changeset/base/312972 Log: [net80211] address seqno allocation for group addressed frames After some digging and looking at packet traces, it looks like the sequence number allocation being done by net80211 doesn't meet 802.11-2012. Specifically, group addressed frames (broadcast, multicast) have sequence numbers allocated from a separate pool, even if they're QoS frames. This patch starts to try and address this, both on transmit and receive. * When receiving, don't throw away multicast frames for now. It's sub-optimal, but until we correctly track group addressed frames via another TID counter, this is the best we can do. * When doing A-MPDU checks, don't include group addressed frames in the sequence number checks. * When transmitting, don't allocate group frame sequence numbers from the TID, instead use the NONQOS TID for allocation. This may fix iwn(4) 11n because I /think/ this was one of the handful of places where ni_txseqs[] was being assigned /outside/ of the driver itself. This however doesn't completely fix things - notably the way that TID assignment versus WME assignment for driver hardware queues will mess up multicast ordering. For example, if all multicast QoS frames come from one sequence number space but they're expected to obey the QoS value assigned, they'll end up in different queues in the hardware and go out in different orders. I can't fix that right now and indeed fixing it will require some pretty heavy lifting of both the WME<->TID QoS assignment, as well as figuring out what the correct way for drivers to behave. For example, both iwn(4) and ath(4) shouldn't put QoS multicast traffic into the same output queue as aggregate traffic, because the sequence numbers are all wrong. So perhaps the correct thing to do there is ignore the WME/TID for QoS traffic and map it all to the best effort queue or something, and ensure it doesn't muck up the TID/blockack window tracking. However, I'm /pretty/ sure that is still going to happen. .. maybe I should disable multicast QoS frames in general as well, but I don't know what that'll do for whatever the current state of 802.11s mesh support is. Tested: * STA mode, ath10k NIC * AP mode, AR9344/AR9580 AP * iperf tcp/udp tests with concurrent multicast QoS traffic. Before this, iperfs would fail pretty quickly because the sending AP would start sending out QoS multicast frames that would be out of order from the rest of the TID traffic, causing the blockack window to get way, way out of sync. This now doesn't occur. TODO: * verify which QoS frames SHOULD be tagged as M_AMPDU_MPDU. For example, QoS NULL frames shouldn't be tagged! Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D9357 Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_input.h head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Jan 29 22:38:13 2017 (r312971) +++ head/sys/net80211/ieee80211_ht.c Mon Jan 30 01:11:30 2017 (r312972) @@ -827,6 +827,16 @@ ieee80211_ampdu_reorder(struct ieee80211 */ return PROCESS; } + + /* + * 802.11-2012 9.3.2.10 - Duplicate detection and recovery. + * + * Multicast QoS data frames are checked against a different + * counter, not the per-TID counter. + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + return PROCESS; + if (IEEE80211_IS_DSTODS(wh)) tid = ((struct ieee80211_qosframe_addr4 *)wh)->i_qos[0]; else Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Sun Jan 29 22:38:13 2017 (r312971) +++ head/sys/net80211/ieee80211_input.h Mon Jan 30 01:11:30 2017 (r312972) @@ -149,6 +149,12 @@ ishtinfooui(const uint8_t *frm) * (as the seqnum wraps), handle that special case so packets aren't * incorrectly dropped - ie, if the next packet is sequence number 0 * but a retransmit since the initial packet didn't make it. + * + * XXX TODO: handle sequence number space wrapping with dropped frames; + * especially in high interference conditions under high traffic load + * The RX AMPDU reorder code also needs it. + * + * XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery. */ static __inline int ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh, @@ -175,6 +181,13 @@ ieee80211_check_rxseq(struct ieee80211_n if (! IEEE80211_HAS_SEQ(type, subtype)) return 1; + /* + * Always allow multicast frames for now - QoS (any TID) + * or not. + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + return 1; + tid = ieee80211_gettid(wh); /* Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jan 29 22:38:13 2017 (r312971) +++ head/sys/net80211/ieee80211_output.c Mon Jan 30 01:11:30 2017 (r312972) @@ -122,9 +122,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; -#ifdef IEEE80211_SUPPORT_SUPERG int mcast; -#endif if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { @@ -164,9 +162,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * interface it (might have been) received on. */ m->m_pkthdr.rcvif = (void *)ni; -#ifdef IEEE80211_SUPPORT_SUPERG mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; -#endif BPF_MTAP(ifp, m); /* 802.3 tx */ @@ -181,10 +177,15 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * The default ic_ampdu_enable routine handles staggering * ADDBA requests in case the receiver NAK's us or we are * otherwise unable to establish a BA stream. + * + * Don't treat group-addressed frames as candidates for aggregation; + * net80211 doesn't support 802.11aa-2012 and so group addressed + * frames will always have sequence numbers allocated from the NON_QOS + * TID. */ if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX)) { - if ((m->m_flags & M_EAPOL) == 0) { + if ((m->m_flags & M_EAPOL) == 0 && (! mcast)) { int tid = WME_AC_TO_TID(M_WME_GETAC(m)); struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; @@ -776,12 +777,20 @@ ieee80211_send_setup( * requiring the TX lock. */ tap = &ni->ni_tx_ampdu[tid]; - if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) + if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) { m->m_flags |= M_AMPDU_MPDU; - else { + } else { if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK, type & IEEE80211_FC0_SUBTYPE_MASK)) - seqno = ni->ni_txseqs[tid]++; + /* + * 802.11-2012 9.3.2.10 - QoS multicast frames + * come out of a different seqno space. + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + } else { + seqno = ni->ni_txseqs[tid]++; + } else seqno = 0; @@ -1239,7 +1248,7 @@ ieee80211_encap(struct ieee80211vap *vap struct ieee80211_frame *wh; struct ieee80211_key *key; struct llc *llc; - int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr; + int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr, is_mcast; ieee80211_seq seqno; int meshhdrsize, meshae; uint8_t *qos; @@ -1247,6 +1256,8 @@ ieee80211_encap(struct ieee80211vap *vap IEEE80211_TX_LOCK_ASSERT(ic); + is_mcast = !! (m->m_flags & (M_MCAST | M_BCAST)); + /* * Copy existing Ethernet header to a safe place. The * rest of the code assumes it's ok to strip it when @@ -1291,11 +1302,19 @@ ieee80211_encap(struct ieee80211vap *vap * ap's require all data frames to be QoS-encapsulated * once negotiated in which case we'll need to make this * configurable. - * NB: mesh data frames are QoS. + * + * Don't send multicast QoS frames. + * Technically multicast frames can be QoS if all stations in the + * BSS are also QoS. + * + * NB: mesh data frames are QoS, including multicast frames. */ - addqos = ((ni->ni_flags & (IEEE80211_NODE_QOS|IEEE80211_NODE_HT)) || + addqos = + (((is_mcast == 0) && (ni->ni_flags & + (IEEE80211_NODE_QOS|IEEE80211_NODE_HT))) || (vap->iv_opmode == IEEE80211_M_MBSS)) && (m->m_flags & M_EAPOL) == 0; + if (addqos) hdrsize = sizeof(struct ieee80211_qosframe); else @@ -1560,6 +1579,22 @@ ieee80211_encap(struct ieee80211vap *vap */ if ((m->m_flags & M_AMPDU_MPDU) == 0) { /* + * 802.11-2012 9.3.2.10 - + * + * If this is a multicast frame then we need + * to ensure that the sequence number comes from + * a separate seqno space and not the TID space. + * + * Otherwise multicast frames may actually cause + * holes in the TX blockack window space and + * upset various things. + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + else + seqno = ni->ni_txseqs[tid]++; + + /* * NB: don't assign a sequence # to potential * aggregates; we expect this happens at the * point the frame comes off any aggregation q From owner-svn-src-head@freebsd.org Mon Jan 30 02:15:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0A43CC6B64; Mon, 30 Jan 2017 02:15:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0367C2; Mon, 30 Jan 2017 02:15:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2FsSn006456; Mon, 30 Jan 2017 02:15:54 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2Fsl0006455; Mon, 30 Jan 2017 02:15:54 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701300215.v0U2Fsl0006455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Jan 2017 02:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312973 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:15:55 -0000 Author: jhibbits Date: Mon Jan 30 02:15:54 2017 New Revision: 312973 URL: https://svnweb.freebsd.org/changeset/base/312973 Log: Add atomic_fcmpset_*() inlines for powerpc Summary: atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer in the case of failure. Requested by: mjg Differential Revision: https://reviews.freebsd.org/D9325 Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Mon Jan 30 01:11:30 2017 (r312972) +++ head/sys/powerpc/include/atomic.h Mon Jan 30 02:15:54 2017 (r312973) @@ -674,6 +674,129 @@ atomic_cmpset_rel_long(volatile u_long * #define atomic_cmpset_rel_ptr atomic_cmpset_rel_int #endif +/* + * Atomically compare the value stored at *p with *cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed and sets *cmpval to the read value from *p, + * nonzero otherwise. + */ +static __inline int +atomic_fcmpset_int(volatile u_int *p, u_int *cmpval, u_int newval) +{ + int ret; + +#ifdef __GNUCLIKE_ASM + __asm __volatile ( + "1:\tlwarx %0, 0, %3\n\t" /* load old value */ + "cmplw %4, %0\n\t" /* compare */ + "bne 2f\n\t" /* exit if not equal */ + "stwcx. %5, 0, %3\n\t" /* attempt to store */ + "bne- 1b\n\t" /* spin if failed */ + "li %0, 1\n\t" /* success - retval = 1 */ + "b 3f\n\t" /* we've succeeded */ + "2:\n\t" + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ + "stwx %0, 0, %7\n\t" + "li %0, 0\n\t" /* failure - retval = 0 */ + "3:\n\t" + : "=&r" (ret), "=m" (*p), "=m" (*cmpval) + : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) + : "cr0", "memory"); +#endif + + return (ret); +} +static __inline int +atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval) +{ + int ret; + +#ifdef __GNUCLIKE_ASM + __asm __volatile ( + #ifdef __powerpc64__ + "1:\tldarx %0, 0, %3\n\t" /* load old value */ + "cmpld %4, %0\n\t" /* compare */ + "bne 2f\n\t" /* exit if not equal */ + "stdcx. %5, 0, %3\n\t" /* attempt to store */ + #else + "1:\tlwarx %0, 0, %3\n\t" /* load old value */ + "cmplw %4, %0\n\t" /* compare */ + "bne 2f\n\t" /* exit if not equal */ + "stwcx. %5, 0, %3\n\t" /* attempt to store */ + #endif + "bne- 1b\n\t" /* spin if failed */ + "li %0, 1\n\t" /* success - retval = 1 */ + "b 3f\n\t" /* we've succeeded */ + "2:\n\t" + #ifdef __powerpc64__ + "stdcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ + "stdx %0, 0, %7\n\t" + #else + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ + "stwx %0, 0, %7\n\t" + #endif + "li %0, 0\n\t" /* failure - retval = 0 */ + "3:\n\t" + : "=&r" (ret), "=m" (*p), "=m" (*cmpval) + : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) + : "cr0", "memory"); +#endif + + return (ret); +} + +static __inline int +atomic_fcmpset_acq_int(volatile u_int *p, u_int *cmpval, u_int newval) +{ + int retval; + + retval = atomic_fcmpset_int(p, cmpval, newval); + __ATOMIC_ACQ(); + return (retval); +} + +static __inline int +atomic_fcmpset_rel_int(volatile u_int *p, u_int *cmpval, u_int newval) +{ + __ATOMIC_REL(); + return (atomic_fcmpset_int(p, cmpval, newval)); +} + +static __inline int +atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval) +{ + u_long retval; + + retval = atomic_fcmpset_long(p, cmpval, newval); + __ATOMIC_ACQ(); + return (retval); +} + +static __inline int +atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval) +{ + __ATOMIC_REL(); + return (atomic_fcmpset_long(p, cmpval, newval)); +} + +#define atomic_fcmpset_32 atomic_fcmpset_int +#define atomic_fcmpset_acq_32 atomic_fcmpset_acq_int +#define atomic_fcmpset_rel_32 atomic_fcmpset_rel_int + +#ifdef __powerpc64__ +#define atomic_fcmpset_64 atomic_fcmpset_long +#define atomic_fcmpset_acq_64 atomic_fcmpset_acq_long +#define atomic_fcmpset_rel_64 atomic_fcmpset_rel_long + +#define atomic_fcmpset_ptr atomic_fcmpset_long +#define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_long +#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_long +#else +#define atomic_fcmpset_ptr atomic_fcmpset_int +#define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_int +#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_int +#endif + static __inline u_int atomic_fetchadd_int(volatile u_int *p, u_int v) { From owner-svn-src-head@freebsd.org Mon Jan 30 02:21:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA37ECC6FD4; Mon, 30 Jan 2017 02:21:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A113CC2B; Mon, 30 Jan 2017 02:21:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2LTgO007476; Mon, 30 Jan 2017 02:21:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2LTvM007474; Mon, 30 Jan 2017 02:21:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701300221.v0U2LTvM007474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Jan 2017 02:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312974 - in head/sys: powerpc/powerpc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:21:31 -0000 Author: jhibbits Date: Mon Jan 30 02:21:29 2017 New Revision: 312974 URL: https://svnweb.freebsd.org/changeset/base/312974 Log: Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code. Summary: Clang throws the following warning in powerpc intr_machdep: /usr/src/sys/powerpc/powerpc/intr_machdep.c:454:15: warning: comparison of constant -1 with expression of type 'enum intr_trigger' is always false [-Wtautological-constant-out-of-range-compare] if (i->trig == -1) ~~~~~~~ ^ ~~ This may lead to legitimate problems with aggressive optimizations, if not now then in the future. To avoid this, add a new enum, INTR_TRIG_INVALID, set to -1, and use this new enumeration in these checks. Test Plan: Compile test. Reviewed By: jhb, kib Differential Revision: https://reviews.freebsd.org/D9300 Modified: head/sys/powerpc/powerpc/intr_machdep.c head/sys/sys/bus.h Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Mon Jan 30 02:15:54 2017 (r312973) +++ head/sys/powerpc/powerpc/intr_machdep.c Mon Jan 30 02:21:29 2017 (r312974) @@ -451,7 +451,7 @@ powerpc_enable_intr(void) if (error) continue; - if (i->trig == -1) + if (i->trig == INTR_TRIGGER_INVALID) PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, &i->pol); if (i->trig != INTR_TRIGGER_CONFORM || @@ -497,7 +497,7 @@ powerpc_setup_intr(const char *name, u_i error = powerpc_map_irq(i); if (!error) { - if (i->trig == -1) + if (i->trig == INTR_TRIGGER_INVALID) PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, &i->pol); @@ -545,7 +545,7 @@ powerpc_fw_config_intr(int irq, int sens if (i == NULL) return (ENOMEM); - i->trig = -1; + i->trig = INTR_TRIGGER_INVALID; i->pol = INTR_POLARITY_CONFORM; i->fwcode = sense_code; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Jan 30 02:15:54 2017 (r312973) +++ head/sys/sys/bus.h Mon Jan 30 02:21:29 2017 (r312974) @@ -265,6 +265,7 @@ enum intr_type { }; enum intr_trigger { + INTR_TRIGGER_INVALID = -1, INTR_TRIGGER_CONFORM = 0, INTR_TRIGGER_EDGE = 1, INTR_TRIGGER_LEVEL = 2 From owner-svn-src-head@freebsd.org Mon Jan 30 02:24:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B305CC70A3; Mon, 30 Jan 2017 02:24:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7590DE6D; Mon, 30 Jan 2017 02:24:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2OskA010422; Mon, 30 Jan 2017 02:24:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2Osj1010421; Mon, 30 Jan 2017 02:24:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701300224.v0U2Osj1010421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 30 Jan 2017 02:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312975 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:24:55 -0000 Author: mjg Date: Mon Jan 30 02:24:54 2017 New Revision: 312975 URL: https://svnweb.freebsd.org/changeset/base/312975 Log: i386: add atomic_fcmpset Tested by: pho Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon Jan 30 02:21:29 2017 (r312974) +++ head/sys/i386/include/atomic.h Mon Jan 30 02:24:54 2017 (r312975) @@ -106,6 +106,7 @@ void atomic_##NAME##_##TYPE(volatile u_# void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); +int atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); int atomic_testandset_int(volatile u_int *p, u_int v); int atomic_testandclear_int(volatile u_int *p, u_int v); @@ -214,6 +215,24 @@ atomic_cmpset_int(volatile u_int *dst, u return (res); } +static __inline int +atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchgl %3,%1 ; " + " sete %0 ; " + "# atomic_cmpset_int" + : "=r" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+a" (*expect) /* 2 */ + : "r" (src) /* 3 */ + : "memory", "cc"); + return (res); +} + #endif /* CPU_DISABLE_CMPXCHG */ /* @@ -684,6 +703,8 @@ u_long atomic_swap_long(volatile u_long #define atomic_subtract_rel_int atomic_subtract_barr_int #define atomic_cmpset_acq_int atomic_cmpset_int #define atomic_cmpset_rel_int atomic_cmpset_int +#define atomic_fcmpset_acq_int atomic_fcmpset_int +#define atomic_fcmpset_rel_int atomic_fcmpset_int #define atomic_set_acq_long atomic_set_barr_long #define atomic_set_rel_long atomic_set_barr_long @@ -695,6 +716,8 @@ u_long atomic_swap_long(volatile u_long #define atomic_subtract_rel_long atomic_subtract_barr_long #define atomic_cmpset_acq_long atomic_cmpset_long #define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_fcmpset_acq_long atomic_fcmpset_long +#define atomic_fcmpset_rel_long atomic_fcmpset_long #define atomic_readandclear_int(p) atomic_swap_int(p, 0) #define atomic_readandclear_long(p) atomic_swap_long(p, 0) @@ -749,6 +772,9 @@ u_long atomic_swap_long(volatile u_long #define atomic_cmpset_32 atomic_cmpset_int #define atomic_cmpset_acq_32 atomic_cmpset_acq_int #define atomic_cmpset_rel_32 atomic_cmpset_rel_int +#define atomic_fcmpset_32 atomic_fcmpset_int +#define atomic_fcmpset_acq_32 atomic_fcmpset_acq_int +#define atomic_fcmpset_rel_32 atomic_fcmpset_rel_int #define atomic_swap_32 atomic_swap_int #define atomic_readandclear_32 atomic_readandclear_int #define atomic_fetchadd_32 atomic_fetchadd_int @@ -792,6 +818,14 @@ u_long atomic_swap_long(volatile u_long #define atomic_cmpset_rel_ptr(dst, old, new) \ atomic_cmpset_rel_int((volatile u_int *)(dst), (u_int)(old), \ (u_int)(new)) +#define atomic_fcmpset_ptr(dst, old, new) \ + atomic_fcmpset_int((volatile u_int *)(dst), (u_int *)(old), (u_int)(new)) +#define atomic_fcmpset_acq_ptr(dst, old, new) \ + atomic_fcmpset_acq_int((volatile u_int *)(dst), (u_int *)(old), \ + (u_int)(new)) +#define atomic_fcmpset_rel_ptr(dst, old, new) \ + atomic_fcmpset_rel_int((volatile u_int *)(dst), (u_int *)(old), \ + (u_int)(new)) #define atomic_swap_ptr(p, v) \ atomic_swap_int((volatile u_int *)(p), (u_int)(v)) #define atomic_readandclear_ptr(p) \ From owner-svn-src-head@freebsd.org Mon Jan 30 02:25:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4DF3CC714C; Mon, 30 Jan 2017 02:25:56 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945B6101D; Mon, 30 Jan 2017 02:25:56 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2PtdO010513; Mon, 30 Jan 2017 02:25:55 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2Ptsd010512; Mon, 30 Jan 2017 02:25:55 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201701300225.v0U2Ptsd010512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 30 Jan 2017 02:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312976 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:25:56 -0000 Author: hiren Date: Mon Jan 30 02:25:55 2017 New Revision: 312976 URL: https://svnweb.freebsd.org/changeset/base/312976 Log: Man page update to go along with r312907. Reviewed by: Allanjude MFC after: 2 weeks Sponsored by: Limelight Networks Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Jan 30 02:24:54 2017 (r312975) +++ head/share/man/man4/tcp.4 Mon Jan 30 02:25:55 2017 (r312976) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 21, 2016 +.Dd Jan 29, 2017 .Dt TCP 4 .Os .Sh NAME @@ -586,6 +586,12 @@ downshift. List of available TCP function blocks (TCP stacks). .It Va functions_default The default TCP function block (TCP stack). +.It Va functions_inherit_listen_socket_stack +Determines whether to inherit listen socket's tcp stack or use the current +system default tcp stack, as defined by +.Va functions_default +.Pc . +Default is true. .It Va insecure_rst Use criteria defined in RFC793 instead of RFC5961 for accepting RST segments. Default is false. From owner-svn-src-head@freebsd.org Mon Jan 30 02:32:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0709ACC7353; Mon, 30 Jan 2017 02:32:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAAC1143B; Mon, 30 Jan 2017 02:32:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2WXKL014487; Mon, 30 Jan 2017 02:32:33 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2WXMT014486; Mon, 30 Jan 2017 02:32:33 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701300232.v0U2WXMT014486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Jan 2017 02:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312977 - head/sys/dev/adb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:32:35 -0000 Author: jhibbits Date: Mon Jan 30 02:32:33 2017 New Revision: 312977 URL: https://svnweb.freebsd.org/changeset/base/312977 Log: Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned. Clang complains about the shift of (1 << 7) into a int8_t changing the value: warning: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 128 to -128 [-Wconstant-conversion] Squash this warning by forcing clang to see it as an unsigned bit. This seems odd, given that it's still a conversion of 128->-128, but I'm guessing the explicit unsigned attribute notifies clang that sign really doesn't matter in this case. Reported by: Mark Millard MFC after: 2 weeks Modified: head/sys/dev/adb/adb_mouse.c Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:25:55 2017 (r312976) +++ head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:32:33 2017 (r312977) @@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *u } } - sc->packet[0] = 1 << 7; + sc->packet[0] = 1U << 7; sc->packet[0] |= (!(sc->buttons & 1)) << 2; sc->packet[0] |= (!(sc->buttons & 4)) << 1; sc->packet[0] |= (!(sc->buttons & 2)); From owner-svn-src-head@freebsd.org Mon Jan 30 02:52:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601E0CC75B6; Mon, 30 Jan 2017 02:52:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083281C3E; Mon, 30 Jan 2017 02:52:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U2qGOL022478; Mon, 30 Jan 2017 02:52:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U2qGcO022477; Mon, 30 Jan 2017 02:52:16 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701300252.v0U2qGcO022477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Jan 2017 02:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312978 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 02:52:17 -0000 Author: jhibbits Date: Mon Jan 30 02:52:15 2017 New Revision: 312978 URL: https://svnweb.freebsd.org/changeset/base/312978 Log: Drop the __GNUCLIKE_ASM guards around most atomic inlines. There are no alternatives defined, so there's no point in keeping them. Also, they weren't around every inline asm block anyway. Without __GNUCLIKE_ASM defined, the guarded functions return garbage. Reported by: Andrew Thompson Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Mon Jan 30 02:32:33 2017 (r312977) +++ head/sys/powerpc/include/atomic.h Mon Jan 30 02:52:15 2017 (r312978) @@ -446,7 +446,6 @@ atomic_readandclear_int(volatile u_int * { u_int result,temp; -#ifdef __GNUCLIKE_ASM __asm __volatile ( "\tsync\n" /* drain writes */ "1:\tlwarx %0, 0, %3\n\t" /* load old value */ @@ -456,7 +455,6 @@ atomic_readandclear_int(volatile u_int * : "=&r"(result), "=&r"(temp), "=m" (*addr) : "r" (addr), "m" (*addr) : "cr0", "memory"); -#endif return (result); } @@ -467,7 +465,6 @@ atomic_readandclear_long(volatile u_long { u_long result,temp; -#ifdef __GNUCLIKE_ASM __asm __volatile ( "\tsync\n" /* drain writes */ "1:\tldarx %0, 0, %3\n\t" /* load old value */ @@ -477,7 +474,6 @@ atomic_readandclear_long(volatile u_long : "=&r"(result), "=&r"(temp), "=m" (*addr) : "r" (addr), "m" (*addr) : "cr0", "memory"); -#endif return (result); } @@ -565,7 +561,6 @@ atomic_cmpset_int(volatile u_int* p, u_i { int ret; -#ifdef __GNUCLIKE_ASM __asm __volatile ( "1:\tlwarx %0, 0, %2\n\t" /* load old value */ "cmplw %3, %0\n\t" /* compare */ @@ -581,7 +576,6 @@ atomic_cmpset_int(volatile u_int* p, u_i : "=&r" (ret), "=m" (*p) : "r" (p), "r" (cmpval), "r" (newval), "m" (*p) : "cr0", "memory"); -#endif return (ret); } @@ -590,7 +584,6 @@ atomic_cmpset_long(volatile u_long* p, u { int ret; -#ifdef __GNUCLIKE_ASM __asm __volatile ( #ifdef __powerpc64__ "1:\tldarx %0, 0, %2\n\t" /* load old value */ @@ -617,7 +610,6 @@ atomic_cmpset_long(volatile u_long* p, u : "=&r" (ret), "=m" (*p) : "r" (p), "r" (cmpval), "r" (newval), "m" (*p) : "cr0", "memory"); -#endif return (ret); } @@ -685,7 +677,6 @@ atomic_fcmpset_int(volatile u_int *p, u_ { int ret; -#ifdef __GNUCLIKE_ASM __asm __volatile ( "1:\tlwarx %0, 0, %3\n\t" /* load old value */ "cmplw %4, %0\n\t" /* compare */ @@ -702,7 +693,6 @@ atomic_fcmpset_int(volatile u_int *p, u_ : "=&r" (ret), "=m" (*p), "=m" (*cmpval) : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) : "cr0", "memory"); -#endif return (ret); } @@ -711,7 +701,6 @@ atomic_fcmpset_long(volatile u_long *p, { int ret; -#ifdef __GNUCLIKE_ASM __asm __volatile ( #ifdef __powerpc64__ "1:\tldarx %0, 0, %3\n\t" /* load old value */ @@ -740,7 +729,6 @@ atomic_fcmpset_long(volatile u_long *p, : "=&r" (ret), "=m" (*p), "=m" (*cmpval) : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) : "cr0", "memory"); -#endif return (ret); } From owner-svn-src-head@freebsd.org Mon Jan 30 03:04:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EE52CC7C59; Mon, 30 Jan 2017 03:04:37 +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 2D926894; Mon, 30 Jan 2017 03:04:35 +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 v0U34Yix027163; Mon, 30 Jan 2017 03:04:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U34YQp027161; Mon, 30 Jan 2017 03:04:34 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701300304.v0U34YQp027161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 30 Jan 2017 03:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312979 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 03:04:37 -0000 Author: loos Date: Mon Jan 30 03:04:33 2017 New Revision: 312979 URL: https://svnweb.freebsd.org/changeset/base/312979 Log: Do not update the lagg link layer address when destroying a lagg clone. This would enqueue an event to send the gratuitous arp on a dying lagg interface without any physical ports attached to it. Apart from that, the taskqueue_drain() on lagg_clone_destroy() runs too late, when the ifp data structure is already freed. Fix that too. Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Jan 30 02:52:15 2017 (r312978) +++ head/sys/net/if_lagg.c Mon Jan 30 03:04:33 2017 (r312979) @@ -550,12 +550,15 @@ lagg_clone_destroy(struct ifnet *ifp) EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); /* Shutdown and remove lagg ports */ - while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) + while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) { + lp->lp_detaching = LAGG_CLONE_DESTROY; lagg_port_destroy(lp, 1); + } /* Unhook the aggregation protocol */ lagg_proto_detach(sc); LAGG_UNLOCK_ASSERT(sc); + taskqueue_drain(taskqueue_swi, &sc->sc_lladdr_task); ifmedia_removeall(&sc->sc_media); ether_ifdetach(ifp); if_free(ifp); @@ -564,7 +567,6 @@ lagg_clone_destroy(struct ifnet *ifp) SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries); LAGG_LIST_UNLOCK(); - taskqueue_drain(taskqueue_swi, &sc->sc_lladdr_task); LAGG_LOCK_DESTROY(sc); free(sc, M_DEVBUF); } @@ -902,7 +904,7 @@ lagg_port_destroy(struct lagg_port *lp, * Remove multicast addresses and interface flags from this port and * reset the MAC address, skip if the interface is being detached. */ - if (!lp->lp_detaching) { + if (lp->lp_detaching == 0) { lagg_ether_cmdmulti(lp, 0); lagg_setflags(lp, 0); lagg_port_lladdr(lp, lp->lp_lladdr, LAGG_LLQTYPE_PHYS); @@ -935,7 +937,8 @@ lagg_port_destroy(struct lagg_port *lp, bcopy(lp0->lp_lladdr, lladdr, ETHER_ADDR_LEN); } - lagg_lladdr(sc, lladdr); + if (lp->lp_detaching != LAGG_CLONE_DESTROY) + lagg_lladdr(sc, lladdr); /* Mark lp0 as new primary */ sc->sc_primary = lp0; @@ -950,7 +953,7 @@ lagg_port_destroy(struct lagg_port *lp, } /* Remove any pending lladdr changes from the queue */ - if (lp->lp_detaching) { + if (lp->lp_detaching != 0) { SLIST_FOREACH(llq, &sc->sc_llq_head, llq_entries) { if (llq->llq_ifp == ifp) { SLIST_REMOVE(&sc->sc_llq_head, llq, lagg_llq, @@ -1129,7 +1132,7 @@ lagg_port_ifdetach(void *arg __unused, s sc = lp->lp_softc; LAGG_WLOCK(sc); - lp->lp_detaching = 1; + lp->lp_detaching = LAGG_PORT_DETACH; lagg_port_destroy(lp, 1); LAGG_WUNLOCK(sc); } @@ -1660,7 +1663,7 @@ lagg_ether_cmdmulti(struct lagg_port *lp } else { while ((mc = SLIST_FIRST(&lp->lp_mc_head)) != NULL) { SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); - if (mc->mc_ifma && !lp->lp_detaching) + if (mc->mc_ifma && lp->lp_detaching == 0) if_delmulti_ifma(mc->mc_ifma); free(mc, M_DEVBUF); } Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Mon Jan 30 02:52:15 2017 (r312978) +++ head/sys/net/if_lagg.h Mon Jan 30 03:04:33 2017 (r312979) @@ -261,6 +261,8 @@ struct lagg_port { void *lh_cookie; /* if state hook */ void *lp_psc; /* protocol data */ int lp_detaching; /* ifnet is detaching */ +#define LAGG_PORT_DETACH 0x01 /* detach lagg port */ +#define LAGG_CLONE_DESTROY 0x02 /* destroy lagg clone */ SLIST_HEAD(__mclhd, lagg_mc) lp_mc_head; /* multicast addresses */ From owner-svn-src-head@freebsd.org Mon Jan 30 03:07:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5019CC7DA0; Mon, 30 Jan 2017 03:07:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4D63C70; Mon, 30 Jan 2017 03:07:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U37Wax027300; Mon, 30 Jan 2017 03:07:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U37W3L027299; Mon, 30 Jan 2017 03:07:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701300307.v0U37W3L027299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 30 Jan 2017 03:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312980 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 03:07:34 -0000 Author: mjg Date: Mon Jan 30 03:07:32 2017 New Revision: 312980 URL: https://svnweb.freebsd.org/changeset/base/312980 Log: fd: sprinkle __read_mostly and __exclusive_cache_line Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Jan 30 03:04:33 2017 (r312979) +++ head/sys/kern/kern_descrip.c Mon Jan 30 03:07:32 2017 (r312980) @@ -97,8 +97,8 @@ MALLOC_DEFINE(M_FILECAPS, "filecaps", "d MALLOC_DECLARE(M_FADVISE); -static uma_zone_t file_zone; -static uma_zone_t filedesc0_zone; +static __read_mostly uma_zone_t file_zone; +static __read_mostly uma_zone_t filedesc0_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -168,9 +168,9 @@ struct filedesc0 { /* * Descriptor management. */ -volatile int openfiles; /* actual number of open files */ +volatile int __exclusive_cache_line openfiles; /* actual number of open files */ struct mtx sigio_lock; /* mtx to protect pointers to sigio */ -void (*mq_fdclose)(struct thread *td, int fd, struct file *fp); +void __read_mostly (*mq_fdclose)(struct thread *td, int fd, struct file *fp); /* * If low >= size, just return low. Otherwise find the first zero bit in the From owner-svn-src-head@freebsd.org Mon Jan 30 03:15:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE052CC7FCB; Mon, 30 Jan 2017 03:15:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42EA91158; Mon, 30 Jan 2017 03:15:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id c85so195686603wmi.1; Sun, 29 Jan 2017 19:15:51 -0800 (PST) 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; bh=ATAV/pndH8r7/Hx5D12U1DpN7NASJ4atwD+m0QRzH2I=; b=HD+/p0s6f99mP2aUslbaidkKk6O/FezdgdRi2dCWpt/QJ7YOTa4ecMDJI+WuiG5Kdi xF82bHK290smBCAdVZNeX8fU736dpt0z+N0Zi3YUpX0lWQw/AStHIBqGgxy7rDSxWgxK vD0QTYOPSBhQDgOLomYyH34vYtSYtSY9sAXcKiu8VBeZLWGPfOiKU8Gu/loiAxCOH3ux X+DZUmF/JLj1XcUq1c5GKs402I4Yia9I/BbNTujrTsFKy0YQbrbcWtEJ0Yda0mbCG4Bd ciDN4NDE2N3uqoXaTPQqaxKQzq2GeEYDqSSB6DK4Hp+iPluew8YYoZRtL5d6sq9k1xMp KXHg== 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; bh=ATAV/pndH8r7/Hx5D12U1DpN7NASJ4atwD+m0QRzH2I=; b=WzFVy1J6bxGElrks2BhUJRw5R6WIEi8r+saTSq5/1blsqyLO5o1nmE/iNP17e6gwKJ pvzjaqJOp8NlQ625v2PwahhTRfz8nW/+P5OvPxggTJlOu94QyEEQqvh3JpmyeZZXp7pt eiOUHfdmKMVLJMa3fiTNszl4KCcKtkpRhHw4x0HRvqoLRIkptVeKlcx4/o7uGLf+jIXx 4I1mnMmKfngGg3Hs6sKk7ZUcIfLOn7l0xRj5CzNWDg6DzsXY7v4+8sfEtMVXsCoYU9gG XJZ39AHL/wJQcR30bZo9En9y4sU8KQgHDvimG9BFC3ALX+e/lGiUgjms2FxGqLNXieo+ x3pA== X-Gm-Message-State: AIkVDXLn0WYceoNoP4zbmZtfKkBUo12RoRgU9n1z9N0+qp4CyUZJwMQDIc4yJ2EHVwPbonY3DlmsP7DN/7S6tQ== X-Received: by 10.223.169.112 with SMTP id u103mr16055188wrc.166.1485746148696; Sun, 29 Jan 2017 19:15:48 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.82.162 with HTTP; Sun, 29 Jan 2017 19:15:47 -0800 (PST) In-Reply-To: <201701300111.v0U1BV6L081269@repo.freebsd.org> References: <201701300111.v0U1BV6L081269@repo.freebsd.org> From: Adrian Chadd Date: Sun, 29 Jan 2017 19:15:47 -0800 X-Google-Sender-Auth: cPLMGHGgj7utlKAZiWo0BfaH8NU Message-ID: Subject: Re: svn commit: r312972 - head/sys/net80211 To: "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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 03:15:52 -0000 ... and obviously between writing the initial review message and the commit, I also decided to disable multicast QoS frame generation for now. It just makes things less terrible. At some point IBSS/hostap mode should grow "how many stations are QoS/non-QoS" tracking so this can be dynamic and multicast QoS can occur. (ANd for whenever I implement 802.11aa extensions, I'll need it to work..) -adrian On 29 January 2017 at 17:11, Adrian Chadd wrote: > Author: adrian > Date: Mon Jan 30 01:11:30 2017 > New Revision: 312972 > URL: https://svnweb.freebsd.org/changeset/base/312972 > > Log: > [net80211] address seqno allocation for group addressed frames > > After some digging and looking at packet traces, it looks like the > sequence number allocation being done by net80211 doesn't meet > 802.11-2012. > > Specifically, group addressed frames (broadcast, multicast) have > sequence numbers allocated from a separate pool, even if they're > QoS frames. > > This patch starts to try and address this, both on transmit and > receive. > > * When receiving, don't throw away multicast frames for now. > It's sub-optimal, but until we correctly track group addressed > frames via another TID counter, this is the best we can do. > > * When doing A-MPDU checks, don't include group addressed frames > in the sequence number checks. > > * When transmitting, don't allocate group frame sequence numbers > from the TID, instead use the NONQOS TID for allocation. > > This may fix iwn(4) 11n because I /think/ this was one of the > handful of places where ni_txseqs[] was being assigned /outside/ > of the driver itself. > > This however doesn't completely fix things - notably the way that > TID assignment versus WME assignment for driver hardware queues > will mess up multicast ordering. For example, if all multicast > QoS frames come from one sequence number space but they're > expected to obey the QoS value assigned, they'll end up in > different queues in the hardware and go out in different > orders. > > I can't fix that right now and indeed fixing it will require some > pretty heavy lifting of both the WME<->TID QoS assignment, as well > as figuring out what the correct way for drivers to behave. > > For example, both iwn(4) and ath(4) shouldn't put QoS multicast > traffic into the same output queue as aggregate traffic, because > the sequence numbers are all wrong. So perhaps the correct thing > to do there is ignore the WME/TID for QoS traffic and map it all > to the best effort queue or something, and ensure it doesn't > muck up the TID/blockack window tracking. However, I'm /pretty/ > sure that is still going to happen. > > .. maybe I should disable multicast QoS frames in general as well, > but I don't know what that'll do for whatever the current state > of 802.11s mesh support is. > > Tested: > > * STA mode, ath10k NIC > * AP mode, AR9344/AR9580 AP > * iperf tcp/udp tests with concurrent multicast QoS traffic. > > Before this, iperfs would fail pretty quickly because the sending > AP would start sending out QoS multicast frames that would be > out of order from the rest of the TID traffic, causing the blockack > window to get way, way out of sync. > > This now doesn't occur. > > TODO: > > * verify which QoS frames SHOULD be tagged as M_AMPDU_MPDU. > For example, QoS NULL frames shouldn't be tagged! > > Reviewed by: avos > Differential Revision: https://reviews.freebsd.org/D9357 > > Modified: > head/sys/net80211/ieee80211_ht.c > head/sys/net80211/ieee80211_input.h > head/sys/net80211/ieee80211_output.c > > Modified: head/sys/net80211/ieee80211_ht.c > ============================================================================== > --- head/sys/net80211/ieee80211_ht.c Sun Jan 29 22:38:13 2017 (r312971) > +++ head/sys/net80211/ieee80211_ht.c Mon Jan 30 01:11:30 2017 (r312972) > @@ -827,6 +827,16 @@ ieee80211_ampdu_reorder(struct ieee80211 > */ > return PROCESS; > } > + > + /* > + * 802.11-2012 9.3.2.10 - Duplicate detection and recovery. > + * > + * Multicast QoS data frames are checked against a different > + * counter, not the per-TID counter. > + */ > + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) > + return PROCESS; > + > if (IEEE80211_IS_DSTODS(wh)) > tid = ((struct ieee80211_qosframe_addr4 *)wh)->i_qos[0]; > else > > Modified: head/sys/net80211/ieee80211_input.h > ============================================================================== > --- head/sys/net80211/ieee80211_input.h Sun Jan 29 22:38:13 2017 (r312971) > +++ head/sys/net80211/ieee80211_input.h Mon Jan 30 01:11:30 2017 (r312972) > @@ -149,6 +149,12 @@ ishtinfooui(const uint8_t *frm) > * (as the seqnum wraps), handle that special case so packets aren't > * incorrectly dropped - ie, if the next packet is sequence number 0 > * but a retransmit since the initial packet didn't make it. > + * > + * XXX TODO: handle sequence number space wrapping with dropped frames; > + * especially in high interference conditions under high traffic load > + * The RX AMPDU reorder code also needs it. > + * > + * XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery. > */ > static __inline int > ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh, > @@ -175,6 +181,13 @@ ieee80211_check_rxseq(struct ieee80211_n > if (! IEEE80211_HAS_SEQ(type, subtype)) > return 1; > > + /* > + * Always allow multicast frames for now - QoS (any TID) > + * or not. > + */ > + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) > + return 1; > + > tid = ieee80211_gettid(wh); > > /* > > Modified: head/sys/net80211/ieee80211_output.c > ============================================================================== > --- head/sys/net80211/ieee80211_output.c Sun Jan 29 22:38:13 2017 (r312971) > +++ head/sys/net80211/ieee80211_output.c Mon Jan 30 01:11:30 2017 (r312972) > @@ -122,9 +122,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 > { > struct ieee80211com *ic = vap->iv_ic; > struct ifnet *ifp = vap->iv_ifp; > -#ifdef IEEE80211_SUPPORT_SUPERG > int mcast; > -#endif > > if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && > (m->m_flags & M_PWR_SAV) == 0) { > @@ -164,9 +162,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 > * interface it (might have been) received on. > */ > m->m_pkthdr.rcvif = (void *)ni; > -#ifdef IEEE80211_SUPPORT_SUPERG > mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; > -#endif > > BPF_MTAP(ifp, m); /* 802.3 tx */ > > @@ -181,10 +177,15 @@ ieee80211_vap_pkt_send_dest(struct ieee8 > * The default ic_ampdu_enable routine handles staggering > * ADDBA requests in case the receiver NAK's us or we are > * otherwise unable to establish a BA stream. > + * > + * Don't treat group-addressed frames as candidates for aggregation; > + * net80211 doesn't support 802.11aa-2012 and so group addressed > + * frames will always have sequence numbers allocated from the NON_QOS > + * TID. > */ > if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && > (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX)) { > - if ((m->m_flags & M_EAPOL) == 0) { > + if ((m->m_flags & M_EAPOL) == 0 && (! mcast)) { > int tid = WME_AC_TO_TID(M_WME_GETAC(m)); > struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; > > @@ -776,12 +777,20 @@ ieee80211_send_setup( > * requiring the TX lock. > */ > tap = &ni->ni_tx_ampdu[tid]; > - if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) > + if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) { > m->m_flags |= M_AMPDU_MPDU; > - else { > + } else { > if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK, > type & IEEE80211_FC0_SUBTYPE_MASK)) > - seqno = ni->ni_txseqs[tid]++; > + /* > + * 802.11-2012 9.3.2.10 - QoS multicast frames > + * come out of a different seqno space. > + */ > + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { > + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; > + } else { > + seqno = ni->ni_txseqs[tid]++; > + } > else > seqno = 0; > > @@ -1239,7 +1248,7 @@ ieee80211_encap(struct ieee80211vap *vap > struct ieee80211_frame *wh; > struct ieee80211_key *key; > struct llc *llc; > - int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr; > + int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr, is_mcast; > ieee80211_seq seqno; > int meshhdrsize, meshae; > uint8_t *qos; > @@ -1247,6 +1256,8 @@ ieee80211_encap(struct ieee80211vap *vap > > IEEE80211_TX_LOCK_ASSERT(ic); > > + is_mcast = !! (m->m_flags & (M_MCAST | M_BCAST)); > + > /* > * Copy existing Ethernet header to a safe place. The > * rest of the code assumes it's ok to strip it when > @@ -1291,11 +1302,19 @@ ieee80211_encap(struct ieee80211vap *vap > * ap's require all data frames to be QoS-encapsulated > * once negotiated in which case we'll need to make this > * configurable. > - * NB: mesh data frames are QoS. > + * > + * Don't send multicast QoS frames. > + * Technically multicast frames can be QoS if all stations in the > + * BSS are also QoS. > + * > + * NB: mesh data frames are QoS, including multicast frames. > */ > - addqos = ((ni->ni_flags & (IEEE80211_NODE_QOS|IEEE80211_NODE_HT)) || > + addqos = > + (((is_mcast == 0) && (ni->ni_flags & > + (IEEE80211_NODE_QOS|IEEE80211_NODE_HT))) || > (vap->iv_opmode == IEEE80211_M_MBSS)) && > (m->m_flags & M_EAPOL) == 0; > + > if (addqos) > hdrsize = sizeof(struct ieee80211_qosframe); > else > @@ -1560,6 +1579,22 @@ ieee80211_encap(struct ieee80211vap *vap > */ > if ((m->m_flags & M_AMPDU_MPDU) == 0) { > /* > + * 802.11-2012 9.3.2.10 - > + * > + * If this is a multicast frame then we need > + * to ensure that the sequence number comes from > + * a separate seqno space and not the TID space. > + * > + * Otherwise multicast frames may actually cause > + * holes in the TX blockack window space and > + * upset various things. > + */ > + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) > + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; > + else > + seqno = ni->ni_txseqs[tid]++; > + > + /* > * NB: don't assign a sequence # to potential > * aggregates; we expect this happens at the > * point the frame comes off any aggregation q > From owner-svn-src-head@freebsd.org Mon Jan 30 03:20:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 460EACC6061; Mon, 30 Jan 2017 03:20:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 157831355; Mon, 30 Jan 2017 03:20:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U3K6W7031460; Mon, 30 Jan 2017 03:20:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U3K6VH031459; Mon, 30 Jan 2017 03:20:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701300320.v0U3K6VH031459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 30 Jan 2017 03:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312981 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 03:20:07 -0000 Author: mjg Date: Mon Jan 30 03:20:05 2017 New Revision: 312981 URL: https://svnweb.freebsd.org/changeset/base/312981 Log: cache: use vrefact for '.' lookups and refing the rdir in fullpath Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jan 30 03:07:32 2017 (r312980) +++ head/sys/kern/vfs_cache.c Mon Jan 30 03:20:05 2017 (r312981) @@ -1124,7 +1124,7 @@ retry: timespecclear(tsp); if (ticksp != NULL) *ticksp = ticks; - VREF(*vpp); + vrefact(*vpp); /* * When we lookup "." we still can be asked to lock it * differently... @@ -2115,7 +2115,7 @@ vn_fullpath(struct thread *td, struct vn fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); rdir = fdp->fd_rdir; - VREF(rdir); + vrefact(rdir); FILEDESC_SUNLOCK(fdp); error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); vrele(rdir); From owner-svn-src-head@freebsd.org Mon Jan 30 03:42:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 129A3CC668B for ; Mon, 30 Jan 2017 03:42:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-75.reflexion.net [208.70.210.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD208A1 for ; Mon, 30 Jan 2017 03:42:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 20291 invoked from network); 30 Jan 2017 03:42:02 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 30 Jan 2017 03:42:02 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.20.1) with SMTP; Sun, 29 Jan 2017 22:42:02 -0500 (EST) Received: (qmail 29609 invoked from network); 30 Jan 2017 03:42:01 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Jan 2017 03:42:01 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 44750EC7E21; Sun, 29 Jan 2017 19:42:01 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r312977 - head/sys/dev/adb Message-Id: <588CB781-A470-4101-8108-ADAD34525422@dsl-only.net> Date: Sun, 29 Jan 2017 19:42:00 -0800 To: Justin Hibbits , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 03:42:10 -0000 > Author: jhibbits > Date: Mon Jan 30 02:32:33 2017 > New Revision: 312977 > URL:=20 > https://svnweb.freebsd.org/changeset/base/312977 >=20 >=20 > Log: > Force the setting of bit 7 in the sysmouse packet byte 1 to be = unsigned. > =20 > Clang complains about the shift of (1 << 7) into a int8_t changing = the value: > =20 > warning: implicit conversion from 'int' to 'int8_t' (aka 'signed = char') changes > value from 128 to -128 [-Wconstant-conversion] > =20 > Squash this warning by forcing clang to see it as an unsigned bit. > =20 > This seems odd, given that it's still a conversion of 128->-128, but = I'm > guessing the explicit unsigned attribute notifies clang that sign = really doesn't > matter in this case. [The following is based just on the C standard, not POSIX or other standards that may also be involved from FreeBSD's point of view.] An FYI/explanation of sorts. . . In the C11 standard (e.g., since I have it handy) having the new type be signed has the rule for signed and unsigned integer implicit conversions between the types: (After the cases of value-representable-so-value-is-unchanged and new-type-is-unsigned, quoting:) > Otherwise, the new type is signed and the value cannot be represented > in it; either the result is implementation-defined or an > implementation-defined signal is raised. So while 1U use may make the compiler(s) tested be quiet it still leaves the code in implementation-defined territory where different starting types for the same value are allowed to have different results. But they are not required to and compiler releases could change the classification --and if there are messages from the compiler or not. Bit patterns need not be preserved for the sign-bit and/or value-carrying bits in the new type vs. the old type. (By contrast a new type being unsigned is defined with a mathematically specific/unique result and so a specific bit pattern for the value-carrying bits, ignoring trap representations and other pad bits if they exist.) > Reported by: Mark Millard > MFC after: 2 weeks >=20 > Modified: > head/sys/dev/adb/adb_mouse.c >=20 > Modified: head/sys/dev/adb/adb_mouse.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:25:55 2017 = (r312976) > +++ head/sys/dev/adb/adb_mouse.c Mon Jan 30 02:32:33 2017 = (r312977) > @@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *u > } > } > =20 > - sc->packet[0] =3D 1 << 7; > + sc->packet[0] =3D 1U << 7; > sc->packet[0] |=3D (!(sc->buttons & 1)) << 2; > sc->packet[0] |=3D (!(sc->buttons & 4)) << 1; > sc->packet[0] |=3D (!(sc->buttons & 2)); =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Jan 30 04:45:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B583CC7449; Mon, 30 Jan 2017 04:45:10 +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 60CDA1733; Mon, 30 Jan 2017 04:45:09 +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 A3D3310318C; Mon, 30 Jan 2017 15:44:59 +1100 (AEDT) Date: Mon, 30 Jan 2017 15:44:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include In-Reply-To: <201701300224.v0U2Osj1010421@repo.freebsd.org> Message-ID: <20170130142123.V953@besplex.bde.org> References: <201701300224.v0U2Osj1010421@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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=RcezWy2ymVxIhtw7SZQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 04:45:10 -0000 On Mon, 30 Jan 2017, Mateusz Guzik wrote: > Log: > i386: add atomic_fcmpset > > Tested by: pho This is has some bugs and style bugs. > Modified: > head/sys/i386/include/atomic.h > > Modified: head/sys/i386/include/atomic.h > ============================================================================== > --- head/sys/i386/include/atomic.h Mon Jan 30 02:21:29 2017 (r312974) > +++ head/sys/i386/include/atomic.h Mon Jan 30 02:24:54 2017 (r312975) > @@ -214,6 +215,24 @@ atomic_cmpset_int(volatile u_int *dst, u > return (res); > } > > +static __inline int > +atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src) This is unusable except under SMP or CPU_DISABLE_CMPXCHG ifdefs, since it is not defined if CPU_DISABLE_CMPXCHG is configured. CPU_DISABLE_CMPXCHG is still a supported user option if !SMP. According to NOTES, it is to support vmware emulating cmpxchg poorly. This function and its excessive aliases seems to be undocumented and not yet used, so I don't know what it is supposed to be used for or whether these uses are naturally restricted to the SMP case where the function is available. > +{ > + u_char res; > + > + __asm __volatile( > + " " MPLOCKED " " > + " cmpxchgl %3,%1 ; " > + " sete %0 ; " > + "# atomic_cmpset_int" > + : "=r" (res), /* 0 */ Invalid asm. sete is only valid for q registers, except in long mode on amd64. > + "+m" (*dst), /* 1 */ > + "+a" (*expect) /* 2 */ Style bug (inconsistent indentation). Bugs like this can be created by blind indentation. Cloning atomic_cmpset_int() and then s/expect/*expect/ to get the subtle difference between these function would have given the style bug here. But that wouldn't have given the invalid asm. The i386 atomic_cmpset_int() doesn't have the invalid asm, and the amd64 atomic_fcmpset_int() doesn't have the style bug. > + : "r" (src) /* 3 */ > + : "memory", "cc"); > + return (res); > +} > + > #endif /* CPU_DISABLE_CMPXCHG */ > > /* The other style bugs seem to be consistent with the rest of the file (API explosion, unsorted #define's in the explosion, and bogus casts in the "pointer" APIs; amd64 never had the latter, so MI code can't depend on the casts hiding type errors). Bruce From owner-svn-src-head@freebsd.org Mon Jan 30 04:51:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21B5CCC7516; Mon, 30 Jan 2017 04:51:20 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE9381991; Mon, 30 Jan 2017 04:51:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U4pJiN069685; Mon, 30 Jan 2017 04:51:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U4pJnq069682; Mon, 30 Jan 2017 04:51:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201701300451.v0U4pJnq069682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 30 Jan 2017 04:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312982 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 04:51:20 -0000 Author: cy Date: Mon Jan 30 04:51:18 2017 New Revision: 312982 URL: https://svnweb.freebsd.org/changeset/base/312982 Log: Correct comment grammar and make it easier to understand. MFC after: 1 week Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jan 30 03:20:05 2017 (r312981) +++ head/sys/netinet/tcp_output.c Mon Jan 30 04:51:18 2017 (r312982) @@ -1270,8 +1270,8 @@ send: #ifdef INET6 if (isipv6) { /* - * ip6_plen is not need to be filled now, and will be filled - * in ip6_output. + * There is no need to fill in ip6_plen right now. + * It will be filled later by ip6_output. */ m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + From owner-svn-src-head@freebsd.org Mon Jan 30 04:51:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA94DCC7565 for ; Mon, 30 Jan 2017 04:51:39 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 966461B39 for ; Mon, 30 Jan 2017 04:51:39 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it0-x242.google.com with SMTP id o185so14331360itb.1 for ; Sun, 29 Jan 2017 20:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=6ACelhoQDh0RbYsIJHoPJVeQsgIFBmwr5qm1hMAv9es=; b=OwdHTbnDt8OBWkSF9VzgkJEUZK5+iwlsfIJYFVtlmTbBmEO88KNim3pqZ+yUIIUMIl 1wj/yilFlYBd8zKYjxvyhi2ivCt3AL98t2FaiT/fPbdATuUFXrIKneYMkM6LgrLlaAxx bb9JQqvXt+r0G/vKno70fJBDbdySTVxtawUh9AvzgxGWP2uTb9Z7j5JaGCjcYlnp6wOT Y4nuHFj7cUQ+pywEuyAq5ko62NtBNgbJFjGeonWAWoAa03nAMVKz+80BbklhssEmNL2Q DJq9wTBs5ZmGKT5tSMJFRRHjcNP4JjKrgZ+/LVWRkUrEwPai7Cc26jDJXiT/eTM8BOnD BsSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=6ACelhoQDh0RbYsIJHoPJVeQsgIFBmwr5qm1hMAv9es=; b=WUWVqIRoXscMWUZgVsNdyfPvyo7yo6g9LBRdBwzrPtDpZoNy9OVaDgHrC5B5BiYs6Q 5sih1L2Xmba5Mcj7jJwCPTB9c1LY3KLjO0WhbiJhtq8QtuuJ7P0bgCuIwW8s3S60OPdT YXA+fRh8edthR6fvFmflsWLkwoPdqdNA3k7kjdSGQmMSfY0J/ZDJdu2pKW4RBukXO4XV 5iP84WGPjQlQwvjPXrEJojNMbKFJYVQkxM7fokbAG0a3OjQcxfaxyqlyGUquQH3Mcmpb V5mUwDcZqglVozzzEd0EGBUdLf3Yo/+lSnQg35ULoXv0lYVw4sorwAPYXair1J4+R+Uq Ft1w== X-Gm-Message-State: AIkVDXK5+nKASsQGzlYCe5XXD6e4MRdwFfVfjfM2iLGzJYelBX2+4BNfUsyC/fAM900PJQ== X-Received: by 10.36.181.87 with SMTP id j23mr14865323iti.68.1485751898805; Sun, 29 Jan 2017 20:51:38 -0800 (PST) Received: from blackstar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id n134sm5821418itg.19.2017.01.29.20.51.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 29 Jan 2017 20:51:38 -0800 (PST) Cc: svn-src-head@freebsd.org Message-Id: From: Justin Hibbits To: Mark Millard In-Reply-To: <588CB781-A470-4101-8108-ADAD34525422@dsl-only.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r312977 - head/sys/dev/adb Date: Sun, 29 Jan 2017 22:51:36 -0600 References: <588CB781-A470-4101-8108-ADAD34525422@dsl-only.net> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 04:51:39 -0000 Hi Mark, On Jan 29, 2017, at 9:42 PM, Mark Millard wrote: >> Author: jhibbits >> Date: Mon Jan 30 02:32:33 2017 >> New Revision: 312977 >> URL: >> https://svnweb.freebsd.org/changeset/base/312977 >> >> >> Log: >> Force the setting of bit 7 in the sysmouse packet byte 1 to be >> unsigned. >> >> Clang complains about the shift of (1 << 7) into a int8_t changing >> the value: >> >> warning: implicit conversion from 'int' to 'int8_t' (aka 'signed >> char') changes >> value from 128 to -128 [-Wconstant-conversion] >> >> Squash this warning by forcing clang to see it as an unsigned bit. >> >> This seems odd, given that it's still a conversion of 128->-128, >> but I'm >> guessing the explicit unsigned attribute notifies clang that sign >> really doesn't >> matter in this case. > > [The following is based just on the C standard, not POSIX > or other standards that may also be involved from FreeBSD's > point of view.] > > An FYI/explanation of sorts. . . > > In the C11 standard (e.g., since I have it handy) having the > new type be signed has the rule for signed and unsigned integer > implicit conversions between the types: > > (After the cases of value-representable-so-value-is-unchanged > and new-type-is-unsigned, quoting:) > >> Otherwise, the new type is signed and the value cannot be represented >> in it; either the result is implementation-defined or an >> implementation-defined signal is raised. > > So while 1U use may make the compiler(s) tested be quiet it still > leaves > the code in implementation-defined territory where different starting > types for the same value are allowed to have different results. But > they are not required to and compiler releases could change the > classification --and if there are messages from the compiler or not. > Bit patterns need not be preserved for the sign-bit and/or > value-carrying bits in the new type vs. the old type. > > (By contrast a new type being unsigned is defined with a > mathematically > specific/unique result and so a specific bit pattern for the > value-carrying bits, ignoring trap representations and other pad bits > if they exist.) Thanks for the explanation. I had a feeling I was in undefined and/or implementation defined behavior with this, and was surprised that it squashed the warning with such a trivial change. I think we're safe here, though, since the PowerPC ABI and Power ABI are well defined. - Justin From owner-svn-src-head@freebsd.org Mon Jan 30 05:15:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E946CCC7A39 for ; Mon, 30 Jan 2017 05:15:37 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-72.reflexion.net [208.70.210.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 903863CF for ; Mon, 30 Jan 2017 05:15:37 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 29644 invoked from network); 30 Jan 2017 05:17:19 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 30 Jan 2017 05:17:19 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.20.1) with SMTP; Mon, 30 Jan 2017 00:15:35 -0500 (EST) Received: (qmail 19072 invoked from network); 30 Jan 2017 05:15:34 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Jan 2017 05:15:34 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 1BE5AEC77A4; Sun, 29 Jan 2017 21:15:34 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r312977 - head/sys/dev/adb From: Mark Millard In-Reply-To: Date: Sun, 29 Jan 2017 21:15:33 -0800 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <588CB781-A470-4101-8108-ADAD34525422@dsl-only.net> To: Justin Hibbits X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 05:15:38 -0000 On 2017-Jan-29, at 8:51 PM, Justin Hibbits = wrote: > Hi Mark, >=20 > On Jan 29, 2017, at 9:42 PM, Mark Millard wrote: >=20 >>> Author: jhibbits >>> Date: Mon Jan 30 02:32:33 2017 >>> New Revision: 312977 >>> URL: >>> https://svnweb.freebsd.org/changeset/base/312977 >>>=20 >>>=20 >>> Log: >>> Force the setting of bit 7 in the sysmouse packet byte 1 to be = unsigned. >>>=20 >>> Clang complains about the shift of (1 << 7) into a int8_t changing = the value: >>>=20 >>> warning: implicit conversion from 'int' to 'int8_t' (aka 'signed = char') changes >>> value from 128 to -128 [-Wconstant-conversion] >>>=20 >>> Squash this warning by forcing clang to see it as an unsigned bit. >>>=20 >>> This seems odd, given that it's still a conversion of 128->-128, but = I'm >>> guessing the explicit unsigned attribute notifies clang that sign = really doesn't >>> matter in this case. >>=20 >> [The following is based just on the C standard, not POSIX >> or other standards that may also be involved from FreeBSD's >> point of view.] >>=20 >> An FYI/explanation of sorts. . . >>=20 >> In the C11 standard (e.g., since I have it handy) having the >> new type be signed has the rule for signed and unsigned integer >> implicit conversions between the types: >>=20 >> (After the cases of value-representable-so-value-is-unchanged >> and new-type-is-unsigned, quoting:) >>=20 >>> Otherwise, the new type is signed and the value cannot be = represented >>> in it; either the result is implementation-defined or an >>> implementation-defined signal is raised. >>=20 >> So while 1U use may make the compiler(s) tested be quiet it still = leaves >> the code in implementation-defined territory where different starting >> types for the same value are allowed to have different results. But >> they are not required to and compiler releases could change the >> classification --and if there are messages from the compiler or not. >> Bit patterns need not be preserved for the sign-bit and/or >> value-carrying bits in the new type vs. the old type. >>=20 >> (By contrast a new type being unsigned is defined with a = mathematically >> specific/unique result and so a specific bit pattern for the >> value-carrying bits, ignoring trap representations and other pad bits >> if they exist.) >=20 > Thanks for the explanation. I had a feeling I was in undefined and/or = implementation defined behavior with this, and was surprised that it = squashed the warning with such a trivial change. I think we're safe = here, though, since the PowerPC ABI and Power ABI are well defined. >=20 > - Justin FYI: Here is what gcc6 does with -Wpedantic: # gcc6 -std=3Dc99 -Wpedantic signed_test.c signed_test.c: In function 'main': signed_test.c:4:10: warning: overflow in implicit constant conversion = [-Woverflow] sc =3D 1<<7; ^ signed_test.c:5:10: warning: overflow in implicit constant conversion = [-Woverflow] sc =3D 1U<<7; ^~ This was for: # more signed_test.c int main () { signed char sc; sc =3D 1<<7; sc =3D 1U<<7; sc =3D (signed char) (1U<<7); } Without -Wpedantic it is silent about all 3 assignments. -Wpedantic makes no difference to clang: # clang -std=3Dc99 signed_test.c signed_test.c:4:11: warning: implicit conversion from 'int' to 'signed = char' changes value from 128 to -128 [-Wconstant-conversion] sc =3D 1<<7; ~ ~^~~ 1 warning generated. # clang -std=3Dc99 -Wpedantic signed_test.c signed_test.c:4:11: warning: implicit conversion from 'int' to 'signed = char' changes value from 128 to -128 [-Wconstant-conversion] sc =3D 1<<7; ~ ~^~~ 1 warning generated. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Jan 30 05:46:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81BC7CC7246; Mon, 30 Jan 2017 05:46:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41D1E1202; Mon, 30 Jan 2017 05:46:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 75so30640312pgf.3; Sun, 29 Jan 2017 21:46:41 -0800 (PST) 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=o9+e1fV0zYp+Q9krE/7ZcFTccXEKlMo2FLZZGGzUBuQ=; b=PUnymayLooeWyo6cIVsZZvF0K0vRsDDvAzX1CCm5ZEpRo40N1KHmAgG1AJQbX5ExhO 035wh7VTQEMzEZGzoxkV3XNsIrulXy8saq2ez0gxgI/QABDJXjnRLghZoiEvfGI3ne96 dZ8FxviYGOjRIPrZC4SUC0PoHdP+OJ9naNyylTjtGtL93zWPWHLD2/7k3a9JLUEHDvqd nvJml6N1ft2WVFJePE4m9kj0BMcRnQ8IZkozqhoOS5XmFrbCYssl+xhEdneVSDPgR5nf pY5KJajUq0tU25QnzWtsDouLrr/i6X5OBnRnriPE6cGe80Zf1tVR/uEpaqF13kJO7GP2 0UPw== 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=o9+e1fV0zYp+Q9krE/7ZcFTccXEKlMo2FLZZGGzUBuQ=; b=XSUkZfmpCwTITDTbGazT9NRpkm4YtbNC1rWknYX3o+FnuTGBRdWzBbjQfDDhgDBEqh pPAfnzw2wxN5QzrToo6WzAU0b05qvhoHutOF5GVAH6L+glBjIrBt+qVm98ZV6g793TKr PPnXeFdcFby1TDqetJ6hBAHURCvb4hVywbt8UPouebBsZsnuKRbx0pzZkNwq/hxX410F +9MEwvRB32Oectb7GjPXwKV3qxl2biCX1lKZL5PrUwRxOvmgAJBnjN+/94b2GkTsHog/ ZqTWc9UFzYfXMRkccVU721EowRK2UpkIH7RHQ+XKS2o97rRNJJO4xUT72upVj30BmQXK b1GQ== X-Gm-Message-State: AIkVDXLNa4q+wivqIkKAmlDiNnh/8SD9ZKn2b9nhRCszQZ8BYVyEVeJVJEajETUrRcJL3g== X-Received: by 10.84.216.89 with SMTP id f25mr28884330plj.6.1485755200737; Sun, 29 Jan 2017 21:46:40 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j7sm28427810pfe.84.2017.01.29.21.46.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Jan 2017 21:46:39 -0800 (PST) Subject: Re: svn commit: r312981 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_64DC5FA5-C168-4B12-87C4-E60788A54B55"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701300320.v0U3K6VH031459@repo.freebsd.org> Date: Sun, 29 Jan 2017 21:46:38 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201701300320.v0U3K6VH031459@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 05:46:41 -0000 --Apple-Mail=_64DC5FA5-C168-4B12-87C4-E60788A54B55 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 29, 2017, at 19:20, Mateusz Guzik wrote: >=20 > Author: mjg > Date: Mon Jan 30 03:20:05 2017 > New Revision: 312981 > URL: https://svnweb.freebsd.org/changeset/base/312981 >=20 > Log: > cache: use vrefact for '.' lookups and refing the rdir in fullpath =E2=80=A6 why? -Ngie --Apple-Mail=_64DC5FA5-C168-4B12-87C4-E60788A54B55 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 iQIbBAEBCgAGBQJYjtM+AAoJEPWDqSZpMIYV57oP+KWeakdF9OrS3/dPk1hcEPeJ YsFNBkQJjCP7YTtZqE0Jzq1b7WODdvQS4seghP/gdJVoQ2IRaufc1MFWMTW21wEJ TgQfWEs8Q+tHCw8l/ZQozpMSt55rHz13amqspHSzF5z9TP73nGINtECJPclwqJ9W OXjj6nhjqjqEhgzaaJSBH+0ISIzp4pPFNtJeRO3p0F3cMr8FPrg3nnMYmwWrbumA 8zd9VLKu/Iksz1l9iLnvutLX6ieVJSWSx4jaOedB6BFT5eGoBuIUreGP2FqUD/3m EAen6T75wkktKbQ5biPZl74wlQsswcuRywODUI9y2Vqj3b0KoYdWOt8B8Mst+Q+1 iIA4z6dwyyw1iemwil/Qe1bJs+gVEFVPQ8LCYnDqR2sQobX8ChJmTpN9UsYw1svt hLCf99dXDxT38KuOMH+vxO++5JmlyAdWkxmrgLw+oOukzURW5rd8sSAK8ORK7mpP twqxCNNG9FtdGzufFkIoOWkDufZb2ZNMDu8M0oqZmKada0U59fBYeEnZEFh+uCEX SeIYFFamytHPwLTthWfMG8ZgGg5vvmn8s+YQ3v4G2vB96ne72Ju993LHs1e+6EQD 1isMGqf00Bpj0CNUp45kPrhtc350Y/tIdGNaMBvP70U6cnU+Wandmapt2Ofe2Xax JqmysSRHr7Dkbu7i/mI= =OGqj -----END PGP SIGNATURE----- --Apple-Mail=_64DC5FA5-C168-4B12-87C4-E60788A54B55-- From owner-svn-src-head@freebsd.org Mon Jan 30 07:36:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13317CC7CA7; Mon, 30 Jan 2017 07:36:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1A4B1EF3; Mon, 30 Jan 2017 07:36:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id y143so22779806pfb.1; Sun, 29 Jan 2017 23:36:48 -0800 (PST) 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=ybXnzBrwgNxRNj2YdeqU5aLtff+P8x9xPZv76s6J1fU=; b=YcvrAIqOhM+v+khYsmECxX3yTyTiM0kM7s7aykauQwNgehoOXw4yq1f8A8I99iMuwJ oElH1bpiMttrzEVcxKledQgtZ3P3GFQr253ts5VAmUpFzm11vFZ0Y+zIk9YbHA29ec74 XFg+EqWdSuAUmwXERQo9ScvfPGGJ5tbXGmyXJ/WNzCr9idnw/TMXnV54H2dhKSYlO7Sf ko+RfsuFFgoBcNEI3Wj7me87Xae8MGq7lMtfVF902tJwr66f2LuIFtlGUse9GXDR+ilp /ZBdc5uiuCyZV9tfbrkzi8Vt5jtPeIXs4QlmxKhJ0K/OJVv+8YN6aVZy+N0agsNyXX06 9xNw== 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=ybXnzBrwgNxRNj2YdeqU5aLtff+P8x9xPZv76s6J1fU=; b=NXeObqsaiUwlj0O4nDM7Af/VlWAP4NARDEbqVuFonmgghqqLqENboRlBUuX4eut8Ey X2xSWaaucFauP1/VYAnGRvrNwcSkjzftH0x6/kY1KJ+uW+uuiS0MRXrStSSjzagAM2ao nA69Y6lVa+Eg5f0ZKvs91ax4f881EUy6qeQyMtGRW5iePe+QOFgVjJEH6rypo+QtqrUM nMS2Q4uK8GfxErkjLOvxpUZSVz1L7lLtuY1LWWHVpMaxZwWFPy+T3olRqDad6YxMIh6X oJRqmFa3d01E4+L7yAFapTn2nmWMoaThhQ5yj61hBSZYB9tuitHYZZ49IY9zUFQ6BlVG efDQ== X-Gm-Message-State: AIkVDXIFI0/QfjWz7bxZvYkI/I6VP3aetg+9jYjqqVJGupmIbMIRj3XiYuZ8LALdlTKupw== X-Received: by 10.98.196.202 with SMTP id h71mr21642988pfk.66.1485761808485; Sun, 29 Jan 2017 23:36:48 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x16sm29522849pfk.79.2017.01.29.23.36.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Jan 2017 23:36:47 -0800 (PST) Subject: Re: svn commit: r312981 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E31D0254-B597-437C-AD1B-B9FB41878D64"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <69ABCAE8-DC41-41F1-B980-BD4190B59B28@gmail.com> Date: Sun, 29 Jan 2017 23:36:46 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <8BD46B78-3929-4C4C-877B-E8B935359636@gmail.com> References: <201701300320.v0U3K6VH031459@repo.freebsd.org> <69ABCAE8-DC41-41F1-B980-BD4190B59B28@gmail.com> To: Benjamin Kaduk X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 07:36:49 -0000 --Apple-Mail=_E31D0254-B597-437C-AD1B-B9FB41878D64 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 29, 2017, at 21:52, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On Jan 29, 2017, at 21:51, Benjamin Kaduk wrote: >>=20 >> On Sun, Jan 29, 2017 at 11:46 PM, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>> On Jan 29, 2017, at 19:20, Mateusz Guzik wrote: >>>=20 >>> Author: mjg >>> Date: Mon Jan 30 03:20:05 2017 >>> New Revision: 312981 >>> URL: https://svnweb.freebsd.org/changeset/base/312981 >>>=20 >>> Log: >>> cache: use vrefact for '.' lookups and refing the rdir in fullpath >>=20 >> =E2=80=A6 why? >>=20 >> These are cases when it's know that there already exists a reference = somewhere [else], so it's safe to apply the optimization? I'm not sure = I understand whether that's what you're asking, though. >=20 > Thanks! I=E2=80=99m trying to note that for folks that don=E2=80=99t = know this knowledge area, it would be nice if it was actually listed in = the commit message ;)=E2=80=A6 (sending non-unicast this time) -Ngie --Apple-Mail=_E31D0254-B597-437C-AD1B-B9FB41878D64 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 iQIcBAEBCgAGBQJYju0PAAoJEPWDqSZpMIYV3DMP/3kjJbqc4ml/UlxPiHJJ23L7 kRH2X6qFpTDh2YzA3McfKiNP2BZ37qiGhO/sxCL/+nq0FGxokCi0LwVOAWFk0Nsf ZglqhWmBKDLu1P5PvZGGJVW7cIbu+cae95SXU0BNwOCmVX7WRN9+aDt9GXtSBZjF hFfkhukFV+VosJluPbTPw54Fmq+GctxpAstzpaLw6jupRxt6oDV3YvdX1nk0STJo VjFJwc98Nol3jvMOwQYUUB17D9EfK5/ERWlagc7R/EthBm4BsEzXd3XDHzyzvRdf /uOG24LjVaNuOcv1aLBsDmYmrpjEdLDkzuB/joxS8ihTVt9HW7Yccn3EYA4vSWSx TheyNd/yZjYioUGGFpyaucVDhyCNXXpEOWh7IFBoyt6Xeox3Q50S8711Iy8hxSkB RCuVERIGmTj0iiisV6Sqh5hRUGdv+c+FiMC1fLyYJL7mpAlUSC6DVEN656OmUllS XBoRwk96auJJlSkjrdHnI0aMo1pgLJqS70yVJu6gHKBI8Gt9vRG0Ym7IIFc9223n VGCjn69F/xPo9yOEKcBaNaOrYdlK2XNcNbEvF/Q3j02odAlHYULvInPzetfsDpaC uGDa1Ko9pwaI5jt+3MZBeqVX62nqraPeJiHBd+MJg3UAAs0PKIUOe9Y2UCKIBHJB +UpdjEG3JZy8/Hd77xHF =m68A -----END PGP SIGNATURE----- --Apple-Mail=_E31D0254-B597-437C-AD1B-B9FB41878D64-- From owner-svn-src-head@freebsd.org Mon Jan 30 08:35:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED995CC6F16; Mon, 30 Jan 2017 08:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD2631BE0; Mon, 30 Jan 2017 08:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U8ZF7j059590; Mon, 30 Jan 2017 08:35:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U8ZFph059589; Mon, 30 Jan 2017 08:35:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701300835.v0U8ZFph059589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 30 Jan 2017 08:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312983 - head/sys/dev/mlx5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 08:35:17 -0000 Author: hselasky Date: Mon Jan 30 08:35:15 2017 New Revision: 312983 URL: https://svnweb.freebsd.org/changeset/base/312983 Log: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/diagnostics.h Modified: head/sys/dev/mlx5/diagnostics.h ============================================================================== --- head/sys/dev/mlx5/diagnostics.h Mon Jan 30 04:51:18 2017 (r312982) +++ head/sys/dev/mlx5/diagnostics.h Mon Jan 30 08:35:15 2017 (r312983) @@ -33,7 +33,7 @@ #define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; From owner-svn-src-head@freebsd.org Mon Jan 30 08:38:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336B2CC70CD; Mon, 30 Jan 2017 08:38:34 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCEC31E14; Mon, 30 Jan 2017 08:38:33 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0U8cWna059743; Mon, 30 Jan 2017 08:38:33 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0U8cWNx059740; Mon, 30 Jan 2017 08:38:32 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201701300838.v0U8cWNx059740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Mon, 30 Jan 2017 08:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312984 - in head: lib/libsysdecode libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 08:38:34 -0000 Author: peterj Date: Mon Jan 30 08:38:32 2017 New Revision: 312984 URL: https://svnweb.freebsd.org/changeset/base/312984 Log: Extend LD_UTRACE by also generating utrace(2) log events for runtime linker errors. Reviewed by: kib, jhb Approved by: jhb(mentor) MFC after: 1 week Differential Revision: D9347 Modified: head/lib/libsysdecode/utrace.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld_utrace.h Modified: head/lib/libsysdecode/utrace.c ============================================================================== --- head/lib/libsysdecode/utrace.c Mon Jan 30 08:35:15 2017 (r312983) +++ head/lib/libsysdecode/utrace.c Mon Jan 30 08:38:32 2017 (r312984) @@ -124,6 +124,10 @@ print_utrace_rtld(FILE *fp, void *p) fprintf(fp, "RTLD: %p = dlsym(%p, %s)", ut->mapbase, ut->handle, ut->name); break; + case UTRACE_RTLD_ERROR: + fprintf(fp, "RTLD: error: %s\n", ut->name); + break; + default: return (0); } Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Jan 30 08:35:15 2017 (r312983) +++ head/libexec/rtld-elf/rtld.c Mon Jan 30 08:38:32 2017 (r312984) @@ -764,6 +764,7 @@ _rtld_error(const char *fmt, ...) rtld_vsnprintf(buf, sizeof buf, fmt, ap); error_message = buf; va_end(ap); + LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, error_message); } /* Modified: head/libexec/rtld-elf/rtld_utrace.h ============================================================================== --- head/libexec/rtld-elf/rtld_utrace.h Mon Jan 30 08:35:15 2017 (r312983) +++ head/libexec/rtld-elf/rtld_utrace.h Mon Jan 30 08:38:32 2017 (r312984) @@ -45,6 +45,7 @@ #define UTRACE_FINI_CALL 10 #define UTRACE_DLSYM_START 11 #define UTRACE_DLSYM_STOP 12 +#define UTRACE_RTLD_ERROR 13 #define RTLD_UTRACE_SIG_SZ 4 #define RTLD_UTRACE_SIG "RTLD" From owner-svn-src-head@freebsd.org Mon Jan 30 10:53:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CD69CC8285; Mon, 30 Jan 2017 10:53:50 +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 0A8991061; Mon, 30 Jan 2017 10:53:49 +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 v0UArjDG071806 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 12:53:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0UArjDG071806 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0UArjhG071805; Mon, 30 Jan 2017 12:53:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 30 Jan 2017 12:53:45 +0200 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312973 - head/sys/powerpc/include Message-ID: <20170130105345.GL3018@kib.kiev.ua> References: <201701300215.v0U2Fsl0006455@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701300215.v0U2Fsl0006455@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 10:53:50 -0000 > +#ifdef __GNUCLIKE_ASM > + __asm __volatile ( > + "1:\tlwarx %0, 0, %3\n\t" /* load old value */ > + "cmplw %4, %0\n\t" /* compare */ > + "bne 2f\n\t" /* exit if not equal */ > + "stwcx. %5, 0, %3\n\t" /* attempt to store */ > + "bne- 1b\n\t" /* spin if failed */ > + "li %0, 1\n\t" /* success - retval = 1 */ > + "b 3f\n\t" /* we've succeeded */ > + "2:\n\t" > + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ > + "stwx %0, 0, %7\n\t" > + "li %0, 0\n\t" /* failure - retval = 0 */ > + "3:\n\t" > + : "=&r" (ret), "=m" (*p), "=m" (*cmpval) > + : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) > + : "cr0", "memory"); > +#endif It seems that in case of failed conditional store, the code retries. Note that this is not incorrect but also not a desirable behaviour with fcmpset: the function should return error and leave the retry to the caller. There is no point in having embedded loop. From owner-svn-src-head@freebsd.org Mon Jan 30 11:50:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2ADECC665A; Mon, 30 Jan 2017 11:50:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D30C19D4; Mon, 30 Jan 2017 11:50:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UBos4o037621; Mon, 30 Jan 2017 11:50:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UBoswd037616; Mon, 30 Jan 2017 11:50:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701301150.v0UBoswd037616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 30 Jan 2017 11:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312986 - in head/sys: amd64/linux32 compat/freebsd32 compat/linux i386/linux kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 11:50:55 -0000 Author: trasz Date: Mon Jan 30 11:50:54 2017 New Revision: 312986 URL: https://svnweb.freebsd.org/changeset/base/312986 Log: Replace sys_ftruncate() with kern_ftruncate() in various compats. Reviewed by: kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9368 Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_file.c head/sys/i386/linux/linux_machdep.c head/sys/kern/vfs_syscalls.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Mon Jan 30 11:46:06 2017 (r312985) +++ head/sys/amd64/linux32/linux32_machdep.c Mon Jan 30 11:50:54 2017 (r312986) @@ -645,7 +645,6 @@ linux_sigaltstack(struct thread *td, str int linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) { - struct ftruncate_args sa; #ifdef DEBUG if (ldebug(ftruncate64)) @@ -653,9 +652,7 @@ linux_ftruncate64(struct thread *td, str (intmax_t)args->length); #endif - sa.fd = args->fd; - sa.length = args->length; - return sys_ftruncate(td, &sa); + return (kern_ftruncate(td, args->fd, args->length)); } int Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Jan 30 11:46:06 2017 (r312985) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Jan 30 11:50:54 2017 (r312986) @@ -1517,11 +1517,8 @@ freebsd32_truncate(struct thread *td, st int freebsd32_ftruncate(struct thread *td, struct freebsd32_ftruncate_args *uap) { - struct ftruncate_args ap; - ap.fd = uap->fd; - ap.length = PAIR32TO64(off_t,uap->length); - return (sys_ftruncate(td, &ap)); + return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length))); } #ifdef COMPAT_43 @@ -1623,11 +1620,8 @@ freebsd6_freebsd32_truncate(struct threa int freebsd6_freebsd32_ftruncate(struct thread *td, struct freebsd6_freebsd32_ftruncate_args *uap) { - struct ftruncate_args ap; - ap.fd = uap->fd; - ap.length = PAIR32TO64(off_t,uap->length); - return (sys_ftruncate(td, &ap)); + return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length))); } #endif /* COMPAT_FREEBSD6 */ Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jan 30 11:46:06 2017 (r312985) +++ head/sys/compat/linux/linux_file.c Mon Jan 30 11:50:54 2017 (r312986) @@ -939,15 +939,8 @@ linux_truncate64(struct thread *td, stru int linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args) { - struct ftruncate_args /* { - int fd; - int pad; - off_t length; - } */ nuap; - - nuap.fd = args->fd; - nuap.length = args->length; - return (sys_ftruncate(td, &nuap)); + + return (kern_ftruncate(td, args->fd, args->length)); } int Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Mon Jan 30 11:46:06 2017 (r312985) +++ head/sys/i386/linux/linux_machdep.c Mon Jan 30 11:50:54 2017 (r312986) @@ -611,7 +611,6 @@ linux_sigaltstack(struct thread *td, str int linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) { - struct ftruncate_args sa; #ifdef DEBUG if (ldebug(ftruncate64)) @@ -619,9 +618,7 @@ linux_ftruncate64(struct thread *td, str (intmax_t)args->length); #endif - sa.fd = args->fd; - sa.length = args->length; - return sys_ftruncate(td, &sa); + return (kern_ftruncate(td, args->fd, args->length)); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Jan 30 11:46:06 2017 (r312985) +++ head/sys/kern/vfs_syscalls.c Mon Jan 30 11:50:54 2017 (r312986) @@ -3365,11 +3365,8 @@ freebsd6_truncate(struct thread *td, str int freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap) { - struct ftruncate_args ouap; - ouap.fd = uap->fd; - ouap.length = uap->length; - return (sys_ftruncate(td, &ouap)); + return (kern_ftruncate(td, uap->fd, uap->length)); } #endif From owner-svn-src-head@freebsd.org Mon Jan 30 12:24:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19D07CC7D55; Mon, 30 Jan 2017 12:24:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEA821353; Mon, 30 Jan 2017 12:24:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UCOl3B053616; Mon, 30 Jan 2017 12:24:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UCOlJX053611; Mon, 30 Jan 2017 12:24:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701301224.v0UCOlJX053611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 30 Jan 2017 12:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312987 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 12:24:49 -0000 Author: trasz Date: Mon Jan 30 12:24:47 2017 New Revision: 312987 URL: https://svnweb.freebsd.org/changeset/base/312987 Log: Add kern_lseek() and use it instead of sys_lseek() in various compats. I didn't touch svr4/, there's no point. Reviewed by: ed@, kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9366 Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Jan 30 11:50:54 2017 (r312986) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Jan 30 12:24:47 2017 (r312987) @@ -209,26 +209,23 @@ cloudabi_sys_fd_replace(struct thread *t int cloudabi_sys_fd_seek(struct thread *td, struct cloudabi_sys_fd_seek_args *uap) { - struct lseek_args lseek_args = { - .fd = uap->fd, - .offset = uap->offset - }; + int whence; switch (uap->whence) { case CLOUDABI_WHENCE_CUR: - lseek_args.whence = SEEK_CUR; + whence = SEEK_CUR; break; case CLOUDABI_WHENCE_END: - lseek_args.whence = SEEK_END; + whence = SEEK_END; break; case CLOUDABI_WHENCE_SET: - lseek_args.whence = SEEK_SET; + whence = SEEK_SET; break; default: return (EINVAL); } - return (sys_lseek(td, &lseek_args)); + return (kern_lseek(td, uap->fd, uap->offset, whence)); } /* Converts a file descriptor to a CloudABI file descriptor type. */ Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Jan 30 11:50:54 2017 (r312986) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Jan 30 12:24:47 2017 (r312987) @@ -1477,12 +1477,8 @@ freebsd32_pwrite(struct thread *td, stru int ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) { - struct lseek_args nuap; - nuap.fd = uap->fd; - nuap.offset = uap->offset; - nuap.whence = uap->whence; - return (sys_lseek(td, &nuap)); + return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); } #endif @@ -1490,13 +1486,10 @@ int freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap) { int error; - struct lseek_args ap; off_t pos; - ap.fd = uap->fd; - ap.offset = PAIR32TO64(off_t,uap->offset); - ap.whence = uap->whence; - error = sys_lseek(td, &ap); + error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset), + uap->whence); /* Expand the quad return into two parts for eax and edx */ pos = td->td_uretoff.tdu_off; td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ @@ -1593,13 +1586,10 @@ int freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap) { int error; - struct lseek_args ap; off_t pos; - ap.fd = uap->fd; - ap.offset = PAIR32TO64(off_t,uap->offset); - ap.whence = uap->whence; - error = sys_lseek(td, &ap); + error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset), + uap->whence); /* Expand the quad return into two parts for eax and edx */ pos = *(off_t *)(td->td_retval); td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jan 30 11:50:54 2017 (r312986) +++ head/sys/compat/linux/linux_file.c Mon Jan 30 12:24:47 2017 (r312987) @@ -210,31 +210,19 @@ linux_open(struct thread *td, struct lin int linux_lseek(struct thread *td, struct linux_lseek_args *args) { - struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ tmp_args; - int error; #ifdef DEBUG if (ldebug(lseek)) printf(ARGS(lseek, "%d, %ld, %d"), args->fdes, (long)args->off, args->whence); #endif - tmp_args.fd = args->fdes; - tmp_args.offset = (off_t)args->off; - tmp_args.whence = args->whence; - error = sys_lseek(td, &tmp_args); - return (error); + return (kern_lseek(td, args->fdes, args->off, args->whence)); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_llseek(struct thread *td, struct linux_llseek_args *args) { - struct lseek_args bsd_args; int error; off_t off; @@ -245,14 +233,12 @@ linux_llseek(struct thread *td, struct l #endif off = (args->olow) | (((off_t) args->ohigh) << 32); - bsd_args.fd = args->fd; - bsd_args.offset = off; - bsd_args.whence = args->whence; - - if ((error = sys_lseek(td, &bsd_args))) + error = kern_lseek(td, args->fd, off, args->whence); + if (error != 0) return (error); - if ((error = copyout(td->td_retval, args->res, sizeof (off_t)))) + error = copyout(td->td_retval, args->res, sizeof(off_t)); + if (error != 0) return (error); td->td_retval[0] = 0; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Jan 30 11:50:54 2017 (r312986) +++ head/sys/kern/vfs_syscalls.c Mon Jan 30 12:24:47 2017 (r312987) @@ -1806,25 +1806,25 @@ struct lseek_args { }; #endif int -sys_lseek(td, uap) - struct thread *td; - register struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ *uap; +sys_lseek(struct thread *td, struct lseek_args *uap) +{ + + return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); +} + +int +kern_lseek(struct thread *td, int fd, off_t offset, int whence) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_SEEK), &fp); + AUDIT_ARG_FD(fd); + error = fget(td, fd, cap_rights_init(&rights, CAP_SEEK), &fp); if (error != 0) return (error); error = (fp->f_ops->fo_flags & DFLAG_SEEKABLE) != 0 ? - fo_seek(fp, uap->offset, uap->whence, td) : ESPIPE; + fo_seek(fp, offset, whence, td) : ESPIPE; fdrop(fp, td); return (error); } @@ -1841,41 +1841,20 @@ struct olseek_args { }; #endif int -olseek(td, uap) - struct thread *td; - register struct olseek_args /* { - int fd; - long offset; - int whence; - } */ *uap; +olseek(struct thread *td, struct olseek_args *uap) { - struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ nuap; - nuap.fd = uap->fd; - nuap.offset = uap->offset; - nuap.whence = uap->whence; - return (sys_lseek(td, &nuap)); + return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); } #endif /* COMPAT_43 */ #if defined(COMPAT_FREEBSD6) /* Version with the 'pad' argument */ int -freebsd6_lseek(td, uap) - struct thread *td; - register struct freebsd6_lseek_args *uap; +freebsd6_lseek(struct thread *td, struct freebsd6_lseek_args *uap) { - struct lseek_args ouap; - ouap.fd = uap->fd; - ouap.offset = uap->offset; - ouap.whence = uap->whence; - return (sys_lseek(td, &ouap)); + return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); } #endif Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Jan 30 11:50:54 2017 (r312986) +++ head/sys/sys/syscallsubr.h Mon Jan 30 12:24:47 2017 (r312987) @@ -135,6 +135,7 @@ int kern_kldstat(struct thread *td, int int kern_kldunload(struct thread *td, int fileid, int flags); int kern_linkat(struct thread *td, int fd1, int fd2, char *path1, char *path2, enum uio_seg segflg, int follow); +int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_mkdirat(struct thread *td, int fd, char *path, From owner-svn-src-head@freebsd.org Mon Jan 30 12:57:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B827FCC7569; Mon, 30 Jan 2017 12:57:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78FD06EC; Mon, 30 Jan 2017 12:57:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UCvNEG065998; Mon, 30 Jan 2017 12:57:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UCvNrK065993; Mon, 30 Jan 2017 12:57:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701301257.v0UCvNrK065993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 30 Jan 2017 12:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 12:57:24 -0000 Author: trasz Date: Mon Jan 30 12:57:22 2017 New Revision: 312988 URL: https://svnweb.freebsd.org/changeset/base/312988 Log: Add kern_listen(), kern_shutdown(), and kern_socket(), and use them instead of their sys_*() counterparts in various compats. The svr4 is left untouched, because there's no point. Reviewed by: ed@, kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9367 Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/linux/linux_socket.c head/sys/kern/uipc_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Jan 30 12:24:47 2017 (r312987) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Jan 30 12:57:22 2017 (r312988) @@ -100,9 +100,6 @@ cloudabi_sys_fd_create1(struct thread *t struct cloudabi_sys_fd_create1_args *uap) { struct filecaps fcaps = {}; - struct socket_args socket_args = { - .domain = AF_UNIX, - }; switch (uap->type) { case CLOUDABI_FILETYPE_POLL: @@ -113,14 +110,11 @@ cloudabi_sys_fd_create1(struct thread *t CAP_MMAP_RWX); return (kern_shm_open(td, SHM_ANON, O_RDWR, 0, &fcaps)); case CLOUDABI_FILETYPE_SOCKET_DGRAM: - socket_args.type = SOCK_DGRAM; - return (sys_socket(td, &socket_args)); + return (kern_socket(td, AF_UNIX, SOCK_DGRAM, 0)); case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: - socket_args.type = SOCK_SEQPACKET; - return (sys_socket(td, &socket_args)); + return (kern_socket(td, AF_UNIX, SOCK_SEQPACKET, 0)); case CLOUDABI_FILETYPE_SOCKET_STREAM: - socket_args.type = SOCK_STREAM; - return (sys_socket(td, &socket_args)); + return (kern_socket(td, AF_UNIX, SOCK_STREAM, 0)); default: return (EINVAL); } Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Mon Jan 30 12:24:47 2017 (r312987) +++ head/sys/compat/cloudabi/cloudabi_sock.c Mon Jan 30 12:57:22 2017 (r312988) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -165,37 +164,31 @@ int cloudabi_sys_sock_listen(struct thread *td, struct cloudabi_sys_sock_listen_args *uap) { - struct listen_args listen_args = { - .s = uap->sock, - .backlog = uap->backlog, - }; - return (sys_listen(td, &listen_args)); + return (kern_listen(td, uap->sock, uap->backlog)); } int cloudabi_sys_sock_shutdown(struct thread *td, struct cloudabi_sys_sock_shutdown_args *uap) { - struct shutdown_args shutdown_args = { - .s = uap->sock, - }; + int how; switch (uap->how) { case CLOUDABI_SHUT_RD: - shutdown_args.how = SHUT_RD; + how = SHUT_RD; break; case CLOUDABI_SHUT_WR: - shutdown_args.how = SHUT_WR; + how = SHUT_WR; break; case CLOUDABI_SHUT_RD | CLOUDABI_SHUT_WR: - shutdown_args.how = SHUT_RDWR; + how = SHUT_RDWR; break; default: return (EINVAL); } - return (sys_shutdown(td, &shutdown_args)); + return (kern_shutdown(td, uap->sock, how)); } int Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jan 30 12:24:47 2017 (r312987) +++ head/sys/compat/linux/linux_socket.c Mon Jan 30 12:57:22 2017 (r312988) @@ -697,32 +697,26 @@ goout: int linux_socket(struct thread *td, struct linux_socket_args *args) { - struct socket_args /* { - int domain; - int type; - int protocol; - } */ bsd_args; - int retval_socket; + int domain, retval_socket, type; - bsd_args.protocol = args->protocol; - bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; - if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) + type = args->type & LINUX_SOCK_TYPE_MASK; + if (type < 0 || type > LINUX_SOCK_MAX) return (EINVAL); retval_socket = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK, - &bsd_args.type); + &type); if (retval_socket != 0) return (retval_socket); - bsd_args.domain = linux_to_bsd_domain(args->domain); - if (bsd_args.domain == -1) + domain = linux_to_bsd_domain(args->domain); + if (domain == -1) return (EAFNOSUPPORT); - retval_socket = sys_socket(td, &bsd_args); + retval_socket = kern_socket(td, domain, type, args->protocol); if (retval_socket) return (retval_socket); - if (bsd_args.type == SOCK_RAW - && (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0) - && bsd_args.domain == PF_INET) { + if (type == SOCK_RAW + && (args->protocol == IPPROTO_RAW || args->protocol == 0) + && domain == PF_INET) { /* It's a raw IP socket: set the IP_HDRINCL option. */ int hdrincl; @@ -738,7 +732,7 @@ linux_socket(struct thread *td, struct l * For simplicity we do this unconditionally of the net.inet6.ip6.v6only * sysctl value. */ - if (bsd_args.domain == PF_INET6) { + if (domain == PF_INET6) { int v6only; v6only = 0; @@ -816,14 +810,8 @@ linux_connect(struct thread *td, struct int linux_listen(struct thread *td, struct linux_listen_args *args) { - struct listen_args /* { - int s; - int backlog; - } */ bsd_args; - bsd_args.s = args->s; - bsd_args.backlog = args->backlog; - return (sys_listen(td, &bsd_args)); + return (kern_listen(td, args->s, args->backlog)); } static int @@ -1524,14 +1512,8 @@ linux_recvmmsg(struct thread *td, struct int linux_shutdown(struct thread *td, struct linux_shutdown_args *args) { - struct shutdown_args /* { - int s; - int how; - } */ bsd_args; - bsd_args.s = args->s; - bsd_args.how = args->how; - return (sys_shutdown(td, &bsd_args)); + return (kern_shutdown(td, args->s, args->how)); } int Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Jan 30 12:24:47 2017 (r312987) +++ head/sys/kern/uipc_syscalls.c Mon Jan 30 12:57:22 2017 (r312988) @@ -124,13 +124,19 @@ getsock_cap(struct thread *td, int fd, c int sys_socket(struct thread *td, struct socket_args *uap) { + + return (kern_socket(td, uap->domain, uap->type, uap->protocol)); +} + +int +kern_socket(struct thread *td, int domain, int type, int protocol) +{ struct socket *so; struct file *fp; - int fd, error, type, oflag, fflag; + int fd, error, oflag, fflag; - AUDIT_ARG_SOCKET(uap->domain, uap->type, uap->protocol); + AUDIT_ARG_SOCKET(domain, type, protocol); - type = uap->type; oflag = 0; fflag = 0; if ((type & SOCK_CLOEXEC) != 0) { @@ -143,8 +149,7 @@ sys_socket(struct thread *td, struct soc } #ifdef MAC - error = mac_socket_check_create(td->td_ucred, uap->domain, type, - uap->protocol); + error = mac_socket_check_create(td->td_ucred, domain, type, protocol); if (error != 0) return (error); #endif @@ -152,8 +157,7 @@ sys_socket(struct thread *td, struct soc if (error != 0) return (error); /* An extra reference on `fp' has been held for us by falloc(). */ - error = socreate(uap->domain, &so, type, uap->protocol, - td->td_ucred, td); + error = socreate(domain, &so, type, protocol, td->td_ucred, td); if (error != 0) { fdclose(td, fp, fd); } else { @@ -231,13 +235,20 @@ sys_bindat(struct thread *td, struct bin int sys_listen(struct thread *td, struct listen_args *uap) { + + return (kern_listen(td, uap->s, uap->backlog)); +} + +int +kern_listen(struct thread *td, int s, int backlog) +{ struct socket *so; struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->s); - error = getsock_cap(td, uap->s, cap_rights_init(&rights, CAP_LISTEN), + AUDIT_ARG_FD(s); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_LISTEN), &fp, NULL, NULL); if (error == 0) { so = fp->f_data; @@ -245,10 +256,10 @@ sys_listen(struct thread *td, struct lis error = mac_socket_check_listen(td->td_ucred, so); if (error == 0) #endif - error = solisten(so, uap->backlog, td); + error = solisten(so, backlog, td); fdrop(fp, td); } - return(error); + return (error); } /* @@ -1205,17 +1216,24 @@ sys_recvmsg(struct thread *td, struct re int sys_shutdown(struct thread *td, struct shutdown_args *uap) { + + return (kern_shutdown(td, uap->s, uap->how)); +} + +int +kern_shutdown(struct thread *td, int s, int how) +{ struct socket *so; struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->s); - error = getsock_cap(td, uap->s, cap_rights_init(&rights, CAP_SHUTDOWN), + AUDIT_ARG_FD(s); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SHUTDOWN), &fp, NULL, NULL); if (error == 0) { so = fp->f_data; - error = soshutdown(so, uap->how); + error = soshutdown(so, how); /* * Previous versions did not return ENOTCONN, but 0 in * case the socket was not connected. Some important Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Jan 30 12:24:47 2017 (r312987) +++ head/sys/sys/syscallsubr.h Mon Jan 30 12:57:22 2017 (r312988) @@ -135,6 +135,7 @@ int kern_kldstat(struct thread *td, int int kern_kldunload(struct thread *td, int fileid, int flags); int kern_linkat(struct thread *td, int fd1, int fd2, char *path1, char *path2, enum uio_seg segflg, int follow); +int kern_listen(struct thread *td, int s, int backlog); int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); @@ -213,6 +214,7 @@ int kern_shmat(struct thread *td, int sh int shmflg); int kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, size_t *bufsz); +int kern_shutdown(struct thread *td, int s, int how); int kern_sigaction(struct thread *td, int sig, const struct sigaction *act, struct sigaction *oact, int flags); int kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); @@ -221,6 +223,7 @@ int kern_sigprocmask(struct thread *td, int kern_sigsuspend(struct thread *td, sigset_t mask); int kern_sigtimedwait(struct thread *td, sigset_t waitset, struct ksiginfo *ksi, struct timespec *timeout); +int kern_socket(struct thread *td, int domain, int type, int protocol); int kern_statat(struct thread *td, int flag, int fd, char *path, enum uio_seg pathseg, struct stat *sbp, void (*hook)(struct vnode *vp, struct stat *sbp)); From owner-svn-src-head@freebsd.org Mon Jan 30 15:20:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1FA9CC78C1; Mon, 30 Jan 2017 15:20:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C7D7E2; Mon, 30 Jan 2017 15:20:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UFKDjM023763; Mon, 30 Jan 2017 15:20:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UFKDej023762; Mon, 30 Jan 2017 15:20:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701301520.v0UFKDej023762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Jan 2017 15:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312991 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 15:20:15 -0000 Author: avg Date: Mon Jan 30 15:20:13 2017 New Revision: 312991 URL: https://svnweb.freebsd.org/changeset/base/312991 Log: put very expensive sanity checks of advisory locks under DIAGNOSTIC The checks have quadratic complexity over a number of advisory locks active for a file and that could be a lot. What's the worse is that the checks are done while holding ls_lock. That could lead to a long a very long backlog and performance degradation even if all requested locks are compatible (e.g. all shared locks). The checks used to be under INVARIANTS. Discussed with: kib MFC after: 2 weeks Sponsored by: Panzura Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Jan 30 14:34:04 2017 (r312990) +++ head/sys/kern/kern_lockf.c Mon Jan 30 15:20:13 2017 (r312991) @@ -689,7 +689,7 @@ retry_setlock: break; } -#ifdef INVARIANTS +#ifdef DIAGNOSTIC /* * Check for some can't happen stuff. In this case, the active * lock list becoming disordered or containing mutually @@ -917,7 +917,7 @@ lf_add_edge(struct lockf_entry *x, struc struct lockf_edge *e; int error; -#ifdef INVARIANTS +#ifdef DIAGNOSTIC LIST_FOREACH(e, &x->lf_outedges, le_outlink) KASSERT(e->le_to != y, ("adding lock edge twice")); #endif From owner-svn-src-head@freebsd.org Mon Jan 30 15:32:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D29CC7F05; Mon, 30 Jan 2017 15:32:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E427129A; Mon, 30 Jan 2017 15:32:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id e1so19373822qkh.1; Mon, 30 Jan 2017 07:32:25 -0800 (PST) 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=jZbDYn1jQfj/ftnA0jhAIZDe+iy8JUpYQf1hKwj2IeY=; b=vTO7JD/2xL/q2WAlJBtLRpJ3ZyqogQXAOFX3u9/K+lwutgyCbqJi+fxkHbis+yKAi7 g9wpPPbYUy3o8clruUZkyx5bWEWqhYIVB27iKmSc3+RIePd9N2hfwX1VF1ECcAw5YSX2 UcYLLXW+Vwb95umSZwI+uTXjVL9ewxp8kjkHvJKaUrLtLPMgSv3EaXhbS2G4NZ2Q+gp5 ej+x6uhWs4ifiXHZu26pIAq4EwgBWzepzBirvWUsGTBcw9AjYVoGVGstHZLAAGQGT/0u CVGBJJYHjuEdAxzwbE53/PnrB216e0/xmHNQPt0iL1clZP1C03QJtDjpHH1aBsD8bb3o 1iWg== 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=jZbDYn1jQfj/ftnA0jhAIZDe+iy8JUpYQf1hKwj2IeY=; b=agQelR7v1bvPICnFVh/8Oc8ynSMSfUlknOZvBiJA2454k5Ek6mTPL+pM776Dfeq1w7 TJbCn842rDEcpTojogXOf0ubMap03ycFeuiEEwiWz43Nx7Ufi2anko6G/Xwd9LIZA7+f gws6onxoCNWUD0TQx/USBeHyM+YzG1vHEMGAhrOa9/YZ49LImJiKk8IP6pgnBt74B+pq A8rZ2Cqg+8g+hiHIpZBeY/SDd88ZH9K0o8AL5oi13QFkpeG5pzlBhc6wYrPe7s5uJYNl Lz8QZcwMuM5SbyfIgubvgjdc7gAZAFxCSsvgLQacVOyfymvq9pGlCcSfYacBEx9DeoA0 ydGg== X-Gm-Message-State: AIkVDXLtjL5XmUzreZklLC9lewMy8K8RldhCmHf88NagFvWRx/dwlDT5X+S75h51wHffkLCuB5wJAkXtMhBbnA== X-Received: by 10.55.118.67 with SMTP id r64mr21465147qkc.285.1485790344345; Mon, 30 Jan 2017 07:32:24 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.157.69 with HTTP; Mon, 30 Jan 2017 07:32:23 -0800 (PST) In-Reply-To: <20170130105345.GL3018@kib.kiev.ua> References: <201701300215.v0U2Fsl0006455@repo.freebsd.org> <20170130105345.GL3018@kib.kiev.ua> From: Justin Hibbits Date: Mon, 30 Jan 2017 09:32:23 -0600 X-Google-Sender-Auth: AZj9ZLz8UbmlOwR_C-0inZyvOuo Message-ID: Subject: Re: svn commit: r312973 - head/sys/powerpc/include To: Konstantin Belousov Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 15:32:25 -0000 On Mon, Jan 30, 2017 at 4:53 AM, Konstantin Belousov wrote: >> +#ifdef __GNUCLIKE_ASM >> + __asm __volatile ( >> + "1:\tlwarx %0, 0, %3\n\t" /* load old value */ >> + "cmplw %4, %0\n\t" /* compare */ >> + "bne 2f\n\t" /* exit if not equal */ >> + "stwcx. %5, 0, %3\n\t" /* attempt to store */ >> + "bne- 1b\n\t" /* spin if failed */ >> + "li %0, 1\n\t" /* success - retval = 1 */ >> + "b 3f\n\t" /* we've succeeded */ >> + "2:\n\t" >> + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ >> + "stwx %0, 0, %7\n\t" >> + "li %0, 0\n\t" /* failure - retval = 0 */ >> + "3:\n\t" >> + : "=&r" (ret), "=m" (*p), "=m" (*cmpval) >> + : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) >> + : "cr0", "memory"); >> +#endif > > It seems that in case of failed conditional store, the code retries. > Note that this is not incorrect but also not a desirable behaviour > with fcmpset: the function should return error and leave the retry > to the caller. There is no point in having embedded loop. From owner-svn-src-head@freebsd.org Mon Jan 30 15:37:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E06AACC8085; Mon, 30 Jan 2017 15:37:05 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0DB51658; Mon, 30 Jan 2017 15:37:05 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id e1so19397553qkh.1; Mon, 30 Jan 2017 07:37:05 -0800 (PST) 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=U8+O3G3MyVI8KLIYE6Qxmz6WbiSdZwbgFrbB2Fim1iY=; b=kmHWcV61rNtIi7kCZ6S/uKXn6CPqzWgf8p08+6SnltDVFdwPnLBZjWd7ti08O2Ylo5 iuxRXALzvhdGHrErHCb0eBifGz8hFt90xnAkrIYFLoXa+qT4t5h5IU6nEypBiNoEHFCy pMVUsM0dQQwvNhasIVj3Y1VbsAeIP1B5mLpb9EhPn6x39/HZICzIEOeJH41pqi88+rSg EmwftfRbnG5kURZ6+yLBiRyCIKT9uqj3itktWfD5K2p43QIdEhoqhUOCdn8FTR4EK+Gq VdBXoNUmBBN8uzgM/DSW+8Wg7Y/v+VuA1U8VfJw3cbq1kOii5rl8d2vYwpOD8Rircma0 NmUw== 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=U8+O3G3MyVI8KLIYE6Qxmz6WbiSdZwbgFrbB2Fim1iY=; b=XQ2YlbEHoxCUHm4FoXi5DS/Rv/oPnSoYrE523WXgGLO5ay9mxbGn0RJ7lGOSzCvzE2 7LbmBsx+VyikdUDEr5+JlG1t37GMDZ5EwgiApBl4F0dd6iGBR/d4BjPJYqSECLRevbj4 L1BvbRk8ATCBlJXlYeT9Oy1Olug8nJZze5vJzkWiP9H0VCU+DmdDs4pk1axjU1Atex2c WRuQ0cHqwd+h9avw63B5Sm1y/Z+GRthAohL/ngoreizl8f5vq6nrG0twd3pG9wh9Irmg vdrOMLRtqhbchF2DHYC2f064uiGBdDKXiYs4KaRdtJFGQ3a9e8co+bi8s5qiQLa9cFxV 0uhg== X-Gm-Message-State: AIkVDXL09tfnE0Bc604h0IT+ZujAnceywgeG5bkeTr65rXv0Qq27ZLegYF3EDYgf7+mYtUROJtBHsczFpGRHAQ== X-Received: by 10.55.5.66 with SMTP id 63mr23796315qkf.163.1485790624832; Mon, 30 Jan 2017 07:37:04 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.157.69 with HTTP; Mon, 30 Jan 2017 07:37:04 -0800 (PST) In-Reply-To: References: <201701300215.v0U2Fsl0006455@repo.freebsd.org> <20170130105345.GL3018@kib.kiev.ua> From: Justin Hibbits Date: Mon, 30 Jan 2017 09:37:04 -0600 X-Google-Sender-Auth: 0GOHapSvjeQpu4XIe49L53f7NrQ Message-ID: Subject: Re: svn commit: r312973 - head/sys/powerpc/include To: Konstantin Belousov Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 15:37:06 -0000 On Mon, Jan 30, 2017 at 9:32 AM, Justin Hibbits wrote: > On Mon, Jan 30, 2017 at 4:53 AM, Konstantin Belousov > wrote: >>> +#ifdef __GNUCLIKE_ASM >>> + __asm __volatile ( >>> + "1:\tlwarx %0, 0, %3\n\t" /* load old value */ >>> + "cmplw %4, %0\n\t" /* compare */ >>> + "bne 2f\n\t" /* exit if not equal */ >>> + "stwcx. %5, 0, %3\n\t" /* attempt to store */ >>> + "bne- 1b\n\t" /* spin if failed */ >>> + "li %0, 1\n\t" /* success - retval = 1 */ >>> + "b 3f\n\t" /* we've succeeded */ >>> + "2:\n\t" >>> + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ >>> + "stwx %0, 0, %7\n\t" >>> + "li %0, 0\n\t" /* failure - retval = 0 */ >>> + "3:\n\t" >>> + : "=&r" (ret), "=m" (*p), "=m" (*cmpval) >>> + : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) >>> + : "cr0", "memory"); >>> +#endif >> >> It seems that in case of failed conditional store, the code retries. >> Note that this is not incorrect but also not a desirable behaviour >> with fcmpset: the function should return error and leave the retry >> to the caller. There is no point in having embedded loop. (stupid gmail web UI being so slow it registered me clicking Send when I clicked the ...) Thanks, Kib. I discussed this with mjg on IRC, and it was kind of a toss-up how to implement it, so I took the easiest route. I'll update it tonight and remove the loop. There is an instruction on newer ISAs that would reduce this inline asm even further, 'mfocrf', but it doesn't exist on all supported PowerPC architectures, so it will be just a minor tweak. - Justin From owner-svn-src-head@freebsd.org Mon Jan 30 16:19:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C31DCC8B0D; Mon, 30 Jan 2017 16:19:07 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F78BEA8; Mon, 30 Jan 2017 16:19:06 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-248-244.albq.qwest.net [67.0.248.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 0337C1928BA; Mon, 30 Jan 2017 16:18:59 +0000 (UTC) Subject: Re: svn commit: r312755 - head/sys/net To: John Baldwin References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy From: Sean Bruno Message-ID: Date: Mon, 30 Jan 2017 09:18:56 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <6817684.C985jk9qCN@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HFqjPIwvv10aPjluuAjqto8MMfcn16jEE" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 16:19:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE Content-Type: multipart/mixed; boundary="42evHKNlMPM6UtKtjBbTOdhvqFOqofU90"; protected-headers="v1" From: Sean Bruno To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy Message-ID: Subject: Re: svn commit: r312755 - head/sys/net References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx> In-Reply-To: <6817684.C985jk9qCN@ralph.baldwin.cx> --42evHKNlMPM6UtKtjBbTOdhvqFOqofU90 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01/27/17 12:28, John Baldwin wrote: > On Wednesday, January 25, 2017 02:37:05 PM Sean Bruno wrote: >> Author: sbruno >> Date: Wed Jan 25 14:37:05 2017 >> New Revision: 312755 >> URL: https://svnweb.freebsd.org/changeset/base/312755 >> >> Log: >> Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is re= turns >> success and a good value. Only then try to use it and set the MSIX_= ENABLE >> bit. >> =20 >> With the current em(4) driver we have observed failures in this case= in a >> specific environment when pci_find_cap() would not return the assume= d >> value, which meant we ended up writing to PCI register 2 (PCI_DEVICE= _ID) >> which is read-only. >=20 > Why is this writing directly to the MSIX registers at all? pci_alloc_m= six() > etc. handle those registers for all other drivers and proper suspend/re= sume > depends on drivers using the existing PCI API for managing MSI and MSI-= X. >=20 The comment above this code block explains what's up. Basically, virtualized environments are sometimes "lazy" about correct register setu= p. If MSIX caps aren't set, try to enable them. If that fails, assume MSI. Later on the code does the proper pci_alloc_msix() calls in the proper sequence, IMO. sean --42evHKNlMPM6UtKtjBbTOdhvqFOqofU90-- --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEuq1GMucSHejSCZfdEgHvyh5yfmQFAliPZ3BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJB QUQ0NjMyRTcxMjFERThEMjA5OTdERDEyMDFFRkNBMUU3MjdFNjQACgkQEgHvyh5y fmSI0gf/d+zpOy+MJvENkQhw88p52UOyAmubJbWsLifVwxlRpUv89t+rAHM54rKF kE8Vx1045CZCmU1jEiajrW9DOSnmZZvWAjjI3jWqK4TYNL1AFRayhKZwzpG4x41k e/2rCgy3NhpZWK7rRkDRy7Qqb7DtU+BvZCcIpp4uqb1bMdbCNiFhYkzgRr4SgNje YHuSBmD9CIfCJQnbj9p+rDs6t26iyCIViCppZzEaJpnk1BivyYOrR3mOZVj3b8Wi 2tkEKF1PZRakF5tT8dpuwRgglppxYaUImect8yT+uwCkqlVHDz2CtEkQvPLzc8Cl oTKz9fCVOZ2oMNz5Oz3qBFeLWLVhFA== =lj4B -----END PGP SIGNATURE----- --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE-- From owner-svn-src-head@freebsd.org Mon Jan 30 16:32:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C9DCC8F3F; Mon, 30 Jan 2017 16:32:55 +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 571E3194C; Mon, 30 Jan 2017 16:32:55 +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 v0UGWsB3055950; Mon, 30 Jan 2017 16:32:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UGWrG6055942; Mon, 30 Jan 2017 16:32:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701301632.v0UGWrG6055942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 Jan 2017 16:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312992 - in head: contrib/openresolv sbin/resolvconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 16:32:55 -0000 Author: pfg Date: Mon Jan 30 16:32:53 2017 New Revision: 312992 URL: https://svnweb.freebsd.org/changeset/base/312992 Log: MFV r312970: openresolv: update to version 3.9.0. It is now possible to drop the _WITH_ARG vars thanks to a change to the pdns_recursor upstreamed by Guy Yur. MFC after: 3 weeks Modified: head/contrib/openresolv/Makefile head/contrib/openresolv/configure head/contrib/openresolv/libc.in head/contrib/openresolv/pdns_recursor.in head/contrib/openresolv/resolvconf.8.in head/contrib/openresolv/resolvconf.conf.5.in head/contrib/openresolv/resolvconf.in head/sbin/resolvconf/Makefile Directory Properties: head/contrib/openresolv/ (props changed) Modified: head/contrib/openresolv/Makefile ============================================================================== --- head/contrib/openresolv/Makefile Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/Makefile Mon Jan 30 16:32:53 2017 (r312992) @@ -37,6 +37,11 @@ SED_STATUSARG= -e 's:@STATUSARG@:${STAT DISTPREFIX?= ${PKG}-${VERSION} DISTFILEGZ?= ${DISTPREFIX}.tar.gz DISTFILE?= ${DISTPREFIX}.tar.xz +DISTINFO= ${DISTFILE}.distinfo +DISTINFOSIGN= ${DISTINFO}.asc +CKSUM?= cksum -a SHA256 +PGP?= netpgp + FOSSILID?= current .SUFFIXES: .in @@ -53,7 +58,7 @@ clean: rm -f ${TARGET} distclean: clean - rm -f config.mk ${DISTFILE} + rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} installdirs: @@ -83,3 +88,11 @@ dist: fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} gunzip -c ${DISTFILEGZ} | xz >${DISTFILE} rm ${DISTFILEGZ} + +distinfo: dist + rm -f ${DISTINFO} ${DISTINFOSIGN} + ${CKSUM} ${DISTFILE} >${DISTINFO} + #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO} + ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} + chmod 644 ${DISTINFOSIGN} + ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} Modified: head/contrib/openresolv/configure ============================================================================== --- head/contrib/openresolv/configure Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/configure Mon Jan 30 16:32:53 2017 (r312992) @@ -120,14 +120,21 @@ echo "Configuring openresolv for ... $OS rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK -# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled -# regardless of if it's not running. -# So we force onestatus to work around this silly bug. -if [ -z "$STATUSARG" ]; then - case "$OS" in - freebsd*) STATUSARG="onestatus";; - esac -fi +case "$OS" in +freebsd*) + # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled + # regardless of if it's not running. + # So we force onestatus to work around this silly bug. + if [ -z "$STATUSARG" ]; then + STATUSARG="onestatus" + fi + ;; +linux*) + # cksum does't support -a and netpgp is rare + echo "CKSUM= sha256sum --tag" >>$CONFIG_MK + echo "PGP= gpg2" >>$CONFIG_MK + ;; +esac for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG do Modified: head/contrib/openresolv/libc.in ============================================================================== --- head/contrib/openresolv/libc.in Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/libc.in Mon Jan 30 16:32:53 2017 (r312992) @@ -216,7 +216,7 @@ fi if $backup; then if [ "$newconf" = "$signature$NL" ]; then if [ -e "$resolv_conf.bak" ]; then - newconf="$(cat "$resolv_conf.bak")" + newconf="$(cat "$resolv_conf.bak")$NL" fi elif [ -e "$resolv_conf" ]; then read line <"$resolv_conf" Modified: head/contrib/openresolv/pdns_recursor.in ============================================================================== --- head/contrib/openresolv/pdns_recursor.in Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/pdns_recursor.in Mon Jan 30 16:32:53 2017 (r312992) @@ -34,7 +34,6 @@ NL=" " : ${pdns_service:=pdns_recursor} -: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} newzones= @@ -68,5 +67,12 @@ if [ ! -f "$pdns_zones" ] || \ [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] then printf %s "$newzones" >"$pdns_zones" - eval $pdns_restart + if [ -n "$pdns_restart" ]; then + eval $pdns_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${pdns_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${pdns_service} + fi fi Modified: head/contrib/openresolv/resolvconf.8.in ============================================================================== --- head/contrib/openresolv/resolvconf.8.in Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/resolvconf.8.in Mon Jan 30 16:32:53 2017 (r312992) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 7, 2016 +.Dd November 29, 2016 .Dt RESOLVCONF 8 .Os .Sh NAME @@ -45,6 +45,8 @@ .Fl il Ar pattern .Nm .Fl u +.Nm +.Fl Fl version .Sh DESCRIPTION .Nm manages @@ -106,7 +108,7 @@ See .Xr resolvconf.conf 5 for how to configure .Nm -to use a local name server. +to use a local name server and how to remove the private marking. .Pp .Nm can mark an interfaces @@ -126,7 +128,7 @@ on the .Ar interface . .Pp Here are some options for the above commands:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl f Ignore non existent interfaces. Only really useful for deleting interfaces. @@ -146,7 +148,7 @@ as exclusive when adding, otherwise only .Pp .Nm has some more commands for general usage:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl i Ar pattern List the interfaces and protocols, optionally matching .Ar pattern , @@ -168,12 +170,15 @@ to update all its subscribers. .Nm does not update the subscribers when adding a resolv.conf that matches what it already has for that interface. +.It Fl Fl version +Echo the resolvconf version to +.Em stdout . .El .Pp .Nm also has some commands designed to be used by it's subscribers and system startup:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl I Initialise the state directory .Pa @VARDIR@ . @@ -223,7 +228,7 @@ Here are some suggested protocol tags to .Pa resolv.conf file registered on an .Ar interface Ns No :- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It dhcp Dynamic Host Configuration Protocol. Initial versions of Modified: head/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- head/contrib/openresolv/resolvconf.conf.5.in Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/resolvconf.conf.5.in Mon Jan 30 16:32:53 2017 (r312992) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 2016 +.Dd December 29, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -69,6 +69,11 @@ If unset, defaults to the following:- These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:- .D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* +.It Sy inclusive_interfaces +Ignore any exlcusive marking for these interfaces. +This is handy when 3rd party integrations force the +.Nm resolvconf -x +option and you want to disable it easily. .It Sy local_nameservers If unset, defaults to the following:- .D1 127.* 0.0.0.0 255.255.255.255 ::1 @@ -102,6 +107,11 @@ Requires a local nameserver other than l This is equivalent to the .Nm resolvconf -p option. +.It Sy public_interfaces +Force these interface to be public, overriding the private marking. +This is handy when 3rd party integrations force the +.Nm resolvconf -p +option and you want to disable it easily. .It Sy replace Is a space separated list of replacement keywords. The syntax is this: Modified: head/contrib/openresolv/resolvconf.in ============================================================================== --- head/contrib/openresolv/resolvconf.in Mon Jan 30 15:20:13 2017 (r312991) +++ head/contrib/openresolv/resolvconf.in Mon Jan 30 16:32:53 2017 (r312992) @@ -25,13 +25,19 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" -OPENRESOLV_VERSION="3.8.1" +OPENRESOLV_VERSION="3.9.0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ RCDIR=@RCDIR@ RESTARTCMD=@RESTARTCMD@ +if [ "$1" = "--version" ]; then + echo "openresolv $OPENRESOLV_VERSION" + echo "Copyright (c) 2007-2016 Roy Marples" + exit 0 +fi + # Disregard dhcpcd setting unset interface_order state_dir @@ -90,6 +96,7 @@ usage() that match the specified pattern -u Run updates from our current DNS information + --version Echo the ${RESOLVCONF##*/} version Options: -f Ignore non existent interfaces @@ -129,6 +136,34 @@ strip_trailing_dots() printf "\n" } +private_iface() +{ + local p + + # Allow expansion + cd "$IFACEDIR" + + # Public interfaces override private ones. + for p in $public_interfaces; do + case "$iface" in + "$p"|"$p":*) return 1;; + esac + done + + if [ -e "$PRIVATEDIR/$iface" ]; then + return 0 + fi + + for p in $private_interfaces; do + case "$iface" in + "$p"|"$p":*) return 0;; + esac + done + + # Not a private interface + return 1 +} + # Parse resolv.conf's and make variables # for domain name servers, search name servers and global nameservers parse_resolv() @@ -144,20 +179,10 @@ parse_resolv() if ${new}; then iface="${line#\# resolv.conf from *}" new=false - if [ -e "$PRIVATEDIR/$iface" ]; then + if private_iface "$iface"; then private=true else - # Allow expansion - cd "$IFACEDIR" private=false - for p in $private_interfaces; do - case "$iface" in - "$p"|"$p":*) - private=true - break - ;; - esac - done fi fi ;; @@ -301,9 +326,9 @@ fi" /usr/sbin/service \$1 restart; fi" elif [ -x /bin/sv ]; then - RESTARTCMD="/bin/sv try-restart \$1" + RESTARTCMD="/bin/sv status \$1 >/dev/null 2>&1 && /bin/sv try-restart \$1" elif [ -x /usr/bin/sv ]; then - RESTARTCMD="/usr/bin/sv try-restart \$1" + RESTARTCMD="/usr/bin/sv status \$1 >/dev/null 2>&1 && /usr/bin/sv try-restart \$1" elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then RCDIR=/etc/rc.d RESTARTCMD="if [ -e /var/run/daemons/\$1 ]; then @@ -378,6 +403,14 @@ list_resolv() done fi excl=true + cd "$IFACEDIR" + for i in $inclusive_interfaces; do + if [ -f "$i" -a "$list" = "$i" ]; then + list= + excl=false + break + fi + done ;; *) excl=false @@ -418,7 +451,6 @@ list_resolv() cd "$IFACEDIR" retval=1 - excl=true for i in $(uniqify $list); do # Only list interfaces which we really have if ! [ -f "$i" ]; then @@ -432,8 +464,7 @@ list_resolv() if [ "$cmd" = i -o "$cmd" = "-i" ]; then printf %s "$i " else - echo_resolv "$i" - echo + echo_resolv "$i" && echo fi [ $? = 0 -a "$retval" = 1 ] && retval=0 done Modified: head/sbin/resolvconf/Makefile ============================================================================== --- head/sbin/resolvconf/Makefile Mon Jan 30 15:20:13 2017 (r312991) +++ head/sbin/resolvconf/Makefile Mon Jan 30 16:32:53 2017 (r312992) @@ -20,20 +20,16 @@ SBINDIR= /sbin # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. -CMD1_WITH_ARG= \1 onestatus >/dev/null 2>\&1 -CMD2_WITH_ARG= \1 restart -RESTARTCMD_WITH_ARG= /usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG} -CMD1= \\$$1 onestatus >/dev/null 2>\&1 -CMD2= \\$$1 restart -RESTARTCMD= "/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}" +CMD1= \1 onestatus >/dev/null 2>\&1 +CMD2= \1 restart +RESTARTCMD= /usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2} .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: ${f}.in sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ - -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \ - -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ + -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ -e 's:@SBINDIR@:${SBINDIR}:g' \ -e 's: vpn : ng[0-9]*&:g' \ From owner-svn-src-head@freebsd.org Mon Jan 30 18:06:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 818CDCC7D27; Mon, 30 Jan 2017 18:06:45 +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 60E0F130C; Mon, 30 Jan 2017 18:06:45 +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 8FDBA10A791; Mon, 30 Jan 2017 13:06:43 -0500 (EST) From: John Baldwin To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy Subject: Re: svn commit: r312755 - head/sys/net Date: Mon, 30 Jan 2017 10:06:36 -0800 Message-ID: <212260342.t54IaOFj3v@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx> 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, 30 Jan 2017 13:06:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 18:06:45 -0000 On Monday, January 30, 2017 09:18:56 AM Sean Bruno wrote: > > On 01/27/17 12:28, John Baldwin wrote: > > On Wednesday, January 25, 2017 02:37:05 PM Sean Bruno wrote: > >> Author: sbruno > >> Date: Wed Jan 25 14:37:05 2017 > >> New Revision: 312755 > >> URL: https://svnweb.freebsd.org/changeset/base/312755 > >> > >> Log: > >> Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns > >> success and a good value. Only then try to use it and set the MSIX_ENABLE > >> bit. > >> > >> With the current em(4) driver we have observed failures in this case in a > >> specific environment when pci_find_cap() would not return the assumed > >> value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID) > >> which is read-only. > > > > Why is this writing directly to the MSIX registers at all? pci_alloc_msix() > > etc. handle those registers for all other drivers and proper suspend/resume > > depends on drivers using the existing PCI API for managing MSI and MSI-X. > > > > The comment above this code block explains what's up. Basically, > virtualized environments are sometimes "lazy" about correct register setup. Can you provide more details here? We already deploy workarounds for specific versions of Xen that emulate MSI-X incorrectly, though for Xen your change actually makes things worse (older versions of Xen don't "see" updates to the MSI-X table while MSI-X is enabled). However, you are still enabling MSI-X while there is uninitialized junk in the table meaning that if the device asserted an interrupt it could trigger a panic. If there are bugs with hypervisors, we need to work around them in the base PCI code as we have done with the Xen workarounds. They are not going to be e1000-specific (or even NIC-specific), so iflib is the wrong place to handle them. > If MSIX caps aren't set, try to enable them. If that fails, assume MSI. Enabling MSI-X with an uninitialized table is not safe. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 30 18:35:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 069F5CC8456; Mon, 30 Jan 2017 18:35:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA40936E; Mon, 30 Jan 2017 18:35:25 +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 v0UIZOcB005212; Mon, 30 Jan 2017 18:35:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UIZOhO005211; Mon, 30 Jan 2017 18:35:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701301835.v0UIZOhO005211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 30 Jan 2017 18:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312993 - head/contrib/llvm/lib/Transforms/Scalar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 18:35:26 -0000 Author: dim Date: Mon Jan 30 18:35:24 2017 New Revision: 312993 URL: https://svnweb.freebsd.org/changeset/base/312993 Log: Pull in r279454 from upstream llvm trunk (by James Molloy): [SROA] Remove incorrect assertion Confirmed with aprantl, this assertion is incorrect - code can get here (for example 80-bit FP types) and if it does it's benign. This is exposed by a completely unrelated patch of mine, so stop the compiler falling over. Original differential: http://reviews.llvm.org/D16187 aprantl's advice to remove assertion: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382129.html This should fix assertions when building the math/opensolaris-libm port. Reported by: marino MFC after: 3 days Modified: head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp Modified: head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp Mon Jan 30 16:32:53 2017 (r312992) +++ head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp Mon Jan 30 18:35:24 2017 (r312993) @@ -4040,9 +4040,6 @@ bool SROA::splitAlloca(AllocaInst &AI, A Size = std::min(Size, AbsEnd - Start); } PieceExpr = DIB.createBitPieceExpression(Start, Size); - } else { - assert(Pieces.size() == 1 && - "partition is as large as original alloca"); } // Remove any existing dbg.declare intrinsic describing the same alloca. From owner-svn-src-head@freebsd.org Mon Jan 30 18:51:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0955BCC88DF; Mon, 30 Jan 2017 18:51:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8227F9A; Mon, 30 Jan 2017 18:51:44 +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 v0UIphA0012233; Mon, 30 Jan 2017 18:51:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UIph0M012232; Mon, 30 Jan 2017 18:51:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701301851.v0UIph0M012232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Jan 2017 18:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312994 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 18:51:45 -0000 Author: markj Date: Mon Jan 30 18:51:43 2017 New Revision: 312994 URL: https://svnweb.freebsd.org/changeset/base/312994 Log: Avoid page lookups in the top-level object in vm_object_madvise(). We can iterate over consecutive resident pages in the top-level object using the object's page list rather than by performing lookups in the object radix tree. This extends one of the optimizations in r312208 to the case where a shadow chain is present. Suggested by: alc Reviewed by: alc, kib (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9282 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Jan 30 18:35:24 2017 (r312993) +++ head/sys/vm/vm_object.c Mon Jan 30 18:51:43 2017 (r312994) @@ -1075,6 +1075,33 @@ vm_object_sync(vm_object_t object, vm_oo } /* + * Determine whether the given advice can be applied to the object. Advice is + * not applied to unmanaged pages since they never belong to page queues, and + * since MADV_FREE is destructive, it can apply only to anonymous pages that + * have been mapped at most once. + */ +static bool +vm_object_advice_applies(vm_object_t object, int advice) +{ + + if ((object->flags & OBJ_UNMANAGED) != 0) + return (false); + if (advice != MADV_FREE) + return (true); + return ((object->type == OBJT_DEFAULT || object->type == OBJT_SWAP) && + (object->flags & OBJ_ONEMAPPING) != 0); +} + +static void +vm_object_madvise_freespace(vm_object_t object, int advice, vm_pindex_t pindex, + vm_size_t size) +{ + + if (advice == MADV_FREE && object->type == OBJT_SWAP) + swap_pager_freespace(object, pindex, size); +} + +/* * vm_object_madvise: * * Implements the madvise function at the object/page level. @@ -1101,100 +1128,102 @@ vm_object_madvise(vm_object_t object, vm { vm_pindex_t tpindex; vm_object_t backing_object, tobject; - vm_page_t m; + vm_page_t m, tm; if (object == NULL) return; - VM_OBJECT_WLOCK(object); - for (m = NULL; pindex < end; pindex++) { relookup: + VM_OBJECT_WLOCK(object); + if (!vm_object_advice_applies(object, advice)) { + VM_OBJECT_WUNLOCK(object); + return; + } + for (m = vm_page_find_least(object, pindex); pindex < end; pindex++) { tobject = object; - tpindex = pindex; -shadowlookup: - /* - * MADV_FREE only operates on OBJT_DEFAULT or OBJT_SWAP pages - * and those pages must be OBJ_ONEMAPPING. - */ - if (advice == MADV_FREE) { - if ((tobject->type != OBJT_DEFAULT && - tobject->type != OBJT_SWAP) || - (tobject->flags & OBJ_ONEMAPPING) == 0) { - goto unlock_tobject; - } - } else if ((tobject->flags & OBJ_UNMANAGED) != 0) - goto unlock_tobject; /* - * In the common case where the object has no backing object, we - * can avoid performing lookups at each pindex. In either case, - * when applying MADV_FREE we take care to release any swap - * space used to store non-resident pages. + * If the next page isn't resident in the top-level object, we + * need to search the shadow chain. When applying MADV_FREE, we + * take care to release any swap space used to store + * non-resident pages. */ - if (object->backing_object == NULL) { - m = (m != NULL) ? TAILQ_NEXT(m, listq) : - vm_page_find_least(object, pindex); - tpindex = (m != NULL && m->pindex < end) ? - m->pindex : end; - if (advice == MADV_FREE && object->type == OBJT_SWAP && - tpindex > pindex) - swap_pager_freespace(object, pindex, - tpindex - pindex); - if ((pindex = tpindex) == end) - break; - } else if ((m = vm_page_lookup(tobject, tpindex)) == NULL) { - if (advice == MADV_FREE && tobject->type == OBJT_SWAP) - swap_pager_freespace(tobject, tpindex, 1); + if (m == NULL || pindex < m->pindex) { /* - * Prepare to search the next object in the chain. + * Optimize a common case: if the top-level object has + * no backing object, we can skip over the non-resident + * range in constant time. */ - backing_object = tobject->backing_object; - if (backing_object == NULL) - goto unlock_tobject; - VM_OBJECT_WLOCK(backing_object); - tpindex += OFF_TO_IDX(tobject->backing_object_offset); - if (tobject != object) - VM_OBJECT_WUNLOCK(tobject); - tobject = backing_object; - goto shadowlookup; + if (object->backing_object == NULL) { + tpindex = (m != NULL && m->pindex < end) ? + m->pindex : end; + vm_object_madvise_freespace(object, advice, + pindex, tpindex - pindex); + if ((pindex = tpindex) == end) + break; + goto next_page; + } + + tpindex = pindex; + do { + vm_object_madvise_freespace(tobject, advice, + tpindex, 1); + /* + * Prepare to search the next object in the + * chain. + */ + backing_object = tobject->backing_object; + if (backing_object == NULL) + goto next_pindex; + VM_OBJECT_WLOCK(backing_object); + tpindex += + OFF_TO_IDX(tobject->backing_object_offset); + if (tobject != object) + VM_OBJECT_WUNLOCK(tobject); + tobject = backing_object; + if (!vm_object_advice_applies(tobject, advice)) + goto next_pindex; + } while ((tm = vm_page_lookup(tobject, tpindex)) == + NULL); + } else { +next_page: + tm = m; + m = TAILQ_NEXT(m, listq); } /* * If the page is not in a normal state, skip it. */ - if (m->valid != VM_PAGE_BITS_ALL) - goto unlock_tobject; - vm_page_lock(m); - if (m->hold_count != 0 || m->wire_count != 0) { - vm_page_unlock(m); - goto unlock_tobject; - } - KASSERT((m->flags & PG_FICTITIOUS) == 0, - ("vm_object_madvise: page %p is fictitious", m)); - KASSERT((m->oflags & VPO_UNMANAGED) == 0, - ("vm_object_madvise: page %p is not managed", m)); - if (vm_page_busied(m)) { + if (tm->valid != VM_PAGE_BITS_ALL) + goto next_pindex; + vm_page_lock(tm); + if (tm->hold_count != 0 || tm->wire_count != 0) { + vm_page_unlock(tm); + goto next_pindex; + } + KASSERT((tm->flags & PG_FICTITIOUS) == 0, + ("vm_object_madvise: page %p is fictitious", tm)); + KASSERT((tm->oflags & VPO_UNMANAGED) == 0, + ("vm_object_madvise: page %p is not managed", tm)); + if (vm_page_busied(tm)) { + if (object != tobject) + VM_OBJECT_WUNLOCK(tobject); + VM_OBJECT_WUNLOCK(object); if (advice == MADV_WILLNEED) { /* * Reference the page before unlocking and * sleeping so that the page daemon is less - * likely to reclaim it. + * likely to reclaim it. */ - vm_page_aflag_set(m, PGA_REFERENCED); + vm_page_aflag_set(tm, PGA_REFERENCED); } - if (object != tobject) - VM_OBJECT_WUNLOCK(object); - VM_OBJECT_WUNLOCK(tobject); - vm_page_busy_sleep(m, "madvpo", false); - m = NULL; - VM_OBJECT_WLOCK(object); + vm_page_busy_sleep(tm, "madvpo", false); goto relookup; } - vm_page_advise(m, advice); - vm_page_unlock(m); - if (advice == MADV_FREE && tobject->type == OBJT_SWAP) - swap_pager_freespace(tobject, tpindex, 1); -unlock_tobject: + vm_page_advise(tm, advice); + vm_page_unlock(tm); + vm_object_madvise_freespace(tobject, advice, tm->pindex, 1); +next_pindex: if (tobject != object) VM_OBJECT_WUNLOCK(tobject); } From owner-svn-src-head@freebsd.org Mon Jan 30 19:49:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C03CC7BEA; Mon, 30 Jan 2017 19:49:09 +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 3824211E9; Mon, 30 Jan 2017 19:49:09 +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 v0UJn89C034347; Mon, 30 Jan 2017 19:49:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UJn8jL034346; Mon, 30 Jan 2017 19:49:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701301949.v0UJn8jL034346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 30 Jan 2017 19:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312995 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 19:49:09 -0000 Author: asomers Date: Mon Jan 30 19:49:08 2017 New Revision: 312995 URL: https://svnweb.freebsd.org/changeset/base/312995 Log: Initialize a stack variable in mprsas_get_sas_address_for_sata_disk Thought it's difficult to reproduce, I think this variable was responsible for a use-after-free panic when a SATA disk timed out responding to a SATA identify command during boot. Submitted by: slm Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9364 Modified: head/sys/dev/mpr/mpr_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon Jan 30 18:51:43 2017 (r312994) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon Jan 30 19:49:08 2017 (r312995) @@ -911,6 +911,7 @@ mprsas_get_sas_address_for_sata_disk(str u8 sas_status; memset(&ata_identify, 0, sizeof(ata_identify)); + memset(&mpi_reply, 0, sizeof(mpi_reply)); try_count = 0; do { rc = mprsas_get_sata_identify(sc, handle, &mpi_reply, From owner-svn-src-head@freebsd.org Mon Jan 30 22:11:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63004CC8E39; Mon, 30 Jan 2017 22:11:56 +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 00585BF9; Mon, 30 Jan 2017 22:11:55 +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 v0UMBtVk097752; Mon, 30 Jan 2017 22:11:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UMBs6u097740; Mon, 30 Jan 2017 22:11:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701302211.v0UMBs6u097740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 Jan 2017 22:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312997 - in head/lib/libedit: . TEST edit/readline X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:11:56 -0000 Author: pfg Date: Mon Jan 30 22:11:53 2017 New Revision: 312997 URL: https://svnweb.freebsd.org/changeset/base/312997 Log: MFV r312996: Re-import libedit 2016-02-27 This reverts r296435: the issues related to lldb and this update appear to have been identified (in lldb). Obtained from: NetBSD Reported by: emaste MFC after: 3 weeks Modified: head/lib/libedit/Makefile head/lib/libedit/TEST/tc1.c head/lib/libedit/TEST/wtc1.c head/lib/libedit/chared.c head/lib/libedit/chared.h head/lib/libedit/chartype.c head/lib/libedit/chartype.h head/lib/libedit/common.c head/lib/libedit/config.h head/lib/libedit/edit/readline/readline.h head/lib/libedit/editline.3 head/lib/libedit/el.c head/lib/libedit/el.h head/lib/libedit/eln.c head/lib/libedit/emacs.c head/lib/libedit/filecomplete.c head/lib/libedit/hist.c head/lib/libedit/hist.h head/lib/libedit/histedit.h head/lib/libedit/history.c head/lib/libedit/keymacro.c head/lib/libedit/makelist head/lib/libedit/map.c head/lib/libedit/parse.c head/lib/libedit/prompt.c head/lib/libedit/prompt.h head/lib/libedit/read.c head/lib/libedit/read.h head/lib/libedit/readline.c head/lib/libedit/refresh.c head/lib/libedit/refresh.h head/lib/libedit/search.c head/lib/libedit/search.h head/lib/libedit/sig.c head/lib/libedit/sig.h head/lib/libedit/sys.h head/lib/libedit/terminal.c head/lib/libedit/terminal.h head/lib/libedit/tokenizer.c head/lib/libedit/tty.c head/lib/libedit/tty.h head/lib/libedit/vi.c Directory Properties: head/lib/libedit/ (props changed) head/lib/libedit/edit/readline/ (props changed) Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/Makefile Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2009/01/18 12:17:49 lukem Exp $ +# $NetBSD: Makefile,v 1.55 2016/02/24 14:25:38 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ @@ -7,7 +7,7 @@ LIB= edit SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ +OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c @@ -35,7 +35,6 @@ CLEANFILES+= common.h editline.c emacs.h INCS= histedit.h -OSRCS+= eln.c SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR Modified: head/lib/libedit/TEST/tc1.c ============================================================================== --- head/lib/libedit/TEST/tc1.c Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/TEST/tc1.c Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $ */ +/* $NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $"); +__RCSID("$NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $"); #endif #endif /* not lint && not SCCSID */ __FBSDID("$FreeBSD$"); @@ -50,15 +50,15 @@ __FBSDID("$FreeBSD$"); /* * test.c: A little test program */ -#include -#include -#include #include #include -#include -#include #include #include +#include +#include +#include +#include +#include #include "histedit.h" @@ -158,7 +158,7 @@ main(int argc, char *argv[]) /* Add a user-defined function */ el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete); - /* Bind tab to it */ + /* Bind tab to it */ el_set(el, EL_BIND, "^I", "ed-complete", NULL); /* Modified: head/lib/libedit/TEST/wtc1.c ============================================================================== --- head/lib/libedit/TEST/wtc1.c Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/TEST/wtc1.c Mon Jan 30 22:11:53 2017 (r312997) @@ -5,13 +5,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include #include +#include #include #include +#include +#include +#include +#include +#include #include "../histedit.h" Modified: head/lib/libedit/chared.c ============================================================================== --- head/lib/libedit/chared.c Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/chared.c Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); /* * chared.c: Character editor utilities */ +#include #include +#include + #include "el.h" +#include "common.h" private void ch__clearmacro (EditLine *); @@ -201,7 +205,7 @@ c_delbefore1(EditLine *el) * Return if p is part of a word according to emacs */ protected int -ce__isword(Int p) +ce__isword(wint_t p) { return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL; } @@ -211,7 +215,7 @@ ce__isword(Int p) * Return if p is part of a word according to vi */ protected int -cv__isword(Int p) +cv__isword(wint_t p) { if (Isalnum(p) || p == '_') return 1; @@ -225,7 +229,7 @@ cv__isword(Int p) * Return if p is part of a big word according to vi */ protected int -cv__isWord(Int p) +cv__isWord(wint_t p) { return !Isspace(p); } @@ -235,7 +239,7 @@ cv__isWord(Int p) * Find the previous word */ protected Char * -c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int)) +c__prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t)) { p--; @@ -259,7 +263,7 @@ c__prev_word(Char *p, Char *low, int n, * Find the next word */ protected Char * -c__next_word(Char *p, Char *high, int n, int (*wtest)(Int)) +c__next_word(Char *p, Char *high, int n, int (*wtest)(wint_t)) { while (n--) { while ((p < high) && !(*wtest)(*p)) @@ -277,7 +281,7 @@ c__next_word(Char *p, Char *high, int n, * Find the next word vi style */ protected Char * -cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int)) +cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(wint_t)) { int test; @@ -306,7 +310,7 @@ cv_next_word(EditLine *el, Char *p, Char * Find the previous word vi style */ protected Char * -cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int)) +cv_prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t)) { int test; @@ -370,7 +374,7 @@ cv_delfini(EditLine *el) * Go to the end of this word according to vi */ protected Char * -cv__endword(Char *p, Char *high, int n, int (*wtest)(Int)) +cv__endword(Char *p, Char *high, int n, int (*wtest)(wint_t)) { int test; @@ -524,7 +528,7 @@ ch_enlargebufs(EditLine *el, size_t addl /* zero the newly added memory, leave old data in */ (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer)); - + oldbuf = el->el_line.buffer; el->el_line.buffer = newbuffer; @@ -573,7 +577,7 @@ ch_enlargebufs(EditLine *el, size_t addl el->el_chared.c_redo.lim = newbuffer + (el->el_chared.c_redo.lim - el->el_chared.c_redo.buf); el->el_chared.c_redo.buf = newbuffer; - + if (!hist_enlargebuf(el, sz, newsz)) return 0; @@ -673,9 +677,9 @@ out: protected int c_gets(EditLine *el, Char *buf, const Char *prompt) { - Char ch; + wchar_t wch; ssize_t len; - Char *cp = el->el_line.buffer; + Char *cp = el->el_line.buffer, ch; if (prompt) { len = (ssize_t)Strlen(prompt); @@ -690,26 +694,28 @@ c_gets(EditLine *el, Char *buf, const Ch el->el_line.lastchar = cp + 1; re_refresh(el); - if (FUN(el,getc)(el, &ch) != 1) { + if (el_wgetc(el, &wch) != 1) { ed_end_of_file(el, 0); len = -1; break; } + ch = (Char)wch; switch (ch) { - case 0010: /* Delete and backspace */ + case L'\b': /* Delete and backspace */ case 0177: if (len == 0) { len = -1; break; } + len--; cp--; continue; case 0033: /* ESC */ - case '\r': /* Newline */ - case '\n': + case L'\r': /* Newline */ + case L'\n': buf[len] = ch; break; Modified: head/lib/libedit/chared.h ============================================================================== --- head/lib/libedit/chared.h Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/chared.h Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: chared.h,v 1.27 2016/02/16 22:53:14 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,11 +41,6 @@ #ifndef _h_el_chared #define _h_el_chared -#include -#include - -#include "histedit.h" - #define EL_MAXMACRO 10 /* @@ -140,24 +135,18 @@ typedef struct el_chared_t { #define MODE_REPLACE 1 #define MODE_REPLACE_1 2 -#include "common.h" -#include "vi.h" -#include "emacs.h" -#include "search.h" -#include "fcns.h" - -protected int cv__isword(Int); -protected int cv__isWord(Int); +protected int cv__isword(wint_t); +protected int cv__isWord(wint_t); protected void cv_delfini(EditLine *); -protected Char *cv__endword(Char *, Char *, int, int (*)(Int)); -protected int ce__isword(Int); +protected Char *cv__endword(Char *, Char *, int, int (*)(wint_t)); +protected int ce__isword(wint_t); protected void cv_undo(EditLine *); protected void cv_yank(EditLine *, const Char *, int); -protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int)); -protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int)); -protected Char *c__next_word(Char *, Char *, int, int (*)(Int)); -protected Char *c__prev_word(Char *, Char *, int, int (*)(Int)); +protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(wint_t)); +protected Char *cv_prev_word(Char *, Char *, int, int (*)(wint_t)); +protected Char *c__next_word(Char *, Char *, int, int (*)(wint_t)); +protected Char *c__prev_word(Char *, Char *, int, int (*)(wint_t)); protected void c_insert(EditLine *, int); protected void c_delbefore(EditLine *, int); protected void c_delbefore1(EditLine *); Modified: head/lib/libedit/chartype.c ============================================================================== --- head/lib/libedit/chartype.c Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/chartype.c Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -31,13 +31,16 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $"); #endif /* not lint && not SCCSID */ #include __FBSDID("$FreeBSD$"); -#include "el.h" +#include #include +#include + +#include "el.h" #define CT_BUFSIZ ((size_t)1024) @@ -68,7 +71,7 @@ ct_conv_wbuff_resize(ct_buffer_t *conv, { void *p; - if (wsize <= conv->wsize) + if (wsize <= conv->wsize) return 0; conv->wsize = wsize; @@ -206,6 +209,28 @@ ct_encode_char(char *dst, size_t len, Ch } return l; } + +size_t +ct_mbrtowc(wchar_t *wc, const char *s, size_t n) +{ + mbstate_t mbs; + /* This only works because UTF-8 is stateless */ + memset(&mbs, 0, sizeof(mbs)); + return mbrtowc(wc, s, n, &mbs); +} + +#else + +size_t +ct_mbrtowc(wchar_t *wc, const char *s, size_t n) + if (s == NULL) + return 0; + if (n == 0) + return (size_t)-2; + if (wc != NULL) + *wc = *s; + return *s != '\0'; +} #endif protected const Char * @@ -329,7 +354,7 @@ ct_visual_char(Char *dst, size_t len, Ch return c > 0xffff ? 8 : 7; #else *dst++ = '\\'; -#define tooctaldigit(v) ((v) + '0') +#define tooctaldigit(v) (Char)((v) + '0') *dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7); *dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7); *dst++ = tooctaldigit(((unsigned int) c ) & 0x7); Modified: head/lib/libedit/chartype.h ============================================================================== --- head/lib/libedit/chartype.h Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/chartype.h Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.23 2016/02/24 17:20:01 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -32,7 +32,6 @@ #define _h_chartype_f - #ifdef WIDECHAR /* Ideally we should also test the value of the define to see if it @@ -55,21 +54,18 @@ #warning Build environment does not support non-BMP characters #endif -#define ct_mbtowc mbtowc -#define ct_mbtowc_reset mbtowc(0,0,(size_t)0) +#define ct_wctob wctob #define ct_wctomb wctomb #define ct_wctomb_reset wctomb(0,0) #define ct_wcstombs wcstombs #define ct_mbstowcs mbstowcs #define Char wchar_t -#define Int wint_t #define FUN(prefix,rest) prefix ## _w ## rest #define FUNW(type) type ## _w #define TYPE(type) type ## W -#define FCHAR "%lc" #define FSTR "%ls" -#define STR(x) L ## x +#define STR(x) L ## x #define UC(c) c #define Isalpha(x) iswalpha(x) #define Isalnum(x) iswalnum(x) @@ -110,21 +106,18 @@ Width(wchar_t c) #else /* NARROW */ -#define ct_mbtowc error -#define ct_mbtowc_reset +#define ct_wctob(w) ((int)(w)) #define ct_wctomb error -#define ct_wctomb_reset +#define ct_wctomb_reset #define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a)) #define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a)) #define Char char -#define Int int #define FUN(prefix,rest) prefix ## _ ## rest #define FUNW(type) type #define TYPE(type) type -#define FCHAR "%c" #define FSTR "%s" -#define STR(x) x +#define STR(x) x #define UC(c) (unsigned char)(c) #define Isalpha(x) isalpha((unsigned char)x) @@ -213,7 +206,7 @@ protected size_t ct_enc_width(Char); #define VISUAL_WIDTH_MAX ((size_t)8) /* The terminal is thought of in terms of X columns by Y lines. In the cases - * where a wide character takes up more than one column, the adjacent + * where a wide character takes up more than one column, the adjacent * occupied column entries will contain this faux character. */ #define MB_FILL_CHAR ((Char)-1) @@ -245,5 +238,7 @@ protected const Char *ct_visual_string(c protected int ct_chr_class(Char c); #endif +size_t ct_mbrtowc(wchar_t *, const char *, size_t); + #endif /* _chartype_f */ Modified: head/lib/libedit/common.c ============================================================================== --- head/lib/libedit/common.c Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/common.c Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $ */ +/* $NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $"); +__RCSID("$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -46,7 +46,13 @@ __FBSDID("$FreeBSD$"); /* * common.c: Common Editor functions */ +#include +#include + #include "el.h" +#include "common.h" +#include "parse.h" +#include "vi.h" /* ed_end_of_file(): * Indicate end of file @@ -54,7 +60,7 @@ __FBSDID("$FreeBSD$"); */ protected el_action_t /*ARGSUSED*/ -ed_end_of_file(EditLine *el, Int c __attribute__((__unused__))) +ed_end_of_file(EditLine *el, wint_t c __attribute__((__unused__))) { re_goto_bottom(el); @@ -68,7 +74,7 @@ ed_end_of_file(EditLine *el, Int c __att * Insert a character [bound to all insert keys] */ protected el_action_t -ed_insert(EditLine *el, Int c) +ed_insert(EditLine *el, wint_t c) { int count = el->el_state.argument; @@ -87,14 +93,14 @@ ed_insert(EditLine *el, Int c) || el->el_line.cursor >= el->el_line.lastchar) c_insert(el, 1); - *el->el_line.cursor++ = c; + *el->el_line.cursor++ = (Char)c; re_fastaddc(el); /* fast refresh for one char. */ } else { if (el->el_state.inputmode != MODE_REPLACE_1) c_insert(el, el->el_state.argument); while (count-- && el->el_line.cursor < el->el_line.lastchar) - *el->el_line.cursor++ = c; + *el->el_line.cursor++ = (Char)c; re_refresh(el); } @@ -111,7 +117,7 @@ ed_insert(EditLine *el, Int c) */ protected el_action_t /*ARGSUSED*/ -ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_prev_word(EditLine *el, wint_t c __attribute__((__unused__))) { Char *cp, *p, *kp; @@ -139,7 +145,7 @@ ed_delete_prev_word(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__))) { #ifdef DEBUG_EDIT #define EL el->el_line @@ -186,7 +192,7 @@ ed_delete_next_char(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_kill_line(EditLine *el, Int c __attribute__((__unused__))) +ed_kill_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *kp, *cp; @@ -207,7 +213,7 @@ ed_kill_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_move_to_end(EditLine *el, Int c __attribute__((__unused__))) +ed_move_to_end(EditLine *el, wint_t c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.lastchar; @@ -230,7 +236,7 @@ ed_move_to_end(EditLine *el, Int c __att */ protected el_action_t /*ARGSUSED*/ -ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__))) +ed_move_to_beg(EditLine *el, wint_t c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.buffer; @@ -253,7 +259,7 @@ ed_move_to_beg(EditLine *el, Int c __att * [^T] [^T] */ protected el_action_t -ed_transpose_chars(EditLine *el, Int c) +ed_transpose_chars(EditLine *el, wint_t c) { if (el->el_line.cursor < el->el_line.lastchar) { @@ -266,7 +272,7 @@ ed_transpose_chars(EditLine *el, Int c) /* must have at least two chars entered */ c = el->el_line.cursor[-2]; el->el_line.cursor[-2] = el->el_line.cursor[-1]; - el->el_line.cursor[-1] = c; + el->el_line.cursor[-1] = (Char)c; return CC_REFRESH; } else return CC_ERROR; @@ -279,7 +285,7 @@ ed_transpose_chars(EditLine *el, Int c) */ protected el_action_t /*ARGSUSED*/ -ed_next_char(EditLine *el, Int c __attribute__((__unused__))) +ed_next_char(EditLine *el, wint_t c __attribute__((__unused__))) { Char *lim = el->el_line.lastchar; @@ -308,7 +314,7 @@ ed_next_char(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_word(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_word(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor == el->el_line.buffer) @@ -334,7 +340,7 @@ ed_prev_word(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_char(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor > el->el_line.buffer) { @@ -358,14 +364,12 @@ ed_prev_char(EditLine *el, Int c __attri * [^V] [^V] */ protected el_action_t -ed_quoted_insert(EditLine *el, Int c) +ed_quoted_insert(EditLine *el, wint_t c) { int num; - Char tc; tty_quotemode(el); - num = FUN(el,getc)(el, &tc); - c = tc; + num = el_wgetc(el, &c); tty_noquotemode(el); if (num == 1) return ed_insert(el, c); @@ -378,7 +382,7 @@ ed_quoted_insert(EditLine *el, Int c) * Adds to argument or enters a digit */ protected el_action_t -ed_digit(EditLine *el, Int c) +ed_digit(EditLine *el, wint_t c) { if (!Isdigit(c)) @@ -406,7 +410,7 @@ ed_digit(EditLine *el, Int c) * For ESC-n */ protected el_action_t -ed_argument_digit(EditLine *el, Int c) +ed_argument_digit(EditLine *el, wint_t c) { if (!Isdigit(c)) @@ -432,7 +436,7 @@ ed_argument_digit(EditLine *el, Int c) protected el_action_t /*ARGSUSED*/ ed_unassigned(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) + wint_t c __attribute__((__unused__))) { return CC_ERROR; @@ -449,8 +453,8 @@ ed_unassigned(EditLine *el __attribute__ */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigint(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigint(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -463,8 +467,8 @@ ed_tty_sigint(EditLine *el __attribute__ */ protected el_action_t /*ARGSUSED*/ -ed_tty_dsusp(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_dsusp(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -477,8 +481,8 @@ ed_tty_dsusp(EditLine *el __attribute__( */ protected el_action_t /*ARGSUSED*/ -ed_tty_flush_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_flush_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -491,8 +495,8 @@ ed_tty_flush_output(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigquit(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigquit(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -505,8 +509,8 @@ ed_tty_sigquit(EditLine *el __attribute_ */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigtstp(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigtstp(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -519,8 +523,8 @@ ed_tty_sigtstp(EditLine *el __attribute_ */ protected el_action_t /*ARGSUSED*/ -ed_tty_stop_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_stop_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -533,8 +537,8 @@ ed_tty_stop_output(EditLine *el __attrib */ protected el_action_t /*ARGSUSED*/ -ed_tty_start_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_start_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -547,7 +551,7 @@ ed_tty_start_output(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_newline(EditLine *el, Int c __attribute__((__unused__))) +ed_newline(EditLine *el, wint_t c __attribute__((__unused__))) { re_goto_bottom(el); @@ -563,7 +567,7 @@ ed_newline(EditLine *el, Int c __attribu */ protected el_action_t /*ARGSUSED*/ -ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor <= el->el_line.buffer) @@ -583,7 +587,7 @@ ed_delete_prev_char(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_clear_screen(EditLine *el, Int c __attribute__((__unused__))) +ed_clear_screen(EditLine *el, wint_t c __attribute__((__unused__))) { terminal_clear_screen(el); /* clear the whole real screen */ @@ -598,8 +602,8 @@ ed_clear_screen(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_redisplay(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_redisplay(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_REDISPLAY; @@ -612,7 +616,7 @@ ed_redisplay(EditLine *el __attribute__( */ protected el_action_t /*ARGSUSED*/ -ed_start_over(EditLine *el, Int c __attribute__((__unused__))) +ed_start_over(EditLine *el, wint_t c __attribute__((__unused__))) { ch_reset(el, 0); @@ -626,8 +630,8 @@ ed_start_over(EditLine *el, Int c __attr */ protected el_action_t /*ARGSUSED*/ -ed_sequence_lead_in(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_sequence_lead_in(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -640,7 +644,7 @@ ed_sequence_lead_in(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_history(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__))) { char beep = 0; int sv_event = el->el_history.eventno; @@ -660,7 +664,6 @@ ed_prev_history(EditLine *el, Int c __at if (hist_get(el) == CC_ERROR) { if (el->el_map.type == MAP_VI) { el->el_history.eventno = sv_event; - } beep = 1; /* el->el_history.eventno was fixed by first call */ @@ -678,7 +681,7 @@ ed_prev_history(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_next_history(EditLine *el, Int c __attribute__((__unused__))) +ed_next_history(EditLine *el, wint_t c __attribute__((__unused__))) { el_action_t beep = CC_REFRESH, rval; @@ -705,11 +708,11 @@ ed_next_history(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__))) +ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__))) { const Char *hp; int h; - bool_t found = 0; + int found = 0; el->el_chared.c_vcmd.action = NOP; el->el_chared.c_undo.len = -1; @@ -748,7 +751,7 @@ ed_search_prev_history(EditLine *el, Int (el->el_line.lastchar - el->el_line.buffer)) || hp[el->el_line.lastchar - el->el_line.buffer]) && c_hmatch(el, hp)) { - found++; + found = 1; break; } h++; @@ -773,11 +776,11 @@ ed_search_prev_history(EditLine *el, Int */ protected el_action_t /*ARGSUSED*/ -ed_search_next_history(EditLine *el, Int c __attribute__((__unused__))) +ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__))) { const Char *hp; int h; - bool_t found = 0; + int found = 0; el->el_chared.c_vcmd.action = NOP; el->el_chared.c_undo.len = -1; @@ -827,7 +830,7 @@ ed_search_next_history(EditLine *el, Int */ protected el_action_t /*ARGSUSED*/ -ed_prev_line(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *ptr; int nchars = c_hpos(el); @@ -870,7 +873,7 @@ ed_prev_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_next_line(EditLine *el, Int c __attribute__((__unused__))) +ed_next_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *ptr; int nchars = c_hpos(el); @@ -904,7 +907,7 @@ ed_next_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_command(EditLine *el, Int c __attribute__((__unused__))) +ed_command(EditLine *el, wint_t c __attribute__((__unused__))) { Char tmpbuf[EL_BUFSIZ]; int tmplen; Modified: head/lib/libedit/config.h ============================================================================== --- head/lib/libedit/config.h Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/config.h Mon Jan 30 22:11:53 2017 (r312997) @@ -21,8 +21,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if you have the `fgetln' function. */ -#define HAVE_FGETLN 1 +/* Define to 1 if you have the `getline' function. */ +#define HAVE_GETLINE 1 /* Define to 1 if you have the `fork' function. */ #define HAVE_FORK 1 @@ -188,9 +188,6 @@ /* Define to 1 if you have the `vis' function. */ #define HAVE_VIS 1 -/* Define to 1 if you have the `wcsdup' function. */ -#define HAVE_WCSDUP 1 - /* Define to 1 if `fork' works. */ #define HAVE_WORKING_FORK 1 @@ -257,6 +254,9 @@ /* Version number of package */ #define VERSION "3.0" +/* Define to 1 if the system provides the SIZE_MAX constant */ +#define HAVE_SIZE_MAX 1 + /* Define to 1 if you want wide-character code */ /* #undef WIDECHAR */ Modified: head/lib/libedit/edit/readline/readline.h ============================================================================== --- head/lib/libedit/edit/readline/readline.h Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/edit/readline/readline.h Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */ +/* $NetBSD: readline.h,v 1.39 2016/02/17 19:47:49 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ typedef void *histdata_t; typedef struct _hist_entry { const char *line; - histdata_t data; + histdata_t data; } HIST_ENTRY; typedef struct _keymap_entry { @@ -89,7 +89,7 @@ typedef KEYMAP_ENTRY *Keymap; #define RUBOUT 0x7f #define ABORT_CHAR CTRL('G') -#define RL_READLINE_VERSION 0x0402 +#define RL_READLINE_VERSION 0x0402 #define RL_PROMPT_START_IGNORE '\1' #define RL_PROMPT_END_IGNORE '\2' @@ -98,7 +98,7 @@ typedef KEYMAP_ENTRY *Keymap; extern "C" { #endif extern const char *rl_library_version; -extern int rl_readline_version; +extern int rl_readline_version; extern char *rl_readline_name; extern FILE *rl_instream; extern FILE *rl_outstream; @@ -199,10 +199,10 @@ int rl_add_defun(const char *, rl_comm HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); -char *rl_filename_completion_function (const char *, int); +char *rl_filename_completion_function (const char *, int); int _rl_abort_internal(void); int _rl_qsort_string_compare(char **, char **); -char **rl_completion_matches(const char *, rl_compentry_func_t *); +char **rl_completion_matches(const char *, rl_compentry_func_t *); void rl_forced_update_display(void); int rl_set_prompt(const char *); int rl_on_new_line(void); @@ -218,6 +218,8 @@ int rl_generic_bind(int, const char *, int rl_bind_key_in_map(int, rl_command_func_t *, Keymap); void rl_cleanup_after_signal(void); void rl_free_line_state(void); +int rl_set_keyboard_input_timeout(int); + #ifdef __cplusplus } #endif Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Mon Jan 30 21:06:07 2017 (r312996) +++ head/lib/libedit/editline.3 Mon Jan 30 22:11:53 2017 (r312997) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ +.\" $NetBSD: editline.3,v 1.88 2016/02/25 14:59:22 wiz Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2015 +.Dd February 24, 2016 .Dt EDITLINE 3 .Os .Sh NAME *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Jan 30 22:29:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EF1CCC8125; Mon, 30 Jan 2017 22:29:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41A5CC02; Mon, 30 Jan 2017 22:29:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UMTMPB002189; Mon, 30 Jan 2017 22:29:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UMTMES002186; Mon, 30 Jan 2017 22:29:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701302229.v0UMTMES002186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 30 Jan 2017 22:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312998 - in head/sys/modules: . hwpmc_mips24k hwpmc_mips74k X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:29:23 -0000 Author: adrian Date: Mon Jan 30 22:29:21 2017 New Revision: 312998 URL: https://svnweb.freebsd.org/changeset/base/312998 Log: [mips] add some (temporary, I hope!) mips24k/mips74k hwpmc modules. Ideally we'd have a top level hwpmc module with the shared bits, then cpu specific glue as needed. However, on the MIPS side, there's no probe code - {mips24k, mips74k, octeon} implement a set of methods that hwpmc_mips.c expects. So this populates separate modules with duplicate code. Ew, but it does work. This gets me off the hook - these work fine as copied into the relevant mfsroot for mips24k/mips74k systems. TODO: * do it the "right" way in the future. Note that modules/hwpmc/ does build fine on MIPS, it jusn't DO anything. So it'd be nice to maybe call that "hwpmc_core" and then "hwpmc" can be the CPU/arch glue. Added: head/sys/modules/hwpmc_mips24k/ head/sys/modules/hwpmc_mips24k/Makefile (contents, props changed) head/sys/modules/hwpmc_mips74k/ head/sys/modules/hwpmc_mips74k/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 30 22:11:53 2017 (r312997) +++ head/sys/modules/Makefile Mon Jan 30 22:29:21 2017 (r312998) @@ -138,6 +138,8 @@ SUBDIR= \ ${_hptnr} \ ${_hptrr} \ hwpmc \ + ${_hwpmc_mips24k} \ + ${_hwpmc_mips74k} \ ${_hyperv} \ i2c \ ${_ibcore} \ @@ -520,6 +522,11 @@ _cxgbe= cxgbe SUBDIR+= zfs .endif +.if ${MACHINE_CPUARCH} == "mips" + _hwpmc_mips24k= hwpmc_mips24k + _hwpmc_mips74k= hwpmc_mips74k +.endif + .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \ ${MACHINE_CPUARCH} != "riscv" Added: head/sys/modules/hwpmc_mips24k/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/hwpmc_mips24k/Makefile Mon Jan 30 22:29:21 2017 (r312998) @@ -0,0 +1,14 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../dev/hwpmc + +KMOD= hwpmc_mips24k + +SRCS= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c vnode_if.h +SRCS+= hwpmc_mips.c + +SRCS+= hwpmc_mips24k.c + +.include Added: head/sys/modules/hwpmc_mips74k/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/hwpmc_mips74k/Makefile Mon Jan 30 22:29:21 2017 (r312998) @@ -0,0 +1,14 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../dev/hwpmc + +KMOD= hwpmc_mips74k + +SRCS= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c vnode_if.h +SRCS+= hwpmc_mips.c + +SRCS+= hwpmc_mips74k.c + +.include From owner-svn-src-head@freebsd.org Mon Jan 30 22:47:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6189ECC8D3A; Mon, 30 Jan 2017 22:47:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146EF195A; Mon, 30 Jan 2017 22:47:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UMlnRP010450; Mon, 30 Jan 2017 22:47:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UMlnNr010449; Mon, 30 Jan 2017 22:47:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701302247.v0UMlnNr010449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 30 Jan 2017 22:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313001 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:47:50 -0000 Author: glebius Date: Mon Jan 30 22:47:48 2017 New Revision: 313001 URL: https://svnweb.freebsd.org/changeset/base/313001 Log: Fix indentantion in pf_purge_thread(). No functional change. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Jan 30 22:40:43 2017 (r313000) +++ head/sys/netpfil/pf/pf.c Mon Jan 30 22:47:48 2017 (r313001) @@ -1437,35 +1437,41 @@ pf_purge_thread(void *unused __unused) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - if (pf_end_threads) { - pf_end_threads++; - wakeup(pf_purge_thread); - kproc_exit(0); - } + if (pf_end_threads) { + pf_end_threads++; + wakeup(pf_purge_thread); + kproc_exit(0); + } - /* Wait while V_pf_default_rule.timeout is initialized. */ - if (V_pf_vnet_active == 0) { - CURVNET_RESTORE(); - continue; - } + /* Wait until V_pf_default_rule is initialized. */ + if (V_pf_vnet_active == 0) { + CURVNET_RESTORE(); + continue; + } - /* Process 1/interval fraction of the state table every run. */ - idx = pf_purge_expired_states(idx, pf_hashmask / + /* + * Process 1/interval fraction of the state + * table every run. + */ + idx = pf_purge_expired_states(idx, pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); - /* Purge other expired types every PFTM_INTERVAL seconds. */ - if (idx == 0) { /* - * Order is important: - * - states and src nodes reference rules - * - states and rules reference kifs + * Purge other expired types every + * PFTM_INTERVAL seconds. */ - pf_purge_expired_fragments(); - pf_purge_expired_src_nodes(); - pf_purge_unlinked_rules(); - pfi_kif_purge(); - } - CURVNET_RESTORE(); + if (idx == 0) { + /* + * Order is important: + * - states and src nodes reference rules + * - states and rules reference kifs + */ + pf_purge_expired_fragments(); + pf_purge_expired_src_nodes(); + pf_purge_unlinked_rules(); + pfi_kif_purge(); + } + CURVNET_RESTORE(); } VNET_LIST_RUNLOCK(); } From owner-svn-src-head@freebsd.org Mon Jan 30 23:00:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95359CC82FF; Mon, 30 Jan 2017 23:00:53 +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 644C71A1; Mon, 30 Jan 2017 23:00:53 +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 v0UN0qSe014680; Mon, 30 Jan 2017 23:00:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UN0pfN014671; Mon, 30 Jan 2017 23:00:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701302300.v0UN0pfN014671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 Jan 2017 23:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313002 - in head/lib/libedit: . TEST X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 23:00:53 -0000 Author: pfg Date: Mon Jan 30 23:00:51 2017 New Revision: 313002 URL: https://svnweb.freebsd.org/changeset/base/313002 Log: MFV 312999: Update libedit 2016-03-21 Minor cleanups plus some license syncing. Obtained from: NetBSD X-MFC with: r312997 Modified: head/lib/libedit/Makefile head/lib/libedit/TEST/rl1.c head/lib/libedit/chartype.h head/lib/libedit/common.c head/lib/libedit/read.c head/lib/libedit/refresh.c head/lib/libedit/terminal.c head/lib/libedit/tty.c head/lib/libedit/vi.c Directory Properties: head/lib/libedit/ (props changed) Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/Makefile Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.55 2016/02/24 14:25:38 christos Exp $ +# $NetBSD: Makefile,v 1.56 2016/03/02 19:24:20 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ @@ -38,8 +38,8 @@ INCS= histedit.h SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR -CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH -CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT +#CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH +#CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT WARNS?= 1 Modified: head/lib/libedit/TEST/rl1.c ============================================================================== --- head/lib/libedit/TEST/rl1.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/TEST/rl1.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $ */ +/* $NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $"); +__RCSID("$NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $"); #endif /* not lint */ __FBSDID("$FreeBSD$"); Modified: head/lib/libedit/chartype.h ============================================================================== --- head/lib/libedit/chartype.h Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/chartype.h Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.23 2016/02/24 17:20:01 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.25 2016/03/07 00:05:20 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -65,6 +65,7 @@ #define FUNW(type) type ## _w #define TYPE(type) type ## W #define FSTR "%ls" +#define FSTARSTR "%.*ls" #define STR(x) L ## x #define UC(c) c #define Isalpha(x) iswalpha(x) @@ -117,6 +118,7 @@ Width(wchar_t c) #define FUNW(type) type #define TYPE(type) type #define FSTR "%s" +#define FSTARSTR "%.*s" #define STR(x) x #define UC(c) (unsigned char)(c) Modified: head/lib/libedit/common.c ============================================================================== --- head/lib/libedit/common.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/common.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $ */ +/* $NetBSD: common.c,v 1.40 2016/03/02 19:24:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $"); +__RCSID("$NetBSD: common.c,v 1.40 2016/03/02 19:24:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -149,8 +149,9 @@ ed_delete_next_char(EditLine *el, wint_t { #ifdef DEBUG_EDIT #define EL el->el_line - (void) fprintf(el->el_errlfile, - "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n", + (void) fprintf(el->el_errfile, + "\nD(b: %p(" FSTR ") c: %p(" FSTR ") last: %p(" FSTR + ") limit: %p(" FSTR ")\n", EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar, EL.lastchar, EL.limit, EL.limit); #endif Modified: head/lib/libedit/read.c ============================================================================== --- head/lib/libedit/read.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/read.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $ */ +/* $NetBSD: read.c,v 1.86 2016/03/02 19:24:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $"); +__RCSID("$NetBSD: read.c,v 1.86 2016/03/02 19:24:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -617,7 +617,7 @@ FUN(el,gets)(EditLine *el, int *nread) break; if (b->name) (void) fprintf(el->el_errfile, - "Executing %s\n", b->name); + "Executing " FSTR "\n", b->name); else (void) fprintf(el->el_errfile, "Error command = %d\n", cmdnum); Modified: head/lib/libedit/refresh.c ============================================================================== --- head/lib/libedit/refresh.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/refresh.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: refresh.c,v 1.44 2016/02/17 19:47:49 christos Exp $ */ +/* $NetBSD: refresh.c,v 1.45 2016/03/02 19:24:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: refresh.c,v 1.44 2016/02/17 19:47:49 christos Exp $"); +__RCSID("$NetBSD: refresh.c,v 1.45 2016/03/02 19:24:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -63,7 +63,7 @@ private void re__strncopy(Char *, Char * private void re__copy_and_pad(Char *, const Char *, size_t); #ifdef DEBUG_REFRESH -private void re_printstr(EditLine *, const char *, char *, char *); +private void re_printstr(EditLine *, const char *, Char *, Char *); #define __F el->el_errfile #define ELRE_ASSERT(a, b, c) do \ if (/*CONSTCOND*/ a) { \ @@ -77,7 +77,7 @@ private void re_printstr(EditLine *, con * Print a string on the debugging pty */ private void -re_printstr(EditLine *el, const char *str, char *f, char *t) +re_printstr(EditLine *el, const char *str, Char *f, Char *t) { ELRE_DEBUG(1, (__F, "%s:\"", str)); @@ -207,7 +207,7 @@ re_refresh(EditLine *el) size_t termsz; #endif - ELRE_DEBUG(1, (__F, "el->el_line.buffer = :%s:\r\n", + ELRE_DEBUG(1, (__F, "el->el_line.buffer = :" FSTR ":\r\n", el->el_line.buffer)); /* reset the Drawing cursor */ @@ -295,7 +295,8 @@ re_refresh(EditLine *el) ELRE_DEBUG(1, (__F, "term.h=%d vcur.h=%d vcur.v=%d vdisplay[0]=\r\n:%80.80s:\r\n", el->el_terminal.t_size.h, el->el_refresh.r_cursor.h, - el->el_refresh.r_cursor.v, ct_encode_string(el->el_vdisplay[0]))); + el->el_refresh.r_cursor.v, ct_encode_string(el->el_vdisplay[0], + &el->el_scratch))); ELRE_DEBUG(1, (__F, "updating %d lines.\r\n", el->el_refresh.r_newcv)); for (i = 0; i <= el->el_refresh.r_newcv; i++) { @@ -323,7 +324,7 @@ re_refresh(EditLine *el) /* This Strlen should be safe even with MB_FILL_CHARs */ terminal_clear_EOL(el, (int) Strlen(el->el_display[i])); #ifdef DEBUG_REFRESH - terminal_overwrite(el, "C\b", (size_t)2); + terminal_overwrite(el, STR("C\b"), 2); #endif /* DEBUG_REFRESH */ el->el_display[i][0] = '\0'; } @@ -370,8 +371,9 @@ re_insert(EditLine *el __attribute__((__ ELRE_DEBUG(1, (__F, "re_insert() starting: %d at %d max %d, d == \"%s\"\n", - num, dat, dlen, ct_encode_string(d))); - ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s))); + num, dat, dlen, ct_encode_string(d, &el->el_scratch))); + ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s, + &el->el_scratch))); /* open up the space for num chars */ if (num > 0) { @@ -384,8 +386,9 @@ re_insert(EditLine *el __attribute__((__ ELRE_DEBUG(1, (__F, "re_insert() after insert: %d at %d max %d, d == \"%s\"\n", - num, dat, dlen, ct_encode_string(d))); - ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s))); + num, dat, dlen, ct_encode_string(d, &el->el_scratch))); + ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s, + &el->el_scratch))); /* copy the characters */ for (a = d + dat; (a < d + dlen) && (num > 0); num--) @@ -420,7 +423,7 @@ re_delete(EditLine *el __attribute__((__ } ELRE_DEBUG(1, (__F, "re_delete() starting: %d at %d max %d, d == \"%s\"\n", - num, dat, dlen, ct_encode_string(d))); + num, dat, dlen, ct_encode_string(d, &el->el_scratch))); /* open up the space for num chars */ if (num > 0) { @@ -432,7 +435,7 @@ re_delete(EditLine *el __attribute__((__ } ELRE_DEBUG(1, (__F, "re_delete() after delete: %d at %d max %d, d == \"%s\"\n", - num, dat, dlen, ct_encode_string(d))); + num, dat, dlen, ct_encode_string(d, &el->el_scratch))); } @@ -690,9 +693,9 @@ re_update_line(EditLine *el, Char *old, sx = (int)((nls - nse) - (ols - ose)); ELRE_DEBUG(1, (__F, "fx %d, sx %d\n", fx, sx)); - ELRE_DEBUG(1, (__F, "ofd %d, osb %d, ose %d, ols %d, oe %d\n", + ELRE_DEBUG(1, (__F, "ofd %td, osb %td, ose %td, ols %td, oe %td\n", ofd - old, osb - old, ose - old, ols - old, oe - old)); - ELRE_DEBUG(1, (__F, "nfd %d, nsb %d, nse %d, nls %d, ne %d\n", + ELRE_DEBUG(1, (__F, "nfd %td, nsb %td, nse %td, nls %td, ne %td\n", nfd - new, nsb - new, nse - new, nls - new, ne - new)); ELRE_DEBUG(1, (__F, "xxx-xxx:\"00000000001111111111222222222233333333334\"\r\n")); @@ -766,7 +769,7 @@ re_update_line(EditLine *el, Char *old, if ((nsb != nfd) && fx > 0 && ((p - old) + fx <= el->el_terminal.t_size.h)) { ELRE_DEBUG(1, - (__F, "first diff insert at %d...\r\n", nfd - new)); + (__F, "first diff insert at %td...\r\n", nfd - new)); /* * Move to the first char to insert, where the first diff is. */ @@ -805,7 +808,7 @@ re_update_line(EditLine *el, Char *old, } } else if (fx < 0) { ELRE_DEBUG(1, - (__F, "first diff delete at %d...\r\n", ofd - old)); + (__F, "first diff delete at %td...\r\n", ofd - old)); /* * move to the first char to delete where the first diff is */ @@ -852,7 +855,7 @@ re_update_line(EditLine *el, Char *old, if (sx < 0 && (ose - old) + fx < el->el_terminal.t_size.h) { ELRE_DEBUG(1, (__F, - "second diff delete at %d...\r\n", (ose - old) + fx)); + "second diff delete at %td...\r\n", (ose - old) + fx)); /* * Check if we have stuff to delete */ @@ -890,7 +893,7 @@ re_update_line(EditLine *el, Char *old, * if we have a first insert AND WE HAVEN'T ALREADY DONE IT... */ if ((nsb != nfd) && (osb - ofd) <= (nsb - nfd) && (fx == 0)) { - ELRE_DEBUG(1, (__F, "late first diff insert at %d...\r\n", + ELRE_DEBUG(1, (__F, "late first diff insert at %td...\r\n", nfd - new)); terminal_move_to_char(el, (int)(nfd - new)); Modified: head/lib/libedit/terminal.c ============================================================================== --- head/lib/libedit/terminal.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/terminal.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: terminal.c,v 1.22 2016/02/17 19:47:49 christos Exp $ */ +/* $NetBSD: terminal.c,v 1.24 2016/03/22 01:38:17 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95"; #else -__RCSID("$NetBSD: terminal.c,v 1.22 2016/02/17 19:47:49 christos Exp $"); +__RCSID("$NetBSD: terminal.c,v 1.24 2016/03/22 01:38:17 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -380,7 +380,7 @@ terminal_alloc(EditLine *el, const struc */ tlen = 0; for (tmp = tlist; tmp < &tlist[T_str]; tmp++) - if (*tmp != NULL && *tmp != '\0' && *tmp != *str) { + if (*tmp != NULL && **tmp != '\0' && *tmp != *str) { char *ptr; for (ptr = *tmp; *ptr != '\0'; termbuf[tlen++] = *ptr++) @@ -668,7 +668,7 @@ terminal_overwrite(EditLine *el, const C if (n > (size_t)el->el_terminal.t_size.h) { #ifdef DEBUG_SCREEN (void) fprintf(el->el_errfile, - "%s: n is ridiculous: %d\r\n", __func__, n); + "%s: n is ridiculous: %zu\r\n", __func__, n); #endif /* DEBUG_SCREEN */ return; } Modified: head/lib/libedit/tty.c ============================================================================== --- head/lib/libedit/tty.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/tty.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.58 2016/02/27 18:13:21 christos Exp $ */ +/* $NetBSD: tty.c,v 1.59 2016/03/22 01:34:32 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tty.c,v 1.58 2016/02/27 18:13:21 christos Exp $"); +__RCSID("$NetBSD: tty.c,v 1.59 2016/03/22 01:34:32 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -500,10 +500,12 @@ tty_setup(EditLine *el) { int rst = 1; - el->el_tty.t_initialized = 0; if (el->el_flags & EDIT_DISABLED) return 0; + if (el->el_tty.t_initialized) + return -1; + if (!isatty(el->el_outfd)) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "%s: isatty: %s\n", __func__, @@ -573,6 +575,7 @@ tty_init(EditLine *el) el->el_tty.t_mode = EX_IO; el->el_tty.t_vdisable = _POSIX_VDISABLE; + el->el_tty.t_initialized = 0; (void) memcpy(el->el_tty.t_t, ttyperm, sizeof(ttyperm_t)); (void) memcpy(el->el_tty.t_c, ttychar, sizeof(ttychar_t)); return tty_setup(el); @@ -589,7 +592,7 @@ tty_end(EditLine *el) if (el->el_flags & EDIT_DISABLED) return; - if (el->el_tty.t_initialized) + if (!el->el_tty.t_initialized) return; if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { Modified: head/lib/libedit/vi.c ============================================================================== --- head/lib/libedit/vi.c Mon Jan 30 22:47:48 2017 (r313001) +++ head/lib/libedit/vi.c Mon Jan 30 23:00:51 2017 (r313002) @@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.54 2016/02/17 19:47:49 christos Exp $ */ +/* $NetBSD: vi.c,v 1.55 2016/03/02 19:24:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.54 2016/02/17 19:47:49 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.55 2016/03/02 19:24:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -105,7 +105,8 @@ cv_paste(EditLine *el, wint_t c) if (k->buf == NULL || len == 0) return CC_ERROR; #ifdef DEBUG_PASTE - (void) fprintf(el->el_errfile, "Paste: \"%.*s\"\n", (int)len, k->buf); + (void) fprintf(el->el_errfile, "Paste: \"" FSTARSTR "\"\n", (int)len, + k->buf); #endif cv_undo(el); From owner-svn-src-head@freebsd.org Mon Jan 30 23:02:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05572CC84C5; Mon, 30 Jan 2017 23:02:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 71CB476F; Mon, 30 Jan 2017 23:02:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0UN20wb061288 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 15:02:00 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0UN20c6061287; Mon, 30 Jan 2017 15:02:00 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 30 Jan 2017 15:02:00 -0800 From: Gleb Smirnoff To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20170130230200.GD2611@FreeBSD.org> References: <201701301257.v0UCvNrK065993@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701301257.v0UCvNrK065993@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 23:02:02 -0000 On Mon, Jan 30, 2017 at 12:57:23PM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Mon Jan 30 12:57:22 2017 E> New Revision: 312988 E> URL: https://svnweb.freebsd.org/changeset/base/312988 E> E> Log: E> Add kern_listen(), kern_shutdown(), and kern_socket(), and use them E> instead of their sys_*() counterparts in various compats. The svr4 E> is left untouched, because there's no point. Btw, any good reasons to keep SVR4 support for FreeBSD 12? I recently reviewed some socket code and noticed, that having SVR4-compatible sockets we need COMPAT_OLDSOCK to be compiled in, which isn't in GENERIC, of course. Thus doing just 'kldload svr4' on GENERIC won't allow to create SVR4 compatible sockets. Not even mentioning that COMPAT_OLDSOCK is probably broken since nobody needs it and it has no regression tests. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Jan 30 23:13:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0B71CC8E06; Mon, 30 Jan 2017 23:13:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B071414F4; Mon, 30 Jan 2017 23:13:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UNDfPc022499; Mon, 30 Jan 2017 23:13:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UNDf3h022498; Mon, 30 Jan 2017 23:13:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701302313.v0UNDf3h022498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 30 Jan 2017 23:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313003 - head/libexec/rtld-elf/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 23:13:43 -0000 Author: jhb Date: Mon Jan 30 23:13:41 2017 New Revision: 313003 URL: https://svnweb.freebsd.org/changeset/base/313003 Log: Remove a duplicate store when performing REL32 relocations in rtld. The duplicate call to store_ptr() was added in r204687, but it should have no effect as it only stores an Elf_Sword and the later store_ptr() does a write that is at least as large if not larger. Reviewed by: jmallett Obtained from: CheriBSD (sort of) Sponsored by: DARPA / AFRL Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Mon Jan 30 23:00:51 2017 (r313002) +++ head/libexec/rtld-elf/mips/reloc.c Mon Jan 30 23:13:41 2017 (r313003) @@ -215,7 +215,6 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp sym = symtab + r_symndx; assert(ELF_ST_BIND(sym->st_info) == STB_LOCAL); val += relocbase; - store_ptr(where, val, sizeof(Elf_Sword)); dbg("REL32/L(%p) %p -> %p in ", where, (void *)old, (void *)val); store_ptr(where, val, rlen); From owner-svn-src-head@freebsd.org Tue Jan 31 01:48:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4003CC7D13; Tue, 31 Jan 2017 01:48:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3AA4B33; Tue, 31 Jan 2017 01:48:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0V1mtpJ082937; Tue, 31 Jan 2017 01:48:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V1mtGk082936; Tue, 31 Jan 2017 01:48:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701310148.v0V1mtGk082936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 Jan 2017 01:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313004 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 01:48:57 -0000 Author: adrian Date: Tue Jan 31 01:48:55 2017 New Revision: 313004 URL: https://svnweb.freebsd.org/changeset/base/313004 Log: Fix compilation! Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 30 23:13:41 2017 (r313003) +++ head/sys/modules/Makefile Tue Jan 31 01:48:55 2017 (r313004) @@ -523,8 +523,8 @@ SUBDIR+= zfs .endif .if ${MACHINE_CPUARCH} == "mips" - _hwpmc_mips24k= hwpmc_mips24k - _hwpmc_mips74k= hwpmc_mips74k +_hwpmc_mips24k= hwpmc_mips24k +_hwpmc_mips74k= hwpmc_mips74k .endif .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ From owner-svn-src-head@freebsd.org Tue Jan 31 01:55:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDC3CC90FE; Tue, 31 Jan 2017 01:55:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF49F1135; Tue, 31 Jan 2017 01:55:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0V1tUjg087023; Tue, 31 Jan 2017 01:55:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V1tTrY087021; Tue, 31 Jan 2017 01:55:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701310155.v0V1tTrY087021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 31 Jan 2017 01:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313005 - in head/sys: conf modules/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 01:55:31 -0000 Author: jhibbits Date: Tue Jan 31 01:55:29 2017 New Revision: 313005 URL: https://svnweb.freebsd.org/changeset/base/313005 Log: Update CFLAGS for clang compatibility * Clang/llvm does not (yet) support -m(no-)spe, so make it gcc-only * Clang now supports -msoft-float, and does not appear to recognize "-disable-ppc-float-in-variadic", which appears to have been a crutch until soft-float was implemented. It's now implemented for both 32- and 64-bit. * Clang/llvm use a 'medium' code model by default for powerpc64, supporting up to 4GB TOC, and does not support the '-mminimal-toc' option. Given both of these, make -mminimal-toc gcc-only. MFC after: 2 weeks Modified: head/sys/conf/kern.mk head/sys/modules/zfs/Makefile Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Jan 31 01:48:55 2017 (r313004) +++ head/sys/conf/kern.mk Tue Jan 31 01:55:29 2017 (r313005) @@ -161,14 +161,12 @@ INLINE_LIMIT?= 8000 # Also explicitly disable Altivec instructions inside the kernel. # .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -mno-altivec -CFLAGS.clang+= -mllvm -disable-ppc-float-in-variadic=true -CFLAGS.gcc+= -msoft-float +CFLAGS+= -mno-altivec -msoft-float INLINE_LIMIT?= 15000 .endif .if ${MACHINE_ARCH} == "powerpcspe" -CFLAGS+= -mno-spe +CFLAGS.gcc+= -mno-spe .endif # Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue Jan 31 01:48:55 2017 (r313004) +++ head/sys/modules/zfs/Makefile Tue Jan 31 01:55:29 2017 (r313005) @@ -94,7 +94,7 @@ CFLAGS+=-I${SUNW}/common CFLAGS+=-DBUILDING_ZFS .if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+=-mminimal-toc +CFLAGS.gcc+=-mminimal-toc .endif .ifdef ZFS_DEBUG From owner-svn-src-head@freebsd.org Tue Jan 31 03:26:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26F73CC9FB6; Tue, 31 Jan 2017 03:26:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9968EBB; Tue, 31 Jan 2017 03:26:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0V3QXv5024382; Tue, 31 Jan 2017 03:26:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V3QW30024375; Tue, 31 Jan 2017 03:26:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701310326.v0V3QW30024375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 31 Jan 2017 03:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 03:26:34 -0000 Author: cem Date: Tue Jan 31 03:26:32 2017 New Revision: 313006 URL: https://svnweb.freebsd.org/changeset/base/313006 Log: calculate_crc32c: Add SSE4.2 implementation on x86 Derived from an implementation by Mark Adler. The fast loop performs three simultaneous CRCs over subsets of the data before composing them. This takes advantage of certain properties of the CRC32 implementation in Intel hardware. (The CRC instruction takes 1 cycle but has 2-3 cycles of latency.) The CRC32 instruction does not manipulate FPU state. i386 does not have the crc32q instruction, so avoid it there. Otherwise the implementation is identical to amd64. Add basic userland tests to verify correctness on a variety of inputs. PR: 216467 Reported by: Ben RUBSON Reviewed by: kib@, markj@ (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9342 Added: head/sys/libkern/x86/ head/sys/libkern/x86/crc32_sse42.c (contents, props changed) head/tests/sys/kern/libkern_crc32.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/libkern/crc32.c head/sys/sys/libkern.h head/tests/sys/kern/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jan 31 01:55:29 2017 (r313005) +++ head/sys/conf/files.amd64 Tue Jan 31 03:26:32 2017 (r313006) @@ -593,6 +593,11 @@ compat/ndis/subr_pe.c optional ndisapi compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx64_wrap.S optional ndisapi pci # +crc32_sse42.o standard \ + dependency "$S/libkern/x86/crc32_sse42.c" \ + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ + no-implicit-rule \ + clean "crc32_sse42.o" libkern/memmove.c standard libkern/memset.c standard # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jan 31 01:55:29 2017 (r313005) +++ head/sys/conf/files.i386 Tue Jan 31 03:26:32 2017 (r313006) @@ -554,6 +554,11 @@ kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip kern/subr_sfbuf.c standard +crc32_sse42.o standard \ + dependency "$S/libkern/x86/crc32_sse42.c" \ + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ + no-implicit-rule \ + clean "crc32_sse42.o" libkern/divdi3.c standard libkern/ffsll.c standard libkern/flsll.c standard Modified: head/sys/libkern/crc32.c ============================================================================== --- head/sys/libkern/crc32.c Tue Jan 31 01:55:29 2017 (r313005) +++ head/sys/libkern/crc32.c Tue Jan 31 03:26:32 2017 (r313006) @@ -46,8 +46,14 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#if defined(__amd64__) || defined(__i386__) +#include +#include +#endif + const uint32_t crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -749,6 +755,11 @@ calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length) { +#if defined(__amd64__) || defined(__i386__) + if ((cpu_feature2 & CPUID2_SSE42) != 0) { + return (sse42_crc32c(crc32c, buffer, length)); + } else +#endif if (length < 4) { return (singletable_crc32c(crc32c, buffer, length)); } else { Added: head/sys/libkern/x86/crc32_sse42.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 (r313006) @@ -0,0 +1,288 @@ +/* + * Derived from crc32c.c version 1.1 by Mark Adler. + * + * Copyright (C) 2013 Mark Adler + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the author be held liable for any damages arising from the + * use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * Mark Adler + * madler@alumni.caltech.edu + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * This file is compiled in userspace in order to run ATF unit tests. + */ +#ifdef USERSPACE_TESTING +#include +#else +#include +#include +#include +#include +#endif + +#include + +/* CRC-32C (iSCSI) polynomial in reversed bit order. */ +#define POLY 0x82f63b78 + +/* + * Block sizes for three-way parallel crc computation. LONG and SHORT must + * both be powers of two. + */ +#define LONG 8192 +#define SHORT 256 + +/* Tables for hardware crc that shift a crc by LONG and SHORT zeros. */ +static uint32_t crc32c_long[4][256]; +static uint32_t crc32c_short[4][256]; + +/* + * Multiply a matrix times a vector over the Galois field of two elements, + * GF(2). Each element is a bit in an unsigned integer. mat must have at + * least as many entries as the power of two for most significant one bit in + * vec. + */ +static inline uint32_t +gf2_matrix_times(uint32_t *mat, uint32_t vec) +{ + uint32_t sum; + + sum = 0; + while (vec) { + if (vec & 1) + sum ^= *mat; + vec >>= 1; + mat++; + } + return (sum); +} + +/* + * Multiply a matrix by itself over GF(2). Both mat and square must have 32 + * rows. + */ +static inline void +gf2_matrix_square(uint32_t *square, uint32_t *mat) +{ + int n; + + for (n = 0; n < 32; n++) + square[n] = gf2_matrix_times(mat, mat[n]); +} + +/* + * Construct an operator to apply len zeros to a crc. len must be a power of + * two. If len is not a power of two, then the result is the same as for the + * largest power of two less than len. The result for len == 0 is the same as + * for len == 1. A version of this routine could be easily written for any + * len, but that is not needed for this application. + */ +static void +crc32c_zeros_op(uint32_t *even, size_t len) +{ + uint32_t odd[32]; /* odd-power-of-two zeros operator */ + uint32_t row; + int n; + + /* put operator for one zero bit in odd */ + odd[0] = POLY; /* CRC-32C polynomial */ + row = 1; + for (n = 1; n < 32; n++) { + odd[n] = row; + row <<= 1; + } + + /* put operator for two zero bits in even */ + gf2_matrix_square(even, odd); + + /* put operator for four zero bits in odd */ + gf2_matrix_square(odd, even); + + /* + * first square will put the operator for one zero byte (eight zero + * bits), in even -- next square puts operator for two zero bytes in + * odd, and so on, until len has been rotated down to zero + */ + do { + gf2_matrix_square(even, odd); + len >>= 1; + if (len == 0) + return; + gf2_matrix_square(odd, even); + len >>= 1; + } while (len); + + /* answer ended up in odd -- copy to even */ + for (n = 0; n < 32; n++) + even[n] = odd[n]; +} + +/* + * Take a length and build four lookup tables for applying the zeros operator + * for that length, byte-by-byte on the operand. + */ +static void +crc32c_zeros(uint32_t zeros[][256], size_t len) +{ + uint32_t op[32]; + uint32_t n; + + crc32c_zeros_op(op, len); + for (n = 0; n < 256; n++) { + zeros[0][n] = gf2_matrix_times(op, n); + zeros[1][n] = gf2_matrix_times(op, n << 8); + zeros[2][n] = gf2_matrix_times(op, n << 16); + zeros[3][n] = gf2_matrix_times(op, n << 24); + } +} + +/* Apply the zeros operator table to crc. */ +static inline uint32_t +crc32c_shift(uint32_t zeros[][256], uint32_t crc) +{ + + return (zeros[0][crc & 0xff] ^ zeros[1][(crc >> 8) & 0xff] ^ + zeros[2][(crc >> 16) & 0xff] ^ zeros[3][crc >> 24]); +} + +/* Initialize tables for shifting crcs. */ +static void +#ifdef USERSPACE_TESTING +__attribute__((__constructor__)) +#endif +crc32c_init_hw(void) +{ + crc32c_zeros(crc32c_long, LONG); + crc32c_zeros(crc32c_short, SHORT); +} +#ifdef _KERNEL +SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32c_init_hw, NULL); +#endif + +/* Compute CRC-32C using the Intel hardware instruction. */ +#ifdef USERSPACE_TESTING +uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); +#endif +uint32_t +sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) +{ +#ifdef __amd64__ + const size_t align = 8; +#else + const size_t align = 4; +#endif + const unsigned char *next, *end; + uint64_t crc0, crc1, crc2; /* need to be 64 bits for crc32q */ + + next = buf; + crc0 = crc; + + /* Compute the crc to bring the data pointer to an aligned boundary. */ + while (len && ((uintptr_t)next & (align - 1)) != 0) { + crc0 = _mm_crc32_u8(crc0, *next); + next++; + len--; + } + + /* + * Compute the crc on sets of LONG*3 bytes, executing three independent + * crc instructions, each on LONG bytes -- this is optimized for the + * Nehalem, Westmere, Sandy Bridge, and Ivy Bridge architectures, which + * have a throughput of one crc per cycle, but a latency of three + * cycles. + */ + while (len >= LONG * 3) { + crc1 = 0; + crc2 = 0; + end = next + LONG; + do { +#ifdef __amd64__ + crc0 = _mm_crc32_u64(crc0, *(const uint64_t *)next); + crc1 = _mm_crc32_u64(crc1, + *(const uint64_t *)(next + LONG)); + crc2 = _mm_crc32_u64(crc2, + *(const uint64_t *)(next + (LONG * 2))); +#else + crc0 = _mm_crc32_u32(crc0, *(const uint32_t *)next); + crc1 = _mm_crc32_u32(crc1, + *(const uint32_t *)(next + LONG)); + crc2 = _mm_crc32_u32(crc2, + *(const uint32_t *)(next + (LONG * 2))); +#endif + next += align; + } while (next < end); + crc0 = crc32c_shift(crc32c_long, crc0) ^ crc1; + crc0 = crc32c_shift(crc32c_long, crc0) ^ crc2; + next += LONG * 2; + len -= LONG * 3; + } + + /* + * Do the same thing, but now on SHORT*3 blocks for the remaining data + * less than a LONG*3 block + */ + while (len >= SHORT * 3) { + crc1 = 0; + crc2 = 0; + end = next + SHORT; + do { +#ifdef __amd64__ + crc0 = _mm_crc32_u64(crc0, *(const uint64_t *)next); + crc1 = _mm_crc32_u64(crc1, + *(const uint64_t *)(next + SHORT)); + crc2 = _mm_crc32_u64(crc2, + *(const uint64_t *)(next + (SHORT * 2))); +#else + crc0 = _mm_crc32_u32(crc0, *(const uint32_t *)next); + crc1 = _mm_crc32_u32(crc1, + *(const uint32_t *)(next + SHORT)); + crc2 = _mm_crc32_u32(crc2, + *(const uint32_t *)(next + (SHORT * 2))); +#endif + next += align; + } while (next < end); + crc0 = crc32c_shift(crc32c_short, crc0) ^ crc1; + crc0 = crc32c_shift(crc32c_short, crc0) ^ crc2; + next += SHORT * 2; + len -= SHORT * 3; + } + + /* Compute the crc on the remaining bytes at native word size. */ + end = next + (len - (len & (align - 1))); + while (next < end) { +#ifdef __amd64__ + crc0 = _mm_crc32_u64(crc0, *(const uint64_t *)next); +#else + crc0 = _mm_crc32_u32(crc0, *(const uint32_t *)next); +#endif + next += align; + } + len &= (align - 1); + + /* Compute the crc for any trailing bytes. */ + while (len) { + crc0 = _mm_crc32_u8(crc0, *next); + next++; + len--; + } + + return ((uint32_t)crc0); +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Tue Jan 31 01:55:29 2017 (r313005) +++ head/sys/sys/libkern.h Tue Jan 31 03:26:32 2017 (r313006) @@ -205,6 +205,11 @@ crc32(const void *buf, size_t size) uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length); +#ifdef _KERNEL +#if defined(__amd64__) || defined(__i386__) +uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); +#endif +#endif LIBKERN_INLINE void *memset(void *, int, size_t); Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Tue Jan 31 01:55:29 2017 (r313005) +++ head/tests/sys/kern/Makefile Tue Jan 31 03:26:32 2017 (r313006) @@ -29,13 +29,19 @@ NETBSD_ATF_TESTS_C+= mqueue_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +ATF_TESTS_C+= libkern_crc32 +CFLAGS.libkern_crc32+= -msse4 -DUSERSPACE_TESTING +LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.endif + # subr_unit.c contains functions whose prototypes lie in headers that cannot be # included in userland. But as far as subr_unit_test goes, they're effectively # static. So it's ok to disable -Wmissing-prototypes for this program. CFLAGS.subr_unit.c+= -Wno-missing-prototypes SRCS.subr_unit_test+= subr_unit.c -WARNS?= 5 +WARNS?= 3 TESTS_SUBDIRS+= acct TESTS_SUBDIRS+= execve Added: head/tests/sys/kern/libkern_crc32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/libkern_crc32.c Tue Jan 31 03:26:32 2017 (r313006) @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include + +#include + +extern uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); + +ATF_TC_WITHOUT_HEAD(crc32c_basic_correctness); +ATF_TC_BODY(crc32c_basic_correctness, tc) +{ + const uint64_t inputs[] = { + 0xf408c634b3a9142, + 0x80539e8c7c352e2b, + 0x62e9121db6e4d649, + 0x899345850ed0a286, + 0x2302df11b4a43b15, + 0xe943de7b3d35d70, + 0xdf1ff2bf41abf56b, + 0x9bc138abae315de2, + 0x31cc82e56234f0ff, + 0xce63c0cd6988e847, + 0x3e42f6b78ee352fa, + 0xfa4085436078cfa6, + 0x53349558bf670a4b, + 0x2714e10e7d722c61, + 0xc0d3261addfc6908, + 0xd1567c3181d3a1bf, + }; + const uint32_t results[] = { + 0x2ce33ede, + 0xc49cc573, + 0xb8683c96, + 0x6918660d, + 0xa904e522, + 0x52dbc42c, + 0x98863c22, + 0x894d5d2c, + 0xb003745d, + 0xfc496dbd, + 0x97d2fbb5, + 0x3c062ef1, + 0xcc2eff18, + 0x6a9b09f6, + 0x420242c1, + 0xfd562dc3, + }; + size_t i; + uint32_t act; + + ATF_REQUIRE(nitems(inputs) == nitems(results)); + + for (i = 0; i < nitems(inputs); i++) { + act = sse42_crc32c(~0, (const void *)&inputs[i], + sizeof(inputs[0])); + ATF_REQUIRE_MSG(act == results[i], + "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)inputs[i], + results[i], act); + } +} + +ATF_TC_WITHOUT_HEAD(crc32c_alignment); +ATF_TC_BODY(crc32c_alignment, tc) +{ + const uint64_t input = 0xf408c634b3a9142; + const uint32_t result = 0x2ce33ede; + unsigned char buf[15]; + size_t i; + uint32_t act; + + + for (i = 1; i < 8; i++) { + memcpy(&buf[i], &input, sizeof(input)); + + act = sse42_crc32c(~0, (const void *)&buf[i], sizeof(input)); + ATF_REQUIRE_MSG(act == result, + "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)input, + result, act); + } +} + +ATF_TC_WITHOUT_HEAD(crc32c_trailing_bytes); +ATF_TC_BODY(crc32c_trailing_bytes, tc) +{ + const unsigned char input[] = { + 0x87, 0x54, 0x74, 0xd2, 0xb, 0x9b, 0xdd, 0xf6, 0x68, 0x37, + 0xd4, 0x4, 0x5e, 0xa9, 0xb3 + }; + const uint32_t result = 0xec638d62; + uint32_t act; + + act = sse42_crc32c(~0, input, sizeof(input)); + ATF_REQUIRE_MSG(act == result, "expected 0x%08x, got 0x%08x", result, + act); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, crc32c_basic_correctness); + ATF_TP_ADD_TC(tp, crc32c_alignment); + ATF_TP_ADD_TC(tp, crc32c_trailing_bytes); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Tue Jan 31 03:38:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 636E4C988A9; Tue, 31 Jan 2017 03:38:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (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 040B8182D; Tue, 31 Jan 2017 03:38:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f67.google.com with SMTP id v77so19912156wmv.0; Mon, 30 Jan 2017 19:38:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=x44pXePbmpET/5/N/AuPgcLhsPCt2A8Si7tJECzcEfQ=; b=cAezAf2PbR3b/ANxBTL0OIcWzylKmFPp43G5l2glbfMymaSLLsb11rly4/WFCCe+53 6SxflLYadO9IiVMtGhlHqLTg2QwvU7tengwH/sv6vSUsuWurrqd8AOz1NkQcetUY44uz 7ky3j7j+kIf6Hib6+E2k/i2WEFWmPMSSrxgAYUGeQ4YHtgpzsUNFcu/XE9XAU+kzvIcO o9VIe6HQQBd+R+XwhIAjPwSvQGuWMKFmpis0DIZhjQN1x32H0tuDBh/9P/bFT/gXV21e QZslHZRcS2K17KquJKXLE75A6dQTqYX3TcNQT3OxK0LUzzvwnDDoL0qgGpDLN3FChhrq 3yZA== X-Gm-Message-State: AIkVDXJ03JRdiB3M8WJSZ72LXPHhXm5ZkAIRwK5opVpnuyeySq8vidE6TnKRG9AnoSxNHw== X-Received: by 10.223.134.104 with SMTP id 37mr20551901wrw.121.1485833538323; Mon, 30 Jan 2017 19:32:18 -0800 (PST) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com. [74.125.82.45]) by smtp.gmail.com with ESMTPSA id g40sm25952432wrg.19.2017.01.30.19.32.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 19:32:18 -0800 (PST) Received: by mail-wm0-f45.google.com with SMTP id v77so74026038wmv.0; Mon, 30 Jan 2017 19:32:18 -0800 (PST) X-Received: by 10.28.155.5 with SMTP id d5mr16194449wme.85.1485833538113; Mon, 30 Jan 2017 19:32:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.22.42 with HTTP; Mon, 30 Jan 2017 19:32:17 -0800 (PST) In-Reply-To: <201701310326.v0V3QW30024375@repo.freebsd.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> From: Conrad Meyer Date: Mon, 30 Jan 2017 19:32:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern To: svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 03:38:11 -0000 On Mon, Jan 30, 2017 at 7:26 PM, Conrad E. Meyer wrote: > (The CRC instruction takes 1 cycle but has 2-3 cycles of latency.) My mistake, it's not 2 anywhere. It's just 3 cycles on all workstation/server CPUs since Nehalem. Different on Atom chips and AMD. Best, Conrad From owner-svn-src-head@freebsd.org Tue Jan 31 03:40:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8A01C98AAD; Tue, 31 Jan 2017 03:40:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 611831A5B; Tue, 31 Jan 2017 03:40:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0V3eDoZ028800; Tue, 31 Jan 2017 03:40:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V3eDcj028799; Tue, 31 Jan 2017 03:40:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701310340.v0V3eDcj028799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 31 Jan 2017 03:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313007 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 03:40:14 -0000 Author: jhibbits Date: Tue Jan 31 03:40:13 2017 New Revision: 313007 URL: https://svnweb.freebsd.org/changeset/base/313007 Log: Don't retry a lost reservation in atomic_fcmpset() The desired behavior of atomic_fcmpset_() is to always exit on error. Instead of retrying on lost reservation, leave the retry to the caller, and return error. Reported by: kib Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Tue Jan 31 03:26:32 2017 (r313006) +++ head/sys/powerpc/include/atomic.h Tue Jan 31 03:40:13 2017 (r313007) @@ -678,18 +678,18 @@ atomic_fcmpset_int(volatile u_int *p, u_ int ret; __asm __volatile ( - "1:\tlwarx %0, 0, %3\n\t" /* load old value */ + "lwarx %0, 0, %3\n\t" /* load old value */ "cmplw %4, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne 1f\n\t" /* exit if not equal */ "stwcx. %5, 0, %3\n\t" /* attempt to store */ - "bne- 1b\n\t" /* spin if failed */ + "bne- 1f\n\t" /* exit if failed */ "li %0, 1\n\t" /* success - retval = 1 */ - "b 3f\n\t" /* we've succeeded */ - "2:\n\t" + "b 2f\n\t" /* we've succeeded */ + "1:\n\t" "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ "stwx %0, 0, %7\n\t" "li %0, 0\n\t" /* failure - retval = 0 */ - "3:\n\t" + "2:\n\t" : "=&r" (ret), "=m" (*p), "=m" (*cmpval) : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) : "cr0", "memory"); @@ -703,20 +703,20 @@ atomic_fcmpset_long(volatile u_long *p, __asm __volatile ( #ifdef __powerpc64__ - "1:\tldarx %0, 0, %3\n\t" /* load old value */ + "ldarx %0, 0, %3\n\t" /* load old value */ "cmpld %4, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne 1f\n\t" /* exit if not equal */ "stdcx. %5, 0, %3\n\t" /* attempt to store */ #else - "1:\tlwarx %0, 0, %3\n\t" /* load old value */ + "lwarx %0, 0, %3\n\t" /* load old value */ "cmplw %4, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne 1f\n\t" /* exit if not equal */ "stwcx. %5, 0, %3\n\t" /* attempt to store */ #endif - "bne- 1b\n\t" /* spin if failed */ + "bne- 1f\n\t" /* exit if failed */ "li %0, 1\n\t" /* success - retval = 1 */ - "b 3f\n\t" /* we've succeeded */ - "2:\n\t" + "b 2f\n\t" /* we've succeeded */ + "1:\n\t" #ifdef __powerpc64__ "stdcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ "stdx %0, 0, %7\n\t" @@ -725,7 +725,7 @@ atomic_fcmpset_long(volatile u_long *p, "stwx %0, 0, %7\n\t" #endif "li %0, 0\n\t" /* failure - retval = 0 */ - "3:\n\t" + "2:\n\t" : "=&r" (ret), "=m" (*p), "=m" (*cmpval) : "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval) : "cr0", "memory"); From owner-svn-src-head@freebsd.org Tue Jan 31 05:27:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42A1CC9B28; Tue, 31 Jan 2017 05:27:05 +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 39ED61733; Tue, 31 Jan 2017 05:27:04 +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 20059D644D1; Tue, 31 Jan 2017 16:26:56 +1100 (AEDT) Date: Tue, 31 Jan 2017 16:26:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: <201701310326.v0V3QW30024375@repo.freebsd.org> Message-ID: <20170131153411.G1061@besplex.bde.org> References: <201701310326.v0V3QW30024375@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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=uODR78-PWboclYSAja4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 05:27:05 -0000 On Tue, 31 Jan 2017, Conrad E. Meyer wrote: > Log: > calculate_crc32c: Add SSE4.2 implementation on x86 This breaks building with gcc-4.2.1, and depends on using non-kernel clang headers for clang. > Modified: head/sys/conf/files.amd64 > ============================================================================== > --- head/sys/conf/files.amd64 Tue Jan 31 01:55:29 2017 (r313005) > +++ head/sys/conf/files.amd64 Tue Jan 31 03:26:32 2017 (r313006) > @@ -593,6 +593,11 @@ compat/ndis/subr_pe.c optional ndisapi > compat/ndis/subr_usbd.c optional ndisapi pci > compat/ndis/winx64_wrap.S optional ndisapi pci > # > +crc32_sse42.o standard \ I don't want it, but it is standard. > + dependency "$S/libkern/x86/crc32_sse42.c" \ > + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ -msse4 is not supported by gcc-4.2.1, Removing nostdinc pollutes the build with host headers, and the one needed might not be installed, and it doesn't exist for gcc-4.2.1. Similarly for i386. > Modified: head/sys/libkern/crc32.c > ============================================================================== > --- head/sys/libkern/crc32.c Tue Jan 31 01:55:29 2017 (r313005) > +++ head/sys/libkern/crc32.c Tue Jan 31 03:26:32 2017 (r313006) > @@ -46,8 +46,14 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include Style bug. libkern.h is part if systm.h. > #include Ordering bug. systm.h is a prerequisite for all kernel headers except param.h, since it defines macros which might be used by other headers. > Added: head/sys/libkern/x86/crc32_sse42.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 (r313006) > @@ -0,0 +1,288 @@ > ... > +#ifdef USERSPACE_TESTING > +#include > +#else > +#include > +#include > +#include > +#include > +#endif Style and ordering bugs, as above. > + > +#include This header is outside of the kernel source tree. It is not even in /usr/include, but clang finds it in: crc32_sse42.o: /usr/bin/../lib/clang/3.9.0/include/nmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/smmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/tmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/pmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/emmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/xmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/mmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/f16cintrin.h \ /usr/bin/../lib/clang/3.9.0/include/popcntintrin.h nmmintrin.h doesn't exist for gcc-4.2.1. gcc-4.2.1 has some of the other intrin.h files, but they aren't installed in FreeBSD-9, and of course they don't support newer SSE. Inline asm is much less unportable than intrinsics. kib used the correct method of .byte's in asms to avoid depending on assembler support for newer instructions. .byte is still used for clflush on amd64 and i386. It used to be used for invpcid on amd64. I can't find where it is or was used for xsave stuff. Bruce From owner-svn-src-head@freebsd.org Tue Jan 31 06:12:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28B60CC9C90; Tue, 31 Jan 2017 06:12: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 EC8071051; Tue, 31 Jan 2017 06:12:52 +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 v0V6Cq22093452; Tue, 31 Jan 2017 06:12:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V6CqVL093451; Tue, 31 Jan 2017 06:12:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701310612.v0V6CqVL093451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 31 Jan 2017 06:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313008 - head/tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 06:12:53 -0000 Author: ngie Date: Tue Jan 31 06:12:51 2017 New Revision: 313008 URL: https://svnweb.freebsd.org/changeset/base/313008 Log: Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md} The test assumed that `ggatel create` created a device on completion, but that's incorrect. This squashes the race by waiting for the device to appear, as `ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called with `-v`. Discussed with: asomers MFC after: 1 week PR: 204616 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Tue Jan 31 03:40:13 2017 (r313007) +++ head/tests/sys/geom/class/gate/ggate_test.sh Tue Jan 31 06:12:51 2017 (r313008) @@ -74,7 +74,11 @@ ggatel_file_body() atf_check ggatel create -u $us work - dd if=src of=/dev/ggate${us} bs=1m count=1 conv=notrunc + ggate_dev=/dev/ggate${us} + + wait_for_ggate_device ${ggate_dev} + + dd if=src of=${ggate_dev} bs=1m count=1 conv=notrunc checksum src work } @@ -104,7 +108,11 @@ ggatel_md_body() atf_check ggatel create -u $us /dev/$work - dd if=/dev/$src of=/dev/ggate${us} bs=1m count=1 conv=notrunc + ggate_dev=/dev/ggate${us} + + wait_for_ggate_device ${ggate_dev} + + dd if=/dev/$src of=${ggate_dev} bs=1m count=1 conv=notrunc checksum /dev/$src /dev/$work } @@ -191,3 +199,14 @@ common_cleanup() fi true } + +# Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` +# isn't called with `-v`. +wait_for_ggate_device() +{ + ggate_device=$1 + + while [ ! -c $ggate_device ]; do + sleep 0.5 + done +} From owner-svn-src-head@freebsd.org Tue Jan 31 06:25:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E3A0CC90A0; Tue, 31 Jan 2017 06:25:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (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 F3922164F; Tue, 31 Jan 2017 06:25:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f43.google.com with SMTP id b65so63717249wmf.0; Mon, 30 Jan 2017 22:25:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=gnxo8+rR5kwSlYgMLWIjuHqxzaEAdZiU7x1v2/YWlh0=; b=TUFBK2GAtMK+QAtiBO9Men2WBdsOMzJUHFdo3K75ona4uBaRm3+IH4JdGpICHo9WQY vG9Nfr2r+tif+5eB+m3nUdM23z2JHr7DO6CQP1zhGnX7Dv754qv0DNSwpi5xBL6HJq9K CEz0ytKH2GlD4qM6jonTKJ1VAJujy6OBiPBPw3ZQn6DHpIYyTGjHGomDgzok6TfPOBoq p786VldKuqNmkW8jhkvZUGkx0ykU9oV9GYSOAYOCHtn+ap04PhBS5jVEFRstBPtEPNPt sOgASTyGaAKVJ6Dhe3whpIYmTGYVKuL38pS4c1cATzdNkkx0nieTNKE2WMROgBuHDSYV jSHQ== X-Gm-Message-State: AIkVDXKZIkgpIY3/rrKQyKHnjIGXaoMZBHNRdC4qxZbprkJmOGoVJeXKOse8OZURY76rQg== X-Received: by 10.223.148.35 with SMTP id 32mr25568575wrq.18.1485843446537; Mon, 30 Jan 2017 22:17:26 -0800 (PST) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com. [74.125.82.48]) by smtp.gmail.com with ESMTPSA id m188sm20693446wma.0.2017.01.30.22.17.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 22:17:26 -0800 (PST) Received: by mail-wm0-f48.google.com with SMTP id b65so63494606wmf.0; Mon, 30 Jan 2017 22:17:26 -0800 (PST) X-Received: by 10.223.173.183 with SMTP id w52mr26223441wrc.164.1485843446226; Mon, 30 Jan 2017 22:17:26 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.22.42 with HTTP; Mon, 30 Jan 2017 22:17:25 -0800 (PST) In-Reply-To: <20170131153411.G1061@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> From: Conrad Meyer Date: Mon, 30 Jan 2017 22:17:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 06:25:34 -0000 Hi Bruce, On Mon, Jan 30, 2017 at 9:26 PM, Bruce Evans wrote: > On Tue, 31 Jan 2017, Conrad E. Meyer wrote: > >> Log: >> calculate_crc32c: Add SSE4.2 implementation on x86 > > > This breaks building with gcc-4.2.1, gcc-4.2.1 is an ancient compiler. Good riddance. >> Added: head/sys/libkern/x86/crc32_sse42.c >> >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 >> (r313006) >> + >> +#include > > ... > > Inline asm is much less unportable than intrinsics. kib used the correct > method of .byte's in asms to avoid depending on assembler support for newer > instructions. .byte is still used for clflush on amd64 and i386. It > used to be used for invpcid on amd64. I can't find where it is or was > used for xsave stuff. Konstantin predicted this complaint in code review (phabricator). Unfortunately, Clang does not automatically unroll asms, even with the correct mnemonic. Unrolling is essential to performance below the by-3 block size (768 bytes in this implementation). Hand unrolling in C seems to generate less efficient assembly than the compiler's unrolling. The left column below is block size. The measurements are nanoseconds per buf, per CLOCK_VIRTUAL, averaged over 10^5 loops. These numbers do not vary more than +/- 1ns run to run on my idle Sandy Bridge laptop. "asm" is using __asm__(), "intrins" using the _mm_crc32 intrinsics that Clang can unroll, and multitable is the older lookup-table implementation (still used on other architectures). 0x000010: asm:0 intrins:0 multitable:0 (ns per buf) 0x000020: asm:7 intrins:9 multitable:78 (ns per buf) 0x000040: asm:10 intrins:7 multitable:50 (ns per buf) 0x000080: asm:15 intrins:9 multitable:91 (ns per buf) 0x000100: asm:25 intrins:17 multitable:178 (ns per buf) 0x000200: asm:55 intrins:38 multitable:347 (ns per buf) 0x000400: asm:61 intrins:62 multitable:684 (ns per buf) Both implementations are superior to the multitable approach, so it is unreasonable not to make one of them standard on x86 platforms. The unrolled intrinsics are consistently better than not unrolled on objects 0x40-0x200 bytes large. At 0x400 bytes we pass the first unroll-by-3 threshold and it stops mattering as much. At 0x40 bytes, it is the difference between 6.4 GB/s and 9.1 GB/s. At 0x200 bytes, it is the difference between 9.3 GB/s and 13.5 GB/s. I think this justifies some minor ugliness. Best, Conrad From owner-svn-src-head@freebsd.org Tue Jan 31 07:13:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE80CC9FE7; Tue, 31 Jan 2017 07:13:02 +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 B9D38DC8; Tue, 31 Jan 2017 07:13:02 +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 v0V7D1B4017927; Tue, 31 Jan 2017 07:13:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0V7D14H017926; Tue, 31 Jan 2017 07:13:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701310713.v0V7D14H017926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 31 Jan 2017 07:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313009 - head/lib/libclang_rt/profile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 07:13:03 -0000 Author: ngie Date: Tue Jan 31 07:13:01 2017 New Revision: 313009 URL: https://svnweb.freebsd.org/changeset/base/313009 Log: Expose symbols in lib/libclang_rt/profile to fix --coverage The symbols currently hidden in libprofile_rt are needed for linking with `clang --coverage` to add coverage counters at link time and produce coverage numbers at runtime. In collaboration with: dim MFC after: 1 month Sponsored by: Dell EMC Isilon Differential Revision: D9168 Modified: head/lib/libclang_rt/profile/Makefile Modified: head/lib/libclang_rt/profile/Makefile ============================================================================== --- head/lib/libclang_rt/profile/Makefile Tue Jan 31 06:12:51 2017 (r313008) +++ head/lib/libclang_rt/profile/Makefile Tue Jan 31 07:13:01 2017 (r313009) @@ -4,6 +4,9 @@ LIB= clang_rt.profile-${CRTARCH} +# This is needed for --coverage +CFLAGS+= -fvisibility=default + SRCS+= profile/GCDAProfiling.c SRCS+= profile/InstrProfiling.c SRCS+= profile/InstrProfilingBuffer.c From owner-svn-src-head@freebsd.org Tue Jan 31 08:31:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04B3CCAA3D; Tue, 31 Jan 2017 08:31:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7091678; Tue, 31 Jan 2017 08:31:39 +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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id EAB303C4326; Tue, 31 Jan 2017 19:31:29 +1100 (AEDT) Date: Tue, 31 Jan 2017 19:31:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: Message-ID: <20170131175309.N1418@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=srfTNGtpKdxiwwSISBkA:9 a=5ylg2T7B_A-Amnrw:21 a=MTGi1m3gAQG5o30M:21 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 08:31:41 -0000 On Mon, 30 Jan 2017, Conrad Meyer wrote: > On Mon, Jan 30, 2017 at 9:26 PM, Bruce Evans wrote: >> On Tue, 31 Jan 2017, Conrad E. Meyer wrote: >> >>> Log: >>> calculate_crc32c: Add SSE4.2 implementation on x86 >> >> This breaks building with gcc-4.2.1, > > gcc-4.2.1 is an ancient compiler. Good riddance. I prefer it. >>> Added: head/sys/libkern/x86/crc32_sse42.c >>> >>> ============================================================================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 >>> (r313006) >>> + >>> +#include >> >> ... >> >> Inline asm is much less unportable than intrinsics. kib used the correct >> method of .byte's in asms to avoid depending on assembler support for newer >> instructions. .byte is still used for clflush on amd64 and i386. It >> used to be used for invpcid on amd64. I can't find where it is or was >> used for xsave stuff. > > Konstantin predicted this complaint in code review (phabricator). > Unfortunately, Clang does not automatically unroll asms, even with the > correct mnemonic. Unrolling is essential to performance below the > by-3 block size (768 bytes in this implementation). Hand unrolling in > C seems to generate less efficient assembly than the compiler's > unrolling. Unorolling is almost completely useless if the instruction takes 3 cycles like you said it does. The loop calculations run much faster than that, so they can run in parallel. However, clang generates horrible code for inline asms instead of intrinsics. Simple asms can be compiled even by gcc (apparently old binutils supports SSE4): X Index: crc32_sse42.c X =================================================================== X --- crc32_sse42.c (revision 313007) X +++ crc32_sse42.c (working copy) X @@ -38,8 +38,29 @@ X #include X #endif X X -#include X +static __inline uint32_t X +_mm_crc32_u8(uint32_t x, uint8_t y) X +{ X + __asm("crc32b %1,%0" : "+r" (x) : "rm" (y)); X + return (x); X +} X X +static __inline uint32_t __unused X +_mm_crc32_u32(uint32_t x, int32_t y) X +{ X + __asm("crc32l %1,%0" : "+r" (x) : "rm" (y)); X + return (x); X +} X + X +#ifdef __amd64__ X +static __inline uint64_t X +_mm_crc32_u64(uint64_t x, int64_t y) X +{ X + __asm("crc32q %1,%0" : "+r" (x) : "rm" (y)); X + return (x); X +} X +#endif X + X /* CRC-32C (iSCSI) polynomial in reversed bit order. */ X #define POLY 0x82f63b78 I only tested this at compile time. clang generates horrible code. Starting with y in an array in memory, it always copies y to the stack and does a memory access there. There is nothing special about these inline asms, so I think clang does the same pessimizations for most asms in cpufunc.h. jkim got annoyed by this for something like rdtsc() and changed too much to reduce the problem for just one case. The differences in the generated code look like: intrinsincs (old <) vs inline asm (new >): 28,29c29,33 < movl %edi, %eax < crc32b (%rsi), %eax --- > movzbl (%rsi), %eax > movb %al, -10(%rbp) > #APP > crc32b -10(%rbp), %edi > #NO_APP Similarly for crc32q, except the load doesn't do an extension. 157,181d192 < .p2align 4, 0x90 < .LBB0_19: # %while.body69 < # =>This Inner Loop Header: Depth=1 < crc32b (%rsi,%rdx), %eax < crc32b 1(%rsi,%rdx), %eax < crc32b 2(%rsi,%rdx), %eax < crc32b 3(%rsi,%rdx), %eax < crc32b 4(%rsi,%rdx), %eax < crc32b 5(%rsi,%rdx), %eax < crc32b 6(%rsi,%rdx), %eax < crc32b 7(%rsi,%rdx), %eax This is the only clang unrolling. < addq $8, %rdx < testl %edx, %edx < jne .LBB0_19 < # BB#20: # %while.end75.loopexit.unr-lcssa.loopexit < addq %rdx, %rsi < .LBB0_21: # %while.end75.loopexit.unr-lcssa < testl %ecx, %ecx < je .LBB0_24 < # BB#22: # %while.body69.epil.preheader 184c195 < .LBB0_23: # %while.body69.epil --- > .LBB0_18: # %while.body69 186c197,201 < crc32b (%rsi), %eax --- > movzbl (%rsi), %edx > movb %dl, -9(%rbp) > #APP > crc32b -9(%rbp), %eax > #NO_APP With inline asm, clang doesn't unroll this byte loop. gcc generates nice-looking code: G #APP G crc32q (%r8),%rcx G crc32q 8192(%r8),%rdi G crc32q 16384(%r8),%r10 G #NO_APP G ... G #APP G crc32q (%r8),%rcx G crc32q 256(%r8),%rdi G crc32q 512(%r8),%r10 G #NO_APP G ... G .L97: G movl %ecx, %r8d G decl %edx G #APP G crc32b -1(%rsi),%r8d G #NO_APP G mov %r8d, %ecx G .L96: G incq %rsi G testl %edx, %edx G jne .L97 It doesn't do the copying or the unrolling. > The left column below is block size. The measurements are nanoseconds > per buf, per CLOCK_VIRTUAL, averaged over 10^5 loops. These numbers > do not vary more than +/- 1ns run to run on my idle Sandy Bridge > laptop. "asm" is using __asm__(), "intrins" using the _mm_crc32 > intrinsics that Clang can unroll, and multitable is the older > lookup-table implementation (still used on other architectures). > > 0x000010: asm:0 intrins:0 multitable:0 (ns per buf) > 0x000020: asm:7 intrins:9 multitable:78 (ns per buf) > 0x000040: asm:10 intrins:7 multitable:50 (ns per buf) > 0x000080: asm:15 intrins:9 multitable:91 (ns per buf) > 0x000100: asm:25 intrins:17 multitable:178 (ns per buf) > 0x000200: asm:55 intrins:38 multitable:347 (ns per buf) > 0x000400: asm:61 intrins:62 multitable:684 (ns per buf) > > Both implementations are superior to the multitable approach, so it is > unreasonable not to make one of them standard on x86 platforms. > > The unrolled intrinsics are consistently better than not unrolled on > objects 0x40-0x200 bytes large. At 0x400 bytes we pass the first > unroll-by-3 threshold and it stops mattering as much. > > At 0x40 bytes, it is the difference between 6.4 GB/s and 9.1 GB/s. At > 0x200 bytes, it is the difference between 9.3 GB/s and 13.5 GB/s. I > think this justifies some minor ugliness. If it matters, which I doubt, then the compiler shouldn't be trusted for unrolling. It can only do better than handwritten unrolling if it has tables for the correct amount unrolling for every instruction for thousands of CPUs (since such tables are too hard to write manually). clang seems to only unroll for the byte loop. Perhaps that is useless since if the byte loop is reached then things are already slow. I get this by only noticing large differences for the byte loop in the above diff, and then static instruction counting. All of clang with intrinsics, clang with asms and gcc with asms generate the same number of crc32q's; clang with asms and gcc with asms generate the same number of crc32b's; so the only difference seems to be extra crc32b's for the unrolling. You get differences of a few nsec per buf, but say that this is for _mm_crc32. I don't see any unrolling for _mm_crc32. The full byte loop with clang pessimizations is: C .p2align 4, 0x90 C .LBB0_18: # %while.body69 C # =>This Inner Loop Header: Depth=1 C movzbl (%rsi), %edx C movb %dl, -9(%rbp) C #APP C crc32b -9(%rbp), %eax C #NO_APP C incq %rsi C incl %ecx C jne .LBB0_18 That has too many instructions, but many of them can be done in parallel. gcc increments the counter at the beginning of the loop, but then has to do an extra instruction (testl) to check the status just before the branch. clang's extra instructions to copy to the stack can't help. I'm not sure if the overhead for this is mostly hidden by parallelism, or if it creates serious extra dependencies. The unrolling is mediocre at best: < crc32b (%rsi,%rdx), %eax < crc32b 1(%rsi,%rdx), %eax < crc32b 2(%rsi,%rdx), %eax < crc32b 3(%rsi,%rdx), %eax < crc32b 4(%rsi,%rdx), %eax < crc32b 5(%rsi,%rdx), %eax < crc32b 6(%rsi,%rdx), %eax < crc32b 7(%rsi,%rdx), %eax Why not a single crc32q for this? I don't know exactly what the instruction does, but there must be ways to calculate with more than a byte at a time. Every instruction in this has a dependency on the result of the previous one. It is might be better to do crc32b into 8 different registers and combine the result. Similar techniques if FP code give speedups of about a factor of 2. Inet checksum (in_cksum.c) might be more important than this, but is still pessimized on amd64 and only "optimized" for 486-era CPUs on i386. i386 uses asms, but these had bugs related to not using __volatile enough and/ or not declaring enough clobbers, and this was "fixed" for amd64 by not using asms but regressing to a C MD version of in_cksum.c that is little different from the C MI version. My i386 version has some updates for newer CPUs, but I never saw a significant difference from this. The "optimizations" have similar problems to the above. The main loop doing 32-bit accesses might be OK, but setup and exit code with byte loops in it has large overheads and is just as hard to unroll correctly; the code doesn't try to unroll it manually and ends up quite slow. NetBSD wrote the entire in_cksum for i386 in asm. This was faster in the i586 era, but would be difficult to maintain. Every CPU needs different scheduling for best results. OTOH, newer CPUs have better scheduling in hardware. I looked at the source code. Unrolling for the byte loop is just a pessimization. This loop is just for trailing bytes. The main loop should have used wider accesses, leaving < 8 bytes to handle at the end on amd64, and 4 bytes on i386. Thus the 8 unrolled crc32b's in the above (for amd64) are never reached, but it takes an extra branch to not reach them. The real byte loop at the end for the intrinsics case is: X .p2align 4, 0x90 X .LBB0_23: # %while.body69.epil X # =>This Inner Loop Header: Depth=1 X crc32b (%rsi), %eax X incq %rsi X incl %ecx X jne .LBB0_23 This is the same as in the asm case except it is missing the pessimization. The other loops have lots of manual unrolling which is apparently too hard for clang to understand to unroll further. The main step seems to be just manually unrolling into 3 crc32[lq]'s at a time. This 3 looks like an optimization for i386 -- i386 barely has 3 registers to hold the results. Or perhaps 3 is exactly right for the latency/throughput of crc32[lq] on the author's hardware. 3 would go well with a latency of 3 cycles and a throughput of 3 per 3 cycles. Then the extra instructions for the asm would mess up the latency/throughput hard-coding. Here is one of the loops with this 3-way unrolling, for the asm case: C .p2align 4, 0x90 C .LBB0_7: # %do.body C # Parent Loop BB0_6 Depth=1 C # => This Inner Loop Header: Depth=2 C movq %rsi, %rbx C movq -16384(%rbx), %rsi C movq %rsi, -72(%rbp) C #APP C crc32q -72(%rbp), %rax C #NO_APP C movq -8192(%rbx), %rsi C movq %rsi, -64(%rbp) C #APP C crc32q -64(%rbp), %rdi C #NO_APP C movq (%rbx), %rsi C movq %rsi, -56(%rbp) C #APP C crc32q -56(%rbp), %rcx C #NO_APP C leaq 8(%rbx), %rsi C addq $-16376, %rbx # imm = 0xC008 C cmpq %r8, %rbx C jb .LBB0_7 This has 2 extra instructions before every crc32q. If 3 crc32q's in parallel leave no spare resouces (or if less than 3 can run in parallel), then there is nothing to spare for loop control or for the extra instructions. The loss would be quite small however. Just a couple of cycles extra if 3 crc32q's take 3 cycles with nothing to spare. L2 (and L1?) cache misses already cost more. Bruce From owner-svn-src-head@freebsd.org Tue Jan 31 10:26:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E0BECC90A2 for ; Tue, 31 Jan 2017 10:26:30 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-70.reflexion.net [208.70.210.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43CC1184C for ; Tue, 31 Jan 2017 10:26:29 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 29549 invoked from network); 31 Jan 2017 10:28:08 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 31 Jan 2017 10:28:08 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.20.1) with SMTP; Tue, 31 Jan 2017 05:26:22 -0500 (EST) Received: (qmail 16305 invoked from network); 31 Jan 2017 10:26:22 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 31 Jan 2017 10:26:22 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id D03FBEC825A; Tue, 31 Jan 2017 02:26:21 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313005 - in head/sys: conf modules/zfs Message-Id: <676ECF89-F9AE-436A-942A-003B76C6BFE2@dsl-only.net> Date: Tue, 31 Jan 2017 02:26:21 -0800 To: Justin Hibbits , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 10:26:30 -0000 > Author: jhibbits > Date: Tue Jan 31 01:55:29 2017 > New Revision: 313005 > URL: https://svnweb.freebsd.org/changeset/base/313005 > . . . > Modified: head/sys/conf/kern.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/kern.mk Tue Jan 31 01:48:55 2017 = (r313004) > +++ head/sys/conf/kern.mk Tue Jan 31 01:55:29 2017 = (r313005) > @@ -161,14 +161,12 @@ INLINE_LIMIT?=3D 8000 > # Also explicitly disable Altivec instructions inside the kernel. > # > .if ${MACHINE_CPUARCH} =3D=3D "powerpc" > -CFLAGS+=3D -mno-altivec > -CFLAGS.clang+=3D -mllvm -disable-ppc-float-in-variadic=3Dtrue > -CFLAGS.gcc+=3D -msoft-float > +CFLAGS+=3D -mno-altivec -msoft-float > INLINE_LIMIT?=3D 15000 > .endif =20 Looks like I never submitted it to bugzilla but my old variant of the above was: # svnlite diff sys/conf/kern.mk Index: sys/conf/kern.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/conf/kern.mk (revision 312982) +++ sys/conf/kern.mk (working copy) @@ -162,7 +162,11 @@ # .if ${MACHINE_CPUARCH} =3D=3D "powerpc" CFLAGS+=3D -mno-altivec +.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} < 30800 CFLAGS.clang+=3D -mllvm -disable-ppc-float-in-variadic=3Dtrue +.else +CFLAGS.clang+=3D -msoft-float +.endif CFLAGS.gcc+=3D -msoft-float INLINE_LIMIT?=3D 15000 .endif In other words: I tried to span older clang's as well. (Not that you should.) > .if ${MACHINE_ARCH} =3D=3D "powerpcspe" > -CFLAGS+=3D -mno-spe > +CFLAGS.gcc+=3D -mno-spe > .endif > =20 > # I had nothing for powerpcspe . > Modified: head/sys/modules/zfs/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/modules/zfs/Makefile Tue Jan 31 01:48:55 2017 = (r313004) > +++ head/sys/modules/zfs/Makefile Tue Jan 31 01:55:29 2017 = (r313005) > @@ -94,7 +94,7 @@ CFLAGS+=3D-I${SUNW}/common > CFLAGS+=3D-DBUILDING_ZFS > =20 > .if ${MACHINE_ARCH} =3D=3D "powerpc64" > -CFLAGS+=3D-mminimal-toc > +CFLAGS.gcc+=3D-mminimal-toc > .endif > =20 > .ifdef ZFS_DEBUG You may want to process my bugzilla 215107 with = head/sys/modules/zfs/Makefile as it also deals with that -mminimal-toc: in other words to declare = 215107 fixed by this update. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Tue Jan 31 12:33:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C39DDCC9194; Tue, 31 Jan 2017 12:33:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 73EC621B; Tue, 31 Jan 2017 12:33:46 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id BC1271A76F5; Tue, 31 Jan 2017 23:33:37 +1100 (AEDT) Date: Tue, 31 Jan 2017 23:33:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312702 - in head/sys: kern libkern sys In-Reply-To: <20170125050656.J2916@besplex.bde.org> Message-ID: <20170131221815.I2119@besplex.bde.org> References: <201701241805.v0OI5Tb6043549@repo.freebsd.org> <20170125050656.J2916@besplex.bde.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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=TmtWvxBWPL09_z5EqmcA:9 a=uTqGz10Rns5fSL9v:21 a=YesT7bfhR0lfImA_:21 a=K3mnNL1lbooI8mgQ:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 12:33:47 -0000 On Wed, 25 Jan 2017, Bruce Evans wrote: > On Tue, 24 Jan 2017, Conrad E. Meyer wrote: > >> Log: >> Use time_t for intermediate values to avoid overflow in clock_ts_to_ct > > This is bogus. time_t is for storing times in seconds, not for times in > days, hours or minutes. These bugs are still present. Bounds checking for presposterous values in privileged syscalls is silly, especially it is incomplete. There are thousands of sysctls that privileged users can use to shoot themself even more easily. Just near the settimeofday() syscall, similar foot shooting can be accomplished directly using the adjkerntz sysctl. Changes to this normally update the RTC immediately. This is correct if the changes are correct. Small garbage values give garbage in the RTC and large garbage values give overflows. Bounds checking in this commit sometimes detects these overflows. Foot-shooting can also be accomplished indirectly using adjkerntz. Set it to a large (in magnitude) value that doesn't cause overflows. This augments the overflows in the next call to settimeofday(). The fix is not to add bounds checking to all sysctls. Even restricting according to securelevel wouldn't work right, since securelevel doesn't work right. In sys/kern, there are only 10 sysctls (not includinging adjkerntz) restricted by securelevel. However, settimeofday() is restricted by securelevel. You can't set the time backwards at high securelevels, but you can still set the RTC to anything using adjkerntz at high securelevels. settimeofday() gives another unsecured method with results similar to adjkerntz for panicing and corrupting the RTC. set/gettimeofday() still support timezones, and resettodr() adds both adjkerntz and (tz_minuteswest * 60) to convert the kernel time to the RTC time. Both of these additions are FreeBSD features. adjkerntz is necessary to support normal use of the RTC on x86 (it is on local time), but timezones in the kernel were deprecated 25 years ago, so why use them now? On my systems, adjkerntz is always used and I never used tz_minutewest until today to demonstrate foot shooting. The man page says that the timezone is no longer used; actually, it is used for this foot shooting. There are many bugs in the implementation of the foot-shooting: A: There are no bounds check on tz_minuteswest, so expressions like (tz_minuteswest * 60) may overflow before the foot is the target. settimeofday() tries to be careful about the order of operations, but there is no order that just works for the dependent operations of setting the time and the timezone. The new timezone should be set before setting the time, since the timezone is needed for the RTC part of setting the time, and settings should be reversible in case one part fails. In practice, the time is set first, and if this succeeds then further errors are mostly not detected, but sometimes cause panics; then the RTC is set using a non-atomic copy of the pair (adjkerntz, tz_minuteswest), where tz_minuteswest was usually set by the previous settimeofday() call. Then tz_minuteswest is set for this call. B: There is no interlocking for any of this. adjkerntz and tz_minuteswest are plain ints, so reading them is probably atomic, but any number of adjkerntz sysctls and settimeofday() syscalls can race each other. The adjkerntz sysctl claims to be MPSAFE, but does nothing special. It just overwrites the adjkerntz using a hopefully-atomic access, then calls resettodr() like settime(). kib added some locking around the hardware part of resettodr(), and did more careful things for the boottime offset for timecounters. The boottime offset is more important since it is used for every CLOCK_REALTIME timecounter call, and needs atomic accesses more since it is larger than an int. Some of the interlocking belongs in applications. E.g., after setting the time, read the time and the monotonic time to check that the (monotonic) time taken to set the time was not so long as to make the setting too out of date, and retry until it was not too out of date. Coherency between separate settings of the time and the RTC could be maintained in the same way, but since the kernel sets both it do the check. Granularity of the x86 RTC is 1 second, and accuracy is worse, so a long lag is acceptable, but this is MD. My version doesn't bother doing RTC updates for differences of less than 2 seconds. >> Add additionally safety and overflow checks to clock_ts_to_ct and the >> BCD routines while we're here. > > I also disagreed with previous versions of this fix. > >> Perform a safety check in sys_clock_settime() first to avoid easy local >> root panic, without having to propagate an error value back through >> dozens of APIs currently lacking error returns. > > I agree with not over-engineering this to check at all levels. But top-level > check needs to be more stringent and magic to work. It is easier to check > a couple of levels lower. But there is no way for lower levels to report errors, so the up-front check is of some use. It mainly needs to be much stricter so that lower levels can't fail. > ... I wrote a test program to demonstrate most of the panics reported previously, and a couple of other problems: X #include X #include X X int X main(void) X { X struct timeval tv; X struct timezone tz; X int r; X X r = gettimeofday(&tv, &tz); X if (r != 0) X err(1, "gettimeofday"); X tv.tv_usec = 0; X #ifdef NEG X tv.tv_sec = 0; X /* X * The RTC time wants to be tv_sec - adjkerntz - tz_minuteswest. X * Make this go negative (and panic) by putting a positive value X * in tz_minuteswest large enough to kill any non-perverse value X * in adjkerntz. We can get the panic (and lots of races) more X * easily using sysctl to put perverse values in adjkerntz before X * calling settimeofday. X */ X tz.tz_minuteswest = 24 * 60; /* 1 day before 1970 */ The limit checking added to the bcd functions detects bugs from this setting. If the RTC is messed up by less preposterous settings, then the error is detected on the next boot; then machdep.adjkerntz is set to 0 instead of the correct value, and machdep.disable_rtc_set is set to 1 to disable updating the RTC when adjkerntz is changed. It takes settimeofday() or the periodic update from an ntp-known-good value to update the RTC, and these don't unset machdep.disable_rtc_set. X #elif YETANOTHERBUG X /* X * With 32-bit time_t, INT_MAX is accepted, but overflows 1 second X * later. Userland then prints the year as 1901. Userland does X * avoid overflow when adding a positive timezone offset to INT_MAX. X */ X tv.tv_sec = INT_MAX; X tz.tz_minuteswest = 0; This shows that times anywhere the limit must not be allowed. The limit should be about 2034 for 32-bit time_t. The limit should be TIME_MAX, but that doesn't exist. X #elif defined(__i386__) /* XXX really 32-bit time_t */ X /* X * 32-bit time_t is easy to overflow to negative starting at any X * non-small nonnegative value. X */ X tv.tv_sec = INT_MAX; X tz.tz_minuteswest = -24 * 60; /* 1 day after end of 32-bit time_t */ X #else /* XXX really 64-bit time_t */ X /* X * Put the bogus upper value for the limit check in tv_sec to get a X * panic. We don't even need to go ~1 day higher using, X * tz_minuteswest, since 366 is ~3/4 above the length of a year so X * so the limit is already ~7499 days above the 5-digit year 10000. X * Plus the Epoch bias of 1970 years. 1990.53 years altogether. X * The panic for this gives the precise value 1989 above 10000. X */ X tv.tv_sec = 9999L * 366 * 24 * 60 * 60; X tz.tz_minuteswest = -24 * 60; X #endif X r = settimeofday(&tv, &tz); X if (r != 0) X err(1, "1st settimeofday"); X /* X * One of many bugs in settimeofday() is that its tz_minuteswest X * setting doesn't apply until the next call. Make this call. X */ X r = settimeofday(&tv, &tz); X if (r != 0) X err(1, "2nd settimeofday"); X return (0); X } Bruce From owner-svn-src-head@freebsd.org Tue Jan 31 14:36:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43FB1CC9832; Tue, 31 Jan 2017 14:36:08 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135BDAAA; Tue, 31 Jan 2017 14:36:08 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VEa7gO096353; Tue, 31 Jan 2017 14:36:07 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VEa7fv096352; Tue, 31 Jan 2017 14:36:07 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201701311436.v0VEa7fv096352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 31 Jan 2017 14:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313014 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 14:36:08 -0000 Author: jmcneill Date: Tue Jan 31 14:36:06 2017 New Revision: 313014 URL: https://svnweb.freebsd.org/changeset/base/313014 Log: Add missing ephy bus gates and resets. Modified: head/sys/boot/fdt/dts/arm/h3.dtsi Modified: head/sys/boot/fdt/dts/arm/h3.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/h3.dtsi Tue Jan 31 12:33:59 2017 (r313013) +++ head/sys/boot/fdt/dts/arm/h3.dtsi Tue Jan 31 14:36:06 2017 (r313014) @@ -69,10 +69,10 @@ reg = <0x01c30000 0x104>, <0x01c00030 0x4>; reg-names = "emac", "syscon"; interrupts = ; - resets = <&ahb_rst 17>; - reset-names = "ahb"; - clocks = <&bus_gates 17>; - clock-names = "ahb"; + resets = <&ahb_rst 17>, <&ahb_rst 66>; + reset-names = "ahb", "ephy"; + clocks = <&bus_gates 17>, <&bus_gates 128>; + clock-names = "ahb", "ephy"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; From owner-svn-src-head@freebsd.org Tue Jan 31 15:07:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CF4CCA1E3; Tue, 31 Jan 2017 15:07:34 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com [IPv6:2a00:1450:400c:c01::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 BDC7C1BC2; Tue, 31 Jan 2017 15:07:33 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wj0-x242.google.com with SMTP id le4so1636453wjb.0; Tue, 31 Jan 2017 07:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xbdUGizSgtNGu5czd80cq53WrOLvbEEUdJ4eona2kYg=; b=l2JMlo0BfrWFoxvSJNOT8JyHSJgtDqKEsKeO5aSQWOK4hWtcO90meKw2yAeatlJDQT bJa7McRy0weMK90b7Pm8j4vevqkkuJufT0fw+M8/+2QztxqSP9sQysIW9S2BaqYiAMVf VPFV86BGXU9P+oBBscBDk36MYa+nlODxrvs/v60aahPAQ8CgQDfmD9R23W5Jd1hVRm6K 9QMw6j8yAcHIxDbquinO4Zba9eGzwq0r4VXw11o2fyD1vXiCpAdZwqCX2rRrX+WaV5Kb zTrQSs8vbTcEpg+IFqgV8nmyFmvVo4COjTo4l3aMutavPvQDdy3r2lBm49hzV3XasSjK ruOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=xbdUGizSgtNGu5czd80cq53WrOLvbEEUdJ4eona2kYg=; b=WqXggBWgw7gkEDeShfBPU+KuRKmfDdDIjyx6803mXfKuR3KqiJoqGbjKCrxswU18NI v7/7rV4l20ekQVtgiWGxwwaVNM1wMcQWydhQuKU2di7RryIcbC7BZAHD+fkXXuXBsO+f kjE42748uzUD0b8jXbVzelH47lgGs6ddWJ4oBEVJRJzOYs5Lt8RpJ91FCrF1CcGQtKnY m9TSRa05nNzRzIUvaYo5z2Ie81ec4GHVTdqfjxwzopOz03XPMq70VvdPVX5naAbs0DKD socJaEWXu3BpJmDkCb/jlraihRvvZ5C9hpghlt7RsyO7hNm3yb5tPEO5vs5EFIZMX5OF NhQg== X-Gm-Message-State: AIkVDXIMa0g1+w2URtG+fPjPGR30S4tsSLm9nk0gqC8FhZkFB3ZIkv7M4ZOCFR/4VvELVg== X-Received: by 10.223.161.158 with SMTP id u30mr23616931wru.152.1485875250141; Tue, 31 Jan 2017 07:07:30 -0800 (PST) Received: from brick (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id u198sm24316127wmf.9.2017.01.31.07.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 07:07:29 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 31 Jan 2017 15:07:27 +0000 From: Edward Tomasz Napierala To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20170131150727.GA8617@brick> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201701301257.v0UCvNrK065993@repo.freebsd.org> <20170130230200.GD2611@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170130230200.GD2611@FreeBSD.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:07:34 -0000 On 0130T1502, Gleb Smirnoff wrote: > On Mon, Jan 30, 2017 at 12:57:23PM +0000, Edward Tomasz Napierala wrote: > E> Author: trasz > E> Date: Mon Jan 30 12:57:22 2017 > E> New Revision: 312988 > E> URL: https://svnweb.freebsd.org/changeset/base/312988 > E> > E> Log: > E> Add kern_listen(), kern_shutdown(), and kern_socket(), and use them > E> instead of their sys_*() counterparts in various compats. The svr4 > E> is left untouched, because there's no point. > > Btw, any good reasons to keep SVR4 support for FreeBSD 12? I don't think so. However, I seem to remember there was an attempt to remove one of the compats some time ago, and it turned out there were still some people using it. So, I don't have plans to disconnect svr4, but I don't have plans to keep it up to date either. From owner-svn-src-head@freebsd.org Tue Jan 31 15:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB15ACCA2EB; Tue, 31 Jan 2017 15:10:43 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780E81DD1; Tue, 31 Jan 2017 15:10:43 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x243.google.com with SMTP id o65so4726185ybo.3; Tue, 31 Jan 2017 07:10:43 -0800 (PST) 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=2HyIpJzFgnNuNAr2fZ6q6tUeAYdtFKoC0YOkSbyQfv4=; b=oR9eZDcCEWd+5kuTTrFNBraZl+tg5CPQqUDL4MSlMZvEOZwIjJO4wF0xzgCLKQ5nnF LmfL1qaRqvx+WRkqNZBV4KnbSonH1oMLj4nrjXYebcbmVxw0o4xhif0WOzdQWYzlIMTw 5mmlnhY76FPCSQyhtvAA97dGKZanYn0IdoBLWCSfJNG0se0+meGLBO5r0L8ETJkBg5lz TfyP4+VEfuMmX5Skdw5AolOoD3eZo8HH6Fz6TiIFVgtqEUjAPJYt/vLi0CrWPztJJOYm PaeYEB/PIRX7TeQJQkrao9eoE/lgd4l4g3YZSjxjpnOnOOhi28qviDCSidmde9YPVOVr N+uA== 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=2HyIpJzFgnNuNAr2fZ6q6tUeAYdtFKoC0YOkSbyQfv4=; b=MUnr/LLykCnfmEaQlCYJHe+wzHWgHGB3jUmufIu9dK5+ORoKUF3Z2awvVmE+K1lWDk phBxmtXmleislCJgZ23V6y9gf4WEWzVEBJJpoezpHdw2Z2qiEkq/xwsP3yuHve384CAM ApCJV8atoNUH5Izcz/HeFE47fWJF8RegI3Px7O0Q2TyBbrk+lyDoHRgKsKj0ygSiTUgA PqIjPlzKPizJvr/yaf31RjU1xo0u26yRcIJdtW40JBZEV1BiC0oFe409YzFaxIzvOlNN dsRfbwacvClZU4+2iqItBQol4ur8pks3IRSS6d3ibDMogIYXSttLu1Ju74HxJI2EYEF4 vA5Q== X-Gm-Message-State: AIkVDXK2myjztSewA3VfuQdijjWfe+PHuSdE51LOYo0MaUZccUQd8m+wxt3RH4NNvraTpoJksL6PJVOo9cEzZQ== X-Received: by 10.37.105.76 with SMTP id e73mr14051796ybc.113.1485875442424; Tue, 31 Jan 2017 07:10:42 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.38.133 with HTTP; Tue, 31 Jan 2017 07:10:41 -0800 (PST) In-Reply-To: <201701310612.v0V6CqVL093451@repo.freebsd.org> References: <201701310612.v0V6CqVL093451@repo.freebsd.org> From: Alan Somers Date: Tue, 31 Jan 2017 08:10:41 -0700 X-Google-Sender-Auth: myT_ltXr67cUqusPQLeubDQP87w Message-ID: Subject: Re: svn commit: r313008 - head/tests/sys/geom/class/gate To: Ngie Cooper 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:10:43 -0000 I think wait_for_ggate_device should also be used at line 32, which calls "ggatec create". -Alan On Mon, Jan 30, 2017 at 11:12 PM, Ngie Cooper wrote: > Author: ngie > Date: Tue Jan 31 06:12:51 2017 > New Revision: 313008 > URL: https://svnweb.freebsd.org/changeset/base/313008 > > Log: > Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md} > > The test assumed that `ggatel create` created a device on completion, but that's > incorrect. This squashes the race by waiting for the device to appear, as > `ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called > with `-v`. > > Discussed with: asomers > MFC after: 1 week > PR: 204616 > Sponsored by: Dell EMC Isilon > > Modified: > head/tests/sys/geom/class/gate/ggate_test.sh > > Modified: head/tests/sys/geom/class/gate/ggate_test.sh > ============================================================================== > --- head/tests/sys/geom/class/gate/ggate_test.sh Tue Jan 31 03:40:13 2017 (r313007) > +++ head/tests/sys/geom/class/gate/ggate_test.sh Tue Jan 31 06:12:51 2017 (r313008) > @@ -74,7 +74,11 @@ ggatel_file_body() > > atf_check ggatel create -u $us work > > - dd if=src of=/dev/ggate${us} bs=1m count=1 conv=notrunc > + ggate_dev=/dev/ggate${us} > + > + wait_for_ggate_device ${ggate_dev} > + > + dd if=src of=${ggate_dev} bs=1m count=1 conv=notrunc > > checksum src work > } > @@ -104,7 +108,11 @@ ggatel_md_body() > > atf_check ggatel create -u $us /dev/$work > > - dd if=/dev/$src of=/dev/ggate${us} bs=1m count=1 conv=notrunc > + ggate_dev=/dev/ggate${us} > + > + wait_for_ggate_device ${ggate_dev} > + > + dd if=/dev/$src of=${ggate_dev} bs=1m count=1 conv=notrunc > > checksum /dev/$src /dev/$work > } > @@ -191,3 +199,14 @@ common_cleanup() > fi > true > } > + > +# Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` > +# isn't called with `-v`. > +wait_for_ggate_device() > +{ > + ggate_device=$1 > + > + while [ ! -c $ggate_device ]; do > + sleep 0.5 > + done > +} > From owner-svn-src-head@freebsd.org Tue Jan 31 15:11:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99DFDCCA38C; Tue, 31 Jan 2017 15:11:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA7E73; Tue, 31 Jan 2017 15:11:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VFBNh2012669; Tue, 31 Jan 2017 15:11:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VFBN6F012666; Tue, 31 Jan 2017 15:11:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701311511.v0VFBN6F012666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313015 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:11:24 -0000 Author: trasz Date: Tue Jan 31 15:11:23 2017 New Revision: 313015 URL: https://svnweb.freebsd.org/changeset/base/313015 Log: Add kern_cpuset_getid() and kern_cpuset_setid(), and use them in compat32 instead of their sub_*() counterparts. Reviewed by: jhb@, kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9382 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_cpuset.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 14:36:06 2017 (r313014) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:11:23 2017 (r313015) @@ -2556,27 +2556,18 @@ int freebsd32_cpuset_setid(struct thread *td, struct freebsd32_cpuset_setid_args *uap) { - struct cpuset_setid_args ap; - ap.which = uap->which; - ap.id = PAIR32TO64(id_t,uap->id); - ap.setid = uap->setid; - - return (sys_cpuset_setid(td, &ap)); + return (kern_cpuset_setid(td, uap->which, + PAIR32TO64(id_t, uap->id), uap->setid)); } int freebsd32_cpuset_getid(struct thread *td, struct freebsd32_cpuset_getid_args *uap) { - struct cpuset_getid_args ap; - - ap.level = uap->level; - ap.which = uap->which; - ap.id = PAIR32TO64(id_t,uap->id); - ap.setid = uap->setid; - return (sys_cpuset_getid(td, &ap)); + return (kern_cpuset_getid(td, uap->level, uap->which, + PAIR32TO64(id_t, uap->id), uap->setid)); } int Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Jan 31 14:36:06 2017 (r313014) +++ head/sys/kern/kern_cpuset.c Tue Jan 31 15:11:23 2017 (r313015) @@ -976,18 +976,26 @@ struct cpuset_setid_args { int sys_cpuset_setid(struct thread *td, struct cpuset_setid_args *uap) { + + return (kern_cpuset_setid(td, uap->which, uap->id, uap->setid)); +} + +int +kern_cpuset_setid(struct thread *td, cpuwhich_t which, + id_t id, cpusetid_t setid) +{ struct cpuset *set; int error; /* * Presently we only support per-process sets. */ - if (uap->which != CPU_WHICH_PID) + if (which != CPU_WHICH_PID) return (EINVAL); - set = cpuset_lookup(uap->setid, td); + set = cpuset_lookup(setid, td); if (set == NULL) return (ESRCH); - error = cpuset_setproc(uap->id, set, NULL); + error = cpuset_setproc(id, set, NULL); cpuset_rel(set); return (error); } @@ -1003,19 +1011,28 @@ struct cpuset_getid_args { int sys_cpuset_getid(struct thread *td, struct cpuset_getid_args *uap) { + + return (kern_cpuset_getid(td, uap->level, uap->which, uap->id, + uap->setid)); +} + +int +kern_cpuset_getid(struct thread *td, cpulevel_t level, cpuwhich_t which, + id_t id, cpusetid_t *setid) +{ struct cpuset *nset; struct cpuset *set; struct thread *ttd; struct proc *p; - cpusetid_t id; + cpusetid_t tmpid; int error; - if (uap->level == CPU_LEVEL_WHICH && uap->which != CPU_WHICH_CPUSET) + if (level == CPU_LEVEL_WHICH && which != CPU_WHICH_CPUSET) return (EINVAL); - error = cpuset_which(uap->which, uap->id, &p, &ttd, &set); + error = cpuset_which(which, id, &p, &ttd, &set); if (error) return (error); - switch (uap->which) { + switch (which) { case CPU_WHICH_TID: case CPU_WHICH_PID: thread_lock(ttd); @@ -1030,7 +1047,7 @@ sys_cpuset_getid(struct thread *td, stru case CPU_WHICH_DOMAIN: return (EINVAL); } - switch (uap->level) { + switch (level) { case CPU_LEVEL_ROOT: nset = cpuset_refroot(set); cpuset_rel(set); @@ -1041,10 +1058,10 @@ sys_cpuset_getid(struct thread *td, stru case CPU_LEVEL_WHICH: break; } - id = set->cs_id; + tmpid = set->cs_id; cpuset_rel(set); if (error == 0) - error = copyout(&id, uap->setid, sizeof(id)); + error = copyout(&tmpid, setid, sizeof(id)); return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Jan 31 14:36:06 2017 (r313014) +++ head/sys/sys/syscallsubr.h Tue Jan 31 15:11:23 2017 (r313015) @@ -86,6 +86,10 @@ int kern_clock_settime(struct thread *td int kern_close(struct thread *td, int fd); int kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); +int kern_cpuset_getid(struct thread *td, cpulevel_t level, + cpuwhich_t which, id_t id, cpusetid_t *setid); +int kern_cpuset_setid(struct thread *td, cpuwhich_t which, + id_t id, cpusetid_t setid); int kern_dup(struct thread *td, u_int mode, int flags, int old, int new); int kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p); From owner-svn-src-head@freebsd.org Tue Jan 31 15:19:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 653A4CCA8A1; Tue, 31 Jan 2017 15:19:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1998BA08; Tue, 31 Jan 2017 15:19:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VFJjke013034; Tue, 31 Jan 2017 15:19:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VFJjTI013032; Tue, 31 Jan 2017 15:19:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701311519.v0VFJjTI013032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313016 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:19:46 -0000 Author: trasz Date: Tue Jan 31 15:19:44 2017 New Revision: 313016 URL: https://svnweb.freebsd.org/changeset/base/313016 Log: Replace calls to sys_truncate() with kern_truncate(). Reviewed by: kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9371 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:11:23 2017 (r313015) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:19:44 2017 (r313016) @@ -1500,11 +1500,9 @@ freebsd32_lseek(struct thread *td, struc int freebsd32_truncate(struct thread *td, struct freebsd32_truncate_args *uap) { - struct truncate_args ap; - ap.path = uap->path; - ap.length = PAIR32TO64(off_t,uap->length); - return (sys_truncate(td, &ap)); + return (kern_truncate(td, uap->path, UIO_USERSPACE, + PAIR32TO64(off_t, uap->length))); } int @@ -1600,11 +1598,9 @@ freebsd6_freebsd32_lseek(struct thread * int freebsd6_freebsd32_truncate(struct thread *td, struct freebsd6_freebsd32_truncate_args *uap) { - struct truncate_args ap; - ap.path = uap->path; - ap.length = PAIR32TO64(off_t,uap->length); - return (sys_truncate(td, &ap)); + return (kern_truncate(td, uap->path, UIO_USERSPACE, + PAIR32TO64(off_t, uap->length))); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Jan 31 15:11:23 2017 (r313015) +++ head/sys/kern/vfs_syscalls.c Tue Jan 31 15:19:44 2017 (r313016) @@ -3310,22 +3310,10 @@ struct otruncate_args { }; #endif int -otruncate(td, uap) - struct thread *td; - register struct otruncate_args /* { - char *path; - long length; - } */ *uap; +otruncate(struct thread *td, struct otruncate_args *uap) { - struct truncate_args /* { - char *path; - int pad; - off_t length; - } */ nuap; - - nuap.path = uap->path; - nuap.length = uap->length; - return (sys_truncate(td, &nuap)); + + return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length)); } #endif /* COMPAT_43 */ @@ -3334,11 +3322,8 @@ otruncate(td, uap) int freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap) { - struct truncate_args ouap; - ouap.path = uap->path; - ouap.length = uap->length; - return (sys_truncate(td, &ouap)); + return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length)); } int From owner-svn-src-head@freebsd.org Tue Jan 31 15:22:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38EA7CCAB1F; Tue, 31 Jan 2017 15:22:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07214F47; Tue, 31 Jan 2017 15:22:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VFMq34016830; Tue, 31 Jan 2017 15:22:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VFMqna016829; Tue, 31 Jan 2017 15:22:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701311522.v0VFMqna016829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313017 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:22:53 -0000 Author: trasz Date: Tue Jan 31 15:22:51 2017 New Revision: 313017 URL: https://svnweb.freebsd.org/changeset/base/313017 Log: Fix linux_getppid() to debug the actual parent, even it was reparented by debugger. Reviewed by: dchagin@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9361 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Jan 31 15:19:44 2017 (r313016) +++ head/sys/compat/linux/linux_misc.c Tue Jan 31 15:22:51 2017 (r313017) @@ -1733,9 +1733,7 @@ linux_getppid(struct thread *td, struct printf(ARGS(getppid, "")); #endif - PROC_LOCK(td->td_proc); - td->td_retval[0] = td->td_proc->p_pptr->p_pid; - PROC_UNLOCK(td->td_proc); + td->td_retval[0] = kern_getppid(td); return (0); } From owner-svn-src-head@freebsd.org Tue Jan 31 15:35:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF3DCC81FF; Tue, 31 Jan 2017 15:35:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1B601EF9; Tue, 31 Jan 2017 15:35:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VFZJF5022193; Tue, 31 Jan 2017 15:35:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VFZIlE022189; Tue, 31 Jan 2017 15:35:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701311535.v0VFZIlE022189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313018 - in head/sys: compat/freebsd32 compat/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:35:20 -0000 Author: trasz Date: Tue Jan 31 15:35:18 2017 New Revision: 313018 URL: https://svnweb.freebsd.org/changeset/base/313018 Log: Add kern_pread() and kern_pwrite(), and use it in compats instead of their sys_*() counterparts. The svr4 is left unchanged. Reviewed by: kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9379 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_file.c head/sys/kern/sys_generic.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:22:51 2017 (r313017) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:35:18 2017 (r313018) @@ -1452,25 +1452,17 @@ freebsd4_freebsd32_fhstatfs(struct threa int freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap) { - struct pread_args ap; - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = PAIR32TO64(off_t,uap->offset); - return (sys_pread(td, &ap)); + return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, + PAIR32TO64(off_t, uap->offset))); } int freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap) { - struct pwrite_args ap; - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = PAIR32TO64(off_t,uap->offset); - return (sys_pwrite(td, &ap)); + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, + PAIR32TO64(off_t, uap->offset))); } #ifdef COMPAT_43 @@ -1559,25 +1551,17 @@ freebsd32_getdirentries(struct thread *t int freebsd6_freebsd32_pread(struct thread *td, struct freebsd6_freebsd32_pread_args *uap) { - struct pread_args ap; - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = PAIR32TO64(off_t,uap->offset); - return (sys_pread(td, &ap)); + return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, + PAIR32TO64(off_t, uap->offset))); } int freebsd6_freebsd32_pwrite(struct thread *td, struct freebsd6_freebsd32_pwrite_args *uap) { - struct pwrite_args ap; - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = PAIR32TO64(off_t,uap->offset); - return (sys_pwrite(td, &ap)); + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, + PAIR32TO64(off_t, uap->offset))); } int Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Tue Jan 31 15:22:51 2017 (r313017) +++ head/sys/compat/linux/linux_file.c Tue Jan 31 15:35:18 2017 (r313018) @@ -997,20 +997,13 @@ linux_fdatasync(td, uap) } int -linux_pread(td, uap) - struct thread *td; - struct linux_pread_args *uap; +linux_pread(struct thread *td, struct linux_pread_args *uap) { - struct pread_args bsd; cap_rights_t rights; struct vnode *vp; int error; - bsd.fd = uap->fd; - bsd.buf = uap->buf; - bsd.nbyte = uap->nbyte; - bsd.offset = uap->offset; - error = sys_pread(td, &bsd); + error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset); if (error == 0) { /* This seems to violate POSIX but linux does it */ error = fgetvp(td, uap->fd, @@ -1027,17 +1020,10 @@ linux_pread(td, uap) } int -linux_pwrite(td, uap) - struct thread *td; - struct linux_pwrite_args *uap; -{ - struct pwrite_args bsd; - - bsd.fd = uap->fd; - bsd.buf = uap->buf; - bsd.nbyte = uap->nbyte; - bsd.offset = uap->offset; - return (sys_pwrite(td, &bsd)); +linux_pwrite(struct thread *td, struct linux_pwrite_args *uap) +{ + + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); } int Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Tue Jan 31 15:22:51 2017 (r313017) +++ head/sys/kern/sys_generic.c Tue Jan 31 15:35:18 2017 (r313018) @@ -220,39 +220,37 @@ struct pread_args { }; #endif int -sys_pread(td, uap) - struct thread *td; - struct pread_args *uap; +sys_pread(struct thread *td, struct pread_args *uap) +{ + + return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); +} + +int +kern_pread(struct thread *td, int fd, void *buf, size_t nbyte, off_t offset) { struct uio auio; struct iovec aiov; int error; - if (uap->nbyte > IOSIZE_MAX) + if (nbyte > IOSIZE_MAX) return (EINVAL); - aiov.iov_base = uap->buf; - aiov.iov_len = uap->nbyte; + aiov.iov_base = buf; + aiov.iov_len = nbyte; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; - auio.uio_resid = uap->nbyte; + auio.uio_resid = nbyte; auio.uio_segflg = UIO_USERSPACE; - error = kern_preadv(td, uap->fd, &auio, uap->offset); - return(error); + error = kern_preadv(td, fd, &auio, offset); + return (error); } #if defined(COMPAT_FREEBSD6) int -freebsd6_pread(td, uap) - struct thread *td; - struct freebsd6_pread_args *uap; +freebsd6_pread(struct thread *td, struct freebsd6_pread_args *uap) { - struct pread_args oargs; - oargs.fd = uap->fd; - oargs.buf = uap->buf; - oargs.nbyte = uap->nbyte; - oargs.offset = uap->offset; - return (sys_pread(td, &oargs)); + return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); } #endif @@ -435,39 +433,38 @@ struct pwrite_args { }; #endif int -sys_pwrite(td, uap) - struct thread *td; - struct pwrite_args *uap; +sys_pwrite(struct thread *td, struct pwrite_args *uap) +{ + + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); +} + +int +kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte, + off_t offset) { struct uio auio; struct iovec aiov; int error; - if (uap->nbyte > IOSIZE_MAX) + if (nbyte > IOSIZE_MAX) return (EINVAL); - aiov.iov_base = (void *)(uintptr_t)uap->buf; - aiov.iov_len = uap->nbyte; + aiov.iov_base = (void *)(uintptr_t)buf; + aiov.iov_len = nbyte; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; - auio.uio_resid = uap->nbyte; + auio.uio_resid = nbyte; auio.uio_segflg = UIO_USERSPACE; - error = kern_pwritev(td, uap->fd, &auio, uap->offset); + error = kern_pwritev(td, fd, &auio, offset); return(error); } #if defined(COMPAT_FREEBSD6) int -freebsd6_pwrite(td, uap) - struct thread *td; - struct freebsd6_pwrite_args *uap; +freebsd6_pwrite(struct thread *td, struct freebsd6_pwrite_args *uap) { - struct pwrite_args oargs; - oargs.fd = uap->fd; - oargs.buf = uap->buf; - oargs.nbyte = uap->nbyte; - oargs.offset = uap->offset; - return (sys_pwrite(td, &oargs)); + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); } #endif Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Jan 31 15:22:51 2017 (r313017) +++ head/sys/sys/syscallsubr.h Tue Jan 31 15:35:18 2017 (r313018) @@ -171,11 +171,15 @@ int kern_posix_fallocate(struct thread * off_t len); int kern_procctl(struct thread *td, enum idtype idtype, id_t id, int com, void *data); +int kern_pread(struct thread *td, int fd, void *buf, size_t nbyte, + off_t offset); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); int kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data); +int kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte, + off_t offset); int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset); int kern_readlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, char *buf, enum uio_seg bufseg, size_t count); From owner-svn-src-head@freebsd.org Tue Jan 31 15:37:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69150CC8288; Tue, 31 Jan 2017 15:37:34 +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 17E5BF2; Tue, 31 Jan 2017 15:37:33 +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 6BCFE104D0EB; Wed, 1 Feb 2017 02:37:02 +1100 (AEDT) Date: Wed, 1 Feb 2017 02:36:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: <20170131175309.N1418@besplex.bde.org> Message-ID: <20170201005009.E2504@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=e7l4R82dM9Md61vNAUYA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:37:34 -0000 On Tue, 31 Jan 2017, Bruce Evans wrote: > On Mon, 30 Jan 2017, Conrad Meyer wrote: > >> On Mon, Jan 30, 2017 at 9:26 PM, Bruce Evans wrote: >>> On Tue, 31 Jan 2017, Conrad E. Meyer wrote: >>> >>>> Log: >>>> calculate_crc32c: Add SSE4.2 implementation on x86 >>> >>> This breaks building with gcc-4.2.1, >> >> gcc-4.2.1 is an ancient compiler. Good riddance. > > I prefer it. It also works better on ordinary asms for crc32. >>>> Added: head/sys/libkern/x86/crc32_sse42.c >>>> >>>> ============================================================================== >>>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>>> +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 >>>> (r313006) >>>> + >>>> +#include >>> >>> ... >>> >>> Inline asm is much less unportable than intrinsics. kib used the correct >>> method of .byte's in asms to avoid depending on assembler support for >>> newer >>> instructions. .byte is still used for clflush on amd64 and i386. It >>> used to be used for invpcid on amd64. I can't find where it is or was >>> used for xsave stuff. >> >> Konstantin predicted this complaint in code review (phabricator). >> Unfortunately, Clang does not automatically unroll asms, even with the >> correct mnemonic. Unrolling is essential to performance below the >> by-3 block size (768 bytes in this implementation). Hand unrolling in >> C seems to generate less efficient assembly than the compiler's >> unrolling. > > Unorolling is almost completely useless if the instruction takes 3 cycles > like you said it does. The loop calculations run much faster than that, > so they can run in parallel. However, clang generates horrible code for > inline asms instead of intrinsics. The unrolling was worse than useless (see previous reply). It is the horrible code in the non-intrinsics case that seems to be the main source of differences (see below). >> The left column below is block size. The measurements are nanoseconds >> per buf, per CLOCK_VIRTUAL, averaged over 10^5 loops. These numbers >> do not vary more than +/- 1ns run to run on my idle Sandy Bridge >> laptop. "asm" is using __asm__(), "intrins" using the _mm_crc32 >> intrinsics that Clang can unroll, and multitable is the older >> lookup-table implementation (still used on other architectures). >> >> 0x000010: asm:0 intrins:0 multitable:0 (ns per buf) >> 0x000020: asm:7 intrins:9 multitable:78 (ns per buf) >> 0x000040: asm:10 intrins:7 multitable:50 (ns per buf) >> 0x000080: asm:15 intrins:9 multitable:91 (ns per buf) >> 0x000100: asm:25 intrins:17 multitable:178 (ns per buf) >> 0x000200: asm:55 intrins:38 multitable:347 (ns per buf) >> 0x000400: asm:61 intrins:62 multitable:684 (ns per buf) >> >> Both implementations are superior to the multitable approach, so it is >> unreasonable not to make one of them standard on x86 platforms. >> >> The unrolled intrinsics are consistently better than not unrolled on >> objects 0x40-0x200 bytes large. At 0x400 bytes we pass the first >> unroll-by-3 threshold and it stops mattering as much. >> >> At 0x40 bytes, it is the difference between 6.4 GB/s and 9.1 GB/s. At >> 0x200 bytes, it is the difference between 9.3 GB/s and 13.5 GB/s. I >> think this justifies some minor ugliness. > > If it matters, which I doubt, then the compiler shouldn't be trusted > for unrolling. It can only do better than handwritten unrolling if > it has tables for the correct amount unrolling for every instruction > for thousands of CPUs (since such tables are too hard to write manually). It is the 3-way unrolling that makes the main difference. clang is clueless about unrolling in this function, but this 3-way unrolling is in the C code. It is to reduce dependencies. The timing seems to be as I suspected -- the crc32 instruction has a latency of 3 and a throughput of 3 per 3 cycles, so with 3 dependent instructions it runs 3 times slower than with 3 independent instructions. Naive unrolling gives more dependent instructions, so is equally slow to no unrolling. Test program for this: X #include X #include X X #ifndef __clang__ Change this to __clang__X to kill intrinsics for clang. X static __inline uint32_t X _mm_crc32_u8(uint32_t x, uint8_t y) X { X __asm("crc32b %1,%0" : "+r" (x) : "rm" (y)); X return (x); X } X X static __inline uint32_t __unused X _mm_crc32_u32(uint32_t x, int32_t y) X { X __asm("crc32l %1,%0" : "+r" (x) : "rm" (y)); X return (x); X } X X #ifdef __amd64__ X static __inline uint64_t X _mm_crc32_u64(uint64_t x, int64_t y) X { X __asm("crc32q %1,%0" : "+r" (x) : "rm" (y)); X return (x); X } X #endif X #else X #include X #endif X X #define MISALIGN 0 MISALIGN 1 costs about 4% (0.36 seconds instead of 0.34 seconds on freefall's Xeon). X #define SIZE 1000000 The large size of 1M is to bust at least the L1 cache. This makes little difference, since the speed is CPU-bound (0.34 seconds @ 3.3 GHz = ~34/33 cycles per crc32 instruction). Actually, I'm not sure about the speeds. freefalls's machdep.tsc_freq is 3.3GHz, but the speed could be anything due to turbo mode and frequency control (boot message give similarly useless values for the actual speed). The test accesses 10g bytes or 1.25g crc32 instructions and that if the instructions take 1 cycle each that is 0.38 seconds. I think I'm measuring the CPU speed and not L2 cache speed since SIZE 1000 fits in L1 and gives the same speed. X X uint8_t buf[MISALIGN + SIZE]; X X int X main(void) X { X uint64_t crc1, crc2, crc3, crc4, crc5, crc6, crc7, crc8; X int i, j; X X crc1 = 0; X crc2 = 0; X crc3 = 0; X for (i = 0; i < 10000; i++) X for (j = MISALIGN; j < MISALIGN SIZE; j += 24) { X crc1 = _mm_crc32_u64(crc1, *(uint64_t *)&buf[j + 0]); X crc2 = _mm_crc32_u64(crc2, *(uint64_t *)&buf[j + 8]); X crc3 = _mm_crc32_u64(crc3, *(uint64_t *)&buf[j + 16]); I tried up to 8-way unrolling, with up to 8 crcN's or 8 crc steps into crc1. 8 crcNs are no better than 3, and the common crc1 is always 3 times slower. X } X return (crc1 + crc2 + crc3 == 0 ? 0 : 1); Sloppy combination to get the result used. X } gcc generates the natural code for the inner loop and runs in 0.34 seconds: G .p2align 4,,7 G .L3: G #APP G crc32q buf(%rdx),%rsi G crc32q buf+8(%rdx),%rcx G crc32q buf+16(%rdx),%rax G #NO_APP G addq $24, %rdx G cmpq $1008, %rdx G jne .L3 clang with intrinsics unrolls twice and runs in 0.34 seconds: C .p2align 4, 0x90 C .LBB0_2: # %for.body3 C # Parent Loop BB0_1 Depth=1 C # => This Inner Loop Header: Depth=2 C crc32q buf(%rdi), %rcx C crc32q buf+8(%rdi), %rsi C crc32q buf+16(%rdi), %rdx C crc32q buf+24(%rdi), %rcx C crc32q buf+32(%rdi), %rsi C crc32q buf+40(%rdi), %rdx C addq $48, %rdi C cmpq $1000, %rdi # imm = 0x3E8 C jl .LBB0_2 clang without intrinsics generates a mess and runs in 0.43 seconds: C .p2align 4, 0x90 C .LBB0_2: # %for.body3 C # Parent Loop BB0_1 Depth=1 C # => This Inner Loop Header: Depth=2 C movq buf(%rdi), %rax C movq %rax, -24(%rbp) C #APP C crc32q -24(%rbp), %rcx C #NO_APP C movq buf+8(%rdi), %rax C movq %rax, -16(%rbp) C #APP C crc32q -16(%rbp), %rsi C #NO_APP C movq buf+16(%rdi), %rax C movq %rax, -8(%rbp) C #APP C crc32q -8(%rbp), %rdx C #NO_APP C addq $24, %rdi C cmpq $1000, %rdi # imm = 0x3E8 C jl .LBB0_2 Editing just this inner loop to the natural code gives a speed of 0.34 seconds. freefall's Xeon is just short of resources to execute the extra instructions. Using 4 independent crcN's didn't help, but using 8 gave a time of 0.36 seconds. This is very MD, but my Haswell runs at the same speed in cycles as freefall's Xeon. I just noticed that the kernel code has plenty comments about the 3/1 latency/throughput and related optimizations. Unrolling (or not) may be helpful or harmful for entry and exit code. I think there should by no alignment on entry -- just assume the buffer is aligned in the usual case, and only run 4% slower when it is misaligned. The exit code handles up to SHORT * 3 = 768 bytes, not up to 4 or 8 bytes or up to 3 times that like simpler algorithms. 768 is quite large, and the exit code is quite slow. It reduces 8 or 4 bytes at a time without any dependency reduction, and then 1 byte at a time. I don't understand the algorithm for joining crcs -- why doesn't it work to reduce to 12 or 24 bytes in the main loop? Your benchmarks mainly give results for the <= 768 bytes where most of the manual optimizations don't apply. Compiler optimizations are more likely to help there. So I looked more closely at the last 2 loop. clang indeed only unrolls the last one, only for the unreachable case with more than 8 bytes on amd64. Unrolling the previous one might be useful, but slight extra complexity apparently prevents this. In my test program, the hard-coded sizes allow the compiler to at least know that the unrolling is of reachable code. Bruce From owner-svn-src-head@freebsd.org Tue Jan 31 15:47:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2F6CC86F2; Tue, 31 Jan 2017 15:47:23 +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 0C48F9C2; Tue, 31 Jan 2017 15:47:22 +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 v0VFlIpn082793 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 31 Jan 2017 17:47:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0VFlIpn082793 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0VFlH5i082792; Tue, 31 Jan 2017 17:47:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 31 Jan 2017 17:47:17 +0200 From: Konstantin Belousov To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20170131154717.GV3018@kib.kiev.ua> References: <201701301257.v0UCvNrK065993@repo.freebsd.org> <20170130230200.GD2611@FreeBSD.org> <20170131150727.GA8617@brick> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170131150727.GA8617@brick> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:47:23 -0000 On Tue, Jan 31, 2017 at 03:07:27PM +0000, Edward Tomasz Napierala wrote: > On 0130T1502, Gleb Smirnoff wrote: > > On Mon, Jan 30, 2017 at 12:57:23PM +0000, Edward Tomasz Napierala wrote: > > E> Author: trasz > > E> Date: Mon Jan 30 12:57:22 2017 > > E> New Revision: 312988 > > E> URL: https://svnweb.freebsd.org/changeset/base/312988 > > E> > > E> Log: > > E> Add kern_listen(), kern_shutdown(), and kern_socket(), and use them > > E> instead of their sys_*() counterparts in various compats. The svr4 > > E> is left untouched, because there's no point. > > > > Btw, any good reasons to keep SVR4 support for FreeBSD 12? > > I don't think so. However, I seem to remember there was an attempt > to remove one of the compats some time ago, and it turned out there were > still some people using it. So, I don't have plans to disconnect svr4, > but I don't have plans to keep it up to date either. > SVr4 is barely useful, but still connected to the build. iBCS2, on the other hand, was used by many people: I can claim it because I usually got more than one report for a regression in that code when core parts of the kernel change. I did some improvements for iBCS2 previous summer, both to better fit it into current kernel code, and fix outstanding bugs, biggest of which was incompatible signal frame layout. But there were concerns that the work required an approval from the SCO copyright owners, and we were unable to get a clearing. As result, iBCS2 emulator was disconnected from the build for 11 and HEAD. It would be somewhat pity to kill it because it is useful for many people, but we cannot update the code safely. There is no such concern for SVr4. From owner-svn-src-head@freebsd.org Tue Jan 31 16:12:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3717ACC8DF1; Tue, 31 Jan 2017 16:12:33 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C1C11852; Tue, 31 Jan 2017 16:12:32 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VGCWin038610; Tue, 31 Jan 2017 16:12:32 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VGCVsd038606; Tue, 31 Jan 2017 16:12:31 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201701311612.v0VGCVsd038606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Tue, 31 Jan 2017 16:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313019 - in head/sys: dev/e1000 dev/vnic net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 16:12:33 -0000 Author: stevek Date: Tue Jan 31 16:12:31 2017 New Revision: 313019 URL: https://svnweb.freebsd.org/changeset/base/313019 Log: Add the folowing set accessor functions for recently-added members of ifnet structure: if_gethwtsomax(), if_sethwtsomax() - if_hw_tsomax if_gethwtsomaxsegcount(), if_sethwtsomaxsegcount() - if_hw_tsomaxsegcount if_gethwtsomaxsegsize(), if_sethwtsomaxsegsize() - if_hw_tsomaxsegsize Update em and vnic drivers which had already been coverted to use accessor functions for the other ifnet structure members. Reviewed by: erj Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8544 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/vnic/nicvf_main.c head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jan 31 15:35:18 2017 (r313018) +++ head/sys/dev/e1000/if_em.c Tue Jan 31 16:12:31 2017 (r313019) @@ -2481,10 +2481,10 @@ em_setup_interface(if_ctx_t ctx) INIT_DEBUGOUT("em_setup_interface: begin"); /* TSO parameters */ - ifp->if_hw_tsomax = IP_MAXPACKET; + if_sethwtsomax(ifp, IP_MAXPACKET); /* Take m_pullup(9)'s in em_xmit() w/ TSO into acount. */ - ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER - 5; - ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; + if_sethwtsomaxsegcount(ifp, EM_MAX_SCATTER - 5); + if_sethwtsomaxsegsize(ifp, EM_TSO_SEG_SIZE); /* Single Queue */ if (adapter->tx_num_queues == 1) { Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Tue Jan 31 15:35:18 2017 (r313018) +++ head/sys/dev/vnic/nicvf_main.c Tue Jan 31 16:12:31 2017 (r313019) @@ -370,9 +370,9 @@ nicvf_setup_ifnet(struct nicvf *nic) /* TSO */ if_setcapabilitiesbit(ifp, IFCAP_TSO4, 0); /* TSO parameters */ - ifp->if_hw_tsomax = NICVF_TSO_MAXSIZE; - ifp->if_hw_tsomaxsegcount = NICVF_TSO_NSEGS; - ifp->if_hw_tsomaxsegsize = MCLBYTES; + if_sethwtsomax(ifp, NICVF_TSO_MAXSIZE); + if_sethwtsomaxsegcount(ifp, NICVF_TSO_NSEGS); + if_sethwtsomaxsegsize(ifp, MCLBYTES); } /* IP/TCP/UDP HW checksums */ if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); @@ -453,7 +453,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long #if defined(INET) || defined(INET6) /* Avoid reinitialization unless it's necessary */ if (avoid_reset) { - ifp->if_flags |= IFF_UP; + if_setflagbits(ifp, IFF_UP, 0); if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) nicvf_if_init(nic); #ifdef INET @@ -482,8 +482,8 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long NICVF_CORE_LOCK(nic); if (if_getflags(ifp) & IFF_UP) { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { - flags = ifp->if_flags ^ nic->if_flags; - if ((nic->if_flags & ifp->if_flags) & + flags = if_getflags(ifp) ^ nic->if_flags; + if ((nic->if_flags & if_getflags(ifp)) & IFF_PROMISC) { /* Change promiscous mode */ #if 0 @@ -492,7 +492,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long #endif } - if ((nic->if_flags ^ ifp->if_flags) & + if ((nic->if_flags ^ if_getflags(ifp)) & IFF_ALLMULTI) { /* Change multicasting settings */ #if 0 @@ -506,7 +506,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long } else if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) nicvf_stop_locked(nic); - nic->if_flags = ifp->if_flags; + nic->if_flags = if_getflags(ifp); NICVF_CORE_UNLOCK(nic); break; @@ -528,24 +528,24 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long break; case SIOCSIFCAP: - mask = ifp->if_capenable ^ ifr->ifr_reqcap; + mask = if_getcapenable(ifp) ^ ifr->ifr_reqcap; if (mask & IFCAP_VLAN_MTU) { /* No work to do except acknowledge the change took. */ - ifp->if_capenable ^= IFCAP_VLAN_MTU; + if_togglecapenable(ifp, IFCAP_VLAN_MTU); } if (mask & IFCAP_TXCSUM) - ifp->if_capenable ^= IFCAP_TXCSUM; + if_togglecapenable(ifp, IFCAP_TXCSUM); if (mask & IFCAP_RXCSUM) - ifp->if_capenable ^= IFCAP_RXCSUM; + if_togglecapenable(ifp, IFCAP_RXCSUM); if ((mask & IFCAP_TSO4) && nic->hw_tso) - ifp->if_capenable ^= IFCAP_TSO4; + if_togglecapenable(ifp, IFCAP_TSO4); if (mask & IFCAP_LRO) { /* * Lock the driver for a moment to avoid * mismatch in per-queue settings. */ NICVF_CORE_LOCK(nic); - ifp->if_capenable ^= IFCAP_LRO; + if_togglecapenable(ifp, IFCAP_LRO); if ((if_getdrvflags(nic->ifp) & IFF_DRV_RUNNING) != 0) { /* * Now disable LRO for subsequent packets. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jan 31 15:35:18 2017 (r313018) +++ head/sys/net/if.c Tue Jan 31 16:12:31 2017 (r313019) @@ -4103,6 +4103,51 @@ if_vlancap(if_t ifh) VLAN_CAPABILITIES(ifp); } +int +if_sethwtsomax(if_t ifp, u_int if_hw_tsomax) +{ + + ((struct ifnet *)ifp)->if_hw_tsomax = if_hw_tsomax; + return (0); +} + +int +if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount) +{ + + ((struct ifnet *)ifp)->if_hw_tsomaxsegcount = if_hw_tsomaxsegcount; + return (0); +} + +int +if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize) +{ + + ((struct ifnet *)ifp)->if_hw_tsomaxsegsize = if_hw_tsomaxsegsize; + return (0); +} + +u_int +if_gethwtsomax(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomax); +} + +u_int +if_gethwtsomaxsegcount(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomaxsegcount); +} + +u_int +if_gethwtsomaxsegsize(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomaxsegsize); +} + void if_setinitfn(if_t ifp, void (*init_fn)(void *)) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Jan 31 15:35:18 2017 (r313018) +++ head/sys/net/if_var.h Tue Jan 31 16:12:31 2017 (r313019) @@ -658,6 +658,12 @@ int if_getflags(if_t ifp); int if_sendq_empty(if_t ifp); int if_setsendqready(if_t ifp); int if_setsendqlen(if_t ifp, int tx_desc_count); +int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax); +int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount); +int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize); +u_int if_gethwtsomax(if_t ifp); +u_int if_gethwtsomaxsegcount(if_t ifp); +u_int if_gethwtsomaxsegsize(if_t ifp); int if_input(if_t ifp, struct mbuf* sendmp); int if_sendq_prepend(if_t ifp, struct mbuf *m); struct mbuf *if_dequeue(if_t ifp); From owner-svn-src-head@freebsd.org Tue Jan 31 18:48:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C09CCC9F64; Tue, 31 Jan 2017 18:48:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (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 2D39B1BB4; Tue, 31 Jan 2017 18:48:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f54.google.com with SMTP id b65so1384218wmf.0; Tue, 31 Jan 2017 10:48:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=rxudrZZz9kFFXO9BqDqkZb124+bR2aD1NiGyuvKQ9BM=; b=f9fyiVi1UaTMAct9h+H0/MgPOqovY7FHKhcN5t3nIUnLujyeU1/Z08pTbq5dtXqMtw RTd53UpI0FNYQ6skftszCTYbZUbhJ7qSvLcCKteGcYuVtT0jfzUNCjjta+ll3fxgBDob pIdHDVITwC9cBGK/2edFVk8YtVVgKIgScmMP/oDxDDsIx1/44FxKNGolQ2CKsABZcxXm kQxtlZqRNaeoAzkjEam9vYpNU7nKkPHSeKDLzd80QWeRDvLO2GHKokRGabwuZ7LI+S2w lOu+6ykXTH6E1dP72xBBKEYdN2azfzC+uQZB8oWJnK3i6YtJt1Om+KCE7+qbtY5K8jZq n/Mw== X-Gm-Message-State: AIkVDXJ0dVdGv9UzKa0kL4V11yKnkXmhw4pho3PkdlfmT4GHvLB22p0vwmVt1ykjeOkz9g== X-Received: by 10.223.148.2 with SMTP id 2mr27184251wrq.75.1485882914317; Tue, 31 Jan 2017 09:15:14 -0800 (PST) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com. [74.125.82.48]) by smtp.gmail.com with ESMTPSA id 8sm33366640wmg.1.2017.01.31.09.15.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 09:15:14 -0800 (PST) Received: by mail-wm0-f48.google.com with SMTP id c85so270054213wmi.1; Tue, 31 Jan 2017 09:15:14 -0800 (PST) X-Received: by 10.223.177.202 with SMTP id r10mr24559020wra.94.1485882913947; Tue, 31 Jan 2017 09:15:13 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.22.42 with HTTP; Tue, 31 Jan 2017 09:15:13 -0800 (PST) In-Reply-To: <20170201005009.E2504@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> From: Conrad Meyer Date: Tue, 31 Jan 2017 09:15:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 18:48:17 -0000 On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans wrote: > On Tue, 31 Jan 2017, Bruce Evans wrote: > Unrolling (or not) may be helpful or harmful for entry and exit code. Helpful, per my earlier benchmarks. > I > think there should by no alignment on entry -- just assume the buffer is > aligned in the usual case, and only run 4% slower when it is misaligned. Please write such a patch and demonstrate the improvement. > The exit code handles up to SHORT * 3 =3D 768 bytes, not up to 4 or 8 > bytes or up to 3 times that like simpler algorithms. 768 is quite > large, and the exit code is quite slow. It reduces 8 or 4 bytes at a > time without any dependency reduction, and then 1 byte at a time. Yes, this is the important loop to unroll for small inputs. Somehow with the unrolling, it is only ~19% slower than the by-3 algorithm on my system =E2=80=94 not 66%. Clang 3.9.1 unrolls both of these trailing loops; here is the first: 0x0000000000401b88 <+584>: cmp $0x38,%rbx 0x0000000000401b8c <+588>: jae 0x401b93 0x0000000000401b8e <+590>: mov %rsi,%rdx 0x0000000000401b91 <+593>: jmp 0x401be1 0x0000000000401b93 <+595>: lea -0x1(%rdi),%rbx 0x0000000000401b97 <+599>: sub %rdx,%rbx 0x0000000000401b9a <+602>: mov %rsi,%rdx 0x0000000000401b9d <+605>: nopl (%rax) 0x0000000000401ba0 <+608>: crc32q (%rdx),%rax 0x0000000000401ba6 <+614>: crc32q 0x8(%rdx),%rax 0x0000000000401bad <+621>: crc32q 0x10(%rdx),%rax 0x0000000000401bb4 <+628>: crc32q 0x18(%rdx),%rax 0x0000000000401bbb <+635>: crc32q 0x20(%rdx),%rax 0x0000000000401bc2 <+642>: crc32q 0x28(%rdx),%rax 0x0000000000401bc9 <+649>: crc32q 0x30(%rdx),%rax 0x0000000000401bd0 <+656>: crc32q 0x38(%rdx),%rax 0x0000000000401bd7 <+663>: add $0x40,%rdx 0x0000000000401bdb <+667>: add $0x8,%rbx 0x0000000000401bdf <+671>: jne 0x401ba0 > I > don't understand the algorithm for joining crcs -- why doesn't it work > to reduce to 12 or 24 bytes in the main loop? It would, but I haven't implemented or tested that. You're welcome to do so and demonstrate an improvement. It does add more lookup table bloat, but perhaps we could just remove the 3x8k table =E2=80=94 I'm not su= re it adds any benefit over the 3x256 table. > Your benchmarks mainly give results for the <=3D 768 bytes where most of > the manual optimizations don't apply. 0x000400: asm:68 intrins:62 multitable:684 (ns per buf) 0x000800: asm:132 intrins:133 (ns per buf) 0x002000: asm:449 intrins:446 (ns per buf) 0x008000: asm:1501 intrins:1497 (ns per buf) 0x020000: asm:5618 intrins:5609 (ns per buf) (All routines are in a separate compilation unit with no full-program optimization, as they are in the kernel.) > Compiler optimizations are more > likely to help there. So I looked more closely at the last 2 loop. > clang indeed only unrolls the last one, Not in 3.9.1. > only for the unreachable case > with more than 8 bytes on amd64. How is it unreachable? Best, Conrad From owner-svn-src-head@freebsd.org Tue Jan 31 18:54:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 454C2CCA186; Tue, 31 Jan 2017 18:54:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF678F0; Tue, 31 Jan 2017 18:54:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VIsEZV021095; Tue, 31 Jan 2017 18:54:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VIsEUO021094; Tue, 31 Jan 2017 18:54:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701311854.v0VIsEUO021094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 31 Jan 2017 18:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313020 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 18:54:15 -0000 Author: jhb Date: Tue Jan 31 18:54:13 2017 New Revision: 313020 URL: https://svnweb.freebsd.org/changeset/base/313020 Log: Fix a couple of issues with t4iov probe and attach. - Check for Chelsio vendor ID in probe routines. - Fail attach instead of faulting if pci_find_dbsf() doesn't find a device. PR: 216539 Reported by: asomers Tested by: Dave Baukus MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_iov.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Tue Jan 31 16:12:31 2017 (r313019) +++ head/sys/dev/cxgbe/t4_iov.c Tue Jan 31 18:54:13 2017 (r313020) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include "common/common.h" #include "t4_if.h" struct t4iov_softc { @@ -106,6 +107,9 @@ t4iov_probe(device_t dev) uint16_t d; size_t i; + if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + d = pci_get_device(dev); for (i = 0; i < nitems(t4iov_pciids); i++) { if (d == t4iov_pciids[i].device) { @@ -123,6 +127,9 @@ t5iov_probe(device_t dev) uint16_t d; size_t i; + if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + d = pci_get_device(dev); for (i = 0; i < nitems(t5iov_pciids); i++) { if (d == t5iov_pciids[i].device) { @@ -140,6 +147,9 @@ t6iov_probe(device_t dev) uint16_t d; size_t i; + if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + d = pci_get_device(dev); for (i = 0; i < nitems(t6iov_pciids); i++) { if (d == t6iov_pciids[i].device) { @@ -161,6 +171,8 @@ t4iov_attach(device_t dev) sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), 4); + if (sc->sc_main == NULL) + return (ENXIO); if (T4_IS_MAIN_READY(sc->sc_main) == 0) return (t4iov_attach_child(dev)); return (0); From owner-svn-src-head@freebsd.org Tue Jan 31 19:09:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B27A7CCA8CD; Tue, 31 Jan 2017 19:09:07 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82496D60; Tue, 31 Jan 2017 19:09:07 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VJ96bJ025648; Tue, 31 Jan 2017 19:09:06 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VJ964x025647; Tue, 31 Jan 2017 19:09:06 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201701311909.v0VJ964x025647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 31 Jan 2017 19:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313021 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 19:09:07 -0000 Author: brd (doc,ports committer) Date: Tue Jan 31 19:09:06 2017 New Revision: 313021 URL: https://svnweb.freebsd.org/changeset/base/313021 Log: Force a few variables to be upper case when they are evaulated. This allows specifying, for example: CLOUDWARE=vagrant-vmware Approved by: re (gjb) Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Tue Jan 31 18:54:13 2017 (r313020) +++ head/release/Makefile.vm Tue Jan 31 19:09:06 2017 (r313021) @@ -58,8 +58,8 @@ cw-${_CW:tl}: env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ - -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \ - -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF} + -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW:tu}_FORMAT} \ + -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW:tu}IMAGE} -c ${${_CW}CONF} touch ${.TARGET} cw${_CW:tl}-package: From owner-svn-src-head@freebsd.org Tue Jan 31 20:13:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA5D3CCAFEB; Tue, 31 Jan 2017 20:13:51 +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 A8E291E56; Tue, 31 Jan 2017 20:13:51 +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 v0VKDoXh055370; Tue, 31 Jan 2017 20:13:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VKDocD055369; Tue, 31 Jan 2017 20:13:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701312013.v0VKDocD055369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 31 Jan 2017 20:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313025 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 20:13:52 -0000 Author: asomers Date: Tue Jan 31 20:13:50 2017 New Revision: 313025 URL: https://svnweb.freebsd.org/changeset/base/313025 Log: Add tests for multi-fib IPv6 routing PR: 196361 Submitted by: jhujhiti@adjectivism.org Reported by: Jason Healy MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/tests/sys/netinet/fibs_test.sh Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Tue Jan 31 19:17:06 2017 (r313024) +++ head/tests/sys/netinet/fibs_test.sh Tue Jan 31 20:13:50 2017 (r313025) @@ -75,9 +75,9 @@ arpresolve_checks_interface_fib_body() get_fibs 2 # Configure TAP interfaces - setup_tap "$FIB0" ${ADDR0} ${MASK0} + setup_tap "$FIB0" inet ${ADDR0} ${MASK0} TAP0=$TAP - setup_tap "$FIB1" ${ADDR1} ${MASK1} + setup_tap "$FIB1" inet ${ADDR1} ${MASK1} TAP1=$TAP # Simulate a crossover cable @@ -112,7 +112,7 @@ arpresolve_checks_interface_fib_cleanup( atf_test_case loopback_and_network_routes_on_nondefault_fib cleanup loopback_and_network_routes_on_nondefault_fib_head() { - atf_set "descr" "When creating and deleting loopback routes, use the interface's fib" + atf_set "descr" "When creating and deleting loopback IPv4 routes, use the interface's fib" atf_set "require.user" "root" atf_set "require.config" "fibs" } @@ -132,7 +132,7 @@ loopback_and_network_routes_on_nondefaul get_fibs 1 # Configure a TAP interface - setup_tap ${FIB0} ${ADDR} ${MASK} + setup_tap ${FIB0} inet ${ADDR} ${MASK} # Check whether the host route exists in only the correct FIB setfib ${FIB0} netstat -rn -f inet | grep -q "^${ADDR}.*UHS.*lo0" @@ -156,7 +156,7 @@ loopback_and_network_routes_on_nondefaul setfib 0 netstat -rn -f inet | \ grep -q "^${SUBNET}/${MASK}.*${TAPD}" if [ 0 -eq $? ]; then - setfib ${FIB0} netstat -rn -f inet + setfib 0 netstat -rn -f inet atf_fail "Network route appeared in the wrong FIB" fi } @@ -166,12 +166,70 @@ loopback_and_network_routes_on_nondefaul cleanup_tap } +atf_test_case loopback_and_network_routes_on_nondefault_fib_inet6 cleanup +loopback_and_network_routes_on_nondefault_fib_inet6_head() +{ + atf_set "descr" "When creating and deleting loopback IPv6 routes, use the interface's fib" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +loopback_and_network_routes_on_nondefault_fib_inet6_body() +{ + atf_expect_fail "PR196361 IPv6 network routes don't respect net.add_addr_allfibs=0" + # Configure the TAP interface to use a nonrouteable RFC3849 + # address and a non-default fib + ADDR="2001:db8::2" + SUBNET="2001:db8::" + MASK="64" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 1 + + # Configure a TAP interface + setup_tap ${FIB0} inet6 ${ADDR} ${MASK} + + # Check whether the host route exists in only the correct FIB + setfib ${FIB0} netstat -rn -f inet6 | grep -q "^${ADDR}.*UHS.*lo0" + if [ 0 -ne $? ]; then + setfib ${FIB0} netstat -rn -f inet6 + atf_fail "Host route did not appear in the correct FIB" + fi + setfib 0 netstat -rn -f inet6 | grep -q "^${ADDR}.*UHS.*lo0" + if [ 0 -eq $? ]; then + setfib 0 netstat -rn -f inet6 + atf_fail "Host route appeared in the wrong FIB" + fi + + # Check whether the network route exists in only the correct FIB + setfib ${FIB0} netstat -rn -f inet6 | \ + grep -q "^${SUBNET}/${MASK}.*${TAPD}" + if [ 0 -ne $? ]; then + setfib ${FIB0} netstat -rn -f inet6 + atf_fail "Network route did not appear in the correct FIB" + fi + setfib 0 netstat -rn -f inet6 | \ + grep -q "^${SUBNET}/${MASK}.*${TAPD}" + if [ 0 -eq $? ]; then + setfib 0 netstat -rn -f inet6 + atf_fail "Network route appeared in the wrong FIB" + fi +} + +loopback_and_network_routes_on_nondefault_fib_inet6_cleanup() +{ + cleanup_tap +} + # Regression test for kern/187552 atf_test_case default_route_with_multiple_fibs_on_same_subnet cleanup default_route_with_multiple_fibs_on_same_subnet_head() { - atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default routes" + atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv4 routes" atf_set "require.user" "root" atf_set "require.config" "fibs" } @@ -193,9 +251,9 @@ default_route_with_multiple_fibs_on_same get_fibs 2 # Configure TAP interfaces - setup_tap "$FIB0" ${ADDR0} ${MASK} + setup_tap "$FIB0" inet ${ADDR0} ${MASK} TAP0=$TAP - setup_tap "$FIB1" ${ADDR1} ${MASK} + setup_tap "$FIB1" inet ${ADDR1} ${MASK} TAP1=$TAP # Attempt to add default routes @@ -215,6 +273,53 @@ default_route_with_multiple_fibs_on_same cleanup_tap } +atf_test_case default_route_with_multiple_fibs_on_same_subnet_inet6 cleanup +default_route_with_multiple_fibs_on_same_subnet_inet6_head() +{ + atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv6 routes" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +default_route_with_multiple_fibs_on_same_subnet_inet6_body() +{ + # Configure the TAP interfaces to use nonrouteable RFC3849 + # addresses and non-default FIBs + ADDR0="2001:db8::2" + ADDR1="2001:db8::3" + GATEWAY="2001:db8::1" + SUBNET="2001:db8::" + MASK="64" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 2 + + # Configure TAP interfaces + setup_tap "$FIB0" inet6 ${ADDR0} ${MASK} + TAP0=$TAP + setup_tap "$FIB1" inet6 ${ADDR1} ${MASK} + TAP1=$TAP + + # Attempt to add default routes + setfib ${FIB0} route -6 add default ${GATEWAY} + setfib ${FIB1} route -6 add default ${GATEWAY} + + # Verify that the default route exists for both fibs, with their + # respective interfaces. + atf_check -o match:"^default.*${TAP0}$" \ + setfib ${FIB0} netstat -rn -f inet6 + atf_check -o match:"^default.*${TAP1}$" \ + setfib ${FIB1} netstat -rn -f inet6 +} + +default_route_with_multiple_fibs_on_same_subnet_inet6_cleanup() +{ + cleanup_tap +} + # Regression test for PR kern/189089 # Create two tap interfaces and assign them both the same IP address but with @@ -223,7 +328,7 @@ default_route_with_multiple_fibs_on_same atf_test_case same_ip_multiple_ifaces_fib0 cleanup same_ip_multiple_ifaces_fib0_head() { - atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface." + atf_set "descr" "Can remove an IPv4 alias from an interface when the same IPv4 is also assigned to another interface." atf_set "require.user" "root" atf_set "require.config" "fibs" } @@ -237,16 +342,16 @@ same_ip_multiple_ifaces_fib0_body() # of net.add_addr_allfibs # Setup the interfaces, then remove one alias. It should not panic. - setup_tap 0 ${ADDR} ${MASK0} + setup_tap 0 inet ${ADDR} ${MASK0} TAP0=${TAP} - setup_tap 0 ${ADDR} ${MASK1} + setup_tap 0 inet ${ADDR} ${MASK1} TAP1=${TAP} ifconfig ${TAP1} -alias ${ADDR} # Do it again, in the opposite order. It should not panic. - setup_tap 0 ${ADDR} ${MASK0} + setup_tap 0 inet ${ADDR} ${MASK0} TAP0=${TAP} - setup_tap 0 ${ADDR} ${MASK1} + setup_tap 0 inet ${ADDR} ${MASK1} TAP1=${TAP} ifconfig ${TAP0} -alias ${ADDR} } @@ -266,7 +371,7 @@ same_ip_multiple_ifaces_fib0_cleanup() atf_test_case same_ip_multiple_ifaces cleanup same_ip_multiple_ifaces_head() { - atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface, on non-default FIBs." + atf_set "descr" "Can remove an IPv4 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." atf_set "require.user" "root" atf_set "require.config" "fibs" } @@ -282,18 +387,18 @@ same_ip_multiple_ifaces_body() get_fibs 2 # Setup the interfaces, then remove one alias. It should not panic. - setup_tap ${FIB0} ${ADDR} ${MASK0} + setup_tap ${FIB0} inet ${ADDR} ${MASK0} TAP0=${TAP} - setup_tap ${FIB1} ${ADDR} ${MASK1} + setup_tap ${FIB1} inet ${ADDR} ${MASK1} TAP1=${TAP} ifconfig ${TAP1} -alias ${ADDR} atf_check -o not-match:"^${ADDR}[[:space:]]" \ setfib ${FIB1} netstat -rn -f inet # Do it again, in the opposite order. It should not panic. - setup_tap ${FIB0} ${ADDR} ${MASK0} + setup_tap ${FIB0} inet ${ADDR} ${MASK0} TAP0=${TAP} - setup_tap ${FIB1} ${ADDR} ${MASK1} + setup_tap ${FIB1} inet ${ADDR} ${MASK1} TAP1=${TAP} ifconfig ${TAP0} -alias ${ADDR} atf_check -o not-match:"^${ADDR}[[:space:]]" \ @@ -304,15 +409,58 @@ same_ip_multiple_ifaces_cleanup() # Due to PR kern/189088, we must destroy the interfaces in LIFO order # in order for the routes to be correctly cleaned up. for TAPD in `tail -r "tap_devices_to_cleanup"`; do + echo ifconfig ${TAPD} destroy ifconfig ${TAPD} destroy done } +atf_test_case same_ip_multiple_ifaces_inet6 cleanup +same_ip_multiple_ifaces_inet6_head() +{ + atf_set "descr" "Can remove an IPv6 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +same_ip_multiple_ifaces_inet6_body() +{ + ADDR="2001:db8::2" + MASK0="64" + MASK1="128" + + # Unlike most of the tests in this file, this is applicable regardless + # of net.add_addr_allfibs + get_fibs 2 + + # Setup the interfaces, then remove one alias. It should not panic. + setup_tap ${FIB0} inet6 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} inet6 ${ADDR} ${MASK1} + TAP1=${TAP} + atf_check -s exit:0 ifconfig ${TAP1} inet6 ${ADDR} -alias + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB1} netstat -rn -f inet6 + ifconfig ${TAP1} destroy + ifconfig ${TAP0} destroy + + # Do it again, in the opposite order. It should not panic. + setup_tap ${FIB0} inet6 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} inet6 ${ADDR} ${MASK1} + TAP1=${TAP} + atf_check -s exit:0 ifconfig ${TAP0} inet6 ${ADDR} -alias + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB0} netstat -rn -f inet6 +} +same_ip_multiple_ifaces_inet6_cleanup() +{ + cleanup_tap +} + # Regression test for kern/187550 atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup subnet_route_with_multiple_fibs_on_same_subnet_head() { - atf_set "descr" "Multiple FIBs can have subnet routes for the same subnet" + atf_set "descr" "Multiple FIBs can have IPv4 subnet routes for the same subnet" atf_set "require.user" "root" atf_set "require.config" "fibs" } @@ -333,8 +481,8 @@ subnet_route_with_multiple_fibs_on_same_ get_fibs 2 # Configure TAP interfaces - setup_tap "$FIB0" ${ADDR0} ${MASK} - setup_tap "$FIB1" ${ADDR1} ${MASK} + setup_tap "$FIB0" inet ${ADDR0} ${MASK} + setup_tap "$FIB1" inet ${ADDR1} ${MASK} # Check that a subnet route exists on both fibs atf_check -o ignore setfib "$FIB0" route get $ADDR1 @@ -346,6 +494,43 @@ subnet_route_with_multiple_fibs_on_same_ cleanup_tap } +atf_test_case subnet_route_with_multiple_fibs_on_same_subnet_inet6 cleanup +subnet_route_with_multiple_fibs_on_same_subnet_inet6_head() +{ + atf_set "descr" "Multiple FIBs can have IPv6 subnet routes for the same subnet" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +subnet_route_with_multiple_fibs_on_same_subnet_inet6_body() +{ + # Configure the TAP interfaces to use a RFC3849 nonrouteable addresses + # and a non-default fib + ADDR0="2001:db8::2" + ADDR1="2001:db8::3" + SUBNET="2001:db8::" + MASK="64" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 2 + + # Configure TAP interfaces + setup_tap "$FIB0" inet6 ${ADDR0} ${MASK} + setup_tap "$FIB1" inet6 ${ADDR1} ${MASK} + + # Check that a subnet route exists on both fibs + atf_check -o ignore setfib "$FIB0" route -6 get $ADDR1 + atf_check -o ignore setfib "$FIB1" route -6 get $ADDR0 +} + +subnet_route_with_multiple_fibs_on_same_subnet_inet6_cleanup() +{ + cleanup_tap +} + # Test that source address selection works correctly for UDP packets with # SO_DONTROUTE set that are sent on non-default FIBs. # This bug was discovered with "setfib 1 netperf -t UDP_STREAM -H some_host" @@ -386,9 +571,9 @@ udp_dontroute_body() get_fibs 2 # Configure the TAP interfaces - setup_tap ${FIB0} ${ADDR0} ${MASK} + setup_tap ${FIB0} inet ${ADDR0} ${MASK} TARGET_TAP=${TAP} - setup_tap ${FIB1} ${ADDR1} ${MASK} + setup_tap ${FIB1} inet ${ADDR1} ${MASK} # Send a UDP packet with SO_DONTROUTE. In the failure case, it will # return ENETUNREACH, or send the packet to the wrong tap @@ -397,8 +582,8 @@ udp_dontroute_body() cleanup_tap # Repeat, but this time target the other tap - setup_tap ${FIB0} ${ADDR0} ${MASK} - setup_tap ${FIB1} ${ADDR1} ${MASK} + setup_tap ${FIB0} inet ${ADDR0} ${MASK} + setup_tap ${FIB1} inet ${ADDR1} ${MASK} TARGET_TAP=${TAP} atf_check -o ignore setfib ${FIB1} \ @@ -415,10 +600,14 @@ atf_init_test_cases() { atf_add_test_case arpresolve_checks_interface_fib atf_add_test_case loopback_and_network_routes_on_nondefault_fib + atf_add_test_case loopback_and_network_routes_on_nondefault_fib_inet6 atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case default_route_with_multiple_fibs_on_same_subnet_inet6 atf_add_test_case same_ip_multiple_ifaces_fib0 atf_add_test_case same_ip_multiple_ifaces + atf_add_test_case same_ip_multiple_ifaces_inet6 atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet + atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet_inet6 atf_add_test_case udp_dontroute } @@ -464,24 +653,27 @@ get_tap() # Create a tap(4) interface, configure it, and register it for cleanup. # parameters: # fib +# Protocol (inet or inet6) # IP address # Netmask in number of bits (eg 24 or 8) # Return: the tap interface name as the env variable TAP setup_tap() { local FIB=$1 - local ADDR=$2 - local MASK=$3 + local PROTO=$2 + local ADDR=$3 + local MASK=$4 get_tap - echo setfib ${FIB} ifconfig $TAP ${ADDR}/${MASK} fib $FIB - setfib ${FIB} ifconfig $TAP ${ADDR}/${MASK} fib $FIB + echo setfib ${FIB} ifconfig $TAP ${PROTO} ${ADDR}/${MASK} fib $FIB + setfib ${FIB} ifconfig $TAP ${PROTO} ${ADDR}/${MASK} fib $FIB } cleanup_tap() { if [ -f tap_devices_to_cleanup ]; then for tap_device in $(cat tap_devices_to_cleanup); do - ifconfig "${tap_device}" destroy + echo ifconfig "${tap_device}" destroy + ifconfig "${tap_device}" destroy 2>/dev/null || true done rm -f tap_devices_to_cleanup fi From owner-svn-src-head@freebsd.org Tue Jan 31 20:57:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B187ACCAE7C; Tue, 31 Jan 2017 20:57:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CA01A8C; Tue, 31 Jan 2017 20:57:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VKveS4073637; Tue, 31 Jan 2017 20:57:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VKvehU073636; Tue, 31 Jan 2017 20:57:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701312057.v0VKvehU073636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 Jan 2017 20:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313026 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 20:57:41 -0000 Author: adrian Date: Tue Jan 31 20:57:40 2017 New Revision: 313026 URL: https://svnweb.freebsd.org/changeset/base/313026 Log: [ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU. This is just to improve adrian-debugging. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jan 31 20:13:50 2017 (r313025) +++ head/sys/dev/ath/if_ath_tx.c Tue Jan 31 20:57:40 2017 (r313026) @@ -2979,7 +2979,9 @@ ath_tx_tid_seqno_assign(struct ath_softc M_SEQNO_SET(m0, seqno); /* Return so caller can do something with it if needed */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: -> seqno=%d\n", __func__, seqno); + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: -> subtype=0x%x, tid=%d, seqno=%d\n", + __func__, subtype, tid, seqno); return seqno; } From owner-svn-src-head@freebsd.org Tue Jan 31 21:59:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2627CCA77F; Tue, 31 Jan 2017 21:59:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9750D617; Tue, 31 Jan 2017 21:59:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VLxAuK099751; Tue, 31 Jan 2017 21:59:10 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VLxAUs099750; Tue, 31 Jan 2017 21:59:10 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201701312159.v0VLxAUs099750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 31 Jan 2017 21:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313027 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 21:59:11 -0000 Author: brd (doc,ports committer) Date: Tue Jan 31 21:59:10 2017 New Revision: 313027 URL: https://svnweb.freebsd.org/changeset/base/313027 Log: Add a new vagrant-box target, to make it easier and less redundant to only produce the Vagrant box and not upload it. Approved by: re (gjb) Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Tue Jan 31 20:57:40 2017 (r313026) +++ head/release/Makefile.vagrant Tue Jan 31 21:59:10 2017 (r313027) @@ -24,8 +24,8 @@ VAGRANT_VERSION!= date +%Y.%m.%d VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE} .if !empty(CLOUDWARE) . for _PROVIDER in ${CLOUDWARE} -. if ${_PROVIDER:MVAGRANT*} -VAGRANT_PROVIDERS+= ${_PROVIDER:S/VAGRANT-//:tl} +. if ${_PROVIDER:tu:MVAGRANT*} +VAGRANT_PROVIDERS+= ${_PROVIDER:tu:S/VAGRANT-//:tl} . endif . endfor .endif @@ -70,13 +70,16 @@ ${VAGRANT_TARGET}.${PROVIDER}.box: ${PRO . endif CLEANFILES+= vagrant-do-upload-${PROVIDER} -vagrant-do-upload-${PROVIDER}: ${VAGRANT_TARGET}.${PROVIDER}.box +vagrant-do-upload-${PROVIDER}: vagrant-box . if ${PROVIDER} == "virtualbox" ${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} . elif ${PROVIDER} == "vmware" ${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER}_desktop -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} . endif touch ${.OBJDIR}/${.TARGET} + +vagrant-box: ${VAGRANT_TARGET}.${PROVIDER}.box + .endfor vagrant-upload: ${VAGRANT_UPLOAD_TGTS} From owner-svn-src-head@freebsd.org Tue Jan 31 22:21:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38ECCCCAE13; Tue, 31 Jan 2017 22:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13A0C11BC; Tue, 31 Jan 2017 22:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VML9Cg011682; Tue, 31 Jan 2017 22:21:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VML9wj011680; Tue, 31 Jan 2017 22:21:09 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701312221.v0VML9wj011680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 31 Jan 2017 22:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313028 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 22:21:10 -0000 Author: avos Date: Tue Jan 31 22:21:08 2017 New Revision: 313028 URL: https://svnweb.freebsd.org/changeset/base/313028 Log: net80211: cleanup ic_flags / iv_flags Flags - IEEE80211_F_ASCAN - IEEE80211_F_SIBSS - IEEE80211_F_IBSSON are not used since r170530 (old WI compatibility ioctls removal) and r178354 (removed from other places). IEEE80211_F_TXPOW_FIXED was never utilized; initially added with IEEE80211_F_TXPOW_AUTO / IEEE80211_F_TXPOW_OFF flags, which were replaced with IEEE80211_C_TXPMGT capability check in r138568. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9369 Modified: head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Tue Jan 31 21:59:10 2017 (r313027) +++ head/sys/net80211/ieee80211_node.c Tue Jan 31 22:21:08 2017 (r313028) @@ -349,7 +349,6 @@ ieee80211_create_ibss(struct ieee80211va ni->ni_fhindex = 1; } if (vap->iv_opmode == IEEE80211_M_IBSS) { - vap->iv_flags |= IEEE80211_F_SIBSS; ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS; /* XXX */ if (vap->iv_flags & IEEE80211_F_DESBSSID) IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Jan 31 21:59:10 2017 (r313027) +++ head/sys/net80211/ieee80211_var.h Tue Jan 31 22:21:08 2017 (r313028) @@ -572,8 +572,7 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_F_PRIVACY 0x00000010 /* CONF: privacy enabled */ #define IEEE80211_F_PUREG 0x00000020 /* CONF: 11g w/o 11b sta's */ #define IEEE80211_F_SCAN 0x00000080 /* STATUS: scanning */ -#define IEEE80211_F_ASCAN 0x00000100 /* STATUS: active scan */ -#define IEEE80211_F_SIBSS 0x00000200 /* STATUS: start IBSS */ +/* 0x00000300 reserved */ /* NB: this is intentionally setup to be IEEE80211_CAPINFO_SHORT_SLOTTIME */ #define IEEE80211_F_SHSLOT 0x00000400 /* STATUS: use short slot time*/ #define IEEE80211_F_PMGTON 0x00000800 /* CONF: Power mgmt enable */ @@ -581,8 +580,7 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_F_WME 0x00002000 /* CONF: enable WME use */ #define IEEE80211_F_BGSCAN 0x00004000 /* CONF: bg scan enabled (???)*/ #define IEEE80211_F_SWRETRY 0x00008000 /* CONF: sw tx retry enabled */ -#define IEEE80211_F_TXPOW_FIXED 0x00010000 /* TX Power: fixed rate */ -#define IEEE80211_F_IBSSON 0x00020000 /* CONF: IBSS creation enable */ +/* 0x00030000 reserved */ #define IEEE80211_F_SHPREAMBLE 0x00040000 /* STATUS: use short preamble */ #define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */ #define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ @@ -600,9 +598,9 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_F_DWDS 0x80000000 /* CONF: Dynamic WDS enabled */ #define IEEE80211_F_BITS \ - "\20\1TURBOP\2COMP\3FF\4BURST\5PRIVACY\6PUREG\10SCAN\11ASCAN\12SIBSS" \ - "\13SHSLOT\14PMGTON\15DESBSSID\16WME\17BGSCAN\20SWRETRY\21TXPOW_FIXED" \ - "\22IBSSON\23SHPREAMBLE\24DATAPAD\25USEPROT\26USERBARKER\27CSAPENDING" \ + "\20\1TURBOP\2COMP\3FF\4BURST\5PRIVACY\6PUREG\10SCAN" \ + "\13SHSLOT\14PMGTON\15DESBSSID\16WME\17BGSCAN\20SWRETRY" \ + "\23SHPREAMBLE\24DATAPAD\25USEPROT\26USERBARKER\27CSAPENDING" \ "\30WPA1\31WPA2\32DROPUNENC\33COUNTERM\34HIDESSID\35NOBRIDG\36PCF" \ "\37DOTH\40DWDS" From owner-svn-src-head@freebsd.org Tue Jan 31 22:26:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BDA3CCAFC9; Tue, 31 Jan 2017 22:26:41 +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 4CA401551; Tue, 31 Jan 2017 22:26:41 +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 1D04010A7DB; Tue, 31 Jan 2017 17:26:40 -0500 (EST) From: John Baldwin To: Takahashi Yoshihiro Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Date: Tue, 31 Jan 2017 14:20:17 -0800 Message-ID: <2911087.bbEsWibF87@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701280222.v0S2MFSR022477@repo.freebsd.org> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 31 Jan 2017 17:26:40 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 22:26:41 -0000 On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: > Author: nyan > Date: Sat Jan 28 02:22:15 2017 > New Revision: 312910 > URL: https://svnweb.freebsd.org/changeset/base/312910 > > Log: > Remove pc98 support completely. > I thank all developers and contributors for pc98. > > Relnotes: yes BTW, my impression was that there are some other device drivers that are effectively PC-98 only (e.g. everything that uses scsi_low.c) but they might have pccard attachments for use with PC-98 laptops? Perhaps Warner might know? It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) all came from NetBSD/pc98 via PAO. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jan 31 22:26:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155F9CCAFF8; Tue, 31 Jan 2017 22:26:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E820315C3; Tue, 31 Jan 2017 22:26:48 +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 6B9AB10A7FA; Tue, 31 Jan 2017 17:26:41 -0500 (EST) From: John Baldwin To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Date: Tue, 31 Jan 2017 14:13:36 -0800 Message-ID: <3349880.lYJPXOWCO7@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701301257.v0UCvNrK065993@repo.freebsd.org> References: <201701301257.v0UCvNrK065993@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 31 Jan 2017 17:26:41 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 22:26:49 -0000 On Monday, January 30, 2017 12:57:23 PM Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Jan 30 12:57:22 2017 > New Revision: 312988 > URL: https://svnweb.freebsd.org/changeset/base/312988 > > Log: > Add kern_listen(), kern_shutdown(), and kern_socket(), and use them > instead of their sys_*() counterparts in various compats. The svr4 > is left untouched, because there's no point. Note that you can compile test svr4 since it is still in the tree. If we want to remove svr4, then we should remove it. However, we should maintain code that is in the tree if it is still there. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jan 31 22:33:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEF6CCA549 for ; Tue, 31 Jan 2017 22:33:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6256B1D12 for ; Tue, 31 Jan 2017 22:33:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id l66so143597423ioi.1 for ; Tue, 31 Jan 2017 14:33:56 -0800 (PST) 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=4fv1ZJZmUQ3oSWjRlKxMM/UX1OJhE4PRw0R8XPY4Gg8=; b=WbYhJjXhxWwceFfYqc9cTc2YxrlLkbkAMWyAA5tQfUG0UjlisMtrqX3kYa1BWIszCW xz2ZP9rQphcC3uAQQ3FGAII+E+sQ85g02AOo/qxgCqENx6I9ivqIYzsBfeM57/CIGqMo eHYpEnnZjVlwlEuC0maK8DWumaL28GsrOUFK3i0Mwbem4CgikmQQ4ocIa3pca+I8bUIA VVmxDQmmlQ8Lr7y++X+XKJQZI0lai4uPxhsn4b1RP4bwpMbnvu3D1CxCwn0PBSdTJ8Y/ S3cRGjOOeX+XtPuHoUjPnRtVBBqdNCioLQfOLCFqUIJQZkxkQKS8hFO/Vlv2oDErmNR5 lbcg== 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=4fv1ZJZmUQ3oSWjRlKxMM/UX1OJhE4PRw0R8XPY4Gg8=; b=X/mR2kF+twdsesvVYCLu0Ms0TBJF3oWoNGqQWKaTEbhB2bdovItGriCVNlRHKlrM8Q 1CPP6C5IaKGOApUuvvLdQoq3on+8dFCKi4qcrK3Rh8O1vxJvvwTpLMMpUsfCjJ+6r37c EahC31/aTFZ8uHA0mmafCf8TJzWpxJou38jXaPC1YRjpVAceNNdo1dkDvXCDn1N/+Er8 sHg9+jvNmMVBozv+B1hgeY28mcKtucOgPqMu6dtiL6DbnATWAHlxV482U1IPuarkUel1 3Kd5cfV6beXn5kbFFj4FKWR8FBbjDNaD5d9cXiN3yoQO7FqMtJwogdZXXD4H7g08VMhl tqCw== X-Gm-Message-State: AIkVDXLzTDeM7bUiFoDzHrt2bG70bN4q1KpCl9M4oAKfiEhFdsGmWeBUR0ddMPnxYHoqDHw1ONbrUmD/LFqAEA== X-Received: by 10.107.20.13 with SMTP id 13mr182944iou.0.1485902035593; Tue, 31 Jan 2017 14:33:55 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Tue, 31 Jan 2017 14:33:55 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <2911087.bbEsWibF87@ralph.baldwin.cx> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <2911087.bbEsWibF87@ralph.baldwin.cx> From: Warner Losh Date: Tue, 31 Jan 2017 15:33:55 -0700 X-Google-Sender-Auth: QzaWJ_bqte2BLVAcCXMQ6MUOIRw Message-ID: Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... To: John Baldwin Cc: Takahashi Yoshihiro , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 22:33:56 -0000 On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: >> Author: nyan >> Date: Sat Jan 28 02:22:15 2017 >> New Revision: 312910 >> URL: https://svnweb.freebsd.org/changeset/base/312910 >> >> Log: >> Remove pc98 support completely. >> I thank all developers and contributors for pc98. >> >> Relnotes: yes > > BTW, my impression was that there are some other device drivers > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) > but they might have pccard attachments for use with PC-98 laptops? > > Perhaps Warner might know? > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) > all came from NetBSD/pc98 via PAO. These all work correctly on any PC Card machine. The only reason they came in this way was because these devices were original marketed only in Japan. I've used all these cards with external SCSI drives in the past. As far as I know, only the if_snc driver, which was removed, is truly pc98 specific. It is wired in such a way that cannot be used in ibm-at compatible laptops. IIRC, it had hard-wired memory decode lines that landed in the middle of the VGA graphics pages or BIOS low memory areas. I have one of these cards still, and it will be detected on my laptops, but can't work due to the required mappings. Now, there's an different question about whether it is time to retire some of the now-ancient SCSI cards from the system, but that's a different kettle of fish that's larger than just nsp, ncv and stg. Warner From owner-svn-src-head@freebsd.org Tue Jan 31 23:22:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C6CCCCA253; Tue, 31 Jan 2017 23:22:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471F6161E; Tue, 31 Jan 2017 23:22:44 +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 BD89C10A7FA; Tue, 31 Jan 2017 18:22:42 -0500 (EST) From: John Baldwin To: Warner Losh Cc: Takahashi Yoshihiro , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Date: Tue, 31 Jan 2017 14:46:23 -0800 Message-ID: <3458844.3oruRKbrzH@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <2911087.bbEsWibF87@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 31 Jan 2017 18:22:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 23:22:45 -0000 On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: > On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: > > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: > >> Author: nyan > >> Date: Sat Jan 28 02:22:15 2017 > >> New Revision: 312910 > >> URL: https://svnweb.freebsd.org/changeset/base/312910 > >> > >> Log: > >> Remove pc98 support completely. > >> I thank all developers and contributors for pc98. > >> > >> Relnotes: yes > > > > BTW, my impression was that there are some other device drivers > > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) > > but they might have pccard attachments for use with PC-98 laptops? > > > > Perhaps Warner might know? > > > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) > > all came from NetBSD/pc98 via PAO. > > These all work correctly on any PC Card machine. The only reason they > came in this way was because these devices were original marketed only > in Japan. I've used all these cards with external SCSI drives in the > past. > > As far as I know, only the if_snc driver, which was removed, is truly > pc98 specific. It is wired in such a way that cannot be used in ibm-at > compatible laptops. IIRC, it had hard-wired memory decode lines that > landed in the middle of the VGA graphics pages or BIOS low memory > areas. I have one of these cards still, and it will be detected on my > laptops, but can't work due to the required mappings. > > Now, there's an different question about whether it is time to retire > some of the now-ancient SCSI cards from the system, but that's a > different kettle of fish that's larger than just nsp, ncv and stg. Fair enough. I haven't fully put away my 12 axe and am toying with dropping any ISA-only storage and NIC drivers (and perhaps pccard-only as well in that case). Hardware that wants to use ISA/pccard for storage is probably happier running 4.x anyway. One question is if we should drop ISA attachments in that case for drivers that support PCI and ISA. However, there's a fair list of ISA-only adapters that would be a good place to start anyway. One concern is to not drop any drivers that are commonly used in emulators or hypervisors (ed(4) comes to mind though I think em(4) is probably available in any modern emulators or hypervisors). -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jan 31 23:34:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D03CCA789; Tue, 31 Jan 2017 23:34:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30E631DD0; Tue, 31 Jan 2017 23:34:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VNY2B2040366; Tue, 31 Jan 2017 23:34:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VNY22N040365; Tue, 31 Jan 2017 23:34:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201701312334.v0VNY22N040365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 31 Jan 2017 23:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313030 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 23:34:03 -0000 Author: tuexen Date: Tue Jan 31 23:34:02 2017 New Revision: 313030 URL: https://svnweb.freebsd.org/changeset/base/313030 Log: Remove a duplicate debug statement. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Tue Jan 31 22:43:35 2017 (r313029) +++ head/sys/netinet/sctp_timer.c Tue Jan 31 23:34:02 2017 (r313030) @@ -719,13 +719,9 @@ start_again: if (num_mk) { SCTPDBG(SCTP_DEBUG_TIMER1, "LAST TSN marked was %x\n", tsnlast); - SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was %d peer-rwd:%ld\n", - num_mk, (u_long)stcb->asoc.peers_rwnd); - SCTPDBG(SCTP_DEBUG_TIMER1, "LAST TSN marked was %x\n", - tsnlast); - SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was %d peer-rwd:%d\n", + SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was %d peer-rwd:%u\n", num_mk, - (int)stcb->asoc.peers_rwnd); + stcb->asoc.peers_rwnd); } #endif *num_marked = num_mk; From owner-svn-src-head@freebsd.org Tue Jan 31 23:36:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92629CCA82A for ; Tue, 31 Jan 2017 23:36:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 619861F2F for ; Tue, 31 Jan 2017 23:36:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id o185so850585itb.1 for ; Tue, 31 Jan 2017 15:36:06 -0800 (PST) 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=2RREsjn7TH45S1/B+ZE7OZk4ySxto7JnHQ+He85FEZM=; b=g57LSMoZoXPQGGQ73DbedEI7gqe1d/OoufBglhlV9D5qzP1//uj6oEvYNYZiZLrayz 15KsmwOpuYiMMdsvoaFhm0T5Rbgq3D0RN65hC2X1cOpDi3swUl7KVXCxL3IyiJ5fQbwE 3NicV1+v2tPxqG9FpkoJTuhqTFPE8crMPePUJC7A7dkJlrHnvtbszCmiljuCMjuIA414 1MK4lFT/9LKFCBFWbiYKZ4N4IppBniu5wIp13HCIwEDB2dXVndeFpCX6nzTr3AHQcE7P ofwFsEB4UAQaWbSnA0lxjSVUgI0WWfPv0g8mGPPoPgmmo2XaRImxVO/lHsgpbullC87l 0omQ== 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=2RREsjn7TH45S1/B+ZE7OZk4ySxto7JnHQ+He85FEZM=; b=Ssu9xHc/3rOkTY0UVPr4SX+b7xFQ6Lz4RwTxCwHhtJBPFqeGrLchgmHX032t0uHH3w T35rfd3CmAqHv0rWR+/XjYYOLgaM4s9YgcZyJDUoO7mam140qsShTvmpM4ZhX8l9X+ou JvheaHHtI6c4kv649d5sJmerWzn8IRjsCfTTQA7z4+jzZIXzkugrrJqe4YDYUHsg5/Ql IJgxaHT8HM46r+lrA2mDWyFsXPNv4DD9Kj7EmvCz459Si0uVCmKBjQJujG5DSUW45ler oSUlD8TDh+XNNb9snC9JX/bs549PNauIRyB9xZebAQXvqRZelP51+2QWNemDkN+mMuv+ fWOw== X-Gm-Message-State: AIkVDXI+8mxSC0lyf9Xh5Q3EOAEgRKU2BxA2zukvMmhMi0SXgpCw9EFWPVKE3BAe3sJkEU165KS37gBqI6OKXw== X-Received: by 10.36.135.194 with SMTP id f185mr330095ite.85.1485905765528; Tue, 31 Jan 2017 15:36:05 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Tue, 31 Jan 2017 15:36:04 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <3458844.3oruRKbrzH@ralph.baldwin.cx> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <2911087.bbEsWibF87@ralph.baldwin.cx> <3458844.3oruRKbrzH@ralph.baldwin.cx> From: Warner Losh Date: Tue, 31 Jan 2017 16:36:04 -0700 X-Google-Sender-Auth: H8Uhf5cb_jHxnVFtcHb_LBb1uko Message-ID: Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... To: John Baldwin Cc: Takahashi Yoshihiro , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 23:36:06 -0000 On Tue, Jan 31, 2017 at 3:46 PM, John Baldwin wrote: > On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: >> On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: >> > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: >> >> Author: nyan >> >> Date: Sat Jan 28 02:22:15 2017 >> >> New Revision: 312910 >> >> URL: https://svnweb.freebsd.org/changeset/base/312910 >> >> >> >> Log: >> >> Remove pc98 support completely. >> >> I thank all developers and contributors for pc98. >> >> >> >> Relnotes: yes >> > >> > BTW, my impression was that there are some other device drivers >> > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) >> > but they might have pccard attachments for use with PC-98 laptops? >> > >> > Perhaps Warner might know? >> > >> > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) >> > all came from NetBSD/pc98 via PAO. >> >> These all work correctly on any PC Card machine. The only reason they >> came in this way was because these devices were original marketed only >> in Japan. I've used all these cards with external SCSI drives in the >> past. >> >> As far as I know, only the if_snc driver, which was removed, is truly >> pc98 specific. It is wired in such a way that cannot be used in ibm-at >> compatible laptops. IIRC, it had hard-wired memory decode lines that >> landed in the middle of the VGA graphics pages or BIOS low memory >> areas. I have one of these cards still, and it will be detected on my >> laptops, but can't work due to the required mappings. >> >> Now, there's an different question about whether it is time to retire >> some of the now-ancient SCSI cards from the system, but that's a >> different kettle of fish that's larger than just nsp, ncv and stg. > > Fair enough. I haven't fully put away my 12 axe and am toying with > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > as well in that case). Hardware that wants to use ISA/pccard for > storage is probably happier running 4.x anyway. One question is if we > should drop ISA attachments in that case for drivers that support PCI > and ISA. However, there's a fair list of ISA-only adapters that would > be a good place to start anyway. One concern is to not drop any drivers > that are commonly used in emulators or hypervisors (ed(4) comes to mind > though I think em(4) is probably available in any modern emulators or > hypervisors). ISA-only attachments would be a good place to start. My quick glance shows this would be le(4), aha(4), cm(4), mse(4), and joy(4). There's maybe half a dozen EISA-only drivers in the tree that I was planning on retiring in 12, along with EISA. Likewise with the MCA attachments. I know that ed, ep, ex, sn, fe and cs PC Card attachments still work, or did fairly recently. All of those also have ISA attachments. I have no clue if the ISA attachments work, though I still have some ISA systems, I got rid of all my SCSI and Network ISA cards some time ago. I had hoped to get all the pnp autoloading code going so we could remove them from GENERIC before the 11 branch, but keep them as modules. I ran out of time. However, there's still time for 12 though. Warner From owner-svn-src-head@freebsd.org Tue Jan 31 23:36:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B78CCA8B4; Tue, 31 Jan 2017 23:36:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0523122; Tue, 31 Jan 2017 23:36:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0VNaVUo040529; Tue, 31 Jan 2017 23:36:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VNaVhv040528; Tue, 31 Jan 2017 23:36:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201701312336.v0VNaVhv040528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 31 Jan 2017 23:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313031 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 23:36:33 -0000 Author: tuexen Date: Tue Jan 31 23:36:31 2017 New Revision: 313031 URL: https://svnweb.freebsd.org/changeset/base/313031 Log: Take the SCTP common header into account when computing the space available for chunks. This unbreaks the handling of ICMPV6 packets indicating "packet too big". It just worked for IPv4 since we are overbooking for IPv4. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Jan 31 23:34:02 2017 (r313030) +++ head/sys/netinet/sctp_usrreq.c Tue Jan 31 23:36:31 2017 (r313031) @@ -108,7 +108,7 @@ sctp_pathmtu_adjustment(struct sctp_tcb /* Adjust that too */ stcb->asoc.smallest_mtu = nxtsz; /* now off to subtract IP_DF flag if needed */ - overhead = IP_HDR_SIZE; + overhead = IP_HDR_SIZE + sizeof(struct sctphdr); if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); } From owner-svn-src-head@freebsd.org Wed Feb 1 00:10:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB535CCAA9C; Wed, 1 Feb 2017 00:10:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B15516D7; Wed, 1 Feb 2017 00:10:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v110AT1k052946; Wed, 1 Feb 2017 00:10:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v110ATTA052945; Wed, 1 Feb 2017 00:10:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201702010010.v110ATTA052945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 1 Feb 2017 00:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313032 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 00:10:30 -0000 Author: tuexen Date: Wed Feb 1 00:10:29 2017 New Revision: 313032 URL: https://svnweb.freebsd.org/changeset/base/313032 Log: Ensure that the variable bail is always initialized before used. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Jan 31 23:36:31 2017 (r313031) +++ head/sys/netinet/sctp_output.c Wed Feb 1 00:10:29 2017 (r313032) @@ -7730,9 +7730,9 @@ sctp_fill_outqueue(struct sctp_tcb *stcb /* must make even word boundary */ space_left &= 0xfffffffc; strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); + giveup = 0; + bail = 0; while ((space_left > 0) && (strq != NULL)) { - giveup = 0; - bail = 0; moved = sctp_move_to_outqueue(stcb, strq, space_left, frag_point, &giveup, eeor_mode, &bail, so_locked); stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved); From owner-svn-src-head@freebsd.org Wed Feb 1 00:45:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB62CC64F7; Wed, 1 Feb 2017 00:45:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACD7927; Wed, 1 Feb 2017 00:45:01 +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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id DBBAF3D0FC6; Wed, 1 Feb 2017 11:44:58 +1100 (AEDT) Date: Wed, 1 Feb 2017 11:44:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: Message-ID: <20170201101029.R1617@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=PO7r1zJSAAAA:8 a=ia-mcPF_aGBLiXcymHcA:9 a=45ClL6m2LaAA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 00:45:02 -0000 On Tue, 31 Jan 2017, Conrad Meyer wrote: > On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans wrote= : >> On Tue, 31 Jan 2017, Bruce Evans wrote: >> Unrolling (or not) may be helpful or harmful for entry and exit code. > > Helpful, per my earlier benchmarks. > >> I >> think there should by no alignment on entry -- just assume the buffer is >> aligned in the usual case, and only run 4% slower when it is misaligned. > > Please write such a patch and demonstrate the improvement. I now understand the algorithm. The division into 3 has to keep sequentiality (since CRC input is a bit string), so it doesn't work to separate the memory acces of the 3 crc32's by 8 bytes as in my simple test -- they have to be separated by large amounts. Then recombining requires multiplying the polynomials associated with the CRCs of the higher 2 blocks by X^N and reducing again, where N is large an related to the block size. This is done using a large table for each N needed, and to keep things reasonably simple, only 2 N's are used. >> The exit code handles up to SHORT * 3 =3D 768 bytes, not up to 4 or 8 >> bytes or up to 3 times that like simpler algorithms. 768 is quite >> large, and the exit code is quite slow. It reduces 8 or 4 bytes at a >> time without any dependency reduction, and then 1 byte at a time. > > Yes, this is the important loop to unroll for small inputs. Somehow Not like clang does it. Unrolling is useless without the 3-way blocking. > with the unrolling, it is only ~19% slower than the by-3 algorithm on > my system =E2=80=94 not 66%. Clang 3.9.1 unrolls both of these trailing > loops; here is the first: Maybe 3.9.1 pessimizes the 3-way loop by unrolling it. This would be fairly easy to do. Just replicate the 3 crc32q's a few times, say 8, and do them in a bad order (3 blocks of 8 dependent ones instead of 8 blocks of 3 independent ones). With enough replication, the code would be too large for the hardware to reorder. Inline asm has another advantage here -- volatile on it prevents reordering and might prevent unrolling. Maybe 3.9.1 unpessimizes the inline asms. But I suspect not getting the 3 times speedup is for another reason. > > 0x0000000000401b88 <+584>: cmp $0x38,%rbx > 0x0000000000401b8c <+588>: jae 0x401b93 > 0x0000000000401b8e <+590>: mov %rsi,%rdx > 0x0000000000401b91 <+593>: jmp 0x401be1 > 0x0000000000401b93 <+595>: lea -0x1(%rdi),%rbx > 0x0000000000401b97 <+599>: sub %rdx,%rbx > 0x0000000000401b9a <+602>: mov %rsi,%rdx > 0x0000000000401b9d <+605>: nopl (%rax) > 0x0000000000401ba0 <+608>: crc32q (%rdx),%rax > 0x0000000000401ba6 <+614>: crc32q 0x8(%rdx),%rax > 0x0000000000401bad <+621>: crc32q 0x10(%rdx),%rax > 0x0000000000401bb4 <+628>: crc32q 0x18(%rdx),%rax > 0x0000000000401bbb <+635>: crc32q 0x20(%rdx),%rax > 0x0000000000401bc2 <+642>: crc32q 0x28(%rdx),%rax > 0x0000000000401bc9 <+649>: crc32q 0x30(%rdx),%rax > 0x0000000000401bd0 <+656>: crc32q 0x38(%rdx),%rax > 0x0000000000401bd7 <+663>: add $0x40,%rdx > 0x0000000000401bdb <+667>: add $0x8,%rbx > 0x0000000000401bdf <+671>: jne 0x401ba0 No, this unrolling is useless. The crc32q's are dependent on each other, so they take 3 cycles each. There are spare resources to run about 12 instructions during that time. Loop control only takes 3. >> I >> don't understand the algorithm for joining crcs -- why doesn't it work >> to reduce to 12 or 24 bytes in the main loop? > > It would, but I haven't implemented or tested that. You're welcome to > do so and demonstrate an improvement. It does add more lookup table > bloat, but perhaps we could just remove the 3x8k table =E2=80=94 I'm not = sure > it adds any benefit over the 3x256 table. > >> Your benchmarks mainly give results for the <=3D 768 bytes where most of >> the manual optimizations don't apply. Actually, they test only the large buffer case. They used buffer size of 1M and 1k and didn't do the entry and exit code that usually dominates for small buffers. I re-tested with the correct blocking. This was about 10% slower (0.34 -> 0.37 seconds for 10GB), except for clang without intrinsics it was 20% slower (0.43 -> 0.51) seconds. > 0x000400: asm:68 intrins:62 multitable:684 (ns per buf) I don't see any signs of this in my test: - a single crc32q in a (C) loop doesn't benefit from unrolling or lose to the extra clang instructions without intrinsics. clang-3.9.0 unrolls this 8-way in the simpler environment of my test program, but this makes no difference. - similarly for a single crc32b in a loop, except when I forgot to change the type of the crc accumulator from uint64_t to uint32_t, gcc was 1 cycle slower in the loop (3 instead of 4). gcc generates an extra instruction to zero-extend the crc, and this is more expensive than usual since it gives gives another dependency. clang optimizes this away. > 0x000800: asm:132 intrins:133 (ns per buf) > 0x002000: asm:449 intrins:446 (ns per buf) > 0x008000: asm:1501 intrins:1497 (ns per buf) > 0x020000: asm:5618 intrins:5609 (ns per buf) Now it is mostly in the 3-way optimized case and the differences are in the noise. > (All routines are in a separate compilation unit with no full-program > optimization, as they are in the kernel.) > >> Compiler optimizations are more >> likely to help there. So I looked more closely at the last 2 loop. >> clang indeed only unrolls the last one, > > Not in 3.9.1. 3.9.1 seems to only extend the useless unrolling. >> only for the unreachable case >> with more than 8 bytes on amd64. > > How is it unreachable? Because the loop doing 8-byte words at a time reduces the count below 8. Bruce From owner-svn-src-head@freebsd.org Wed Feb 1 01:25:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 363DFCCB437; Wed, 1 Feb 2017 01:25:32 +0000 (UTC) (envelope-from jmd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C89275; Wed, 1 Feb 2017 01:25:31 +0000 (UTC) (envelope-from jmd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v111PVTZ087790; Wed, 1 Feb 2017 01:25:31 GMT (envelope-from jmd@FreeBSD.org) Received: (from jmd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v111PVR7087789; Wed, 1 Feb 2017 01:25:31 GMT (envelope-from jmd@FreeBSD.org) Message-Id: <201702010125.v111PVR7087789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmd set sender to jmd@FreeBSD.org using -f From: Johannes M Dieterich Date: Wed, 1 Feb 2017 01:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313033 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 01:25:32 -0000 Author: jmd (ports committer) Date: Wed Feb 1 01:25:30 2017 New Revision: 313033 URL: https://svnweb.freebsd.org/changeset/base/313033 Log: Add myself (jmd) to committers-ports.dot. Document rene and swills as my mentors. Reviewed by: rene (mentor) Approved by: rene (mentor) Differential Revision: https://reviews.freebsd.org/D9393 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Feb 1 00:10:29 2017 (r313032) +++ head/share/misc/committers-ports.dot Wed Feb 1 01:25:30 2017 (r313033) @@ -125,6 +125,7 @@ jgh [label="Jason Helfman\njgh@FreeBSD.o jhale [label="Jason E. Hale\njhale@FreeBSD.org\n2012/09/10"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12"] jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"] +jmd [label="Johannes M. Dieterich\njmd@FreeBSD.org\n2017/01/09"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"] johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"] @@ -562,6 +563,7 @@ rene -> bar rene -> cmt rene -> crees rene -> jgh +rene -> jmd rene -> ler rene -> olivierd @@ -594,6 +596,7 @@ stas -> araujo steve -> netchild swills -> feld +swills -> jmd swills -> jrm swills -> milki swills -> pclin From owner-svn-src-head@freebsd.org Wed Feb 1 02:00:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11CC7CCBCC7; Wed, 1 Feb 2017 02:00:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0A3714A2; Wed, 1 Feb 2017 02:00:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1120J5H000400; Wed, 1 Feb 2017 02:00:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1120JOt000399; Wed, 1 Feb 2017 02:00:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702010200.v1120JOt000399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 1 Feb 2017 02:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313034 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 02:00:20 -0000 Author: imp Date: Wed Feb 1 02:00:18 2017 New Revision: 313034 URL: https://svnweb.freebsd.org/changeset/base/313034 Log: Add USB IDs supported by TI / Intel USB 3410 family (modems of various flavors). This includes both the release products (from Honeywell, Moxa and Multitech) as well as development kits. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Feb 1 01:25:30 2017 (r313033) +++ head/sys/dev/usb/usbdevs Wed Feb 1 02:00:18 2017 (r313034) @@ -587,6 +587,7 @@ vendor CCYU 0x1065 CCYU Technology vendor CURITEL 0x106c Curitel Communications Inc vendor SILABS2 0x10a6 SILABS2 vendor USI 0x10ab USI +vendor HONEYWELL 0x10ac Honeywell vendor LIEBERT2 0x10af Liebert vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante @@ -594,6 +595,7 @@ vendor SILABS 0x10c4 Silicon Labs vendor SILABS3 0x10c5 Silicon Labs vendor SILABS4 0x10ce Silicon Labs vendor ACTIONS 0x10d6 Actions +vendor MOXA 0x110a Moxa vendor ANALOG 0x1110 Analog Devices vendor TENX 0x1130 Ten X Technology, Inc. vendor ISSC 0x1131 Integrated System Solution Corp. @@ -698,6 +700,7 @@ vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor QUALCOMM3 0x19f5 Qualcomm, Inc. +vendor ABBOTT 0x1a61 Abbott Diabetics vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless @@ -806,6 +809,10 @@ product 3COMUSR USRISDN 0x008f 3Com U.S product 3COMUSR HOMECONN 0x009d 3Com HomeConnect Camera product 3COMUSR USR56K 0x3021 U.S. Robotics 56000 Voice FaxModem Pro +/* Abbott Diabetics */ +product ABBOTT STEREO_PLUG 0x3410 Abbott Diabetics Stereo Plug +product ABBOTT STRIP_PORT 0x3420 Abbott Diabetics Strip Port + /* AboCom products */ product ABOCOM XX1 0x110c XX1 product ABOCOM XX2 0x200c XX2 @@ -2290,6 +2297,9 @@ product HITACHI DVDCAM_USB 0x001e DVDCAM /* Holtek products */ product HOLTEK F85 0xa030 Holtek USB gaming keyboard +/* Honeywell */ +product HONEYWELL HGI80 0x0102 Honeywell HGI80 Wireless USB Gateway + /* HP products */ product HP 895C 0x0004 DeskJet 895C product HP 4100C 0x0101 Scanjet 4100C @@ -2448,6 +2458,9 @@ product HUAWEI3COM WUB320G 0x0009 Aolynk /* IBM Corporation */ product IBM USBCDROMDRIVE 0x4427 USB CD-ROM Drive +product IBM USB4543 0x4543 TI IBM USB 4543 Modem +product IBM USB454B 0x454b TI IBM USB 454B Modem +product IBM USB454C 0x454c TI IBM USB 454C Modem /* Icom products */ product ICOM SP1 0x0004 FTDI compatible adapter @@ -3222,12 +3235,27 @@ product MOTOROLA2 MB886 0x710f MB886 Mo product MOTOROLA4 RT2770 0x9031 RT2770 product MOTOROLA4 RT3070 0x9032 RT3070 +/* Moxa */ +product MOXA MXU1_1110 0x1110 Moxa Uport 1110 +product MOXA MXU1_1130 0x1130 Moxa Uport 1130 +product MOXA MXU1_1131 0x1131 Moxa Uport 1131 +product MOXA MXU1_1150 0x1150 Moxa Uport 1150 +product MOXA MXU1_1151 0x1151 Moxa Uport 1151 + /* MpMan products */ product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go /* MultiTech products */ +product MULTITECH MT9234ZBA_2 0x0319 MT9234ZBA USB modem (alt) product MULTITECH ATLAS 0xf101 MT5634ZBA-USB modem +product MULTITECH GSM 0xf108 GSM USB Modem +product MULTITECH CDMA 0xf109 CDMA USB Modem +product MULTITECH CDMA_FW 0xf110 CDMA USB Modem firmware running +product MULTITECH GSM_FW 0xf111 GSM USB Modem firmware running +product MULTITECH EDGE 0xf112 Edge USB Modem +product MULTITECH MT9234MU 0xf114 MT9234 MU +product MULTITECH MT9234ZBA 0xf115 MT9234 ZBA /* Mustek products */ product MUSTEK 1200CU 0x0001 1200 CU scanner @@ -4466,6 +4494,13 @@ product TENX UAUDIO0 0xf211 USB audio h /* Texas Intel products */ product TI UTUSB41 0x1446 UT-USB41 hub product TI TUSB2046 0x2046 TUSB2046 hub +product TI USB3410 0x3410 TI USB 3410 Modem +product TI USB5052 0x5052 TI USB 5250 Modem +product TI FRI2 0x5053 TI Fish River Island II +product TI USB5052_EEPROM 0x505a TI USB 5250 Modem w/Eeprom +product TI USB5052_FW 0x505f TI USB 5250 Modme w/Firmware running +product TI USB5152 0x5152 TI USB 5152 Modem +product TI EZ430 0xf430 TI ex430 development tool /* Thrustmaster products */ product THRUST FUSION_PAD 0xa0a3 Fusion Digital Gamepad From owner-svn-src-head@freebsd.org Wed Feb 1 02:42:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6868CCB837; Wed, 1 Feb 2017 02:42:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75E2FC67; Wed, 1 Feb 2017 02:42:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v112gjnT020240; Wed, 1 Feb 2017 02:42:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v112gjoP020239; Wed, 1 Feb 2017 02:42:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201702010242.v112gjoP020239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 1 Feb 2017 02:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313035 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 02:42:46 -0000 Author: jhibbits Date: Wed Feb 1 02:42:45 2017 New Revision: 313035 URL: https://svnweb.freebsd.org/changeset/base/313035 Log: Add rfdi opcode to binutils The rfdi instruction is part of the e500mc and derivative cores. It came into binutils in a GPLv3 patch, along with the rest of the e500mc instruction set. Currently only rfdi is planned to be used, so rather than attempt to backport the full patch, take a surgical route and add instructions as needed. MFC after: 2 weeks Modified: head/contrib/binutils/opcodes/ppc-opc.c Modified: head/contrib/binutils/opcodes/ppc-opc.c ============================================================================== --- head/contrib/binutils/opcodes/ppc-opc.c Wed Feb 1 02:00:18 2017 (r313034) +++ head/contrib/binutils/opcodes/ppc-opc.c Wed Feb 1 02:42:45 2017 (r313035) @@ -2789,6 +2789,7 @@ const struct powerpc_opcode powerpc_opco { "crnor", XL(19,33), XL_MASK, COM, { BT, BA, BB } }, { "rfmci", X(19,38), 0xffffffff, PPCRFMCI, { 0 } }, +{ "rfdi", XL(19,39), 0xffffffff, BOOKE, { 0 } }, { "rfi", XL(19,50), 0xffffffff, COM, { 0 } }, { "rfci", XL(19,51), 0xffffffff, PPC403 | BOOKE, { 0 } }, From owner-svn-src-head@freebsd.org Wed Feb 1 02:44:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3898CCB8D7 for ; Wed, 1 Feb 2017 02:44:19 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::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 BBB14E51 for ; Wed, 1 Feb 2017 02:44:19 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x243.google.com with SMTP id q20so19706840ioi.3 for ; Tue, 31 Jan 2017 18:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=4cudXx1aF9IxJ3BdrRzvIWEd3jgnMIQiCkLKMZWSg10=; b=vSmFEZyo5c2eFhXCS3q7Zha5V/QBag2794pwcMpTO3NRjnth9N7PIXGelmRghqNn7k OzJfkCKWVqfByZzCTxgAixgDQuNErY2bdhCqmfnLgOE2I4tr+CoPCmdz2ZeJ3Iwsm/r3 2tIXneSi/4puR/5ySJmb0+YvV7+FTRjhUKeer8DHMNwT7uciIETupIKLe1FamPs32iML Zh8/lNbM705hlXZ8/Sg6IHKfpbsEAy5OYZbyfTi+kxPNZBMC69cgnhhq1JHvi0LAefD2 CUkm14Fu7HZxhAnVQ5hc8EdW52ualiUOcKkpYht8oId8LisYdP+KBM29KVhNKqem+BHl atcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=4cudXx1aF9IxJ3BdrRzvIWEd3jgnMIQiCkLKMZWSg10=; b=WaaOtaRO2O21lhge+xRugaqqhH7uY57M3x7OBhhyDKSV8AUdG+FwKUVYS59oPU4e3I 86+CFWIVxNC6ia2eFpG7pknoBAjtg+DballLCzQ1dZybvUTLJOlj5rSzmFRplEyo5kA+ 7E9Q/x4N5guGF5T0d3kf4naAFPUICuNTyymb2FwtTI8QeaBdv55F6id9KEnPpk5eK1oJ 5DkT8eVNSw7RX86gPMa5QW6ac70ZEkT4QxMpBZVDijKJnq2ni3J/QZe704VzIvCek/TW G/jBhP5TscaBCXKRR0CYiqazK9gursF+xkbpzEh1Yu0FdzW42JCHLWUsLcrkzcCcjhwM MOaw== X-Gm-Message-State: AIkVDXIFHsOuJ+V71sQWnR9688xCyae6MvXqmXJjFk02mDkkQKerugtS/2Abp4cT5p5fUg== X-Received: by 10.107.205.66 with SMTP id d63mr750429iog.206.1485917058975; Tue, 31 Jan 2017 18:44:18 -0800 (PST) Received: from blackstar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id n30sm11200351ioe.32.2017.01.31.18.44.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 31 Jan 2017 18:44:18 -0800 (PST) Cc: svn-src-head@freebsd.org Message-Id: <2B31BF44-CB4F-4B07-AFFE-0D2083855BB2@gmail.com> From: Justin Hibbits To: Mark Millard In-Reply-To: <676ECF89-F9AE-436A-942A-003B76C6BFE2@dsl-only.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r313005 - in head/sys: conf modules/zfs Date: Tue, 31 Jan 2017 20:44:16 -0600 References: <676ECF89-F9AE-436A-942A-003B76C6BFE2@dsl-only.net> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 02:44:20 -0000 On Jan 31, 2017, at 4:26 AM, Mark Millard wrote: >> Modified: head/sys/modules/zfs/Makefile >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/modules/zfs/Makefile Tue Jan 31 01:48:55 2017 (r313004) >> +++ head/sys/modules/zfs/Makefile Tue Jan 31 01:55:29 2017 (r313005) >> @@ -94,7 +94,7 @@ CFLAGS+=-I${SUNW}/common >> CFLAGS+=-DBUILDING_ZFS >> >> .if ${MACHINE_ARCH} == "powerpc64" >> -CFLAGS+=-mminimal-toc >> +CFLAGS.gcc+=-mminimal-toc >> .endif >> >> .ifdef ZFS_DEBUG > > You may want to process my bugzilla 215107 with head/sys/modules/zfs/ > Makefile > as it also deals with that -mminimal-toc: in other words to declare > 215107 > fixed by this update. > > === > Mark Millard > markmi at dsl-only.net > Ah, thanks for reminding me, I'll take that. - Justin From owner-svn-src-head@freebsd.org Wed Feb 1 03:16:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0F5CC9058; Wed, 1 Feb 2017 03:16:54 +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 B4C871E96; Wed, 1 Feb 2017 03:16:53 +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 633A31050504; Wed, 1 Feb 2017 14:16:48 +1100 (AEDT) Date: Wed, 1 Feb 2017 14:16:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: Message-ID: <20170201123838.X1974@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=c+HbeV1l c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=PO7r1zJSAAAA:8 a=rmU_qhSHxxD-BSzR1V0A:9 a=45ClL6m2LaAA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 03:16:54 -0000 Another reply to this... On Tue, 31 Jan 2017, Conrad Meyer wrote: > On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans wrote= : >> On Tue, 31 Jan 2017, Bruce Evans wrote: >> Unrolling (or not) may be helpful or harmful for entry and exit code. > > Helpful, per my earlier benchmarks. > >> I >> think there should by no alignment on entry -- just assume the buffer is >> aligned in the usual case, and only run 4% slower when it is misaligned. > > Please write such a patch and demonstrate the improvement. It is easy to demonstrate. I just put #if 0 around the early alignment code. The result seem too good to be true, so maybe I missed some later dependency on alignment of the addresses: - for 128-byte buffers and misalignment of 3, 10g takes 1.48 seconds with alignment and 1.02 seconds without alignment. This actually makes sense, 128 bytes can be done with 16 8-byte unaligned crc32q's. The alignment code makes it do 15 * 8-but and (5 + 3) * 1-byte. 7 more 3-cycle instructions and overhead too is far more than the cost of letting the CPU do read-combining. - for 4096-byte buffers, the difference is insignificant (0.47 seconds for 10g. >> I >> don't understand the algorithm for joining crcs -- why doesn't it work >> to reduce to 12 or 24 bytes in the main loop? > >It would, but I haven't implemented or tested that. You're welcome to >do so and demonstrate an improvement. It does add more lookup table >bloat, but perhaps we could just remove the 3x8k table =E2=80=94 I'm not s= ure >it adds any benefit over the 3x256 table. Good idea, but the big table is useful. Ifdefing out the LONG case reduces the speed for large buffers from ~0.35 seconds to ~0.43 seconds in the setup below. Ifdefing out the SHORT case only reduces to ~0.39 seconds. I hoped that an even shorter SHORT case would work. I think it now handles 768 bytes (3 * SHORT) in the inner loop. That is 32 sets of 3 crc32q's, and I would have thought that update at the end would take about as long as 1 iteration (3%), but it apparently takes 33%. >> ... >> Your benchmarks mainly give results for the <=3D 768 bytes where most of >> the manual optimizations don't apply. > > 0x000400: asm:68 intrins:62 multitable:684 (ns per buf) > 0x000800: asm:132 intrins:133 (ns per buf) > 0x002000: asm:449 intrins:446 (ns per buf) > 0x008000: asm:1501 intrins:1497 (ns per buf) > 0x020000: asm:5618 intrins:5609 (ns per buf) > > (All routines are in a separate compilation unit with no full-program > optimization, as they are in the kernel.) These seem slow. I modified my program to test the actual kernel code, and get for 10gB on freefall's Xeon (main times in seconds): 0x000008: asm(rm):3.41 asm(r):3.07 intrins:6.01 gcc:3.74 (3S =3D 2.4ns/buf= ) 0x000010: asm(rm):2.05 asm(r):1.70 intrins:2.92 gcc:2.62 (2S =3D 3/2ns/buf= ) 0x000020: asm(rm):1.63 asm(r):1.58 intrins:1.62 gcc:1.61 (1.6S =3D 5.12ns/= buf) 0x000040: asm(rm):1.07 asm(r):1.11 intrins:1.06 gcc:1.14 (1.1S =3D 7.04ns/= buf) 0x000080: asm(rm):1.02 asm(r):1.04 intrins:1.03 gcc:1.04 (1.02S =3D 13.06n= s/buf) 0x000100: asm(rm):1.02 asm(r):1.02 intrins:1.02 gcc:1.08 (1.02S =3D 52.22n= s/buf) 0x000200: asm(rm):1.02 asm(r):1.02 intrins:1.02 gcc:1.02 (1.02S =3D 104.45= ns/buf) 0x000400: asm(rm):0.58 asm(r):0.57 intrins:0.57 gcc:0.57 (.57S =3D 116.43n= s/buf) 0x001000: asm(rm):0.62 asm(r):0.57 intrins:0.57 gcc:0.57 (.57S =3D 233.44n= s/buf) 0x002000: asm(rm):0.48 asm(r):0.46 intrins:0.46 gcc:0.46 (.46S =3D 376.83n= s/buf) 0x004000: asm(rm):0.49 asm(r):0.46 intrins:0.46 gcc:0.46 (.46S =3D 753.66n= s/buf) 0x008000: asm(rm):0.49 asm(r):0.38 intrins:0.38 gcc:0.38 (.38S =3D 1245.18= ns/buf) 0x010000: asm(rm):0.47 asm(r):0.38 intrins:0.36 gcc:0.38 (.36S =3D 2359.30= ns/buf) 0x020000: asm(rm):0.43 asm(r):1.05 intrins:0.35 gcc:0.36 (.35S =3D 4587.52= ns/buf) asm(r) is a fix for clang's slownes with inline asms. Just change the constraint from "rm" to "r". This takes an extra register, but no more uops. This is for the aligned case with no hacks. intrins does something bad for small buffers. Probably just the branch ove= r the dead unrolling. Twice 2.4ns/buf for 8-byte buffers is still very fast. This is 16 cycles. 3 cycles to do 1 crc32q and the rest mainly for 1 funct= ion call and too many branches. Bruce From owner-svn-src-head@freebsd.org Wed Feb 1 03:29:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 549DFCC93A4; Wed, 1 Feb 2017 03:29:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3D43C2; Wed, 1 Feb 2017 03:29:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v113TE4h037476; Wed, 1 Feb 2017 03:29:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v113TEPn037471; Wed, 1 Feb 2017 03:29:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201702010329.v113TEPn037471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 1 Feb 2017 03:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313036 - in head/sys/powerpc: booke include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 03:29:15 -0000 Author: jhibbits Date: Wed Feb 1 03:29:13 2017 New Revision: 313036 URL: https://svnweb.freebsd.org/changeset/base/313036 Log: Add Book-E Enhanced Debug (E.D) profile debug support Freescale added the E.D profile to e500mc and derivative cores. From Freescale's EREF reference manual this is enabled by a bit in HID0 and should otherwise default to traditional debug. However, none of the Freescale cores support that bit, and instead always use E.D. This results in kernel panics using the standard debug on e500mc+ cores. Enhanced debug allows debugging of interrupts, including critical interrupts, as it uses a different save/restore registers (srr*). At this time we don't use this ability, so instead share the core of the debug handler code between both handlers. MFC after: 3 weeks Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Wed Feb 1 02:42:45 2017 (r313035) +++ head/sys/powerpc/booke/booke_machdep.c Wed Feb 1 03:29:13 2017 (r313036) @@ -187,6 +187,7 @@ extern void *int_watchdog; extern void *int_data_tlb_error; extern void *int_inst_tlb_error; extern void *int_debug; +extern void *int_debug_ed; extern void *int_vec; extern void *int_vecast; #ifdef HWPMC_HOOKS @@ -242,6 +243,7 @@ ivor_setup(void) case FSL_E500mc: case FSL_E5500: SET_TRAP(SPR_IVOR7, int_fpu); + SET_TRAP(SPR_IVOR15, int_debug_ed); break; case FSL_E500v1: case FSL_E500v2: Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Wed Feb 1 02:42:45 2017 (r313035) +++ head/sys/powerpc/booke/trap_subr.S Wed Feb 1 03:29:13 2017 (r313036) @@ -794,6 +794,22 @@ interrupt_vector_top: INTERRUPT(int_debug) STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG) + bl int_debug_int + FRAME_LEAVE(SPR_CSRR0, SPR_CSRR1) + rfci + +INTERRUPT(int_debug_ed) + STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_DSRR0, SPR_DSRR1) + FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG) + bl int_debug_int + FRAME_LEAVE(SPR_DSRR0, SPR_DSRR1) + rfdi + /* .long 0x4c00004e */ + +/* Internal helper for debug interrupt handling. */ +/* Common code between e500v1/v2 and e500mc-based cores. */ +int_debug_int: + mflr %r14 GET_CPUINFO(%r3) lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0)(%r3) bl 0f @@ -819,7 +835,8 @@ INTERRUPT(int_debug) mtspr SPR_SRR0, %r3 lwz %r4, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR1+8)(%r4); mtspr SPR_SRR1, %r4 - b 9f + mtlr %r14 + blr 1: addi %r3, %r1, 8 bl CNAME(trap) @@ -828,10 +845,6 @@ INTERRUPT(int_debug) * We actually need to return to the process with an rfi. */ b trapexit -9: - FRAME_LEAVE(SPR_CSRR0, SPR_CSRR1) - rfci - /***************************************************************************** * Common trap code Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Wed Feb 1 02:42:45 2017 (r313035) +++ head/sys/powerpc/include/spr.h Wed Feb 1 03:29:13 2017 (r313036) @@ -671,6 +671,8 @@ #define SPR_CSRR1 0x03b /* ..8 59 Critical SRR1 */ #define SPR_MCSRR0 0x23a /* ..8 570 Machine check SRR0 */ #define SPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */ +#define SPR_DSRR0 0x23e /* ..8 574 Debug SRR0 */ +#define SPR_DSRR1 0x23f /* ..8 575 Debug SRR1 */ #define SPR_MMUCR 0x3b2 /* 4.. MMU Control Register */ #define MMUCR_SWOA (0x80000000 >> 7) From owner-svn-src-head@freebsd.org Wed Feb 1 03:32:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BE2CC9573; Wed, 1 Feb 2017 03:32:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB259F7; Wed, 1 Feb 2017 03:32:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v113Wovs041369; Wed, 1 Feb 2017 03:32:50 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v113WnYf041362; Wed, 1 Feb 2017 03:32:49 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201702010332.v113WnYf041362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Wed, 1 Feb 2017 03:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 03:32:51 -0000 Author: jah Date: Wed Feb 1 03:32:49 2017 New Revision: 313037 URL: https://svnweb.freebsd.org/changeset/base/313037 Log: Implement get_pcpu() for the remaining architectures and use it to replace pcpu_find(curcpu) in MI code. Modified: head/sys/amd64/include/pcpu.h head/sys/kern/kern_rmlock.c head/sys/mips/include/pcpu.h head/sys/net/netisr.c head/sys/powerpc/include/cpufunc.h head/sys/powerpc/include/pcpu.h head/sys/sparc64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/amd64/include/pcpu.h Wed Feb 1 03:32:49 2017 (r313037) @@ -78,6 +78,7 @@ extern struct pcpu *pcpup; +#define get_pcpu() (pcpup) #define PCPU_GET(member) (pcpup->pc_ ## member) #define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) #define PCPU_INC(member) PCPU_ADD(member, 1) @@ -203,6 +204,15 @@ extern struct pcpu *pcpup; } \ } +#define get_pcpu() __extension__ ({ \ + struct pcpu *__pc; \ + \ + __asm __volatile("movq %%gs:%1,%0" \ + : "=r" (__pc) \ + : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \ + __pc; \ +}) + #define PCPU_GET(member) __PCPU_GET(pc_ ## member) #define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val) #define PCPU_INC(member) __PCPU_INC(pc_ ## member) Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/kern/kern_rmlock.c Wed Feb 1 03:32:49 2017 (r313037) @@ -156,7 +156,7 @@ unlock_rm(struct lock_object *lock) */ critical_enter(); td = curthread; - pc = pcpu_find(curcpu); + pc = get_pcpu(); for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { tracker = (struct rm_priotracker *)queue; @@ -258,7 +258,7 @@ rm_cleanIPI(void *arg) struct rmlock *rm = arg; struct rm_priotracker *tracker; struct rm_queue *queue; - pc = pcpu_find(curcpu); + pc = get_pcpu(); for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { @@ -355,7 +355,7 @@ _rm_rlock_hard(struct rmlock *rm, struct struct pcpu *pc; critical_enter(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); /* Check if we just need to do a proper critical_exit. */ if (!CPU_ISSET(pc->pc_cpuid, &rm->rm_writecpus)) { @@ -416,7 +416,7 @@ _rm_rlock_hard(struct rmlock *rm, struct } critical_enter(); - pc = pcpu_find(curcpu); + pc = get_pcpu(); CPU_CLR(pc->pc_cpuid, &rm->rm_writecpus); rm_tracker_add(pc, tracker); sched_pin(); @@ -641,7 +641,7 @@ _rm_rlock_debug(struct rmlock *rm, struc #ifdef INVARIANTS if (!(rm->lock_object.lo_flags & LO_RECURSABLE) && !trylock) { critical_enter(); - KASSERT(rm_trackers_present(pcpu_find(curcpu), rm, + KASSERT(rm_trackers_present(get_pcpu(), rm, curthread) == 0, ("rm_rlock: recursed on non-recursive rmlock %s @ %s:%d\n", rm->lock_object.lo_name, file, line)); @@ -771,7 +771,7 @@ _rm_assert(const struct rmlock *rm, int } critical_enter(); - count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + count = rm_trackers_present(get_pcpu(), rm, curthread); critical_exit(); if (count == 0) @@ -797,7 +797,7 @@ _rm_assert(const struct rmlock *rm, int rm->lock_object.lo_name, file, line); critical_enter(); - count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + count = rm_trackers_present(get_pcpu(), rm, curthread); critical_exit(); if (count != 0) Modified: head/sys/mips/include/pcpu.h ============================================================================== --- head/sys/mips/include/pcpu.h Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/mips/include/pcpu.h Wed Feb 1 03:32:49 2017 (r313037) @@ -65,6 +65,7 @@ extern char pcpu_space[MAXCPU][PAGE_SIZE extern struct pcpu *pcpup; #define PCPUP pcpup +#define get_pcpu() (pcpup) #define PCPU_ADD(member, value) (PCPUP->pc_ ## member += (value)) #define PCPU_GET(member) (PCPUP->pc_ ## member) #define PCPU_INC(member) PCPU_ADD(member, 1) Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/net/netisr.c Wed Feb 1 03:32:49 2017 (r313037) @@ -1268,9 +1268,7 @@ netisr_start_swi(u_int cpuid, struct pcp static void netisr_init(void *arg) { -#ifdef EARLY_AP_STARTUP struct pcpu *pc; -#endif NETISR_LOCK_INIT(); if (netisr_maxthreads == 0 || netisr_maxthreads < -1 ) @@ -1308,7 +1306,8 @@ netisr_init(void *arg) netisr_start_swi(pc->pc_cpuid, pc); } #else - netisr_start_swi(curcpu, pcpu_find(curcpu)); + pc = get_pcpu(); + netisr_start_swi(pc->pc_cpuid, pc); #endif } SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL); Modified: head/sys/powerpc/include/cpufunc.h ============================================================================== --- head/sys/powerpc/include/cpufunc.h Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/powerpc/include/cpufunc.h Wed Feb 1 03:32:49 2017 (r313037) @@ -201,7 +201,7 @@ intr_restore(register_t msr) } static __inline struct pcpu * -powerpc_get_pcpup(void) +get_pcpu(void) { struct pcpu *ret; Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/powerpc/include/pcpu.h Wed Feb 1 03:32:49 2017 (r313037) @@ -142,7 +142,7 @@ struct pvo_entry; #ifdef _KERNEL -#define pcpup ((struct pcpu *) powerpc_get_pcpup()) +#define pcpup (get_pcpu()) static __inline __pure2 struct thread * __curthread(void) Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Wed Feb 1 03:29:13 2017 (r313036) +++ head/sys/sparc64/include/pcpu.h Wed Feb 1 03:32:49 2017 (r313037) @@ -74,6 +74,7 @@ struct pcpu; register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); +#define get_pcpu() (pcpup) #define PCPU_GET(member) (pcpup->pc_ ## member) static __inline __pure2 struct thread * From owner-svn-src-head@freebsd.org Wed Feb 1 03:48:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB61CC9886; Wed, 1 Feb 2017 03:48:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) (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 C1B44E71; Wed, 1 Feb 2017 03:48:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f66.google.com with SMTP id u63so2759024wmu.2; Tue, 31 Jan 2017 19:48:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=WWiyHxt5HVthivQqQ/DK2Et9fAgy86UG3XdpnRvUvt0=; b=JjNYEpMdJsxAraZZWJY6hhtGpfkXS5p9rmDm7iMINUSai1TAvj+8wSzNIfhojBnD6p UibOjcAz8X7G1q7sdb9ePsgCTc25kRcQKNJrBxWJCbvkIj3+rhRFcqMpIKDOv7aiMJc5 1jEqb4yi7RYT90+fvmhqcmS+B2PxhqRoA2tptVIp2q7DxnM1/XeTB6PoLDHy/OfaG9Zt R/YdFbZV4t8qMXJjocJNMk6pDgWJQi9B+p0zIHKJO2z5pffc0hHXKqO6DbfT6ZkFTcXK n5/rBHTBHbVzaCJJXLfisaKVv1Lwcwdd7HZYYdCXn6gMxcnXTGNStRy/Cnjw0+cHM3Hz CUog== X-Gm-Message-State: AIkVDXLtgPTXxy0ZLun9fhFnvlGm8Ck3jQGwHhG43EoIeUu8xPNmMC/DO2e/+A30R5XV6w== X-Received: by 10.223.165.1 with SMTP id i1mr517215wrb.82.1485920873992; Tue, 31 Jan 2017 19:47:53 -0800 (PST) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id k70sm27194589wmc.3.2017.01.31.19.47.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 19:47:53 -0800 (PST) Received: by mail-wm0-f53.google.com with SMTP id v77so18495256wmv.0; Tue, 31 Jan 2017 19:47:53 -0800 (PST) X-Received: by 10.223.174.183 with SMTP id y52mr592705wrc.112.1485920873590; Tue, 31 Jan 2017 19:47:53 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.22.42 with HTTP; Tue, 31 Jan 2017 19:47:53 -0800 (PST) In-Reply-To: <20170201123838.X1974@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> <20170201123838.X1974@besplex.bde.org> From: Conrad Meyer Date: Tue, 31 Jan 2017 19:47:53 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 03:48:02 -0000 On Tue, Jan 31, 2017 at 7:16 PM, Bruce Evans wrote: > Another reply to this... > > On Tue, 31 Jan 2017, Conrad Meyer wrote: > >> On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans wrot= e: >>> >>> On Tue, 31 Jan 2017, Bruce Evans wrote: >>> I >>> think there should by no alignment on entry -- just assume the buffer i= s >>> aligned in the usual case, and only run 4% slower when it is misaligned= . >> >> >> Please write such a patch and demonstrate the improvement. > > > It is easy to demonstrate. I just put #if 0 around the early alignment > code. The result seem too good to be true, so maybe I missed some > later dependency on alignment of the addresses: > - for 128-byte buffers and misalignment of 3, 10g takes 1.48 seconds with > alignment and 1.02 seconds without alignment. > This actually makes sense, 128 bytes can be done with 16 8-byte unaligned > crc32q's. The alignment code makes it do 15 * 8-but and (5 + 3) * 1-byte= . > 7 more 3-cycle instructions and overhead too is far more than the cost > of letting the CPU do read-combining. > - for 4096-byte buffers, the difference is insignificant (0.47 seconds fo= r > 10g. I believe it, especially for newer amd64. I seem to recall that older x86 machines had a higher misalignment penalty, but it was largely reduced in (?)Nehalem. Why don't you go ahead and commit that change? >> perhaps we could just remove the 3x8k table =E2=80=94 I'm not sure >> it adds any benefit over the 3x256 table. > > > Good idea, but the big table is useful. Ifdefing out the LONG case reduc= es > the speed for large buffers from ~0.35 seconds to ~0.43 seconds in the > setup below. Ifdefing out the SHORT case only reduces to ~0.39 seconds. Interesting. > I hoped that an even shorter SHORT case would work. I think it now handl= es > 768 bytes (3 * SHORT) in the inner loop. Right. > That is 32 sets of 3 crc32q's, > and I would have thought that update at the end would take about as long > as 1 iteration (3%), but it apparently takes 33%. The update at the end may be faster with PCLMULQDQ. There are versions of this algorithm that use that in place of the lookup-table combine (for example, Linux has a permissively licensed implementation here: http://lxr.free-electrons.com/source/arch/x86/crypto/crc32c-pcl-intel= -asm_64.S ). Unfortunately, PCLMULQDQ uses FPU state, which is inappropriate most of the time in kernel mode. It could be used opportunistically if the thread is already in FPU-save mode or if the input is "big enough" to make it worth it. >>> Your benchmarks mainly give results for the <=3D 768 bytes where most o= f >>> the manual optimizations don't apply. >> >> >> 0x000400: asm:68 intrins:62 multitable:684 (ns per buf) >> 0x000800: asm:132 intrins:133 (ns per buf) >> 0x002000: asm:449 intrins:446 (ns per buf) >> 0x008000: asm:1501 intrins:1497 (ns per buf) >> 0x020000: asm:5618 intrins:5609 (ns per buf) >> >> (All routines are in a separate compilation unit with no full-program >> optimization, as they are in the kernel.) > > > These seem slow. I modified my program to test the actual kernel code, > and get for 10gB on freefall's Xeon (main times in seconds): Freefall has a Haswell Xeon @ 3.3GHz. My laptop is a Sandy Bridge Core i5 @ 2.6 GHz. That may help explain the difference. Best, Conrad From owner-svn-src-head@freebsd.org Wed Feb 1 04:02:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EDECC9C54; Wed, 1 Feb 2017 04:02:01 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC5F164C; Wed, 1 Feb 2017 04:02:01 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 39085E5; Tue, 31 Jan 2017 22:01:55 -0600 (CST) Date: Tue, 31 Jan 2017 22:01:54 -0600 From: Mark Linimon To: Warner Losh Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201040153.GB32398@lonesome.com> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <2911087.bbEsWibF87@ralph.baldwin.cx> <3458844.3oruRKbrzH@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 04:02:01 -0000 On Tue, Jan 31, 2017 at 04:36:04PM -0700, Warner Losh wrote: > ISA-only attachments would be a good place to start. My quick glance > shows this would be le(4), aha(4), cm(4), mse(4), and joy(4). There's > maybe half a dozen EISA-only drivers in the tree that I was planning > on retiring in 12, along with EISA. Likewise with the MCA attachments. I can join the list of people threatening to send ISA cards to anyone who objects. This should scare them into not objecting :-) (Yes, there is still at least one aha(4) card here in the house. Somewhere.) mcl From owner-svn-src-head@freebsd.org Wed Feb 1 05:00:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1338CD4A89; Wed, 1 Feb 2017 05:00:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB635190D; Wed, 1 Feb 2017 05:00:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1150Ygw075052; Wed, 1 Feb 2017 05:00:34 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1150YLR075051; Wed, 1 Feb 2017 05:00:34 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201702010500.v1150YLR075051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 1 Feb 2017 05:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313040 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 05:00:36 -0000 Author: kan Date: Wed Feb 1 05:00:34 2017 New Revision: 313040 URL: https://svnweb.freebsd.org/changeset/base/313040 Log: Add atomic_fcmpset_*() inlines for MIPS atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer. Reviewed by: imp, brooks Requested by: mjg Differential Revision: https://reviews.freebsd.org/D9391 Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Wed Feb 1 04:54:23 2017 (r313039) +++ head/sys/mips/include/atomic.h Wed Feb 1 05:00:34 2017 (r313040) @@ -362,7 +362,7 @@ atomic_load_64(__volatile uint64_t *p, u * zero if the compare failed, nonzero otherwise. */ static __inline uint32_t -atomic_cmpset_32(__volatile uint32_t* p, uint32_t cmpval, uint32_t newval) +atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { uint32_t ret; @@ -405,6 +405,46 @@ atomic_cmpset_rel_32(__volatile uint32_t return (atomic_cmpset_32(p, cmpval, newval)); } +static __inline uint32_t +atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +{ + uint32_t ret; + + __asm __volatile ( + "1:\n\t" + "ll %0, %1\n\t" /* load old value */ + "bne %0, %4, 2f\n\t" /* compare */ + "move %0, %3\n\t" /* value to store */ + "sc %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* if it failed, spin */ + "j 3f\n\t" + "2:\n\t" + "sw %0, %2\n\t" /* save old value */ + "li %0, 0\n\t" + "3:\n" + : "=&r" (ret), "+m" (*p), "=m" (*cmpval) + : "r" (newval), "r" (*cmpval) + : "memory"); + return ret; +} + +static __inline uint32_t +atomic_fcmpset_acq_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +{ + int retval; + + retval = atomic_fcmpset_32(p, cmpval, newval); + mips_sync(); + return (retval); +} + +static __inline uint32_t +atomic_fcmpset_rel_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +{ + mips_sync(); + return (atomic_fcmpset_32(p, cmpval, newval)); +} + /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -431,7 +471,7 @@ atomic_fetchadd_32(__volatile uint32_t * * zero if the compare failed, nonzero otherwise. */ static __inline uint64_t -atomic_cmpset_64(__volatile uint64_t* p, uint64_t cmpval, uint64_t newval) +atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { uint64_t ret; @@ -475,6 +515,47 @@ atomic_cmpset_rel_64(__volatile uint64_t return (atomic_cmpset_64(p, cmpval, newval)); } +static __inline uint32_t +atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +{ + uint32_t ret; + + __asm __volatile ( + "1:\n\t" + "lld %0, %1\n\t" /* load old value */ + "bne %0, %4, 2f\n\t" /* compare */ + "move %0, %3\n\t" /* value to store */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* if it failed, spin */ + "j 3f\n\t" + "2:\n\t" + "sw %0, %2\n\t" /* save old value */ + "li %0, 0\n\t" + "3:\n" + : "=&r" (ret), "+m" (*p), "=m" (*cmpval) + : "r" (newval), "r" (*cmpval) + : "memory"); + + return ret; +} + +static __inline uint64_t +atomic_fcmpset_acq_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +{ + int retval; + + retval = atomic_fcmpset_64(p, cmpval, newval); + mips_sync(); + return (retval); +} + +static __inline uint64_t +atomic_fcmpset_rel_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +{ + mips_sync(); + return (atomic_fcmpset_64(p, cmpval, newval)); +} + /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -568,6 +649,9 @@ atomic_thread_fence_seq_cst(void) #define atomic_cmpset_int atomic_cmpset_32 #define atomic_cmpset_acq_int atomic_cmpset_acq_32 #define atomic_cmpset_rel_int atomic_cmpset_rel_32 +#define atomic_fcmpset_int atomic_fcmpset_32 +#define atomic_fcmpset_acq_int atomic_fcmpset_acq_32 +#define atomic_fcmpset_rel_int atomic_fcmpset_rel_32 #define atomic_load_acq_int atomic_load_acq_32 #define atomic_store_rel_int atomic_store_rel_32 #define atomic_readandclear_int atomic_readandclear_32 @@ -597,6 +681,9 @@ atomic_thread_fence_seq_cst(void) #define atomic_cmpset_long atomic_cmpset_64 #define atomic_cmpset_acq_long atomic_cmpset_acq_64 #define atomic_cmpset_rel_long atomic_cmpset_rel_64 +#define atomic_fcmpset_long atomic_fcmpset_64 +#define atomic_fcmpset_acq_long atomic_fcmpset_acq_64 +#define atomic_fcmpset_rel_long atomic_fcmpset_rel_64 #define atomic_load_acq_long atomic_load_acq_64 #define atomic_store_rel_long atomic_store_rel_64 #define atomic_fetchadd_long atomic_fetchadd_64 @@ -638,6 +725,15 @@ atomic_thread_fence_seq_cst(void) #define atomic_cmpset_rel_long(p, cmpval, newval) \ atomic_cmpset_rel_32((volatile u_int *)(p), (u_int)(cmpval), \ (u_int)(newval)) +#define atomic_fcmpset_long(p, cmpval, newval) \ + atomic_fcmpset_32((volatile u_int *)(p), (u_int *)(cmpval), \ + (u_int)(newval)) +#define atomic_fcmpset_acq_long(p, cmpval, newval) \ + atomic_fcmpset_acq_32((volatile u_int *)(p), (u_int *)(cmpval), \ + (u_int)(newval)) +#define atomic_fcmpset_rel_long(p, cmpval, newval) \ + atomic_fcmpset_rel_32((volatile u_int *)(p), (u_int *)(cmpval), \ + (u_int)(newval)) #define atomic_load_acq_long(p) \ (u_long)atomic_load_acq_32((volatile u_int *)(p)) #define atomic_store_rel_long(p, v) \ @@ -665,6 +761,9 @@ atomic_thread_fence_seq_cst(void) #define atomic_cmpset_ptr atomic_cmpset_long #define atomic_cmpset_acq_ptr atomic_cmpset_acq_long #define atomic_cmpset_rel_ptr atomic_cmpset_rel_long +#define atomic_fcmpset_ptr atomic_fcmpset_long +#define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_long +#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_long #define atomic_load_acq_ptr atomic_load_acq_long #define atomic_store_rel_ptr atomic_store_rel_long #define atomic_readandclear_ptr atomic_readandclear_long From owner-svn-src-head@freebsd.org Wed Feb 1 05:24:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE1CCCEF65; Wed, 1 Feb 2017 05:24:18 +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 3F4B266D; Wed, 1 Feb 2017 05:24:18 +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 v115OH9D086101; Wed, 1 Feb 2017 05:24:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v115OH0n086100; Wed, 1 Feb 2017 05:24:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702010524.v115OH0n086100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 1 Feb 2017 05:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313041 - head/gnu/usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 05:24:18 -0000 Author: emaste Date: Wed Feb 1 05:24:17 2017 New Revision: 313041 URL: https://svnweb.freebsd.org/changeset/base/313041 Log: Bump GCC FBSD_CC_VER for r312899 (-march=octeon+ support) Reported by: lidl MFC after: 1 month MFC with: r312899 Sponsored by: The FreeBSD Foundation Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Wed Feb 1 05:00:34 2017 (r313040) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Wed Feb 1 05:24:17 2017 (r313041) @@ -8,7 +8,7 @@ /* Fake out gcc/config/freebsd.h. */ #define FBSD_MAJOR 12 -#define FBSD_CC_VER 1200000 /* form like __FreeBSD_version */ +#define FBSD_CC_VER 1200001 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ From owner-svn-src-head@freebsd.org Wed Feb 1 08:47:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4F74CCA8E1; Wed, 1 Feb 2017 08:47:00 +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 839DD1056; Wed, 1 Feb 2017 08:47:00 +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 v118kxth070782; Wed, 1 Feb 2017 08:46:59 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v118kxNk070776; Wed, 1 Feb 2017 08:46:59 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201702010846.v118kxNk070776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 1 Feb 2017 08:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313042 - in head/sys/boot: efi/include efi/libefi efi/loader forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 08:47:00 -0000 Author: tsoome Date: Wed Feb 1 08:46:59 2017 New Revision: 313042 URL: https://svnweb.freebsd.org/changeset/base/313042 Log: loader.efi environment related cleanups Since we have dedicated libefi/env.c file for variable support, the following changes are done: Simple cstyle changes in env.c Moved efi variable related commands from loader/main.c to libefi/env.c Did create function to set "efi-version" environment variable in env.c. This function does serve two purposes: for first a small clean up of the loader main(), and for second, it does replace the otherwise unused efi_variable_support hack. A bit of cleanup of ficl backend functions. The TEST_MAIN has no meaning, and removed few memory leaks. The forth code is updated to use "efi-version" variable, instead of ficl environment check. Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D9165 Added: head/sys/boot/efi/libefi/wchar.c (contents, props changed) Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/env.c head/sys/boot/efi/loader/main.c head/sys/boot/forth/loader.4th Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Wed Feb 1 05:24:17 2017 (r313041) +++ head/sys/boot/efi/include/efilib.h Wed Feb 1 08:46:59 2017 (r313042) @@ -65,4 +65,12 @@ EFI_STATUS main(int argc, CHAR16 *argv[] void exit(EFI_STATUS status); void delay(int usecs); +/* EFI environment initialization. */ +void efi_init_environment(void); + +/* CHAR16 utility functions. */ +int wcscmp(CHAR16 *, CHAR16 *); +void cpy8to16(const char *, CHAR16 *, size_t); +void cpy16to8(const CHAR16 *, char *, size_t); + #endif /* _LOADER_EFILIB_H */ Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Wed Feb 1 05:24:17 2017 (r313041) +++ head/sys/boot/efi/libefi/Makefile Wed Feb 1 08:46:59 2017 (r313042) @@ -3,6 +3,7 @@ .include .if ${MK_FORTH} != "no" +CFLAGS+= -DBOOT_FORTH .include "${.CURDIR}/../../Makefile.ficl" .endif @@ -10,17 +11,14 @@ LIB= efi INTERNALLIB= WARNS?= 2 -SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c errno.c \ - handles.c libefi.c +SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ + handles.c wchar.c libefi.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c .elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" SRCS+= time_event.c .endif -.if ${MK_FORTH} != "no" -SRCS+= env.c -.endif # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only Modified: head/sys/boot/efi/libefi/env.c ============================================================================== --- head/sys/boot/efi/libefi/env.c Wed Feb 1 05:24:17 2017 (r313041) +++ head/sys/boot/efi/libefi/env.c Wed Feb 1 08:46:59 2017 (r313042) @@ -26,15 +26,17 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include +#include #include "bootstrap.h" +#ifdef BOOT_FORTH #include "ficl.h" - -int efi_variable_support = 1; +#endif /* * Simple wrappers to the underlying UEFI functions. @@ -42,36 +44,348 @@ int efi_variable_support = 1; * for details. */ EFI_STATUS -efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, EFI_GUID *vendor_guid) +efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, + EFI_GUID *vendor_guid) { - return RS->GetNextVariableName(variable_name_size, variable_name, vendor_guid); + return (RS->GetNextVariableName(variable_name_size, variable_name, + vendor_guid)); } EFI_STATUS -efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 *attributes, UINTN *data_size, - void *data) +efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, + UINT32 *attributes, UINTN *data_size, void *data) { - return RS->GetVariable(variable_name, vendor_guid, attributes, data_size, data); + return (RS->GetVariable(variable_name, vendor_guid, attributes, + data_size, data)); } EFI_STATUS -efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 attributes, UINTN data_size, - void *data) +efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, + UINT32 attributes, UINTN data_size, void *data) +{ + return (RS->SetVariable(variable_name, vendor_guid, attributes, + data_size, data)); +} + +void +efi_init_environment(void) +{ + char var[128]; + + snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, + ST->Hdr.Revision & 0xffff); + env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); +} + +COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); + +static int +efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) { - return RS->SetVariable(variable_name, vendor_guid, attributes, data_size, data); + UINTN datasz, i; + EFI_STATUS status; + UINT32 attr; + CHAR16 *data; + char *str; + uint32_t uuid_status; + int is_ascii; + + datasz = 0; + status = RS->GetVariable(varnamearg, matchguid, &attr, + &datasz, NULL); + if (status != EFI_BUFFER_TOO_SMALL) { + printf("Can't get the variable: error %#lx\n", status); + return (CMD_ERROR); + } + data = malloc(datasz); + status = RS->GetVariable(varnamearg, matchguid, &attr, + &datasz, data); + if (status != EFI_SUCCESS) { + printf("Can't get the variable: error %#lx\n", status); + return (CMD_ERROR); + } + uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); + if (lflag) { + printf("%s 0x%x %S", str, attr, varnamearg); + } else { + printf("%s 0x%x %S=", str, attr, varnamearg); + is_ascii = 1; + free(str); + str = (char *)data; + for (i = 0; i < datasz - 1; i++) { + /* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */ + if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) { + is_ascii = 0; + break; + } + } + if (str[datasz - 1] != '\0') + is_ascii = 0; + if (is_ascii) + printf("%s", str); + else { + for (i = 0; i < datasz / 2; i++) { + if (isalnum(data[i]) || isspace(data[i])) + printf("%c", data[i]); + else + printf("\\x%02x", data[i]); + } + } + } + free(data); + if (pager_output("\n")) + return (CMD_WARN); + return (CMD_OK); } +static int +command_efi_show(int argc, char *argv[]) +{ + /* + * efi-show [-a] + * print all the env + * efi-show -u UUID + * print all the env vars tagged with UUID + * efi-show -v var + * search all the env vars and print the ones matching var + * eif-show -u UUID -v var + * eif-show UUID var + * print all the env vars that match UUID and var + */ + /* NB: We assume EFI_GUID is the same as uuid_t */ + int aflag = 0, gflag = 0, lflag = 0, vflag = 0; + int ch, rv; + unsigned i; + EFI_STATUS status; + EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; + EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; + uint32_t uuid_status; + CHAR16 *varname; + CHAR16 *newnm; + CHAR16 varnamearg[128]; + UINTN varalloc; + UINTN varsz; + + while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { + switch (ch) { + case 'a': + aflag = 1; + break; + case 'g': + gflag = 1; + uuid_from_string(optarg, (uuid_t *)&matchguid, + &uuid_status); + if (uuid_status != uuid_s_ok) { + printf("uid %s could not be parsed\n", optarg); + return (CMD_ERROR); + } + break; + case 'l': + lflag = 1; + break; + case 'v': + vflag = 1; + if (strlen(optarg) >= nitems(varnamearg)) { + printf("Variable %s is longer than %zd characters\n", + optarg, nitems(varnamearg)); + return (CMD_ERROR); + } + for (i = 0; i < strlen(optarg); i++) + varnamearg[i] = optarg[i]; + varnamearg[i] = 0; + break; + default: + printf("Invalid argument %c\n", ch); + return (CMD_ERROR); + } + } + + if (aflag && (gflag || vflag)) { + printf("-a isn't compatible with -v or -u\n"); + return (CMD_ERROR); + } + + if (aflag && optind < argc) { + printf("-a doesn't take any args\n"); + return (CMD_ERROR); + } + + if (optind == argc) + aflag = 1; + + argc -= optind; + argv += optind; + + pager_open(); + if (vflag && gflag) { + rv = efi_print_var(varnamearg, &matchguid, lflag); + pager_close(); + return (rv); + } + + if (argc == 2) { + optarg = argv[0]; + if (strlen(optarg) >= nitems(varnamearg)) { + printf("Variable %s is longer than %zd characters\n", + optarg, nitems(varnamearg)); + pager_close(); + return (CMD_ERROR); + } + for (i = 0; i < strlen(optarg); i++) + varnamearg[i] = optarg[i]; + varnamearg[i] = 0; + optarg = argv[1]; + uuid_from_string(optarg, (uuid_t *)&matchguid, + &uuid_status); + if (uuid_status != uuid_s_ok) { + printf("uid %s could not be parsed\n", optarg); + pager_close(); + return (CMD_ERROR); + } + rv = efi_print_var(varnamearg, &matchguid, lflag); + pager_close(); + return (rv); + } + + if (argc > 0) { + printf("Too many args %d\n", argc); + pager_close(); + return (CMD_ERROR); + } + + /* + * Initiate the search -- note the standard takes pain + * to specify the initial call must be a poiner to a NULL + * character. + */ + varalloc = 1024; + varname = malloc(varalloc); + if (varname == NULL) { + printf("Can't allocate memory to get variables\n"); + pager_close(); + return (CMD_ERROR); + } + varname[0] = 0; + while (1) { + varsz = varalloc; + status = RS->GetNextVariableName(&varsz, varname, &varguid); + if (status == EFI_BUFFER_TOO_SMALL) { + varalloc = varsz; + newnm = realloc(varname, varalloc); + if (newnm == NULL) { + printf("Can't allocate memory to get variables\n"); + free(varname); + pager_close(); + return (CMD_ERROR); + } + varname = newnm; + continue; /* Try again with bigger buffer */ + } + if (status != EFI_SUCCESS) + break; + if (aflag) { + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; + continue; + } + if (vflag) { + if (wcscmp(varnamearg, varname) == 0) { + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; + continue; + } + } + if (gflag) { + if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) { + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; + continue; + } + } + } + free(varname); + pager_close(); + + return (CMD_OK); +} + +COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set); + +static int +command_efi_set(int argc, char *argv[]) +{ + char *uuid, *var, *val; + CHAR16 wvar[128]; + EFI_GUID guid; + uint32_t status; + EFI_STATUS err; + + if (argc != 4) { + printf("efi-set uuid var new-value\n"); + return (CMD_ERROR); + } + uuid = argv[1]; + var = argv[2]; + val = argv[3]; + uuid_from_string(uuid, (uuid_t *)&guid, &status); + if (status != uuid_s_ok) { + printf("Invalid uuid %s %d\n", uuid, status); + return (CMD_ERROR); + } + cpy8to16(var, wvar, sizeof(wvar)); + err = RS->SetVariable(wvar, &guid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS, + strlen(val) + 1, val); + if (EFI_ERROR(err)) { + printf("Failed to set variable: error %lu\n", EFI_ERROR_CODE(err)); + return (CMD_ERROR); + } + return (CMD_OK); +} + +COMMAND_SET(efiunset, "efi-unset", "delete / unset EFI variables", command_efi_unset); + +static int +command_efi_unset(int argc, char *argv[]) +{ + char *uuid, *var; + CHAR16 wvar[128]; + EFI_GUID guid; + uint32_t status; + EFI_STATUS err; + + if (argc != 3) { + printf("efi-unset uuid var\n"); + return (CMD_ERROR); + } + uuid = argv[1]; + var = argv[2]; + uuid_from_string(uuid, (uuid_t *)&guid, &status); + if (status != uuid_s_ok) { + printf("Invalid uuid %s\n", uuid); + return (CMD_ERROR); + } + cpy8to16(var, wvar, sizeof(wvar)); + err = RS->SetVariable(wvar, &guid, 0, 0, NULL); + if (EFI_ERROR(err)) { + printf("Failed to unset variable: error %lu\n", EFI_ERROR_CODE(err)); + return (CMD_ERROR); + } + return (CMD_OK); +} + +#ifdef BOOT_FORTH /* - * FreeBSD's loader interaction words and extras + * FreeBSD's loader interaction words and extras * - * efi-setenv ( value n name n guid n attr -- 0 | -1) - * efi-getenv ( guid n addr n -- addr' n' | -1 ) - * efi-unsetenv ( name n guid n'' -- ) + * efi-setenv ( value n name n guid n attr -- 0 | -1) + * efi-getenv ( guid n addr n -- addr' n' | -1 ) + * efi-unsetenv ( name n guid n'' -- ) */ /* * efi-setenv - * efi-setenv ( value n name n guid n attr -- 0 | -1) + * efi-setenv ( value n name n guid n attr -- 0 | -1) * * Set environment variables using the SetVariable EFI runtime service. * @@ -87,19 +401,18 @@ efi_set_variable(CHAR16 *variable_name, * 4 Run time access * (corresponding to the same bits in the UEFI spec). */ -void +static void ficlEfiSetenv(FICL_VM *pVM) { -#ifndef TESTMAIN char *value = NULL, *guid = NULL; CHAR16 *name = NULL; int i; -#endif char *namep, *valuep, *guidp; int names, values, guids, attr; - int status; + EFI_STATUS status; uuid_t u; uint32_t ustatus; + bool error = true; #if FICL_ROBUST > 1 vmCheckStack(pVM, 6, 0); @@ -112,10 +425,9 @@ ficlEfiSetenv(FICL_VM *pVM) values = stackPopINT(pVM->pStack); valuep = (char*)stackPopPtr(pVM->pStack); -#ifndef TESTMAIN guid = (char*)ficlMalloc(guids); if (guid == NULL) - vmThrowErr(pVM, "Error: out of memory"); + goto out; memcpy(guid, guidp, guids); uuid_from_string(guid, &u, &ustatus); if (ustatus != uuid_s_ok) { @@ -123,16 +435,16 @@ ficlEfiSetenv(FICL_VM *pVM) goto out; } - name = (CHAR16 *)ficlMalloc((names + 1) * sizeof(CHAR16)); + name = ficlMalloc((names + 1) * sizeof(CHAR16)); if (name == NULL) - vmThrowErr(pVM, "Error: out of memory"); + goto out; for (i = 0; i < names; i++) name[i] = namep[i]; - name[names] = (CHAR16)0; + name[names] = 0; - value = (char*)ficlMalloc(values + 1); + value = ficlMalloc(values + 1); if (value == NULL) - vmThrowErr(pVM, "Error: out of memory"); + goto out; memcpy(value, valuep, values); status = efi_set_variable(name, (EFI_GUID *)&u, attr, values, value); @@ -140,21 +452,20 @@ ficlEfiSetenv(FICL_VM *pVM) stackPushINT(pVM->pStack, 0); else stackPushINT(pVM->pStack, -1); + error = false; out: ficlFree(name); ficlFree(value); ficlFree(guid); -#endif - return; + if (error == true) + vmThrowErr(pVM, "Error: out of memory"); } -void +static void ficlEfiGetenv(FICL_VM *pVM) { -#ifndef TESTMAIN char *name, *value; -#endif char *namep; int names; @@ -164,7 +475,6 @@ ficlEfiGetenv(FICL_VM *pVM) names = stackPopINT(pVM->pStack); namep = (char*) stackPopPtr(pVM->pStack); -#ifndef TESTMAIN name = (char*) ficlMalloc(names+1); if (name == NULL) vmThrowErr(pVM, "Error: out of memory"); @@ -178,18 +488,13 @@ ficlEfiGetenv(FICL_VM *pVM) stackPushPtr(pVM->pStack, value); stackPushINT(pVM->pStack, strlen(value)); } else -#endif stackPushINT(pVM->pStack, -1); - - return; } -void +static void ficlEfiUnsetenv(FICL_VM *pVM) { -#ifndef TESTMAIN char *name; -#endif char *namep; int names; @@ -199,7 +504,6 @@ ficlEfiUnsetenv(FICL_VM *pVM) names = stackPopINT(pVM->pStack); namep = (char*) stackPopPtr(pVM->pStack); -#ifndef TESTMAIN name = (char*) ficlMalloc(names+1); if (name == NULL) vmThrowErr(pVM, "Error: out of memory"); @@ -208,9 +512,6 @@ ficlEfiUnsetenv(FICL_VM *pVM) unsetenv(name); ficlFree(name); -#endif - - return; } /************************************************************************** @@ -218,17 +519,14 @@ ficlEfiUnsetenv(FICL_VM *pVM) **************************************************************************/ void ficlEfiCompilePlatform(FICL_SYSTEM *pSys) { - FICL_DICT *dp = pSys->dp; - assert (dp); - - dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); - dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); - dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); + FICL_DICT *dp = pSys->dp; + assert (dp); - /* Would like to export the EFI version, but this will do for now */ - ficlSetEnv(pSys, "efi-boot", 1); - - return; + dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); + dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); + dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); } FICL_COMPILE_SET(ficlEfiCompilePlatform); + +#endif /* BOOT_FORTH */ Added: head/sys/boot/efi/libefi/wchar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/wchar.c Wed Feb 1 08:46:59 2017 (r313042) @@ -0,0 +1,73 @@ +/*- + * Copyright 2016 Netflix, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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 + +/* + * CHAR16 related functions moved from loader. + * Perhaps we should move those to libstand afterall, but they are + * needed only by UEFI. + */ + +int +wcscmp(CHAR16 *a, CHAR16 *b) +{ + + while (*a && *b && *a == *b) { + a++; + b++; + } + return *a - *b; +} + +/* + * cpy8to16 copies a traditional C string into a CHAR16 string and + * 0 terminates it. len is the size of *dst in bytes. + */ +void +cpy8to16(const char *src, CHAR16 *dst, size_t len) +{ + len <<= 1; /* Assume CHAR16 is 2 bytes */ + while (len > 0 && *src) { + *dst++ = *src++; + len--; + } + *dst++ = (CHAR16)0; +} + +void +cpy16to8(const CHAR16 *src, char *dst, size_t len) +{ + size_t i; + + for (i = 0; i < len && src[i]; i++) + dst[i] = (char)src[i]; + if (i < len) + dst[i] = '\0'; +} Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed Feb 1 05:24:17 2017 (r313041) +++ head/sys/boot/efi/loader/main.c Wed Feb 1 08:46:59 2017 (r313042) @@ -52,22 +52,6 @@ __FBSDID("$FreeBSD$"); extern char bootprog_info[]; -#ifdef BOOT_FORTH -/* - * Normally, efi.o from libefi.a would be brought in due to a function we call - * there that's defined there. However, none of its functions are callable from - * here since it just adds words to the FORTH environment or implement those - * words. So, add a reference to a symbol in efi.o to force it to be be brought - * in so the init function there gets added to the "compile" linker set happens - * correctly. - * - * This assumes there's no global analysys that notices dummy1 isn't used - * anywhere and tries to eliminate it. - */ -extern int efi_variable_support; -int *dummy1 = &efi_variable_support; -#endif - struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; @@ -88,32 +72,6 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PRO static void efi_zfs_probe(void); #endif -/* - * cpy8to16 copies a traditional C string into a CHAR16 string and - * 0 terminates it. len is the size of *dst in bytes. - */ -static void -cpy8to16(const char *src, CHAR16 *dst, size_t len) -{ - len <<= 1; /* Assume CHAR16 is 2 bytes */ - while (len > 0 && *src) { - *dst++ = *src++; - len--; - } - *dst++ = (CHAR16)0; -} - -static void -cpy16to8(const CHAR16 *src, char *dst, size_t len) -{ - size_t i; - - for (i = 0; i < len && src[i]; i++) - dst[i] = (char)src[i]; - if (i < len) - dst[i] = '\0'; -} - static int has_keyboard(void) { @@ -455,9 +413,7 @@ main(int argc, CHAR16 *argv[]) } } - snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, - ST->Hdr.Revision & 0xffff); - env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); + efi_init_environment(); setenv("LINES", "24", 1); /* optional */ for (k = 0; k < ST->NumberOfTableEntries; k++) { @@ -476,19 +432,6 @@ main(int argc, CHAR16 *argv[]) return (EFI_SUCCESS); /* keep compiler happy */ } -/* XXX move to lib stand ? */ -static int -wcscmp(CHAR16 *a, CHAR16 *b) -{ - - while (*a && *b && *a == *b) { - a++; - b++; - } - return *a - *b; -} - - COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int @@ -770,305 +713,6 @@ command_reloadbe(int argc, char *argv[]) } #endif -COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); - -static int -efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) -{ - UINTN datasz, i; - EFI_STATUS status; - UINT32 attr; - CHAR16 *data; - char *str; - uint32_t uuid_status; - int is_ascii; - - datasz = 0; - status = RS->GetVariable(varnamearg, matchguid, &attr, - &datasz, NULL); - if (status != EFI_BUFFER_TOO_SMALL) { - printf("Can't get the variable: error %#lx\n", status); - return (CMD_ERROR); - } - data = malloc(datasz); - status = RS->GetVariable(varnamearg, matchguid, &attr, - &datasz, data); - if (status != EFI_SUCCESS) { - printf("Can't get the variable: error %#lx\n", status); - return (CMD_ERROR); - } - uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); - if (lflag) { - printf("%s 0x%x %S", str, attr, varnamearg); - } else { - printf("%s 0x%x %S=", str, attr, varnamearg); - is_ascii = 1; - free(str); - str = (char *)data; - for (i = 0; i < datasz - 1; i++) { - /* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */ - if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) { - is_ascii = 0; - break; - } - } - if (str[datasz - 1] != '\0') - is_ascii = 0; - if (is_ascii) - printf("%s", str); - else { - for (i = 0; i < datasz / 2; i++) { - if (isalnum(data[i]) || isspace(data[i])) - printf("%c", data[i]); - else - printf("\\x%02x", data[i]); - } - } - } - free(data); - if (pager_output("\n")) - return (CMD_WARN); - return (CMD_OK); -} - -static int -command_efi_show(int argc, char *argv[]) -{ - /* - * efi-show [-a] - * print all the env - * efi-show -u UUID - * print all the env vars tagged with UUID - * efi-show -v var - * search all the env vars and print the ones matching var - * eif-show -u UUID -v var - * eif-show UUID var - * print all the env vars that match UUID and var - */ - /* NB: We assume EFI_GUID is the same as uuid_t */ - int aflag = 0, gflag = 0, lflag = 0, vflag = 0; - int ch, rv; - unsigned i; - EFI_STATUS status; - EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - uint32_t uuid_status; - CHAR16 *varname; - CHAR16 *newnm; - CHAR16 varnamearg[128]; - UINTN varalloc; - UINTN varsz; - - while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { - switch (ch) { - case 'a': - aflag = 1; - break; - case 'g': - gflag = 1; - uuid_from_string(optarg, (uuid_t *)&matchguid, - &uuid_status); - if (uuid_status != uuid_s_ok) { - printf("uid %s could not be parsed\n", optarg); - return (CMD_ERROR); - } - break; - case 'l': - lflag = 1; - break; - case 'v': - vflag = 1; - if (strlen(optarg) >= nitems(varnamearg)) { - printf("Variable %s is longer than %zd characters\n", - optarg, nitems(varnamearg)); - return (CMD_ERROR); - } - for (i = 0; i < strlen(optarg); i++) - varnamearg[i] = optarg[i]; - varnamearg[i] = 0; - break; - default: - printf("Invalid argument %c\n", ch); - return (CMD_ERROR); - } - } - - if (aflag && (gflag || vflag)) { - printf("-a isn't compatible with -v or -u\n"); - return (CMD_ERROR); - } - - if (aflag && optind < argc) { - printf("-a doesn't take any args"); - return (CMD_ERROR); - } - - if (optind == argc) - aflag = 1; - - argc -= optind; - argv += optind; - - pager_open(); - if (vflag && gflag) { - rv = efi_print_var(varnamearg, &matchguid, lflag); - pager_close(); - return (rv); - } - - if (argc == 2) { - optarg = argv[0]; - if (strlen(optarg) >= nitems(varnamearg)) { - printf("Variable %s is longer than %zd characters\n", - optarg, nitems(varnamearg)); - pager_close(); - return (CMD_ERROR); - } - for (i = 0; i < strlen(optarg); i++) - varnamearg[i] = optarg[i]; - varnamearg[i] = 0; - optarg = argv[1]; - uuid_from_string(optarg, (uuid_t *)&matchguid, - &uuid_status); - if (uuid_status != uuid_s_ok) { - printf("uid %s could not be parsed\n", optarg); - pager_close(); - return (CMD_ERROR); - } - rv = efi_print_var(varnamearg, &matchguid, lflag); - pager_close(); - return (rv); - } - - if (argc > 0) { - printf("Too many args %d\n", argc); - pager_close(); - return (CMD_ERROR); - } - - /* - * Initiate the search -- note the standard takes pain - * to specify the initial call must be a poiner to a NULL - * character. - */ - varalloc = 1024; - varname = malloc(varalloc); - if (varname == NULL) { - printf("Can't allocate memory to get variables\n"); - pager_close(); - return (CMD_ERROR); - } - varname[0] = 0; - while (1) { - varsz = varalloc; - status = RS->GetNextVariableName(&varsz, varname, &varguid); - if (status == EFI_BUFFER_TOO_SMALL) { - varalloc = varsz; - newnm = malloc(varalloc); - if (newnm == NULL) { - printf("Can't allocate memory to get variables\n"); - free(varname); - pager_close(); - return (CMD_ERROR); - } - memcpy(newnm, varname, varsz); - free(varname); - varname = newnm; - continue; /* Try again with bigger buffer */ - } - if (status != EFI_SUCCESS) - break; - if (aflag) { - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) - break; - continue; - } - if (vflag) { - if (wcscmp(varnamearg, varname) == 0) { - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) - break; - continue; - } - } - if (gflag) { - if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) { - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) - break; - continue; - } - } - } - free(varname); - pager_close(); - - return (CMD_OK); -} - -COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set); - -static int -command_efi_set(int argc, char *argv[]) -{ - char *uuid, *var, *val; - CHAR16 wvar[128]; - EFI_GUID guid; - uint32_t status; - EFI_STATUS err; - - if (argc != 4) { - printf("efi-set uuid var new-value\n"); - return (CMD_ERROR); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 1 10:35:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 210BBCC9891; Wed, 1 Feb 2017 10:35:59 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C860D122B; Wed, 1 Feb 2017 10:35:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cYsGa-0000U0-17; Wed, 01 Feb 2017 13:35:56 +0300 Date: Wed, 1 Feb 2017 13:35:56 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201103555.GA79121@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <2911087.bbEsWibF87@ralph.baldwin.cx> <3458844.3oruRKbrzH@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3458844.3oruRKbrzH@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 10:35:59 -0000 On Tue, Jan 31, 2017 at 02:46:23PM -0800, John Baldwin wrote: > On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: > > On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: > > > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: > > >> Author: nyan > > >> Date: Sat Jan 28 02:22:15 2017 > > >> New Revision: 312910 > > >> URL: https://svnweb.freebsd.org/changeset/base/312910 > > >> > > >> Log: > > >> Remove pc98 support completely. > > >> I thank all developers and contributors for pc98. > > >> > > >> Relnotes: yes > > > > > > BTW, my impression was that there are some other device drivers > > > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) > > > but they might have pccard attachments for use with PC-98 laptops? > > > > > > Perhaps Warner might know? > > > > > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) > > > all came from NetBSD/pc98 via PAO. > > > > These all work correctly on any PC Card machine. The only reason they > > came in this way was because these devices were original marketed only > > in Japan. I've used all these cards with external SCSI drives in the > > past. > > > > As far as I know, only the if_snc driver, which was removed, is truly > > pc98 specific. It is wired in such a way that cannot be used in ibm-at > > compatible laptops. IIRC, it had hard-wired memory decode lines that > > landed in the middle of the VGA graphics pages or BIOS low memory > > areas. I have one of these cards still, and it will be detected on my > > laptops, but can't work due to the required mappings. > > > > Now, there's an different question about whether it is time to retire > > some of the now-ancient SCSI cards from the system, but that's a > > different kettle of fish that's larger than just nsp, ncv and stg. > > Fair enough. I haven't fully put away my 12 axe and am toying with > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > as well in that case). Hardware that wants to use ISA/pccard for > storage is probably happier running 4.x anyway. One question is if we > should drop ISA attachments in that case for drivers that support PCI > and ISA. However, there's a fair list of ISA-only adapters that would > be a good place to start anyway. One concern is to not drop any drivers ps/2 keyboard, mouse, touchpads, lm sensors, etc?... From owner-svn-src-head@freebsd.org Wed Feb 1 10:42:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC75CC9A80; Wed, 1 Feb 2017 10:42:41 +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 998CA16D1; Wed, 1 Feb 2017 10:42:40 +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 1FCEE1046AD9; Wed, 1 Feb 2017 21:42:36 +1100 (AEDT) Date: Wed, 1 Feb 2017 21:42:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: Message-ID: <20170201203814.O953@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> <20170201123838.X1974@besplex.bde.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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=uP1ucDPQAAAA:8 a=sAtkCSKGeD0KkG_lp3sA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 a=9a9ggB8z3XFZH39hjkD6:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 10:42:41 -0000 On Tue, 31 Jan 2017, Conrad Meyer wrote: > On Tue, Jan 31, 2017 at 7:16 PM, Bruce Evans wrote: >> Another reply to this... >> >> On Tue, 31 Jan 2017, Conrad Meyer wrote: >> >>> On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans wrote: >>>> >>>> On Tue, 31 Jan 2017, Bruce Evans wrote: >>>> I >>>> think there should by no alignment on entry -- just assume the buffer is >>>> aligned in the usual case, and only run 4% slower when it is misaligned. >>> >>> Please write such a patch and demonstrate the improvement. >> >> It is easy to demonstrate. I just put #if 0 around the early alignment >> code. The result seem too good to be true, so maybe I missed some >> later dependency on alignment of the addresses: >> - for 128-byte buffers and misalignment of 3, 10g takes 1.48 seconds with >> alignment and 1.02 seconds without alignment. >> This actually makes sense, 128 bytes can be done with 16 8-byte unaligned >> crc32q's. The alignment code makes it do 15 * 8-but and (5 + 3) * 1-byte. >> 7 more 3-cycle instructions and overhead too is far more than the cost >> of letting the CPU do read-combining. >> - for 4096-byte buffers, the difference is insignificant (0.47 seconds for >> 10g. > > I believe it, especially for newer amd64. I seem to recall that older > x86 machines had a higher misalignment penalty, but it was largely > reduced in (?)Nehalem. Why don't you go ahead and commit that change? Needs more work. Here are fairly clean patches for the unportabilities. I can't really test these in the kernel. Merge the asms with yours if yours are better in parts. X Index: conf/files.amd64 X =================================================================== X --- conf/files.amd64 (revision 313007) X +++ conf/files.amd64 (working copy) X @@ -536,6 +536,9 @@ X isa/vga_isa.c optional vga X kern/kern_clocksource.c standard X kern/link_elf_obj.c standard X +libkern/x86/crc32_sse42.c standard X +libkern/memmove.c standard X +libkern/memset.c standard X # X # IA32 binary support X # X @@ -593,14 +596,6 @@ X compat/ndis/subr_usbd.c optional ndisapi pci X compat/ndis/winx64_wrap.S optional ndisapi pci X # X -crc32_sse42.o standard \ X - dependency "$S/libkern/x86/crc32_sse42.c" \ X - compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ X - no-implicit-rule \ X - clean "crc32_sse42.o" X -libkern/memmove.c standard X -libkern/memset.c standard X -# X # x86 real mode BIOS emulator, required by dpms/pci/vesa X # X compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa This also fixes unsorting by crc32_sse42.o and nearby unsorting by all other libkern lines (just 2) in files.amd64. This file is still grossly unsorted near the end. X Index: conf/files.i386 X =================================================================== X --- conf/files.i386 (revision 313007) X +++ conf/files.i386 (working copy) X @@ -554,11 +554,6 @@ X kern/imgact_aout.c optional compat_aout X kern/imgact_gzip.c optional gzip X kern/subr_sfbuf.c standard X -crc32_sse42.o standard \ X - dependency "$S/libkern/x86/crc32_sse42.c" \ X - compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ X - no-implicit-rule \ X - clean "crc32_sse42.o" X libkern/divdi3.c standard X libkern/ffsll.c standard X libkern/flsll.c standard X @@ -569,6 +564,7 @@ X libkern/ucmpdi2.c standard X libkern/udivdi3.c standard X libkern/umoddi3.c standard X +libkern/x86/crc32_sse42.c standard X i386/xbox/xbox.c optional xbox X i386/xbox/xboxfb.c optional xboxfb X dev/fb/boot_font.c optional xboxfb This also fixes unsorting by crc32_sse42.o. files.i386 is not as unsorted as files.i386. The rules for sorting generated files are unclear. They are not in source directories so are nor naturally grouped. Old ones are mostly placed near the beginning. Some are sorted on a pathname of the source file(s) in scattered places in the make rules. crc32_sse42.o is partly like that. It was sorted with libkern sources but not by the x86 part. X Index: libkern/x86/crc32_sse42.c X =================================================================== X --- libkern/x86/crc32_sse42.c (revision 313007) X +++ libkern/x86/crc32_sse42.c (working copy) X @@ -31,15 +31,41 @@ X */ X #ifdef USERSPACE_TESTING X #include X +#include Fix dependency on namespace pollution in for at least size_t. X #else X #include X +#include X #include X -#include X -#include X #endif Fix order of systm.h and not using its standard pollution. X X -#include X +static __inline uint32_t X +_mm_crc32_u8(uint32_t x, uint8_t y) X +{ X + /* X + * clang (at least 3.9.[0-1]) pessimizes "rm" (y) and "m" (y) X + * significantly and "r" (y) a lot by copying y to a different X + * local variable (on the stack or in a register), so only use X + * the latter. This costs a register and an instruction but X + * not a uop. X + */ X + __asm("crc32b %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} X X +static __inline uint32_t X +_mm_crc32_u32(uint32_t x, int32_t y) X +{ X + __asm("crc32l %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} X + X +static __inline uint64_t X +_mm_crc32_u64(uint64_t x, int64_t y) X +{ X + __asm("crc32q %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} X + X /* CRC-32C (iSCSI) polynomial in reversed bit order. */ X #define POLY 0x82f63b78 X >> I hoped that an even shorter SHORT case would work. I think it now handles >> 768 bytes (3 * SHORT) in the inner loop. > > Right. > >> That is 32 sets of 3 crc32q's, >> and I would have thought that update at the end would take about as long >> as 1 iteration (3%), but it apparently takes 33%. > > The update at the end may be faster with PCLMULQDQ. There are > versions of this algorithm that use that in place of the lookup-table > combine (for example, Linux has a permissively licensed implementation > here: http://lxr.free-electrons.com/source/arch/x86/crypto/crc32c-pcl-intel-asm_64.S > ). > > Unfortunately, PCLMULQDQ uses FPU state, which is inappropriate most > of the time in kernel mode. It could be used opportunistically if the > thread is already in FPU-save mode or if the input is "big enough" to > make it worth it. That rules it out for most kernel purposes. I will try to optimize the multiplication. >>> 0x000400: asm:68 intrins:62 multitable:684 (ns per buf) >>> 0x000800: asm:132 intrins:133 (ns per buf) >>> 0x002000: asm:449 intrins:446 (ns per buf) >>> 0x008000: asm:1501 intrins:1497 (ns per buf) >>> 0x020000: asm:5618 intrins:5609 (ns per buf) >>> >>> (All routines are in a separate compilation unit with no full-program >>> optimization, as they are in the kernel.) >> >> These seem slow. I modified my program to test the actual kernel code, >> and get for 10gB on freefall's Xeon (main times in seconds): > > Freefall has a Haswell Xeon @ 3.3GHz. My laptop is a Sandy Bridge > Core i5 @ 2.6 GHz. That may help explain the difference. I thought that Sandy Bridge would be almost as fast here. ref11-i386's lesser Xeon is 5.5 times slower in cycles for a block size of 128K and 3.7 times slower for a block size of 128. i386 is naturally twice as slow. ref11-amd64's lesser Xeon has the same speed as freefall. So there must be a bug in the i386 code... it is simply that gcc doesn't optimize the buggy uint64_t type for the crcs in the 32-bit case, but clang does. After fixing this, the i386 case is only slightly more than twice as slow. Untested fix: Y Index: libkern/x86/crc32_sse42.c Y =================================================================== Y --- libkern/x86/crc32_sse42.c (revision 313007) Y +++ libkern/x86/crc32_sse42.c (working copy) Y @@ -190,7 +216,11 @@ Y const size_t align = 4; Y #endif Y const unsigned char *next, *end; Y - uint64_t crc0, crc1, crc2; /* need to be 64 bits for crc32q */ Y +#ifdef __amd64__ Y + uint64_t crc0, crc1, crc2; Y +#else Y + uint32_t crc0, crc1, crc2; Y +#endif Y Y next = buf; Y crc0 = crc; Bruce From owner-svn-src-head@freebsd.org Wed Feb 1 11:13:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D92CCA5EB; Wed, 1 Feb 2017 11:13:07 +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 0A0BC830; Wed, 1 Feb 2017 11:13:06 +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 ABB43D6424E; Wed, 1 Feb 2017 22:12:58 +1100 (AEDT) Date: Wed, 1 Feb 2017 22:12:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include In-Reply-To: <20170130142123.V953@besplex.bde.org> Message-ID: <20170201214349.H1136@besplex.bde.org> References: <201701300224.v0U2Osj1010421@repo.freebsd.org> <20170130142123.V953@besplex.bde.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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=c6f6VvGJeq85lbJT2RsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 11:13:07 -0000 On Mon, 30 Jan 2017, Bruce Evans wrote: > On Mon, 30 Jan 2017, Mateusz Guzik wrote: > >> Log: >> i386: add atomic_fcmpset >> >> Tested by: pho > > This is has some bugs and style bugs. This is still broken. The invalid asm breaks building at least atomic.o with gcc-4.2.1. Tested fix: X Index: i386/include/atomic.h X =================================================================== X --- i386/include/atomic.h (revision 313007) X +++ i386/include/atomic.h (working copy) X @@ -225,9 +225,9 @@ X " cmpxchgl %3,%1 ; " X " sete %0 ; " X "# atomic_cmpset_int" X - : "=r" (res), /* 0 */ X + : "=q" (res), /* 0 */ X "+m" (*dst), /* 1 */ X - "+a" (*expect) /* 2 */ X + "+a" (*expect) /* 2 */ X : "r" (src) /* 3 */ X : "memory", "cc"); X return (res); The semantics of fcmpset seem to be undocumented. On x86, *expect is updated non-atomically by a store in the output parameter. I think cmpxchg updates the "a" register atomically, but then the output parameter causes this to be stored non-atomically to *expect. A better API would somehow return the "a" register and let the caller store it if it wants. Ordinary cmpset can be built on this by not storing, and the caller can do the store atomically to a different place if *expect is too volatile to be atomic. Maybe just decouple the input parameter from the output parameter. The following works right (for an amd64 API): Y static __inline int Y atomic_xfcmpset_long(volatile u_long *dst, u_long *expect_out, u_long expect_in, Y u_long src) Y { Y u_long expect; Y u_char res; Y Y expect = expect_in; Y __asm __volatile( Y " " MPLOCKED " " Y " cmpxchgq %3,%1 ; " Y " sete %0 ; " Y "# atomic_fcmpset_long" Y : "=r" (res), /* 0 */ Y "+m" (*dst), /* 1 */ Y "+a" (expect) /* 2 */ Y : "r" (src) /* 3 */ Y : "memory", "cc"); Y *expect_out = expect; If the caller doesn't want to use *expect_out, it passes a pointer to an unused local variable. The compiler can then optimize away the store since it is not hidden in the asm. Y return (res); Y } Bruce From owner-svn-src-head@freebsd.org Wed Feb 1 13:12:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B8B0CC226B; Wed, 1 Feb 2017 13:12:09 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6FCAF59; Wed, 1 Feb 2017 13:12:08 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11DC7HA085026; Wed, 1 Feb 2017 13:12:07 GMT (envelope-from harti@FreeBSD.org) Received: (from harti@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11DC7WJ085025; Wed, 1 Feb 2017 13:12:07 GMT (envelope-from harti@FreeBSD.org) Message-Id: <201702011312.v11DC7WJ085025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: harti set sender to harti@FreeBSD.org using -f From: Hartmut Brandt Date: Wed, 1 Feb 2017 13:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313043 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 13:12:09 -0000 Author: harti Date: Wed Feb 1 13:12:07 2017 New Revision: 313043 URL: https://svnweb.freebsd.org/changeset/base/313043 Log: Merge filt_soread and filt_solisten and decide what to do when checking for EVFILT_READ at the point of the check not when the event is registers. This fixes a problem with asio when accepting a connection. Reviewed by: kib@, Scott Mitchell Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Feb 1 08:46:59 2017 (r313042) +++ head/sys/kern/uipc_socket.c Wed Feb 1 13:12:07 2017 (r313043) @@ -159,16 +159,10 @@ static void filt_sordetach(struct knote static int filt_soread(struct knote *kn, long hint); static void filt_sowdetach(struct knote *kn); static int filt_sowrite(struct knote *kn, long hint); -static int filt_solisten(struct knote *kn, long hint); static int inline hhook_run_socket(struct socket *so, void *hctx, int32_t h_id); static int filt_soempty(struct knote *kn, long hint); fo_kqfilter_t soo_kqfilter; -static struct filterops solisten_filtops = { - .f_isfd = 1, - .f_detach = filt_sordetach, - .f_event = filt_solisten, -}; static struct filterops soread_filtops = { .f_isfd = 1, .f_detach = filt_sordetach, @@ -3107,10 +3101,7 @@ soo_kqfilter(struct file *fp, struct kno switch (kn->kn_filter) { case EVFILT_READ: - if (so->so_options & SO_ACCEPTCONN) - kn->kn_fop = &solisten_filtops; - else - kn->kn_fop = &soread_filtops; + kn->kn_fop = &soread_filtops; sb = &so->so_rcv; break; case EVFILT_WRITE: @@ -3321,6 +3312,11 @@ filt_soread(struct knote *kn, long hint) struct socket *so; so = kn->kn_fp->f_data; + if (so->so_options & SO_ACCEPTCONN) { + kn->kn_data = so->so_qlen; + return (!TAILQ_EMPTY(&so->so_comp)); + + } SOCKBUF_LOCK_ASSERT(&so->so_rcv); kn->kn_data = sbavail(&so->so_rcv) - so->so_rcv.sb_ctl; @@ -3333,11 +3329,9 @@ filt_soread(struct knote *kn, long hint) if (kn->kn_sfflags & NOTE_LOWAT) { if (kn->kn_data >= kn->kn_sdata) - return 1; - } else { - if (sbavail(&so->so_rcv) >= so->so_rcv.sb_lowat) - return 1; - } + return (1); + } else if (sbavail(&so->so_rcv) >= so->so_rcv.sb_lowat) + return (1); /* This hook returning non-zero indicates an event, not error */ return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); @@ -3397,16 +3391,6 @@ filt_soempty(struct knote *kn, long hint return (0); } -/*ARGSUSED*/ -static int -filt_solisten(struct knote *kn, long hint) -{ - struct socket *so = kn->kn_fp->f_data; - - kn->kn_data = so->so_qlen; - return (!TAILQ_EMPTY(&so->so_comp)); -} - int socheckuid(struct socket *so, uid_t uid) { From owner-svn-src-head@freebsd.org Wed Feb 1 14:17:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BF2BCCB8C4; Wed, 1 Feb 2017 14:17: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 CF45819C2; Wed, 1 Feb 2017 14:17: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 v11EHLgs016000 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Feb 2017 16:17:21 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v11EHLgs016000 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v11EHL2r015999; Wed, 1 Feb 2017 16:17:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 1 Feb 2017 16:17:21 +0200 From: Konstantin Belousov To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313040 - head/sys/mips/include Message-ID: <20170201141721.GB2092@kib.kiev.ua> References: <201702010500.v1150YLR075051@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702010500.v1150YLR075051@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 14:17:34 -0000 On Wed, Feb 01, 2017 at 05:00:34AM +0000, Alexander Kabaev wrote: > Author: kan > Date: Wed Feb 1 05:00:34 2017 > New Revision: 313040 > URL: https://svnweb.freebsd.org/changeset/base/313040 > > Log: > Add atomic_fcmpset_*() inlines for MIPS > > atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the > read value from the target memory location into the 'old' pointer. > > Reviewed by: imp, brooks > Requested by: mjg > Differential Revision: https://reviews.freebsd.org/D9391 > > Modified: > head/sys/mips/include/atomic.h > > Modified: head/sys/mips/include/atomic.h > ============================================================================== > --- head/sys/mips/include/atomic.h Wed Feb 1 04:54:23 2017 (r313039) > +++ head/sys/mips/include/atomic.h Wed Feb 1 05:00:34 2017 (r313040) > @@ -362,7 +362,7 @@ atomic_load_64(__volatile uint64_t *p, u > * zero if the compare failed, nonzero otherwise. > */ > static __inline uint32_t > -atomic_cmpset_32(__volatile uint32_t* p, uint32_t cmpval, uint32_t newval) > +atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval) > { > uint32_t ret; > > @@ -405,6 +405,46 @@ atomic_cmpset_rel_32(__volatile uint32_t > return (atomic_cmpset_32(p, cmpval, newval)); > } > > +static __inline uint32_t > +atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) > +{ > + uint32_t ret; > + > + __asm __volatile ( > + "1:\n\t" > + "ll %0, %1\n\t" /* load old value */ > + "bne %0, %4, 2f\n\t" /* compare */ > + "move %0, %3\n\t" /* value to store */ > + "sc %0, %1\n\t" /* attempt to store */ > + "beqz %0, 1b\n\t" /* if it failed, spin */ Please do not retry on sc failure, return the error to upper layer. See also r313007 and preceeding discussion after r312973. > + "j 3f\n\t" > + "2:\n\t" > + "sw %0, %2\n\t" /* save old value */ > + "li %0, 0\n\t" > + "3:\n" > + : "=&r" (ret), "+m" (*p), "=m" (*cmpval) > + : "r" (newval), "r" (*cmpval) > + : "memory"); > + return ret; > +} > + From owner-svn-src-head@freebsd.org Wed Feb 1 15:38:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B0ECCB87F; Wed, 1 Feb 2017 15:38:54 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-yb0-x241.google.com (mail-yb0-x241.google.com [IPv6:2607:f8b0:4002:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0D51468; Wed, 1 Feb 2017 15:38:53 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-yb0-x241.google.com with SMTP id j82so26577461ybg.2; Wed, 01 Feb 2017 07:38:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=NIXzNjbSDfhoC5MPB6K7GN2yu067E7HszP1pn1eVEnU=; b=cBWTjGj6+/Avx8arHdJkgmU0NLWueQ+ozZFkjijkorwMPzb0agECq1uhvtoZRGLpH1 A55odRWokbPyVH/Bj6EEBbsaD4tFHTyLsrCBptV8rUzON0jMKEO2mulgudC3xCfgO2gR 6tijkwtUugbaHgfHJj+4rHWQ00r39r7Ah7xQCeO33tnIOd+IZuSptlh+xCDvZZ1P2tp9 bQIncOoJ7MlFxjJPsstTr3x97182MiFbZ0+G6rZ/5h+Muw+PBbygz1TZjDtGhYgNi4d3 54VCU9okVkbRQEAvpX9pnwHbQrOPB7D89NR408VcXc9eOKOpBbTQyHfKGrqCuR+oaOzX FSUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=NIXzNjbSDfhoC5MPB6K7GN2yu067E7HszP1pn1eVEnU=; b=LZn6fZHMl4GUrVm4paVS+ZXAxyQEo7Y1/B9ShOh7hDeu6CJhrdtGEt/QpK/7TETx3t JN2q9Cms3tAuoK5EBlKQyarhL6znGezlfO1Rb23Uul87BZ4eAz7J46NS9Kqh/H2qd++c wh/vSnSQrQjrHu+FgKy9oXiJd1WGcXx4HHdwzp2keEZ8BdityeM0328hQVoLvJxFFIYN JgDZMw7kisfvmvBv0ghzUzkgsA0R6VsspXcQvEemE0hzM20N8IG9GQY4icmOkmZu/2oM 90XF5ncXDSx0M4LUqLTevbjX3U67ahswjm5nl6q+qvH3cKliT5cKcnh6XuKBpTZQ8rfL gfmQ== X-Gm-Message-State: AIkVDXKvaK5XvrQ2YOHhc2NhcaK6tklpQNspQGtvFrXYivKi5ffcEVAaEunmHaCZ7ZMI3Q== X-Received: by 10.55.143.71 with SMTP id r68mr3197422qkd.84.1485963532822; Wed, 01 Feb 2017 07:38:52 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id r131sm18889096qke.14.2017.02.01.07.38.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Feb 2017 07:38:51 -0800 (PST) Date: Wed, 1 Feb 2017 10:38:42 -0500 From: Alexander Kabaev To: Konstantin Belousov Cc: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313040 - head/sys/mips/include Message-ID: <20170201103842.1ad0989f@kan> In-Reply-To: <20170201141721.GB2092@kib.kiev.ua> References: <201702010500.v1150YLR075051@repo.freebsd.org> <20170201141721.GB2092@kib.kiev.ua> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/m8ArkRYN54mNwE1R3WI.e8f"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 15:38:54 -0000 --Sig_/m8ArkRYN54mNwE1R3WI.e8f Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 1 Feb 2017 16:17:21 +0200 Konstantin Belousov wrote: > Please do not retry on sc failure, return the error to upper layer. > See also r313007 and preceeding discussion after r312973. There was not much a discussion there, do you mind expanding a bit on why one behavior is more desired than other? I am not against the change, but I need to understand the reasoning behind it better. Since atomic_cmpset retries too, it will have to be adjusted as well. --=20 Alexander Kabaev --Sig_/m8ArkRYN54mNwE1R3WI.e8f Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAliSAQNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln5iOA//Yc/PREWGTSo0jIPmbBFD5dXbp52HAIeL8b1YKQb9oKrTyecfmcGd1tR3 L/C5XrVYe2LfLjQtpkCUsSxtrws6/rNqHNG2KlZV63Cbj+DZ5UW+eBee0ebf8m6X sLWlWa+YkB4ufrOHg+2Z0X//XTNJC+5bFe1NS7h3zFzI8a3m3u+yJ609tEeYNUcB fSTCBBc56sU4FHJUIn5myicYIZ+Md5dpe7u/eEe7qccFw1JsdHBztXecVO9uhQq5 bjD7F3I7j4N12aqNBZDEXs0U1zDpp9YaABfUlcwaDqPT1Fc5t8hFP8/O+QKdwp80 XlLgp0EP70ExtCtVVkHfuGnS5OlsZ2uJ3BPQxmG3oEMi4Fi02eSQuq9w58BawmSi C3hOzaaPngtKGKfdzI05oT4v3/bIKCIk63Uge3FdGd+hZQJMYyT49A0wLElj32Sr vturltcCVNuOJ/dKrcdM6TMk1sODGAD8a4Umq+w0QcJ1Ho9pF4nKIildomViQKEg PunabH4g0jf3Q7uMOKSpbYNDg3CPCtAqkLjb3X+PDG5TOglLpIK9a2yXUBTBFbYe dCGMjXNw8xA/HJU5T8jDFeO37u+1OwBxqHN/hX50nNF5hp29++kbOJbm8zbpRzfy u4PN7Ot7lnyr25SJZWe6XJXyiFsPcaK0OcLf96WvYMgFvZiVlRE= =A/bQ -----END PGP SIGNATURE----- --Sig_/m8ArkRYN54mNwE1R3WI.e8f-- From owner-svn-src-head@freebsd.org Wed Feb 1 16:13:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FBF9CCB79B; Wed, 1 Feb 2017 16:13:59 +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 1E1ACE3C; Wed, 1 Feb 2017 16:13:58 +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 v11GDsYK036613 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Feb 2017 18:13:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v11GDsYK036613 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v11GDs2l036612; Wed, 1 Feb 2017 18:13:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 1 Feb 2017 18:13:54 +0200 From: Konstantin Belousov To: Alexander Kabaev Cc: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313040 - head/sys/mips/include Message-ID: <20170201161354.GF2092@kib.kiev.ua> References: <201702010500.v1150YLR075051@repo.freebsd.org> <20170201141721.GB2092@kib.kiev.ua> <20170201103842.1ad0989f@kan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201103842.1ad0989f@kan> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 16:13:59 -0000 On Wed, Feb 01, 2017 at 10:38:42AM -0500, Alexander Kabaev wrote: > On Wed, 1 Feb 2017 16:17:21 +0200 > Konstantin Belousov wrote: > > > Please do not retry on sc failure, return the error to upper layer. > > See also r313007 and preceeding discussion after r312973. > > There was not much a discussion there, do you mind expanding a bit on > why one behavior is more desired than other? I am not against the > change, but I need to understand the reasoning behind it better. Since > atomic_cmpset retries too, it will have to be adjusted as well. atomic_cmpset() cannot avoid retry on the ll/sc architectures, because sc might fail even if the old and the new values are same. One of the points of the fcmpset API design is to avoid nested loops: this is a microoptimization to put less pressure on the CPUs frontend. The caller of (f)cmpset must check for failure anyway, so not doing this inside the function reduces number of branches. Less branches makes code shorter, and reduces utilization of some CPU resources, like branch predictor state. From owner-svn-src-head@freebsd.org Wed Feb 1 16:15:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF95CCB817; Wed, 1 Feb 2017 16:15:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACD1AF81; Wed, 1 Feb 2017 16:15:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11GFNUV060305; Wed, 1 Feb 2017 16:15:23 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11GFNGl060304; Wed, 1 Feb 2017 16:15:23 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201702011615.v11GFNGl060304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 1 Feb 2017 16:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313044 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 16:15:25 -0000 Author: brd (doc,ports committer) Date: Wed Feb 1 16:15:23 2017 New Revision: 313044 URL: https://svnweb.freebsd.org/changeset/base/313044 Log: Add some comments with examples on how to build Vagrant images. Approved by: re (gjb) Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Wed Feb 1 13:12:07 2017 (r313043) +++ head/release/Makefile.vagrant Wed Feb 1 16:15:23 2017 (r313044) @@ -1,8 +1,20 @@ # # $FreeBSD$ # +# Makefile for producing and uploading Vagrant boxes to Hashicorp Atlas # -# Makefile for uploading Vagrant boxes to Hashicorp Atlas +# Usage Example: +# Create a Vagrant image for VirtualBox: +# make vagrant-box WITH_VMIMAGES=y WITH_CLOUDWARE=y \ +# CLOUDWARE=vagrant-virtualbox VMFORMATS=vmdk +# +# To create a Vagrant image for VMWare and Upload it to Atlas: +# VAGRANT_KEY is your Atlas API Token +# VAGRANT_USERNAME is your Atlas Username +# env VAGRANT_KEY=foo VAGRANT_USERNAME=bar make vagrant-upload \ +# WITH_VMIMAGES=y WITH_CLOUDWARE=y CLOUDWARE=vagrant-vmware \ +# VMFORMATS=vmdk +# For more info: https://www.vagrantup.com/docs/other/atlas.html # VAGRANT_IMG?= ${.OBJDIR}/vagrant.vmdk From owner-svn-src-head@freebsd.org Wed Feb 1 16:44:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F41CCB2C9; Wed, 1 Feb 2017 16:44:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90413805; Wed, 1 Feb 2017 16:44:13 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [172.20.13.195] ([72.165.49.2]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id v11Gd5TE060987 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Feb 2017 16:39:08 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host [72.165.49.2] claimed to be [172.20.13.195] Content-Type: multipart/signed; boundary="Apple-Mail=_6EFDB1DE-38E6-4B6F-A040-DCE2AAF02419"; protocol="application/pkcs7-signature"; micalg=sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r313040 - head/sys/mips/include From: David Chisnall In-Reply-To: <20170201161354.GF2092@kib.kiev.ua> Date: Wed, 1 Feb 2017 08:39:05 -0800 Cc: Alexander Kabaev , Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <191141D2-4665-4E24-AA4F-A34127C15953@FreeBSD.org> References: <201702010500.v1150YLR075051@repo.freebsd.org> <20170201141721.GB2092@kib.kiev.ua> <20170201103842.1ad0989f@kan> <20170201161354.GF2092@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 16:44:14 -0000 --Apple-Mail=_6EFDB1DE-38E6-4B6F-A040-DCE2AAF02419 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 Feb 2017, at 08:13, Konstantin Belousov = wrote: >=20 > On Wed, Feb 01, 2017 at 10:38:42AM -0500, Alexander Kabaev wrote: >> On Wed, 1 Feb 2017 16:17:21 +0200 >> Konstantin Belousov wrote: >>=20 >>> Please do not retry on sc failure, return the error to upper layer. >>> See also r313007 and preceeding discussion after r312973. >>=20 >> There was not much a discussion there, do you mind expanding a bit on >> why one behavior is more desired than other? I am not against the >> change, but I need to understand the reasoning behind it better. = Since >> atomic_cmpset retries too, it will have to be adjusted as well. >=20 > atomic_cmpset() cannot avoid retry on the ll/sc architectures, because > sc might fail even if the old and the new values are same. One of the > points of the fcmpset API design is to avoid nested loops: this is a > microoptimization to put less pressure on the CPUs frontend. The = caller > of (f)cmpset must check for failure anyway, so not doing this inside = the > function reduces number of branches. Less branches makes code shorter, > and reduces utilization of some CPU resources, like branch predictor > state. C[++]11 addresses this by having a weak and a strong variant of compare = and exchange. The strong version may only fail if the comparison fails, = we weak version is permitted to fail spuriously. Given that most uses = of compare and exchange use a loop, and most ll/sc architectures = guarantee forward process after a few attempts, you almost always want = to use the weak version. The weak version also has the advantage that the compiler is free to = fold the initial load into the load linked, as long as the target = architecture would permit it, so you end up with more idiomatic ll, op, = sc, branch sequences, rather than l, op, ll, branch, sc, branch = sequences. David --Apple-Mail=_6EFDB1DE-38E6-4B6F-A040-DCE2AAF02419 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIK5jCCBPww ggPkoAMCAQICECJrrb9nBol9MHok/UZg/AYwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCSUwx FjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xKTAnBgNVBAsTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g QXV0aG9yaXR5MSMwIQYDVQQDExpTdGFydENvbSBDbGFzcyAxIENsaWVudCBDQTAeFw0xNjA0MTkw OTI3NDJaFw0xNzA0MTkwOTI3NDJaMEQxHTAbBgNVBAMMFHRoZXJhdmVuQGZyZWVic2Qub3JnMSMw IQYJKoZIhvcNAQkBFhR0aGVyYXZlbkBmcmVlYnNkLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBALsL5pEhrGjrswHVdMHWhgxb8ARKDYRePSqpDLmjJ40bpx+n1zrvIwjC2Vk2IpoD 04rg5Pog2IrhnX+Qk2NSXzBXWj2JAaTc9OtSeAY0BtgJYXONGONQbRKVy97QBdzd1SbMEzDrOgH5 UDI+5sF1PboOTmLyTAPI9273XdfZ0BnstUXs8NXr/7p9E5CWJOsO1iQcINbm4XiwC1PLNMeWUknE Nji/hFKwcE8IFtaUe1ymbw6yA3rBpDu3KewIRD1T66FPTZJeIzvUoBIqWd+GAOfCBG2QYmbc3y/x K2hCtcXThcB1uVFA2q39koLKA8wHyqv4Jhm3wzhAqKDsWK4bGW0CAwEAAaOCAbcwggGzMA4GA1Ud DwEB/wQEAwIEsDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwCQYDVR0TBAIwADAdBgNV HQ4EFgQU5J3Kc8GeW8pEGxBkcMoA7eUOPRwwHwYDVR0jBBgwFoAUJIFsOWG+SQ+PtxtGK8kotSdI bWgwbwYIKwYBBQUHAQEEYzBhMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5zdGFydHNzbC5jb20w OQYIKwYBBQUHMAKGLWh0dHA6Ly9haWEuc3RhcnRzc2wuY29tL2NlcnRzL3NjYS5jbGllbnQxLmNy dDA4BgNVHR8EMTAvMC2gK6AphidodHRwOi8vY3JsLnN0YXJ0c3NsLmNvbS9zY2EtY2xpZW50MS5j cmwwHwYDVR0RBBgwFoEUdGhlcmF2ZW5AZnJlZWJzZC5vcmcwIwYDVR0SBBwwGoYYaHR0cDovL3d3 dy5zdGFydHNzbC5jb20vMEYGA1UdIAQ/MD0wOwYLKwYBBAGBtTcBAgUwLDAqBggrBgEFBQcCARYe aHR0cDovL3d3dy5zdGFydHNzbC5jb20vcG9saWN5MA0GCSqGSIb3DQEBCwUAA4IBAQBSBDH+kZf5 bZkNFcMSPdfnGC7F8utBIxs2bi3JQjsBoQTm1vnXdwgINSfO9At6iQZHoEyj8ZE6PcMFuEU0+bk0 aE8aYcW59WnxfWx943upZoMhX0YVaJcFK01EHFrddRAP44sh7Eu6JtdFuAG+6btDReMcg35Qm65X 7/280aVm7awadJ+IQs8r9qBVk2NFqkvHCETtJjNWXd7M6mcsfXstvykbubPQH/VNW/zrX6yzIcI4 aoz+Sn8RJmHNkk6cImqe1KvsdDLXmqCoeoMwos62pT18RaI//jwTdmnf5EHFMlevnxOr7rzA++71 OSZfdYf6+nvHOod1F721rNuy6lxFMIIF4jCCA8qgAwIBAgIQa6eKfQrXiNZRCvlZ5Oe04TANBgkq hkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UE CxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20g Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTUxMjE2MDEwMDA1WhcNMzAxMjE2MDEwMDA1WjB1 MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEpMCcGA1UECxMgU3RhcnRDb20g Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDEgQ2xpZW50 IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvX3a98OifYP2W4L921tfrh4bdcC1 Ga+YJKy7V3nYNewJHnzMlBsK0Hb8Dm4Wo3FZpylcYa1MJGT10QMGWaLER3xCIuRR+8eklf/EqeZW RLojJ7zBRtjMywPOCelrOU+DX12dKp+Ez4J6919rz1UudTO1GvZyCYJ/I7062uHsskM8b7gPxmcC oO1UHwwpgkvpCArJWGFoFzjLdsZbErJcS3HtAhlkbE/BKTMrdYg35Uo12SLBO5tbk8h2imbKTC8i Ms+pskrvI/AVlh6QoTTXk6xboVX6zgMgzxSVVLymQiygYYm0y5aMsvi2raFhC643SOGvErWWPPnS EfbeAD1xswIDAQABo4IBZDCCAWAwDgYDVR0PAQH/BAQDAgEGMB0GA1UdJQQWMBQGCCsGAQUFBwMC BggrBgEFBQcDBDASBgNVHRMBAf8ECDAGAQH/AgEAMDIGA1UdHwQrMCkwJ6AloCOGIWh0dHA6Ly9j cmwuc3RhcnRzc2wuY29tL3Nmc2NhLmNybDBmBggrBgEFBQcBAQRaMFgwJAYIKwYBBQUHMAGGGGh0 dHA6Ly9vY3NwLnN0YXJ0c3NsLmNvbTAwBggrBgEFBQcwAoYkaHR0cDovL2FpYS5zdGFydHNzbC5j b20vY2VydHMvY2EuY3J0MB0GA1UdDgQWBBQkgWw5Yb5JD4+3G0YrySi1J0htaDAfBgNVHSMEGDAW gBROC+8apEBbpRdphzDKNGhD0EGu8jA/BgNVHSAEODA2MDQGBFUdIAAwLDAqBggrBgEFBQcCARYe aHR0cDovL3d3dy5zdGFydHNzbC5jb20vcG9saWN5MA0GCSqGSIb3DQEBCwUAA4ICAQCL4/eH7AGL hK0PAQJbnOEjJyMEvTTwcAJuUh/bodjQl06u4putYOxdSyIjSP/sKt+31LmjG8+IO1WqykE4H/Lm 7NKezWVnCHuwb3ptgFmlwbMbGkU2MOZBtwzfKXdYUhFLhaE2uw5jXhXvLYitQay962wP5uPI6eAI hV4L8aaya1u4s7MnrTq0Rz25FuGNO79vTHYWj797tSRC8rM16js4yGKOLFpQvIg0F8IElv57b1st p+C7omqM5Qn15dePbSnqr8Jb65WtmJJbnv6rlqfY/aLuE/zmNAlzLmPgfMDStKIXdg+EoYBZTEo8 wBUaBxihfNbJ069ndQOxMNNqBelEMgpAtmjTbCuXFjqIwWq+XOx6ZV/Wh2FAmaLsSHlNvEjjSQMZ wE4EeHCdo66ZmEs/5JYlCeOkulKVQ6P3m5/XOj2jP17Q2AgmjP+11+sHN7PvrG0OwrQp9QMe3X+r n0G8MjtFfqBWvR9CgLIxzM3MJNxFdgdjS2rYnShP5uxvqwfZvhZVYCIkqdJhpYON0DvSodfiar0w iM79mySZJjzC0CTbiisBzS/BeBhqeo2wFfli/iw3hn1XKvAx0ty6w/scmBF0AYqmRHYj1TjMSw0l Al7AztLglqWjUPI+sukvadMRPxmtKXlS2nVR4an/Z16imsZ69+fFYH68c1CK7zmjozGCA04wggNK AgEBMIGJMHUxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMSkwJwYDVQQLEyBT dGFydENvbSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEjMCEGA1UEAxMaU3RhcnRDb20gQ2xhc3Mg MSBDbGllbnQgQ0ECECJrrb9nBol9MHok/UZg/AYwCQYFKw4DAhoFAKCCAZkwGAYJKoZIhvcNAQkD MQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwMjAxMTYzOTA2WjAjBgkqhkiG9w0BCQQx FgQUOZv5K02bXP5SCPleRwpS/a8djGMwgZoGCSsGAQQBgjcQBDGBjDCBiTB1MQswCQYDVQQGEwJJ TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDEgQ2xpZW50IENBAhAia62/ZwaJ fTB6JP1GYPwGMIGcBgsqhkiG9w0BCRACCzGBjKCBiTB1MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx IzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDEgQ2xpZW50IENBAhAia62/ZwaJfTB6JP1GYPwGMA0G CSqGSIb3DQEBAQUABIIBAK9uD7/8le+Em4vmnqyQCEfT6oJfHQXQCpZZS/J4BKQNb7ZcYBn+J6SP YqJIB1DvEVMr/1+RHJJCKt+vu1AUh2b045eRimotarSgX01TXC0RyTIS/BsIj6vB7VsjK07BcEoC mt4ujpOlq+QPPmxE5pU0SkS0vhy2vJYIozPIqw+hMOySC9qNPikB7MTeM8I+gVHfquAoaAHARcMM acVtmLRxE2RcEV1xrNzdzXzwKNRxFlpMQ9rRVO3YuS5DPhkUBGh52fUWTm6pT1xmf+BiSGdh+9HA d0hQ98BhhSeqd/HHJGX45PK7QKcpvDhyUF9HfnKDgtyl0EaxewT9h2aUvqsAAAAAAAA= --Apple-Mail=_6EFDB1DE-38E6-4B6F-A040-DCE2AAF02419-- From owner-svn-src-head@freebsd.org Wed Feb 1 16:44:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F84CCB332; Wed, 1 Feb 2017 16:44:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::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 ADA0C94D; Wed, 1 Feb 2017 16:44:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 19so32119260pfo.3; Wed, 01 Feb 2017 08:44:50 -0800 (PST) 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=W84HHGNiJj8ntgbZiS4vhaV3h0eaFeUEOAAfycvZFFY=; b=aWGN4F2zMn1Sdgag55OKiymMATJpzeWirG5+JajIGGZdRf/EcoOo+8gVtpztaQpH8t 8gbKlKJGkpK9DO+ywQdT0ncGo2ZFytPBLqj/e4Ta64rSf/r7Yxq81hm4VDc+K3R3p0Qr aXzIXOC36VqEyhwdnNlf1N8BSeKcicWGR9XOZwV/E8x5EQNA9gDdzHTmB3mL4BiNI78F MzZ0nOSqVPOAYtUWT9pRyObnz5yHrXMyC/SxPNunmgAk1VcYNw583zg4vJ8Or+gDgj3I tWEwT8CyYGHJoIPopz7p+UTf3/uQuORpvk1bhC4He2S4GkEzEfR0pePuyNxlxcHrbKDr fw6w== 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=W84HHGNiJj8ntgbZiS4vhaV3h0eaFeUEOAAfycvZFFY=; b=KAL+Sf9vsmAw+kJxUZe/rE7MFysLrLF14dLDf9100ALZsnx64shl1W414/OPDevnTK j2HMA64GbdkBOveWntVqjOU4dDjMAEItvZKH/LaudD+wrHGtuCFRSKTXDBBNqAxWesi4 jJjsGqA3Za4fxHapjiK3rLO+huLR1Df7t1aPGtv5q+ff4cgvbVefMOdjyQN8RgPDL3J/ 9MLBD74KFIq+cbWfRoLALE3Djzg4gQQvJ9YpWrJ58DZeRt9442kwSiL0tqmHcBgQnStg 1sTD+nrm8DE01j1FutaIIg+VVsMC60YyNRy1+o1OVi/1ppZG6+FmxiCCiRhRvxPG+M9Z qQFA== X-Gm-Message-State: AIkVDXJ9/jMYc12a3xU3RIPXg7Xf4r6xHutY05v0b9Q8tptDg+B3T3G4Fh+Q5qghrAj63A== X-Received: by 10.98.19.145 with SMTP id 17mr4809041pft.26.1485967490120; Wed, 01 Feb 2017 08:44:50 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a1sm51377616pgc.14.2017.02.01.08.44.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Feb 2017 08:44:49 -0800 (PST) Subject: Re: svn commit: r313008 - head/tests/sys/geom/class/gate Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5FA9B4B6-035E-4824-B9C7-716FE054267F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Wed, 1 Feb 2017 08:44:48 -0800 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <88DF0C02-3CA8-416F-8438-8C9410DCEF81@gmail.com> References: <201701310612.v0V6CqVL093451@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 16:44:51 -0000 --Apple-Mail=_5FA9B4B6-035E-4824-B9C7-716FE054267F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 31, 2017, at 07:10, Alan Somers wrote: >=20 > I think wait_for_ggate_device should also be used at line 32, which > calls "ggatec create". > -Alan Yes, you=E2=80=99re right. If I add in the wait_for_ggate_device = call, then I can get rid of the other for loops with retry logic in = them. I=E2=80=99m testing out a change and will add you to a CR if = successful. Thanks! -Ngie --Apple-Mail=_5FA9B4B6-035E-4824-B9C7-716FE054267F 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 iQIcBAEBCgAGBQJYkhCAAAoJEPWDqSZpMIYVdA0QAKnte9iQ+xxntKjfG0VDlhM5 qGcWO1TFPOVbKI041KkRMSxECFx0ZcZ8eKNcTXsDtkb0piyDXM/7ub5W+yZIFj/L gmfHw8EnLLa5OG9OJ46cNW6hoj7VfjIr2BhJHmbzmhuObT6jP/28kf4kzBS2iGOX cwW/jTtinsV33I3Gtwxs6bMXc4K0NpWm6G8gsXLVfX4KBowiNxCALpKSEAQv5VGD DQXh29wbCojNzZJzx/D2BGVfyki5dn+EJIfYytAjlRJcCWUh0BrExNnDIFOGJ7C4 SJu7yDWzshtkL3TVTv1NC9FC61J95ZcT3ugKQ/wdihpy6WAxUqvk2mBl0nprW8HZ exy2Rv6+jqj7NBnYJE9nbU2rCzIIYJ8MOjH15ebrmf3rSxhHOQrEteRj36NAUPqe jfFvt5f8UKmI6xIpUnNKAj6A7V4AJwWxdoZe773zO9WWQO+VM+ERqgAJI5oqHnKy /ANtDY0O7g7vbpzZOHVrMKjHtz8l077XOFvz2NB3PyQ+XxuHG/xhaQMP3sVdA54X bX9V5VA/oiqpcO2Ddmbct+J4Sb1+pdR/fmCVIkknKRVLq0MZd2LBN+Srp5cHHbOd 7vYv5Nc2woDR503XIgUOnjAf1wOK4WE3b6hV/EYtEaNmAs+lgzKgJubuHEsdgoBa L1zGyfgwKPpoKbrPvxH1 =Y9Un -----END PGP SIGNATURE----- --Apple-Mail=_5FA9B4B6-035E-4824-B9C7-716FE054267F-- From owner-svn-src-head@freebsd.org Wed Feb 1 16:59:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC03CCB83C; Wed, 1 Feb 2017 16:59:48 +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 6731B12F8; Wed, 1 Feb 2017 16:59:48 +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 ECF5B10A791; Wed, 1 Feb 2017 11:59:46 -0500 (EST) From: John Baldwin To: Slawa Olhovchenkov Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Date: Wed, 01 Feb 2017 08:59:40 -0800 Message-ID: <12386326.7GSpFTXsMZ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170201103555.GA79121@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 01 Feb 2017 11:59:47 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 16:59:48 -0000 On Wednesday, February 01, 2017 01:35:56 PM Slawa Olhovchenkov wrote: > On Tue, Jan 31, 2017 at 02:46:23PM -0800, John Baldwin wrote: > > > On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: > > > On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: > > > > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: > > > >> Author: nyan > > > >> Date: Sat Jan 28 02:22:15 2017 > > > >> New Revision: 312910 > > > >> URL: https://svnweb.freebsd.org/changeset/base/312910 > > > >> > > > >> Log: > > > >> Remove pc98 support completely. > > > >> I thank all developers and contributors for pc98. > > > >> > > > >> Relnotes: yes > > > > > > > > BTW, my impression was that there are some other device drivers > > > > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) > > > > but they might have pccard attachments for use with PC-98 laptops? > > > > > > > > Perhaps Warner might know? > > > > > > > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) > > > > all came from NetBSD/pc98 via PAO. > > > > > > These all work correctly on any PC Card machine. The only reason they > > > came in this way was because these devices were original marketed only > > > in Japan. I've used all these cards with external SCSI drives in the > > > past. > > > > > > As far as I know, only the if_snc driver, which was removed, is truly > > > pc98 specific. It is wired in such a way that cannot be used in ibm-at > > > compatible laptops. IIRC, it had hard-wired memory decode lines that > > > landed in the middle of the VGA graphics pages or BIOS low memory > > > areas. I have one of these cards still, and it will be detected on my > > > laptops, but can't work due to the required mappings. > > > > > > Now, there's an different question about whether it is time to retire > > > some of the now-ancient SCSI cards from the system, but that's a > > > different kettle of fish that's larger than just nsp, ncv and stg. > > > > Fair enough. I haven't fully put away my 12 axe and am toying with > > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > > as well in that case). Hardware that wants to use ISA/pccard for > > storage is probably happier running 4.x anyway. One question is if we > > should drop ISA attachments in that case for drivers that support PCI > > and ISA. However, there's a fair list of ISA-only adapters that would > > be a good place to start anyway. One concern is to not drop any drivers > > ps/2 keyboard, mouse, touchpads, lm sensors, etc?... Those aren't storage or NICs. There are many "legacy" device still present in modern systems that we obviously have to support. However, if you have an ISA Adapter SCSI HBA in an ISA slot, the machine running that is probably happier running 4.x than 12.0. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 1 17:06:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BABB2CCBC15; Wed, 1 Feb 2017 17:06:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79C751B3B; Wed, 1 Feb 2017 17:06:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cYyMh-000Amd-Ad; Wed, 01 Feb 2017 20:06:39 +0300 Date: Wed, 1 Feb 2017 20:06:39 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201170639.GY37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12386326.7GSpFTXsMZ@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 17:06:41 -0000 On Wed, Feb 01, 2017 at 08:59:40AM -0800, John Baldwin wrote: > On Wednesday, February 01, 2017 01:35:56 PM Slawa Olhovchenkov wrote: > > On Tue, Jan 31, 2017 at 02:46:23PM -0800, John Baldwin wrote: > > > > > On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: > > > > On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: > > > > > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: > > > > >> Author: nyan > > > > >> Date: Sat Jan 28 02:22:15 2017 > > > > >> New Revision: 312910 > > > > >> URL: https://svnweb.freebsd.org/changeset/base/312910 > > > > >> > > > > >> Log: > > > > >> Remove pc98 support completely. > > > > >> I thank all developers and contributors for pc98. > > > > >> > > > > >> Relnotes: yes > > > > > > > > > > BTW, my impression was that there are some other device drivers > > > > > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) > > > > > but they might have pccard attachments for use with PC-98 laptops? > > > > > > > > > > Perhaps Warner might know? > > > > > > > > > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) > > > > > all came from NetBSD/pc98 via PAO. > > > > > > > > These all work correctly on any PC Card machine. The only reason they > > > > came in this way was because these devices were original marketed only > > > > in Japan. I've used all these cards with external SCSI drives in the > > > > past. > > > > > > > > As far as I know, only the if_snc driver, which was removed, is truly > > > > pc98 specific. It is wired in such a way that cannot be used in ibm-at > > > > compatible laptops. IIRC, it had hard-wired memory decode lines that > > > > landed in the middle of the VGA graphics pages or BIOS low memory > > > > areas. I have one of these cards still, and it will be detected on my > > > > laptops, but can't work due to the required mappings. > > > > > > > > Now, there's an different question about whether it is time to retire > > > > some of the now-ancient SCSI cards from the system, but that's a > > > > different kettle of fish that's larger than just nsp, ncv and stg. > > > > > > Fair enough. I haven't fully put away my 12 axe and am toying with > > > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > > > as well in that case). Hardware that wants to use ISA/pccard for > > > storage is probably happier running 4.x anyway. One question is if we > > > should drop ISA attachments in that case for drivers that support PCI > > > and ISA. However, there's a fair list of ISA-only adapters that would > > > be a good place to start anyway. One concern is to not drop any drivers > > > > ps/2 keyboard, mouse, touchpads, lm sensors, etc?... > > Those aren't storage or NICs. There are many "legacy" device still present > in modern systems that we obviously have to support. However, if you have > an ISA Adapter SCSI HBA in an ISA slot, the machine running that is probably > happier running 4.x than 12.0. My be I am missread, I think removed ISA bus and all devices attached to ISA bus. From owner-svn-src-head@freebsd.org Wed Feb 1 17:09:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C957CCBCED; Wed, 1 Feb 2017 17:09:53 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF0F91DFD; Wed, 1 Feb 2017 17:09:52 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cYyPm-000ArC-SH; Wed, 01 Feb 2017 20:09:50 +0300 Date: Wed, 1 Feb 2017 20:09:50 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201170950.GF79121@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12386326.7GSpFTXsMZ@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 17:09:53 -0000 On Wed, Feb 01, 2017 at 08:59:40AM -0800, John Baldwin wrote: > > > Fair enough. I haven't fully put away my 12 axe and am toying with > > > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > > > as well in that case). Hardware that wants to use ISA/pccard for > > > storage is probably happier running 4.x anyway. One question is if we > > > should drop ISA attachments in that case for drivers that support PCI > > > and ISA. However, there's a fair list of ISA-only adapters that would > > > be a good place to start anyway. One concern is to not drop any drivers > > > > ps/2 keyboard, mouse, touchpads, lm sensors, etc?... > > Those aren't storage or NICs. There are many "legacy" device still present > in modern systems that we obviously have to support. However, if you have > an ISA Adapter SCSI HBA in an ISA slot, the machine running that is probably > happier running 4.x than 12.0. Also, I am think current ports don't build on 4.x. I am got complains about using ports on 8.x. From owner-svn-src-head@freebsd.org Wed Feb 1 17:33:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC422CC4380; Wed, 1 Feb 2017 17:33:16 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id DEA19DBA; Wed, 1 Feb 2017 17:33:16 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 9F10B177B0; Wed, 1 Feb 2017 09:33:11 -0800 (PST) Date: Wed, 1 Feb 2017 09:33:11 -0800 From: hiren panchasara To: Hartmut Brandt Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313043 - head/sys/kern Message-ID: <20170201173311.GY84308@strugglingcoder.info> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yTwVabqJa5IUz21H" Content-Disposition: inline In-Reply-To: <201702011312.v11DC7WJ085025@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 17:33:17 -0000 --yTwVabqJa5IUz21H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/01/17 at 01:12P, Hartmut Brandt wrote: > Author: harti > Date: Wed Feb 1 13:12:07 2017 > New Revision: 313043 > URL: https://svnweb.freebsd.org/changeset/base/313043 >=20 > Log: > Merge filt_soread and filt_solisten and decide what to do when checking > for EVFILT_READ at the point of the check not when the event is registe= rs. > This fixes a problem with asio when accepting a connection. > =20 > Reviewed by: kib@, Scott Mitchell >=20 > Modified: > head/sys/kern/uipc_socket.c Is it possible to MFC this back to 11? Cheers, Hiren --yTwVabqJa5IUz21H Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYkhvXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lNt4H/2Pco3hjAGlBRda8Y4rgPhn4 ufFbWf0/Pohm7jE1rHgVqTQyYkcXJjFQSdnWFtESPW/SIsICiK7uxZ9j1uTTBxi8 uSA0V+WlfOf65hwqEEY+O3d+3pMXqR65HhL4txSDqlmqudpY2+38LbrENOiotSPB B05jVuEu2dQKfmF3OOD6gDZjPb0/t78391Di1PUhxuB56P4kpIB+IaJcrCyxfMyn q7k05Iuf74CA1b25egA4mK9N73OkOXzeZIK0rzLMmi4FAMP6WahpmNzwvSW84cr1 SiNGHlzce+6cAOjeYRrjxUcdAUUCU71YgGxKaZ+V52VdgSEjGrMUa3nIbahXBLY= =oOlo -----END PGP SIGNATURE----- --yTwVabqJa5IUz21H-- From owner-svn-src-head@freebsd.org Wed Feb 1 17:56:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19928CC49E0 for ; Wed, 1 Feb 2017 17:56:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::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 D5B3F1E36 for ; Wed, 1 Feb 2017 17:56:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id m98so21692420iod.2 for ; Wed, 01 Feb 2017 09:56:25 -0800 (PST) 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=1LtDJwqZABJ3q8A8J1AJnRwytRlqe4F0Zsmz3yI6MwI=; b=OKIgTUy4g0ijnY1S1YxREvVlMBrUxkqcAm6ZEjlsL+Z8LeaF27SAPzjGOA/K9NY86S BUTeONLpJwZN5NMK56GA+R6kCAf3rZejFbJ+ydF5o/w6d0PO8SJS9pVpvr4DauyjCklY byYTOMHQ5hmLntRIJtKpIP0XKNmv2gMujZ8h7X0y+C8NtcgTCGudxcG3mW0/rM37wbVa 5v64eeQfH29/YjWYN8xXUhJufm40EmVh+oxaQtHpmL57RfZaVkdrAm5S+C/lA0Rt6R7M sinPf8UjCUIH5tl0m7tANswneD5+esxNHOLe6Ty5/HeMTwnbNhMwCppSsgcg44Nt58aB lbpQ== 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=1LtDJwqZABJ3q8A8J1AJnRwytRlqe4F0Zsmz3yI6MwI=; b=lVGU2MH2EYyzLKs0/CegQMA3SMt78PEW6vYHO6RkLmtIJf8k0yd09SvLwMOtkapx0x SDkhvK6e0gZHe8RINf0UN3K2BeNgM5h9ChkE8RPwCBpde1rGAPsxO5Ft4nwVttAKrXjN HeRjBQImhsDfpJ3cZspu02zoZRpCFBH0l0Val85IFHIaaeJsDd1mE1zQ8UHwB+ZW7meo 5zOv26NZLgFjxgZhzBqFZad3BlKke6gHIXWfMRvbyG2U07+gmX6gU0hmepi15wVMQfRB Olco1dCERjsoFiRbdxqWY+vmgmcLhezbh2hqbBXGM+A69mV3uINYWeLcP1zKT2flTlkv A/9Q== X-Gm-Message-State: AIkVDXIaOIL83C7nRGkq48NjdakL9KgkhUNfKXFrThCB8xxspvkvih/Wk0D5zl5w6KIuJ0PU7NTDIXxZw7anjg== X-Received: by 10.107.139.131 with SMTP id n125mr3520929iod.166.1485971784983; Wed, 01 Feb 2017 09:56:24 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Wed, 1 Feb 2017 09:56:24 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <20170201170639.GY37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170639.GY37974@zxy.spb.ru> From: Warner Losh Date: Wed, 1 Feb 2017 10:56:24 -0700 X-Google-Sender-Auth: Osfctzr9wgV7sdoK218dyhFpUGo Message-ID: Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... To: Slawa Olhovchenkov Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 17:56:26 -0000 On Wed, Feb 1, 2017 at 10:06 AM, Slawa Olhovchenkov wrote: > On Wed, Feb 01, 2017 at 08:59:40AM -0800, John Baldwin wrote: > >> On Wednesday, February 01, 2017 01:35:56 PM Slawa Olhovchenkov wrote: >> > On Tue, Jan 31, 2017 at 02:46:23PM -0800, John Baldwin wrote: >> > >> > > On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote: >> > > > On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin wrote: >> > > > > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote: >> > > > >> Author: nyan >> > > > >> Date: Sat Jan 28 02:22:15 2017 >> > > > >> New Revision: 312910 >> > > > >> URL: https://svnweb.freebsd.org/changeset/base/312910 >> > > > >> >> > > > >> Log: >> > > > >> Remove pc98 support completely. >> > > > >> I thank all developers and contributors for pc98. >> > > > >> >> > > > >> Relnotes: yes >> > > > > >> > > > > BTW, my impression was that there are some other device drivers >> > > > > that are effectively PC-98 only (e.g. everything that uses scsi_low.c) >> > > > > but they might have pccard attachments for use with PC-98 laptops? >> > > > > >> > > > > Perhaps Warner might know? >> > > > > >> > > > > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4) >> > > > > all came from NetBSD/pc98 via PAO. >> > > > >> > > > These all work correctly on any PC Card machine. The only reason they >> > > > came in this way was because these devices were original marketed only >> > > > in Japan. I've used all these cards with external SCSI drives in the >> > > > past. >> > > > >> > > > As far as I know, only the if_snc driver, which was removed, is truly >> > > > pc98 specific. It is wired in such a way that cannot be used in ibm-at >> > > > compatible laptops. IIRC, it had hard-wired memory decode lines that >> > > > landed in the middle of the VGA graphics pages or BIOS low memory >> > > > areas. I have one of these cards still, and it will be detected on my >> > > > laptops, but can't work due to the required mappings. >> > > > >> > > > Now, there's an different question about whether it is time to retire >> > > > some of the now-ancient SCSI cards from the system, but that's a >> > > > different kettle of fish that's larger than just nsp, ncv and stg. >> > > >> > > Fair enough. I haven't fully put away my 12 axe and am toying with >> > > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only >> > > as well in that case). Hardware that wants to use ISA/pccard for >> > > storage is probably happier running 4.x anyway. One question is if we >> > > should drop ISA attachments in that case for drivers that support PCI >> > > and ISA. However, there's a fair list of ISA-only adapters that would >> > > be a good place to start anyway. One concern is to not drop any drivers >> > >> > ps/2 keyboard, mouse, touchpads, lm sensors, etc?... >> >> Those aren't storage or NICs. There are many "legacy" device still present >> in modern systems that we obviously have to support. However, if you have >> an ISA Adapter SCSI HBA in an ISA slot, the machine running that is probably >> happier running 4.x than 12.0. > > My be I am missread, I think removed ISA bus and all devices attached > to ISA bus. We will never ever ever remove the ISA bus on the i386 or amd64 ports. That's simply not possible due to the legacy busses and the fact that many devices are logically attached to the address space used by the ISA bus even if there aren't physical plastic ISA slots. Ps/2 keyboards, mice, etc usually also have ACPI attachments. lm sensors might not, but those are still used and useful. If you have an ISA system, you are limited to about 16-32MB of RAM. That's what John is talking about. These systems will barely boot a modern FreeBSD. However, there are many people that have ISA cards in a PCI system to do things. Those systems can still run FreeBSD decently well if they aren't running X11. However, performance of ISA SCSI and ISA Networking cards for those boxes is horrible and there are many PCI-based alternatives that should drop in. I have a friend that has several of these systems he's not going to ever upgrade the hardware since they work just fine for what he needs. He does want to run the latest software to pickup security fixes. But AFAIK, none of these systems is using ISA SCSI. There may be the odd NE-2000 compatible ISA card, but even those have been upgraded a long time ago when his DSL speeds started to exceed 10Mbps. John's point is there's little practical value to keeping the old ISA SCSI cards in the tree. And there's some benefit to removing them since there are a few CAM features that are used only on one or two of these systems. ISA Networking cards are limited to 10Mbps (even if they have PHYs that do 100Mbps) because of the ISA bus. These cards aren't installed in modern systems, and it is quite doubtful they are in systems that will be upgraded to 12. And they are untested. Since there's a non-zero cost in keeping them, there needs to be some benefit. John is making the case that finding that benefit is increasingly difficult and we've passed the point where even the relatively low cost we have to keep the drivers in the system outweighs the benefit. For many, if not most, of these devices, I'm inclined to agree with him. Warner From owner-svn-src-head@freebsd.org Wed Feb 1 18:08:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37492CC4C71; Wed, 1 Feb 2017 18:08:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 20A7C61F; Wed, 1 Feb 2017 18:08:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v11I8Gow012883 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Feb 2017 10:08:16 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v11I8GFa012882; Wed, 1 Feb 2017 10:08:16 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 Feb 2017 10:08:16 -0800 From: Gleb Smirnoff To: Hartmut Brandt Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313043 - head/sys/kern Message-ID: <20170201180816.GF3334@FreeBSD.org> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702011312.v11DC7WJ085025@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 18:08:23 -0000 On Wed, Feb 01, 2017 at 01:12:07PM +0000, Hartmut Brandt wrote: H> Author: harti H> Date: Wed Feb 1 13:12:07 2017 H> New Revision: 313043 H> URL: https://svnweb.freebsd.org/changeset/base/313043 H> H> Log: H> Merge filt_soread and filt_solisten and decide what to do when checking H> for EVFILT_READ at the point of the check not when the event is registers. H> This fixes a problem with asio when accepting a connection. H> H> Reviewed by: kib@, Scott Mitchell This goes into opposite direction with what I am doing: https://reviews.freebsd.org/D9356 Can you please explain the problem with asio when accepting a connection? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Feb 1 18:23:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6209FCCB461; Wed, 1 Feb 2017 18:23:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBD11150; Wed, 1 Feb 2017 18:23:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v11INbCp013008 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Feb 2017 10:23:38 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v11INboo013007; Wed, 1 Feb 2017 10:23:37 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 Feb 2017 10:23:37 -0800 From: Gleb Smirnoff To: John Baldwin Cc: Edward Tomasz Napierala , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20170201182337.GG3334@FreeBSD.org> References: <201701301257.v0UCvNrK065993@repo.freebsd.org> <3349880.lYJPXOWCO7@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3349880.lYJPXOWCO7@ralph.baldwin.cx> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 18:23:39 -0000 On Tue, Jan 31, 2017 at 02:13:36PM -0800, John Baldwin wrote: J> On Monday, January 30, 2017 12:57:23 PM Edward Tomasz Napierala wrote: J> > Author: trasz J> > Date: Mon Jan 30 12:57:22 2017 J> > New Revision: 312988 J> > URL: https://svnweb.freebsd.org/changeset/base/312988 J> > J> > Log: J> > Add kern_listen(), kern_shutdown(), and kern_socket(), and use them J> > instead of their sys_*() counterparts in various compats. The svr4 J> > is left untouched, because there's no point. J> J> Note that you can compile test svr4 since it is still in the tree. J> If we want to remove svr4, then we should remove it. However, we J> should maintain code that is in the tree if it is still there. All we can do right now is maintain it as compilable. My example with COMPAT_OLDSOCK shows that SVR4 simply doesn't work as kld, and nobody complains. Okay, what if I say on freebsd-arch/freebsd-current that I am going to remove it and wait for any objections for a month, and then do it? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Feb 1 19:33:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9023BCCC67D; Wed, 1 Feb 2017 19:33:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A8041272; Wed, 1 Feb 2017 19:33:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11JX0JQ044412; Wed, 1 Feb 2017 19:33:00 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11JX0rA044409; Wed, 1 Feb 2017 19:33:00 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201702011933.v11JX0rA044409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 1 Feb 2017 19:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313045 - in head: cddl/lib/libdtrace sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 19:33:01 -0000 Author: gnn Date: Wed Feb 1 19:33:00 2017 New Revision: 313045 URL: https://svnweb.freebsd.org/changeset/base/313045 Log: Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes. Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9401 Modified: head/cddl/lib/libdtrace/ip.d head/sys/netinet/in_kdtrace.c Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Wed Feb 1 16:15:23 2017 (r313044) +++ head/cddl/lib/libdtrace/ip.d Wed Feb 1 19:33:00 2017 (r313045) @@ -238,6 +238,24 @@ translator ipinfo_t < uint8_t *p > { inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst); }; +#pragma D binding "1.13" translator +translator ipinfo_t < struct mbuf *m > { + ip_ver = m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v; + ip_plength = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + ntohs(((struct ip *)m->m_data)->ip_len) - + (((struct ip *)m->m_data)->ip_hl << 2): + ntohs(((struct ip6_hdr *)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen); + ip_saddr = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) : + inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src); + ip_daddr = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) : + inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst); +}; + #pragma D binding "1.5" IFF_LOOPBACK inline int IFF_LOOPBACK = 0x8; Modified: head/sys/netinet/in_kdtrace.c ============================================================================== --- head/sys/netinet/in_kdtrace.c Wed Feb 1 16:15:23 2017 (r313044) +++ head/sys/netinet/in_kdtrace.c Wed Feb 1 19:33:00 2017 (r313045) @@ -56,28 +56,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send, SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -91,7 +91,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect SDT_PROBE_DEFINE5_XLATE(tcp, , , receive, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output, "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *", - "uint8_t *", "ipinfo_t *"); + "struct mbuf *", "ipinfo_t *"); SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user, "struct tcpcb *", "tcpsinfo_t *" , @@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop, "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *", - "uint8_t *", "ipinfo_t *"); + "struct mbuf *", "ipinfo_t *"); SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change, "void *", "void *", From owner-svn-src-head@freebsd.org Wed Feb 1 20:10:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62358CCC10C; Wed, 1 Feb 2017 20:10:58 +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 233741A4E; Wed, 1 Feb 2017 20:10:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11KAvtN062012; Wed, 1 Feb 2017 20:10:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11KAu3B062003; Wed, 1 Feb 2017 20:10:56 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201702012010.v11KAu3B062003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 1 Feb 2017 20:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313047 - in head/sys/boot: common i386/libi386 uboot/lib usb/storage zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 20:10:58 -0000 Author: tsoome Date: Wed Feb 1 20:10:56 2017 New Revision: 313047 URL: https://svnweb.freebsd.org/changeset/base/313047 Log: loader: disk/part api needs to use uint64_t offsets The disk_* and part_* api is using 64bit values for media size and offsets. However, the current api is using off_t type, which is signed 64-bit int. In this context the signed media size does not make any sense, and the offsets are used to mark absolute, not relative locations. Also, the data from GPT partition table and some other sources is already using uint64_t data type, so using signed off_t can cause sign issues. Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D8710 Modified: head/sys/boot/common/disk.c head/sys/boot/common/disk.h head/sys/boot/common/part.c head/sys/boot/common/part.h head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/zfs/zfs.c Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/common/disk.c Wed Feb 1 20:10:56 2017 (r313047) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); struct open_disk { struct ptable *table; - off_t mediasize; + uint64_t mediasize; u_int sectorsize; u_int flags; int rcnt; @@ -64,7 +64,7 @@ struct dentry { int d_partition; struct open_disk *od; - off_t d_offset; + uint64_t d_offset; STAILQ_ENTRY(dentry) entry; #ifdef DISK_DEBUG uint32_t count; @@ -171,7 +171,7 @@ display_size(uint64_t size, u_int sector } int -ptblread(void *d, void *buf, size_t blocks, off_t offset) +ptblread(void *d, void *buf, size_t blocks, uint64_t offset) { struct disk_devdesc *dev; struct open_disk *od; @@ -238,7 +238,7 @@ disk_print(struct disk_devdesc *dev, cha } int -disk_read(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks) +disk_read(struct disk_devdesc *dev, void *buf, uint64_t offset, u_int blocks) { struct open_disk *od; int ret; @@ -251,7 +251,7 @@ disk_read(struct disk_devdesc *dev, void } int -disk_write(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks) +disk_write(struct disk_devdesc *dev, void *buf, uint64_t offset, u_int blocks) { struct open_disk *od; int ret; @@ -274,7 +274,7 @@ disk_ioctl(struct disk_devdesc *dev, u_l } int -disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize, +disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize, u_int flags) { struct open_disk *od; Modified: head/sys/boot/common/disk.h ============================================================================== --- head/sys/boot/common/disk.h Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/common/disk.h Wed Feb 1 20:10:56 2017 (r313047) @@ -86,7 +86,7 @@ struct disk_devdesc void *d_opendata; int d_slice; int d_partition; - off_t d_offset; + uint64_t d_offset; }; enum disk_ioctl { @@ -97,17 +97,17 @@ enum disk_ioctl { /* * Parse disk metadata and initialise dev->d_offset. */ -extern int disk_open(struct disk_devdesc *dev, off_t mediasize, +extern int disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize, u_int flags); #define DISK_F_NOCACHE 0x0001 /* Do not use metadata caching */ extern int disk_close(struct disk_devdesc *dev); extern void disk_cleanup(const struct devsw *d_dev); extern int disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *buf); -extern int disk_read(struct disk_devdesc *dev, void *buf, off_t offset, +extern int disk_read(struct disk_devdesc *dev, void *buf, uint64_t offset, u_int blocks); -extern int disk_write(struct disk_devdesc *dev, void *buf, off_t offset, +extern int disk_write(struct disk_devdesc *dev, void *buf, uint64_t offset, u_int blocks); -extern int ptblread(void *d, void *buf, size_t blocks, off_t offset); +extern int ptblread(void *d, void *buf, size_t blocks, uint64_t offset); /* * Print information about slices on a disk. Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/common/part.c Wed Feb 1 20:10:56 2017 (r313047) @@ -584,7 +584,7 @@ out: #endif /* LOADER_VTOC8_SUPPORT */ struct ptable* -ptable_open(void *dev, off_t sectors, uint16_t sectorsize, +ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread) { struct dos_partition *dp; Modified: head/sys/boot/common/part.h ============================================================================== --- head/sys/boot/common/part.h Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/common/part.h Wed Feb 1 20:10:56 2017 (r313047) @@ -62,11 +62,11 @@ struct ptable_entry { }; /* The offset and size are in sectors */ -typedef int (diskread_t)(void *arg, void *buf, size_t blocks, off_t offset); +typedef int (diskread_t)(void *arg, void *buf, size_t blocks, uint64_t offset); typedef int (ptable_iterate_t)(void *arg, const char *partname, const struct ptable_entry *part); -struct ptable *ptable_open(void *dev, off_t sectors, uint16_t sectorsize, +struct ptable *ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread); void ptable_close(struct ptable *table); enum ptable_type ptable_gettype(const struct ptable *table); Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/i386/libi386/biosdisk.c Wed Feb 1 20:10:56 2017 (r313047) @@ -493,7 +493,7 @@ bd_ioctl(struct open_file *f, u_long cmd *(u_int *)data = BD(dev).bd_sectorsize; break; case DIOCGMEDIASIZE: - *(off_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; + *(uint64_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; break; default: return (ENOTTY); Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/uboot/lib/disk.c Wed Feb 1 20:10:56 2017 (r313047) @@ -282,7 +282,7 @@ stor_ioctl(struct open_file *f, u_long c *(u_int *)data = SI(dev).bsize; break; case DIOCGMEDIASIZE: - *(off_t *)data = SI(dev).bsize * SI(dev).blocks; + *(uint64_t *)data = SI(dev).bsize * SI(dev).blocks; break; default: return (ENOTTY); Modified: head/sys/boot/usb/storage/umass_loader.c ============================================================================== --- head/sys/boot/usb/storage/umass_loader.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/usb/storage/umass_loader.c Wed Feb 1 20:10:56 2017 (r313047) @@ -143,14 +143,14 @@ umass_disk_ioctl(struct open_file *f __u uint32_t blocksize; switch (cmd) { - case IOCTL_GET_BLOCK_SIZE: - case IOCTL_GET_BLOCKS: + case DIOCGSECTORSIZE: + case DIOCGMEDIASIZE: if (usb_msc_read_capacity(umass_uaa.device, 0, &nblock, &blocksize) != 0) return (EINVAL); - if (cmd == IOCTL_GET_BLOCKS) - *(uint32_t*)buf = nblock; + if (cmd == DIOCGMEDIASIZE) + *(uint64_t*)buf = nblock; else *(uint32_t*)buf = blocksize; Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Wed Feb 1 19:36:33 2017 (r313046) +++ head/sys/boot/zfs/zfs.c Wed Feb 1 20:10:56 2017 (r313047) @@ -417,7 +417,7 @@ struct zfs_probe_args { }; static int -zfs_diskread(void *arg, void *buf, size_t blocks, off_t offset) +zfs_diskread(void *arg, void *buf, size_t blocks, uint64_t offset) { struct zfs_probe_args *ppa; From owner-svn-src-head@freebsd.org Wed Feb 1 20:26:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDC8CCC9A9; Wed, 1 Feb 2017 20:26:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67971666; Wed, 1 Feb 2017 20:26:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11KQhs3069943; Wed, 1 Feb 2017 20:26:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11KQgS3069932; Wed, 1 Feb 2017 20:26:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201702012026.v11KQgS3069932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 1 Feb 2017 20:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313048 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 20:26:45 -0000 Author: glebius Date: Wed Feb 1 20:26:42 2017 New Revision: 313048 URL: https://svnweb.freebsd.org/changeset/base/313048 Log: Update tcpdump to 4.9.0. It fixes many buffer overflow in different protocol parsers, but none of them are critical, even in absense of Capsicum. Security: CVE-2016-7922, CVE-2016-7923, CVE-2016-7924, CVE-2016-7925 Security: CVE-2016-7926, CVE-2016-7927, CVE-2016-7928, CVE-2016-7929 Security: CVE-2016-7930, CVE-2016-7931, CVE-2016-7932, CVE-2016-7933 Security: CVE-2016-7934, CVE-2016-7935, CVE-2016-7936, CVE-2016-7937 Security: CVE-2016-7938, CVE-2016-7939, CVE-2016-7940, CVE-2016-7973 Security: CVE-2016-7974, CVE-2016-7975, CVE-2016-7983, CVE-2016-7984 Security: CVE-2016-7985, CVE-2016-7986, CVE-2016-7992, CVE-2016-7993 Security: CVE-2016-8574, CVE-2016-8575, CVE-2017-5202, CVE-2017-5203 Security: CVE-2017-5204, CVE-2017-5205, CVE-2017-5341, CVE-2017-5342 Security: CVE-2017-5482, CVE-2017-5483, CVE-2017-5484, CVE-2017-5485 Security: CVE-2017-5486 Added: head/contrib/tcpdump/CONTRIBUTING - copied unchanged from r313024, vendor/tcpdump/dist/CONTRIBUTING head/contrib/tcpdump/PLATFORMS - copied unchanged from r313024, vendor/tcpdump/dist/PLATFORMS head/contrib/tcpdump/README - copied unchanged from r313024, vendor/tcpdump/dist/README head/contrib/tcpdump/addrtostr.c - copied, changed from r313024, vendor/tcpdump/dist/addrtostr.c head/contrib/tcpdump/addrtostr.h - copied unchanged from r313024, vendor/tcpdump/dist/addrtostr.h head/contrib/tcpdump/ascii_strcasecmp.c - copied unchanged from r313024, vendor/tcpdump/dist/ascii_strcasecmp.c head/contrib/tcpdump/ascii_strcasecmp.h - copied unchanged from r313024, vendor/tcpdump/dist/ascii_strcasecmp.h head/contrib/tcpdump/netdissect-stdinc.h - copied unchanged from r313024, vendor/tcpdump/dist/netdissect-stdinc.h head/contrib/tcpdump/netdissect.c - copied unchanged from r313024, vendor/tcpdump/dist/netdissect.c head/contrib/tcpdump/print-hncp.c - copied unchanged from r313024, vendor/tcpdump/dist/print-hncp.c head/contrib/tcpdump/print-lisp.c - copied unchanged from r313024, vendor/tcpdump/dist/print-lisp.c head/contrib/tcpdump/print-medsa.c - copied unchanged from r313024, vendor/tcpdump/dist/print-medsa.c head/contrib/tcpdump/print-nsh.c - copied unchanged from r313024, vendor/tcpdump/dist/print-nsh.c head/contrib/tcpdump/print-resp.c - copied unchanged from r313024, vendor/tcpdump/dist/print-resp.c head/contrib/tcpdump/print-vxlan-gpe.c - copied unchanged from r313024, vendor/tcpdump/dist/print-vxlan-gpe.c head/contrib/tcpdump/print.c - copied unchanged from r313024, vendor/tcpdump/dist/print.c head/contrib/tcpdump/print.h - copied unchanged from r313024, vendor/tcpdump/dist/print.h head/contrib/tcpdump/strtoaddr.c - copied unchanged from r313024, vendor/tcpdump/dist/strtoaddr.c head/contrib/tcpdump/strtoaddr.h - copied unchanged from r313024, vendor/tcpdump/dist/strtoaddr.h head/contrib/tcpdump/timeval-operations.h - copied unchanged from r313024, vendor/tcpdump/dist/timeval-operations.h head/contrib/tcpdump/util-print.c - copied unchanged from r313024, vendor/tcpdump/dist/util-print.c Deleted: head/contrib/tcpdump/.cvsignore head/contrib/tcpdump/atmuni31.h head/contrib/tcpdump/missing/addrinfo.h head/contrib/tcpdump/missing/getnameinfo.c head/contrib/tcpdump/missing/inet_aton.c head/contrib/tcpdump/missing/inet_ntop.c head/contrib/tcpdump/missing/inet_pton.c head/contrib/tcpdump/strcasecmp.c head/contrib/tcpdump/tcpdump-stdinc.h head/contrib/tcpdump/util.c Modified: head/contrib/tcpdump/CHANGES (contents, props changed) head/contrib/tcpdump/CREDITS (contents, props changed) head/contrib/tcpdump/INSTALL.txt (contents, props changed) head/contrib/tcpdump/Makefile.in (contents, props changed) head/contrib/tcpdump/VERSION (contents, props changed) head/contrib/tcpdump/addrtoname.c (contents, props changed) head/contrib/tcpdump/addrtoname.h (contents, props changed) head/contrib/tcpdump/af.c (contents, props changed) head/contrib/tcpdump/af.h (contents, props changed) head/contrib/tcpdump/bpf_dump.c (contents, props changed) head/contrib/tcpdump/checksum.c (contents, props changed) head/contrib/tcpdump/config.h.in (contents, props changed) head/contrib/tcpdump/configure (contents, props changed) head/contrib/tcpdump/configure.in (contents, props changed) head/contrib/tcpdump/cpack.c (contents, props changed) head/contrib/tcpdump/cpack.h (contents, props changed) head/contrib/tcpdump/ether.h (contents, props changed) head/contrib/tcpdump/ethertype.h (contents, props changed) head/contrib/tcpdump/extract.h (contents, props changed) head/contrib/tcpdump/gmpls.c (contents, props changed) head/contrib/tcpdump/gmt2local.c (contents, props changed) head/contrib/tcpdump/in_cksum.c (contents, props changed) head/contrib/tcpdump/interface.h (contents, props changed) head/contrib/tcpdump/ip.h (contents, props changed) head/contrib/tcpdump/ip6.h (contents, props changed) head/contrib/tcpdump/ipproto.c (contents, props changed) head/contrib/tcpdump/ipproto.h (contents, props changed) head/contrib/tcpdump/l2vpn.c (contents, props changed) head/contrib/tcpdump/l2vpn.h (contents, props changed) head/contrib/tcpdump/lbl/os-solaris2.h (contents, props changed) head/contrib/tcpdump/lbl/os-sunos4.h (contents, props changed) head/contrib/tcpdump/lbl/os-ultrix4.h (contents, props changed) head/contrib/tcpdump/machdep.c (contents, props changed) head/contrib/tcpdump/machdep.h (contents, props changed) head/contrib/tcpdump/mib.h (contents, props changed) head/contrib/tcpdump/missing/datalinks.c (contents, props changed) head/contrib/tcpdump/missing/dlnames.c (contents, props changed) head/contrib/tcpdump/missing/snprintf.c (contents, props changed) head/contrib/tcpdump/missing/strdup.c (contents, props changed) head/contrib/tcpdump/missing/strlcat.c (contents, props changed) head/contrib/tcpdump/missing/strlcpy.c (contents, props changed) head/contrib/tcpdump/missing/strsep.c (contents, props changed) head/contrib/tcpdump/nameser.h (contents, props changed) head/contrib/tcpdump/netdissect.h (contents, props changed) head/contrib/tcpdump/nfs.h (contents, props changed) head/contrib/tcpdump/nfsfh.h (contents, props changed) head/contrib/tcpdump/nlpid.c (contents, props changed) head/contrib/tcpdump/oui.c (contents, props changed) head/contrib/tcpdump/oui.h (contents, props changed) head/contrib/tcpdump/parsenfsfh.c (contents, props changed) head/contrib/tcpdump/pcap-missing.h (contents, props changed) head/contrib/tcpdump/ppp.h (contents, props changed) head/contrib/tcpdump/print-802_11.c (contents, props changed) head/contrib/tcpdump/print-802_15_4.c (contents, props changed) head/contrib/tcpdump/print-ah.c (contents, props changed) head/contrib/tcpdump/print-ahcp.c (contents, props changed) head/contrib/tcpdump/print-aodv.c (contents, props changed) head/contrib/tcpdump/print-aoe.c (contents, props changed) head/contrib/tcpdump/print-ap1394.c (contents, props changed) head/contrib/tcpdump/print-arcnet.c (contents, props changed) head/contrib/tcpdump/print-arp.c (contents, props changed) head/contrib/tcpdump/print-ascii.c (contents, props changed) head/contrib/tcpdump/print-atalk.c (contents, props changed) head/contrib/tcpdump/print-atm.c (contents, props changed) head/contrib/tcpdump/print-babel.c (contents, props changed) head/contrib/tcpdump/print-beep.c (contents, props changed) head/contrib/tcpdump/print-bfd.c (contents, props changed) head/contrib/tcpdump/print-bgp.c (contents, props changed) head/contrib/tcpdump/print-bootp.c (contents, props changed) head/contrib/tcpdump/print-bt.c (contents, props changed) head/contrib/tcpdump/print-calm-fast.c (contents, props changed) head/contrib/tcpdump/print-carp.c (contents, props changed) head/contrib/tcpdump/print-cdp.c (contents, props changed) head/contrib/tcpdump/print-cfm.c (contents, props changed) head/contrib/tcpdump/print-chdlc.c (contents, props changed) head/contrib/tcpdump/print-cip.c (contents, props changed) head/contrib/tcpdump/print-cnfp.c (contents, props changed) head/contrib/tcpdump/print-dccp.c (contents, props changed) head/contrib/tcpdump/print-decnet.c (contents, props changed) head/contrib/tcpdump/print-dhcp6.c (contents, props changed) head/contrib/tcpdump/print-domain.c (contents, props changed) head/contrib/tcpdump/print-dtp.c (contents, props changed) head/contrib/tcpdump/print-dvmrp.c (contents, props changed) head/contrib/tcpdump/print-eap.c (contents, props changed) head/contrib/tcpdump/print-egp.c (contents, props changed) head/contrib/tcpdump/print-eigrp.c (contents, props changed) head/contrib/tcpdump/print-enc.c (contents, props changed) head/contrib/tcpdump/print-esp.c (contents, props changed) head/contrib/tcpdump/print-ether.c (contents, props changed) head/contrib/tcpdump/print-fddi.c (contents, props changed) head/contrib/tcpdump/print-forces.c (contents, props changed) head/contrib/tcpdump/print-fr.c (contents, props changed) head/contrib/tcpdump/print-frag6.c (contents, props changed) head/contrib/tcpdump/print-ftp.c (contents, props changed) head/contrib/tcpdump/print-geneve.c (contents, props changed) head/contrib/tcpdump/print-geonet.c (contents, props changed) head/contrib/tcpdump/print-gre.c (contents, props changed) head/contrib/tcpdump/print-hsrp.c (contents, props changed) head/contrib/tcpdump/print-http.c (contents, props changed) head/contrib/tcpdump/print-icmp.c (contents, props changed) head/contrib/tcpdump/print-icmp6.c (contents, props changed) head/contrib/tcpdump/print-igmp.c (contents, props changed) head/contrib/tcpdump/print-igrp.c (contents, props changed) head/contrib/tcpdump/print-ip.c (contents, props changed) head/contrib/tcpdump/print-ip6.c (contents, props changed) head/contrib/tcpdump/print-ip6opts.c (contents, props changed) head/contrib/tcpdump/print-ipcomp.c (contents, props changed) head/contrib/tcpdump/print-ipfc.c (contents, props changed) head/contrib/tcpdump/print-ipnet.c (contents, props changed) head/contrib/tcpdump/print-ipx.c (contents, props changed) head/contrib/tcpdump/print-isakmp.c (contents, props changed) head/contrib/tcpdump/print-isoclns.c (contents, props changed) head/contrib/tcpdump/print-juniper.c (contents, props changed) head/contrib/tcpdump/print-krb.c (contents, props changed) head/contrib/tcpdump/print-l2tp.c (contents, props changed) head/contrib/tcpdump/print-lane.c (contents, props changed) head/contrib/tcpdump/print-ldp.c (contents, props changed) head/contrib/tcpdump/print-llc.c (contents, props changed) head/contrib/tcpdump/print-lldp.c (contents, props changed) head/contrib/tcpdump/print-lmp.c (contents, props changed) head/contrib/tcpdump/print-loopback.c (contents, props changed) head/contrib/tcpdump/print-lspping.c (contents, props changed) head/contrib/tcpdump/print-lwapp.c (contents, props changed) head/contrib/tcpdump/print-lwres.c (contents, props changed) head/contrib/tcpdump/print-m3ua.c (contents, props changed) head/contrib/tcpdump/print-mobile.c (contents, props changed) head/contrib/tcpdump/print-mobility.c (contents, props changed) head/contrib/tcpdump/print-mpcp.c (contents, props changed) head/contrib/tcpdump/print-mpls.c (contents, props changed) head/contrib/tcpdump/print-mptcp.c (contents, props changed) head/contrib/tcpdump/print-msdp.c (contents, props changed) head/contrib/tcpdump/print-msnlb.c head/contrib/tcpdump/print-nflog.c (contents, props changed) head/contrib/tcpdump/print-nfs.c (contents, props changed) head/contrib/tcpdump/print-ntp.c (contents, props changed) head/contrib/tcpdump/print-null.c (contents, props changed) head/contrib/tcpdump/print-olsr.c (contents, props changed) head/contrib/tcpdump/print-openflow-1.0.c (contents, props changed) head/contrib/tcpdump/print-openflow.c (contents, props changed) head/contrib/tcpdump/print-ospf.c (contents, props changed) head/contrib/tcpdump/print-ospf6.c (contents, props changed) head/contrib/tcpdump/print-otv.c head/contrib/tcpdump/print-pflog.c (contents, props changed) head/contrib/tcpdump/print-pfsync.c (contents, props changed) head/contrib/tcpdump/print-pgm.c (contents, props changed) head/contrib/tcpdump/print-pim.c (contents, props changed) head/contrib/tcpdump/print-pktap.c (contents, props changed) head/contrib/tcpdump/print-ppi.c (contents, props changed) head/contrib/tcpdump/print-ppp.c (contents, props changed) head/contrib/tcpdump/print-pppoe.c (contents, props changed) head/contrib/tcpdump/print-pptp.c (contents, props changed) head/contrib/tcpdump/print-radius.c (contents, props changed) head/contrib/tcpdump/print-raw.c (contents, props changed) head/contrib/tcpdump/print-rip.c (contents, props changed) head/contrib/tcpdump/print-ripng.c (contents, props changed) head/contrib/tcpdump/print-rpki-rtr.c (contents, props changed) head/contrib/tcpdump/print-rrcp.c (contents, props changed) head/contrib/tcpdump/print-rsvp.c (contents, props changed) head/contrib/tcpdump/print-rt6.c (contents, props changed) head/contrib/tcpdump/print-rtsp.c (contents, props changed) head/contrib/tcpdump/print-rx.c (contents, props changed) head/contrib/tcpdump/print-sctp.c (contents, props changed) head/contrib/tcpdump/print-sflow.c (contents, props changed) head/contrib/tcpdump/print-sip.c (contents, props changed) head/contrib/tcpdump/print-sl.c (contents, props changed) head/contrib/tcpdump/print-sll.c (contents, props changed) head/contrib/tcpdump/print-slow.c (contents, props changed) head/contrib/tcpdump/print-smb.c (contents, props changed) head/contrib/tcpdump/print-smtp.c (contents, props changed) head/contrib/tcpdump/print-snmp.c (contents, props changed) head/contrib/tcpdump/print-stp.c (contents, props changed) head/contrib/tcpdump/print-sunatm.c (contents, props changed) head/contrib/tcpdump/print-sunrpc.c (contents, props changed) head/contrib/tcpdump/print-symantec.c (contents, props changed) head/contrib/tcpdump/print-syslog.c (contents, props changed) head/contrib/tcpdump/print-tcp.c (contents, props changed) head/contrib/tcpdump/print-telnet.c (contents, props changed) head/contrib/tcpdump/print-tftp.c (contents, props changed) head/contrib/tcpdump/print-timed.c (contents, props changed) head/contrib/tcpdump/print-tipc.c head/contrib/tcpdump/print-token.c (contents, props changed) head/contrib/tcpdump/print-udld.c (contents, props changed) head/contrib/tcpdump/print-udp.c (contents, props changed) head/contrib/tcpdump/print-usb.c (contents, props changed) head/contrib/tcpdump/print-vjc.c (contents, props changed) head/contrib/tcpdump/print-vqp.c (contents, props changed) head/contrib/tcpdump/print-vrrp.c (contents, props changed) head/contrib/tcpdump/print-vtp.c (contents, props changed) head/contrib/tcpdump/print-vxlan.c head/contrib/tcpdump/print-wb.c (contents, props changed) head/contrib/tcpdump/print-zephyr.c (contents, props changed) head/contrib/tcpdump/print-zeromq.c head/contrib/tcpdump/rpc_auth.h (contents, props changed) head/contrib/tcpdump/rpc_msg.h (contents, props changed) head/contrib/tcpdump/rpl.h (contents, props changed) head/contrib/tcpdump/setsignal.c (contents, props changed) head/contrib/tcpdump/signature.c (contents, props changed) head/contrib/tcpdump/signature.h (contents, props changed) head/contrib/tcpdump/smb.h (contents, props changed) head/contrib/tcpdump/smbutil.c (contents, props changed) head/contrib/tcpdump/tcp.h (contents, props changed) head/contrib/tcpdump/tcpdump.1.in (contents, props changed) head/contrib/tcpdump/tcpdump.c (contents, props changed) head/contrib/tcpdump/udp.h (contents, props changed) head/contrib/tcpdump/vfprintf.c (contents, props changed) head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h Directory Properties: head/contrib/tcpdump/ (props changed) head/contrib/tcpdump/LICENSE (props changed) head/contrib/tcpdump/Makefile-devel-adds (props changed) head/contrib/tcpdump/ah.h (props changed) head/contrib/tcpdump/appletalk.h (props changed) head/contrib/tcpdump/atime.awk (props changed) head/contrib/tcpdump/atm.h (props changed) head/contrib/tcpdump/chdlc.h (props changed) head/contrib/tcpdump/config.guess (props changed) head/contrib/tcpdump/config.sub (props changed) head/contrib/tcpdump/getopt_long.h (props changed) head/contrib/tcpdump/gmpls.h (props changed) head/contrib/tcpdump/gmt2local.h (props changed) head/contrib/tcpdump/install-sh (props changed) head/contrib/tcpdump/lbl/os-osf4.h (props changed) head/contrib/tcpdump/llc.h (props changed) head/contrib/tcpdump/makemib (props changed) head/contrib/tcpdump/missing/getopt_long.c (props changed) head/contrib/tcpdump/mkdep (props changed) head/contrib/tcpdump/mpls.h (props changed) head/contrib/tcpdump/nlpid.h (props changed) head/contrib/tcpdump/openflow.h (props changed) head/contrib/tcpdump/ospf.h (props changed) head/contrib/tcpdump/packetdat.awk (props changed) head/contrib/tcpdump/pcap_dump_ftell.c (props changed) head/contrib/tcpdump/send-ack.awk (props changed) head/contrib/tcpdump/setsignal.h (props changed) head/contrib/tcpdump/slcompress.h (props changed) head/contrib/tcpdump/stime.awk (props changed) Modified: head/contrib/tcpdump/CHANGES ============================================================================== --- head/contrib/tcpdump/CHANGES Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/CHANGES Wed Feb 1 20:26:42 2017 (r313048) @@ -1,3 +1,187 @@ +Wednesday January 18, 2017 devel.fx.lebail@orange.fr + Summary for 4.9.0 tcpdump release + General updates: + Improve separation frontend/backend (tcpdump/libnetdissect) + Don't require IPv6 library support in order to support IPv6 addresses + Introduce data types to use for integral values in packet structures + Fix display of timestamps with -tt, -ttt and -ttttt options + Fix some heap overflows found with American Fuzzy Lop by Hanno Boeck and others + (More information in the log with CVE-2016-* and CVE-2017-*) + Change the way protocols print link-layer addresses (Fix heap overflows + in CALM-FAST and GeoNetworking printers) + Pass correct caplen value to ether_print() and some other functions + Fix lookup_nsap() to match what isonsap_string() expects + Clean up relative time stamp printing (Fix an array overflow) + Fix some alignment issues with GCC on Solaris 10 SPARC + Add some ND_TTEST_/ND_TCHECK_ macros to simplify writing bounds checks + Add a fn_printztn() which returns the number of bytes processed + Add nd_init() and nd_cleanup() functions. Improve libsmi support + Add CONTRIBUTING file + Add a summary comment in all printers + Compile with more warning options in devel mode if supported (-Wcast-qual, ...) + Fix some leaks found by Valgrind/Memcheck + Fix a bunch of de-constifications + Squelch some Coverity warnings and some compiler warnings + Update Coverity and Travis-CI setup + Update Visual Studio files + + Frontend: + Fix capsicum support to work with zerocopy buffers in bpf + Try opening interfaces by name first, then by name-as-index + Work around pcap_create() failures fetching time stamp type lists + Fix a segmentation fault with 'tcpdump -J' + Improve addrtostr6() bounds checking + Add exit_tcpdump() function + Don't drop CAP_SYS_CHROOT before chrooting + Fixes issue where statistics not reported when -G and -W options used + + New printers supporting: + Generic Protocol Extension for VXLAN (VXLAN-GPE) + Home Networking Control Protocol (HNCP), RFCs 7787 and 7788 + Locator/Identifier Separation Protocol (LISP), type 3 and type 4 packets + Marvell Extended Distributed Switch Architecture header (MEDSA) + Network Service Header (NSH) + REdis Serialization Protocol (RESP) + + Updated printers: + 802.11: Beginnings of 11ac radiotap support + 802.11: Check the Protected bit for management frames + 802.11: Do bounds checking on last_presentp before dereferencing it (Fix a heap overflow) + 802.11: Fix the radiotap printer to handle the special bits correctly + 802.11: If we have the MCS field, it's 11n + 802.11: Only print unknown frame type or subtype messages once + 802.11: Radiotap dBm values get printed as dB; Update a test output accordingly + 802.11: Source and destination addresses were backwards + AH: Add a bounds check + AH: Report to our caller that dissection failed if a bounds check fails + AP1394: Print src > dst, not dst > src + ARP: Don't assume the target hardware address is <= 6 octets long (Fix a heap overflow) + ATALK: Add bounds and length checks (Fix heap overflows) + ATM: Add some bounds checks (Fix a heap overflow) + ATM: Fix an incorrect bounds check + BFD: Update specification from draft to RFC 5880 + BFD: Update to print optional authentication field + BGP: Add decoding of ADD-PATH capability + BGP: Add support for the AIGP attribute (RFC7311) + BGP: Print LARGE_COMMUNITY Path Attribute + BGP: Update BGP numbers from IANA; Print minor values for FSM notification + BOOTP: Add a bounds check + Babel: Add decoder for source-specific extension + CDP: Filter out non-printable characters + CFM: Fixes to match the IEEE standard, additional bounds and length checks + CSLIP: Add more bounds checks (Fix a heap overflow) + ClassicalIPoATM: Add a bounds check on LLC+SNAP header (Fix a heap overflow) + DHCP: Fix MUDURL and TZ options + DHCPv6: Process MUDURL and TZ options + DHCPv6: Update Status Codes with RFCs/IANA names + DNS: Represent the "DNSSEC OK" bit as "DO" instead of "OK". Add a test case + DTP: Improve packet integrity checks + EGP: Fix bounds checks + ESP: Don't use OpenSSL_add_all_algorithms() in OpenSSL 1.1.0 or later + ESP: Handle OpenSSL 1.1.x + Ethernet: Add some bounds checking before calling isoclns_print (Fix a heap overflow) + Ethernet: Print the Length/Type field as length when needed + FDDI: Fix -e output for FDDI + FR: Add some packet-length checks and improve Q.933 printing (Fix heap overflows) + GRE: Add some bounds checks (Fix heap overflows) + Geneve: Fix error message with invalid option length; Update list option classes + HNCP: Fix incorrect time interval format. Fix handling of IPv4 prefixes + ICMP6: Fetch a 32-bit big-endian quantity with EXTRACT_32BITS() + ICMP6: dagid is always an IPv6 address, not an opaque 128-bit string + IGMP: Add a length check + IP: Add a bounds check (Fix a heap overflow) + IP: Check before fetching the protocol version (Fix a heap overflow) + IP: Don't try to dissect if IP version != 4 (Fix a heap overflow) + IP: Stop processing IPPROTO_ values once we hit IPPROTO_IPCOMP + IPComp: Check whether we have the CPI before we fetch it (Fix a heap overflow) + IPoFC: Fix -e output (IP-over-Fibre Channel) + IPv6: Don't overwrite the destination IPv6 address for routing headers + IPv6: Fix header printing + IPv6: Stop processing IPPROTO_ values once we hit IPPROTO_IPCOMP + ISAKMP: Clean up parsing of IKEv2 Security Associations + ISOCLNS/IS-IS: Add support for Purge Originator Identifier (RFC6232) and test cases + ISOCLNS/IS-IS: Don't overwrite packet data when checking the signature + ISOCLNS/IS-IS: Filter out non-printable characters + ISOCLNS/IS-IS: Fix segmentation faults + ISOCLNS/IS-IS: Have signature_verify() do the copying and clearing + ISOCLNS: Add some bounds checks + Juniper: Make sure a Juniper header TLV isn't bigger than what's left in the packet (Fix a heap overflow) + LLC/SNAP: With -e, print the LLC header before the SNAP header; without it, cut the SNAP header + LLC: Add a bounds check (Fix a heap overflow) + LLC: Clean up printing of LLC packets + LLC: Fix the printing of RFC 948-style IP packets + LLC: Skip the LLC and SNAP headers with -x for 802.11 and some other protocols + LLDP: Implement IANA OUI and LLDP MUD option + MPLS LSP ping: Update printing for RFC 4379, bug fixes, more bounds checks + MPLS: "length" is now the *remaining* packet length + MPLS: Add bounds and length checks (Fix a heap overflow) + NFS: Add a test that makes unaligned accesses + NFS: Don't assume the ONC RPC header is nicely aligned + NFS: Don't overflow the Opaque_Handle buffer (Fix a segmentation fault) + NFS: Don't run past the end of an NFSv3 file handle + OLSR: Add a test to cover a HNA sgw case + OLSR: Fix 'Advertised networks' count + OLSR: Fix printing of smart-gateway HNAs in IPv4 + OSPF: Add a bounds check for the Hello packet options + OSPF: Do more bounds checking + OSPF: Fix a segmentation fault + OSPF: Fix printing 'ospf_topology_values' default + OTV: Add missing bounds checks + PGM: Print the formatted IP address, not the raw binary address, as a string + PIM: Add some bounds checking (Fix a heap overflow) + PIMv2: Fix checksumming of Register messages + PPI: Pass an adjusted struct pcap_pkthdr to the sub-printer + PPP: Add some bounds checks (Fix a heap overflow) + PPP: Report invalid PAP AACK/ANAK packets + Q.933: Add a missing bounds check + RADIUS: Add Value 13 "VLAN" to Tunnel-Type attribute + RADIUS: Filter out non-printable characters + RADIUS: Translate UDP/1700 as RADIUS + RESP: Do better checking of RESP packets + RPKI-RTR: Add a return value check for "fn_printn" call + RPKI-RTR: Remove printing when truncated condition already detected + RPL: Fix 'Consistency Check' control code + RPL: Fix suboption print + RSVP: An INTEGRITY object in a submessage covers only the submessage + RSVP: Fix an infinite loop; Add bounds and length checks + RSVP: Fix some if statements missing brackets + RSVP: Have signature_verify() do the copying and clearing + RTCP: Add some bounds checks + RTP: Add some bounds checks, fix two segmentation faults + SCTP: Do more bounds checking + SFLOW: Fix bounds checking + SLOW: Fix bugs, add checks + SMB: Before fetching the flags2 field, make sure we have it + SMB: Do bounds checks on NBNS resource types and resource data lengths + SNMP: Clean up the "have libsmi but no modules loaded" case + SNMP: Clean up the object abbreviation list and fix the code to match them + SNMP: Do bounds checks when printing character and octet strings + SNMP: Improve ASN.1 bounds checks + SNMP: More bounds and length checks + STP: Add a bunch of bounds checks, and fix some printing (Fix heap overflows) + STP: Filter out non-printable characters + TCP: Add bounds and length checks for packets with TCP option 20 + TCP: Correct TCP option Kind value for TCP Auth and add SCPS-TP + TCP: Fix two bounds checks (Fix heap overflows) + TCP: Make sure we have the data offset field before fetching it (Fix a heap overflow) + TCP: Put TCP-AO option decoding right + TFTP: Don't use strchr() to scan packet data (Fix a heap overflow) + Telnet: Add some bounds checks + TokenRing: Fix -e output + UDLD: Fix an infinite loop + UDP: Add a bounds check (Fix a heap overflow) + UDP: Check against the packet length first + UDP: Don't do the DDP-over-UDP heuristic check up front + VAT: Add some bounds checks + VTP: Add a test on Mgmt Domain Name length + VTP: Add bounds checks and filter out non-printable characters + VXLAN: Add a bound check and a test case + ZeroMQ: Fix an infinite loop + +Tuesday April 14, 2015 guy@alum.mit.edu + Summary for 4.8.0 tcpdump release + Fix "-x" for Apple PKTAP and PPI packets + Friday April 10, 2015 guy@alum.mit.edu Summary for 4.7.4 tcpdump release RPKI to Router Protocol: Fix Segmentation Faults and other problems @@ -464,10 +648,10 @@ Wed. November 12, 2003. mcr@sandelman. Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release - Fixed infinite loop when parsing malformed isakmp packets. + Fixed infinite loop when parsing invalid isakmp packets. (reported by iDefense; already fixed in CVS) - Fixed infinite loop when parsing malformed BGP packets. - Fixed buffer overflow with certain malformed NFS packets. + Fixed infinite loop when parsing invalid BGP packets. + Fixed buffer overflow with certain invalid NFS packets. Pretty-print unprintable network names in 802.11 printer. Handle truncated nbp (appletalk) packets. Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt Copied: head/contrib/tcpdump/CONTRIBUTING (from r313024, vendor/tcpdump/dist/CONTRIBUTING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/tcpdump/CONTRIBUTING Wed Feb 1 20:26:42 2017 (r313048, copy of r313024, vendor/tcpdump/dist/CONTRIBUTING) @@ -0,0 +1,103 @@ +Some Information for Contributors +--------------------------------- +You want to contribute to Tcpdump, Thanks! +Please, read these lines. + +1) Fork the Tcpdump repository on GitHub from + https://github.com/the-tcpdump-group/tcpdump + (See https://help.github.com/articles/fork-a-repo/) + +2) Setup an optional Travis-CI build + You can setup a travis build for your fork. So, you can test your changes + on Linux and OSX before sending pull requests. + (See http://docs.travis-ci.com/user/getting-started/) + +3) Clone your repository + git clone https://github.com//tcpdump.git + +4) Do a 'touch .devel' in your working directory. + Currently, the effect is + a) add (via configure, in Makefile) some warnings options ( -Wall + -Wmissing-prototypes -Wstrict-prototypes, ...) to the compiler if it + supports these options, + b) have the Makefile support "make depend" and the configure script run it. + +5) Configure and build + ./configure && make -s && make check + +6) Add/update sample.pcap files + We use tests directory to do regression tests on the dissection of captured + packets, by running tcpdump against a savefile sample.pcap, created with -w + option and comparing the results with a text file sample.out giving the + expected results. + + Any new/updated fields in a dissector must be present in a sample.pcap file + and the corresponding output file. + + Configuration is set in tests/TESTLIST. + Each line in this file has the following format: + test-name sample.pcap sample.out tcpdump-options + + the sample.out file can be build by: + (cd tests && ../tcpdump -n -r sample.pcap tcpdump-options > sample.out) + + It is often useful to have test outputs with different verbosity levels + (none, -v, -vv, -vvv, etc.) depending on the code. + +7) Test with 'make check' + Don't send a pull request if 'make check' gives failed tests. + +8) Rebase your commits against upstream/master + (To keep linearity) + +9) Initiate and send a pull request + (See https://help.github.com/articles/using-pull-requests/) + +Some remarks +------------ +a) A thorough reading of some other printers code is useful. + +b) Put the normative reference if any as comments (RFC, etc.). + +c) Put the format of packets/headers/options as comments. + +d) The printer may receive incomplete packet in the buffer, truncated at any + random position, for example by capturing with '-s size' option. + Thus use ND_TTEST, ND_TTEST2, ND_TCHECK or ND_TCHECK2 for bound checking. + For ND_TCHECK2: + Define : static const char tstr[] = " [|protocol]"; + Define a label: trunc + Print with: ND_PRINT((ndo, "%s", tstr)); + You can test the code via: + sudo ./tcpdump -s snaplen [-v][v][...] -i lo # in a terminal + sudo tcpreplay -i lo sample.pcap # in another terminal + You should try several values for snaplen to do various truncation. + +e) Do invalid packet checks in code: Think that your code can receive in input + not only a valid packet but any arbitrary random sequence of octets (packet + - built malformed originally by the sender or by a fuzz tester, + - became corrupted in transit). + Print with: ND_PRINT((ndo, "%s", istr)); /* to print " (invalid)" */ + +f) Use 'struct tok' for indexed strings and print them with + tok2str() or bittok2str() (for flags). + +g) Avoid empty lines in output of printers. + +h) A commit message must have: + First line: Capitalized short summary in the imperative (70 chars or less) + + Body: Detailed explanatory text, if necessary. Fold it to approximately + 72 characters. There must be an empty line separating the summary from + the body. + +i) Avoid non-ASCII characters in code and commit messages. + +j) Use the style of the modified sources. + +k) Don't mix declarations and code + +l) Don't use // for comments + Not all C compilers accept C++/C99 comments by default. + +m) Avoid trailing tabs/spaces Modified: head/contrib/tcpdump/CREDITS ============================================================================== --- head/contrib/tcpdump/CREDITS Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/CREDITS Wed Feb 1 20:26:42 2017 (r313048) @@ -20,11 +20,13 @@ Additional people who have contributed p Andrea Bittau Andrew Brown Andrew Church + Andrew Darqui Andrew Hintz Andrew Nording Andrew Tridgell Andy Heffernan Anton Bernal + Antonin Décimo Arkadiusz Miskiewicz Armando L. Caro Jr. Arnaldo Carvalho de Melo @@ -33,6 +35,7 @@ Additional people who have contributed p Ben Byer Ben Smithurst Bert Vermeulen + Bill Parker Bjoern A. Zeeb Bram Brent L. Bates @@ -95,6 +98,7 @@ Additional people who have contributed p Jason R. Thorpe Jefferson Ogata Jeffrey Hutzelman + Jean-Raphaël Gaglione Jesper Peterson Jesse Gross Jim Hutchins @@ -119,7 +123,7 @@ Additional people who have contributed p Larry Lile Lennert Buytenhek Loganaden Velvindron - Longinus00 + Daniel Lee Loris Degioanni Love Hörnquist-Åstrand Lucas C. Villa Real @@ -134,6 +138,7 @@ Additional people who have contributed p Markus Schöpflin Marshall Rose Martin Husemann + Matthieu Boutier Max Laier Michael A. Meffie III Michael Madore Modified: head/contrib/tcpdump/INSTALL.txt ============================================================================== --- head/contrib/tcpdump/INSTALL.txt Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/INSTALL.txt Wed Feb 1 20:26:42 2017 (r313048) @@ -49,9 +49,10 @@ addrtoname.c - address to hostname routi addrtoname.h - address to hostname definitions ah.h - IPSEC Authentication Header definitions appletalk.h - AppleTalk definitions +ascii_strcasecmp.c - locale-independent case-independent string comparison + routines atime.awk - TCP ack awk script atm.h - ATM traffic type definitions -atmuni31.h - ATM Q.2931 definitions bpf_dump.c - BPF program printing routines, in case libpcap doesn't have them chdlc.h - Cisco HDLC definitions @@ -100,100 +101,8 @@ pcap_dump_ftell.c - pcap_dump_ftell() im doesn't have it pcap-missing.h - declarations of functions possibly missing from libpcap ppp.h - Point to Point Protocol definitions -print-802_11.c - IEEE 802.11 printer routines -print-ap1394.c - Apple IP-over-IEEE 1394 printer routines -print-ah.c - IPSEC Authentication Header printer routines -print-aodv.c - AODV printer routines -print-arcnet.c - ARCNET printer routines -print-arp.c - Address Resolution Protocol printer routines -print-ascii.c - ASCII packet dump routines -print-atalk.c - AppleTalk printer routines -print-atm.c - ATM printer routines -print-beep.c - BEEP printer routines -print-bgp.c - Border Gateway Protocol printer routines -print-bootp.c - BOOTP and IPv4 DHCP printer routines -print-bt.c - Bluetooth printer routines -print-cdp.c - Cisco Discovery Protocol printer routines -print-chdlc.c - Cisco HDLC printer routines -print-cip.c - Classical-IP over ATM routines -print-cnfp.c - Cisco NetFlow printer routines -print-dccp.c - DCCP printer routines -print-decnet.c - DECnet printer routines -print-dhcp6.c - IPv6 DHCP printer routines -print-domain.c - Domain Name System printer routines -print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines -print-eap.c - EAP printer routines -print-enc.c - OpenBSD IPsec encapsulation BPF layer printer routines -print-egp.c - External Gateway Protocol printer routines -print-esp.c - IPSEC Encapsulating Security Payload printer routines -print-ether.c - Ethernet printer routines -print-fddi.c - Fiber Distributed Data Interface printer routines -print-fr.c - Frame Relay printer routines -print-frag6.c - IPv6 fragmentation header printer routines -print-gre.c - Generic Routing Encapsulation printer routines -print-hsrp.c - Cisco Hot Standby Router Protocol printer routines -print-icmp.c - Internet Control Message Protocol printer routines -print-icmp6.c - IPv6 Internet Control Message Protocol printer routines -print-igmp.c - Internet Group Management Protocol printer routines -print-igrp.c - Interior Gateway Routing Protocol printer routines -print-ip.c - IP printer routines -print-ip6.c - IPv6 printer routines -print-ip6opts.c - IPv6 header option printer routines -print-ipcomp.c - IP Payload Compression Protocol printer routines -print-ipx.c - IPX printer routines -print-isakmp.c - Internet Security Association and Key Management Protocol -print-isoclns.c - ISO CLNS, ESIS, and ISIS printer routines -print-krb.c - Kerberos printer routines -print-l2tp.c - Layer Two Tunneling Protocol printer routines -print-lane.c - ATM LANE printer routines -print-llc.c - IEEE 802.2 LLC printer routines -print-lspping.c - LSPPING printer routines -print-lwres.c - Lightweight Resolver protocol printer routines -print-mobile.c - IPv4 mobility printer routines -print-mobility.c - IPv6 mobility printer routines -print-mpls.c - Multi-Protocol Label Switching printer routines -print-msdp.c - Multicast Source Discovery Protocol printer routines -print-nfs.c - Network File System printer routines -print-ntp.c - Network Time Protocol printer routines -print-null.c - BSD loopback device printer routines -print-ospf.c - Open Shortest Path First printer routines -print-ospf6.c - IPv6 Open Shortest Path First printer routines -print-pflog.c - OpenBSD packet filter log file printer routines -print-pgm.c - Pragmatic General Multicast printer routines -print-pim.c - Protocol Independent Multicast printer routines -print-ppp.c - Point to Point Protocol printer routines -print-pppoe.c - PPP-over-Ethernet printer routines -print-pptp.c - Point-to-Point Tunnelling Protocol printer routines -print-radius.c - Radius protocol printer routines -print-raw.c - Raw IP printer routines -print-rip.c - Routing Information Protocol printer routines -print-ripng.c - IPv6 Routing Information Protocol printer routines -print-rrcp.c - Realtek Remote Control Protocol routines -print-rsvp.c - Resource reSerVation Protocol (RSVP) printer routines -print-rt6.c - IPv6 routing header printer routines -print-rx.c - AFS RX printer routines -print-sctp.c - Stream Control Transmission Protocol printer routines -print-sip.c - SIP printer routines -print-sl.c - Compressed Serial Line Internet Protocol printer routines -print-sll.c - Linux "cooked" capture printer routines -print-slow.c - IEEE "slow protocol" (802.3ad) printer routines -print-smb.c - SMB/CIFS printer routines -print-snmp.c - Simple Network Management Protocol printer routines -print-stp.c - IEEE 802.1d spanning tree protocol printer routines -print-sunatm.c - SunATM DLPI capture printer routines -print-sunrpc.c - Sun Remote Procedure Call printer routines -print-symantec.c - Symantec Enterprise Firewall printer routines -print-tcp.c - TCP printer routines -print-telnet.c - Telnet option printer routines -print-tftp.c - Trivial File Transfer Protocol printer routines -print-timed.c - BSD time daemon protocol printer routines -print-token.c - Token Ring printer routines -print-udp.c - UDP printer routines -print-usb.c - USB printer routines -print-vjc.c - PPP Van Jacobson compression (RFC1144) printer routines -print-vrrp.c - Virtual Router Redundancy Protocol -print-wb.c - White Board printer routines -print-zephyr.c - Zephyr printer routines +print.c - Top-level routines for protocol printing +print-*.c - The netdissect printers rpc_auth.h - definitions for ONC RPC authentication rpc_msg.h - definitions for ONC RPC messages send-ack.awk - unidirectional tcp send/ack awk script @@ -203,11 +112,11 @@ slcompress.h - SLIP/PPP Van Jacobson com smb.h - SMB/CIFS definitions smbutil.c - SMB/CIFS utility routines stime.awk - TCP send awk script -strcasecmp.c - missing routine tcp.h - TCP definitions tcpdump.1 - manual entry tcpdump.c - main program +timeval-operations.h - timeval operations macros udp.h - UDP definitions -util.c - utility routines +util-print.c - utility routines for protocol printers vfprintf.c - emulation routine win32 - headers and routines for building on Win32 systems Modified: head/contrib/tcpdump/Makefile.in ============================================================================== --- head/contrib/tcpdump/Makefile.in Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/Makefile.in Wed Feb 1 20:26:42 2017 (r313048) @@ -74,7 +74,9 @@ CSRC = setsignal.c tcpdump.c LIBNETDISSECT_SRC=\ addrtoname.c \ + addrtostr.c \ af.c \ + ascii_strcasecmp.c \ checksum.c \ cpack.c \ gmpls.c \ @@ -86,6 +88,7 @@ LIBNETDISSECT_SRC=\ nlpid.c \ oui.c \ parsenfsfh.c \ + print.c \ print-802_11.c \ print-802_15_4.c \ print-ah.c \ @@ -98,6 +101,7 @@ LIBNETDISSECT_SRC=\ print-ascii.c \ print-atalk.c \ print-atm.c \ + print-babel.c \ print-beep.c \ print-bfd.c \ print-bgp.c \ @@ -112,6 +116,7 @@ LIBNETDISSECT_SRC=\ print-cnfp.c \ print-dccp.c \ print-decnet.c \ + print-dhcp6.c \ print-domain.c \ print-dtp.c \ print-dvmrp.c \ @@ -124,17 +129,21 @@ LIBNETDISSECT_SRC=\ print-fddi.c \ print-forces.c \ print-fr.c \ + print-frag6.c \ print-ftp.c \ print-geneve.c \ print-geonet.c \ print-gre.c \ + print-hncp.c \ print-hsrp.c \ print-http.c \ print-icmp.c \ + print-icmp6.c \ print-igmp.c \ print-igrp.c \ print-ip.c \ print-ip6.c \ + print-ip6opts.c \ print-ipcomp.c \ print-ipfc.c \ print-ipnet.c \ @@ -146,6 +155,7 @@ LIBNETDISSECT_SRC=\ print-l2tp.c \ print-lane.c \ print-ldp.c \ + print-lisp.c \ print-llc.c \ print-lldp.c \ print-lmp.c \ @@ -154,7 +164,9 @@ LIBNETDISSECT_SRC=\ print-lwapp.c \ print-lwres.c \ print-m3ua.c \ + print-medsa.c \ print-mobile.c \ + print-mobility.c \ print-mpcp.c \ print-mpls.c \ print-mptcp.c \ @@ -162,12 +174,14 @@ LIBNETDISSECT_SRC=\ print-msnlb.c \ print-nflog.c \ print-nfs.c \ + print-nsh.c \ print-ntp.c \ print-null.c \ print-olsr.c \ print-openflow-1.0.c \ print-openflow.c \ print-ospf.c \ + print-ospf6.c \ print-otv.c \ print-pgm.c \ print-pim.c \ @@ -178,10 +192,13 @@ LIBNETDISSECT_SRC=\ print-pptp.c \ print-radius.c \ print-raw.c \ + print-resp.c \ print-rip.c \ + print-ripng.c \ print-rpki-rtr.c \ print-rrcp.c \ print-rsvp.c \ + print-rt6.c \ print-rtsp.c \ print-rx.c \ print-sctp.c \ @@ -211,11 +228,14 @@ LIBNETDISSECT_SRC=\ print-vrrp.c \ print-vtp.c \ print-vxlan.c \ + print-vxlan-gpe.c \ print-wb.c \ print-zephyr.c \ print-zeromq.c \ + netdissect.c \ signature.c \ - util.c + strtoaddr.c \ + util-print.c LOCALSRC = @LOCALSRC@ GENSRC = version.c @@ -232,11 +252,12 @@ SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LI OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ) HDR = \ addrtoname.h \ + addrtostr.h \ af.h \ ah.h \ appletalk.h \ + ascii_strcasecmp.h \ atm.h \ - atmuni31.h \ chdlc.h \ cpack.h \ ether.h \ @@ -264,6 +285,7 @@ HDR = \ oui.h \ pcap-missing.h \ ppp.h \ + print.h \ rpc_auth.h \ rpc_msg.h \ rpl.h \ @@ -271,14 +293,15 @@ HDR = \ signature.h \ slcompress.h \ smb.h \ + strtoaddr.h \ tcp.h \ - tcpdump-stdinc.h \ + netdissect-stdinc.h \ + timeval-operations.h \ udp.h TAGHDR = \ /usr/include/arpa/tftp.h \ /usr/include/net/if_arp.h \ - /usr/include/net/slip.h \ /usr/include/netinet/if_ether.h \ /usr/include/netinet/in.h \ /usr/include/netinet/ip_icmp.h \ @@ -292,11 +315,14 @@ CLEANFILES = $(PROG) $(OBJ) $(GENSRC) EXTRA_DIST = \ CHANGES \ + CONTRIBUTING \ CREDITS \ INSTALL.txt \ LICENSE \ Makefile.in \ Makefile-devel-adds \ + PLATFORMS \ + README \ README.md \ Readme.Win32 \ VERSION \ @@ -314,14 +340,9 @@ EXTRA_DIST = \ lbl/os-sunos4.h \ lbl/os-ultrix4.h \ makemib \ - missing/addrinfo.h \ missing/dlnames.c \ missing/datalinks.c \ - missing/getnameinfo.c \ missing/getopt_long.c \ - missing/inet_aton.c \ - missing/inet_ntop.c \ - missing/inet_pton.c \ missing/snprintf.c \ missing/strdup.c \ missing/strlcat.c \ @@ -330,27 +351,19 @@ EXTRA_DIST = \ mkdep \ packetdat.awk \ pcap_dump_ftell.c \ - print-babel.c \ - print-dhcp6.c \ - print-frag6.c \ - print-icmp6.c \ - print-ip6opts.c \ - print-mobility.c \ - print-ospf6.c \ print-pflog.c \ - print-ripng.c \ - print-rt6.c \ print-smb.c \ send-ack.awk \ smbutil.c \ stime.awk \ - strcasecmp.c \ tcpdump.1.in \ vfprintf.c \ - win32/Include/w32_fzs.h \ win32/prj/GNUmakefile \ win32/prj/WinDump.dsp \ - win32/prj/WinDump.dsw + win32/prj/WinDump.dsw \ + win32/prj/WinDump.sln \ + win32/prj/WinDump.vcproj \ + win32/src/ether_ntohost.c TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` @@ -362,23 +375,15 @@ $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) @rm -f $@ - $(AR) $(ARFLAGS) $@ $(LIBNETDISSECT_OBJ) + $(AR) cr $@ $(LIBNETDISSECT_OBJ) $(RANLIB) $@ datalinks.o: $(srcdir)/missing/datalinks.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c dlnames.o: $(srcdir)/missing/dlnames.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c -getnameinfo.o: $(srcdir)/missing/getnameinfo.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c getopt_long.o: $(srcdir)/missing/getopt_long.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c -inet_pton.o: $(srcdir)/missing/inet_pton.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c -inet_ntop.o: $(srcdir)/missing/inet_ntop.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c -inet_aton.o: $(srcdir)/missing/inet_aton.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c snprintf.o: $(srcdir)/missing/snprintf.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c strdup.o: $(srcdir)/missing/strdup.c @@ -434,6 +439,9 @@ distclean: check: tcpdump (cd tests && ./TESTrun.sh) +extags: $(TAGFILES) + ctags $(TAGFILES) + tags: $(TAGFILES) ctags -wtd $(TAGFILES) Copied: head/contrib/tcpdump/PLATFORMS (from r313024, vendor/tcpdump/dist/PLATFORMS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/tcpdump/PLATFORMS Wed Feb 1 20:26:42 2017 (r313048, copy of r313024, vendor/tcpdump/dist/PLATFORMS) @@ -0,0 +1,9 @@ +== Tested platforms == +NetBSD 5.1/i386 (mcr - 2012/4/1) +Debian Linux (squeeze/i386) (mcr - 2012/4/1) + +--- +RedHat Linux 6.1/i386 (assar) +FreeBSD 2.2.8/i386 (itojun) + + Copied: head/contrib/tcpdump/README (from r313024, vendor/tcpdump/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/tcpdump/README Wed Feb 1 20:26:42 2017 (r313048, copy of r313024, vendor/tcpdump/dist/README) @@ -0,0 +1 @@ +link README.md \ No newline at end of file Modified: head/contrib/tcpdump/VERSION ============================================================================== --- head/contrib/tcpdump/VERSION Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/VERSION Wed Feb 1 20:26:42 2017 (r313048) @@ -1 +1 @@ -4.7.4 +4.9.0 Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Wed Feb 1 20:10:56 2017 (r313047) +++ head/contrib/tcpdump/addrtoname.c Wed Feb 1 20:26:42 2017 (r313048) @@ -20,11 +20,8 @@ * * Internet, ethernet, port, and protocol string to address * and address to string conversion routines - * - * $FreeBSD$ */ -#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -33,7 +30,8 @@ #include #include #endif /* HAVE_CASPER */ -#include + +#include #ifdef USE_ETHER_NTOHOST #ifdef HAVE_NETINET_IF_ETHER_H @@ -64,8 +62,10 @@ extern int ether_ntohost(char *, const s #include #include -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" +#include "addrtostr.h" +#include "ethertype.h" #include "llc.h" #include "setsignal.h" #include "extract.h" @@ -78,7 +78,7 @@ extern int ether_ntohost(char *, const s /* * hash tables for whatever-to-name translations * - * XXX there has to be error checks against strdup(3) failure + * ndo_error() called on strdup(3) failure */ #define HASHNAMESIZE 4096 @@ -96,7 +96,7 @@ static struct hnamemem eprototable[HASHN static struct hnamemem dnaddrtable[HASHNAMESIZE]; static struct hnamemem ipxsaptable[HASHNAMESIZE]; -#if defined(INET6) && defined(WIN32) +#ifdef _WIN32 /* * fake gethostbyaddr for Win2k/XP * gethostbyaddr() returns incorrect value when AF_INET6 is passed @@ -134,9 +134,8 @@ win32_gethostbyaddr(const char *addr, in } } #define gethostbyaddr win32_gethostbyaddr -#endif /* INET6 & WIN32 */ +#endif /* _WIN32 */ -#ifdef INET6 struct h6namemem { struct in6_addr addr; char *name; @@ -144,7 +143,6 @@ struct h6namemem { }; static struct h6namemem h6nametable[HASHNAMESIZE]; -#endif /* INET6 */ struct enamemem { u_short e_addr0; @@ -214,7 +212,7 @@ extern cap_channel_t *capdns; * * NOTE: ap is *NOT* necessarily part of the packet data (not even if * this is being called with the "ipaddr_string()" macro), so you - * *CANNOT* use the TCHECK{2}/TTEST{2} macros on it. Furthermore, + * *CANNOT* use the ND_TCHECK{2}/ND_TTEST{2} macros on it. Furthermore, * even in cases where it *is* part of the packet data, the caller * would still have to check for a null return value, even if it's * just printing the return value with "%s" - not all versions of @@ -232,7 +230,7 @@ getname(netdissect_options *ndo, const u { register struct hostent *hp; uint32_t addr; - static struct hnamemem *p; /* static for longjmp() */ + struct hnamemem *p; memcpy(&addr, ap, sizeof(addr)); p = &hnametable[addr & (HASHNAMESIZE-1)]; @@ -241,7 +239,7 @@ getname(netdissect_options *ndo, const u return (p->name); } p->addr = addr; - p->nxt = newhnamemem(); + p->nxt = newhnamemem(ndo); /* * Print names unless: @@ -263,6 +261,9 @@ getname(netdissect_options *ndo, const u char *dotp; p->name = strdup(hp->h_name); + if (p->name == NULL) + (*ndo->ndo_error)(ndo, + "getname: strdup(hp->h_name)"); if (ndo->ndo_Nflag) { /* Remove domain qualifications */ dotp = strchr(p->name, '.'); @@ -273,10 +274,11 @@ getname(netdissect_options *ndo, const u } } p->name = strdup(intoa(addr)); + if (p->name == NULL) + (*ndo->ndo_error)(ndo, "getname: strdup(intoa(addr))"); return (p->name); } -#ifdef INET6 /* * Return a name for the IP6 address pointed to by ap. This address * is assumed to be in network byte order. @@ -292,7 +294,7 @@ getname6(netdissect_options *ndo, const uint16_t d; } addra; } addr; - static struct h6namemem *p; /* static for longjmp() */ + struct h6namemem *p; register const char *cp; char ntop_buf[INET6_ADDRSTRLEN]; @@ -303,7 +305,7 @@ getname6(netdissect_options *ndo, const return (p->name); } p->addr = addr.addr; - p->nxt = newh6namemem(); + p->nxt = newh6namemem(ndo); /* * Do not print names if -n was given. @@ -315,11 +317,15 @@ getname6(netdissect_options *ndo, const sizeof(addr), AF_INET6); } else #endif - hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); + hp = gethostbyaddr((char *)&addr, sizeof(addr), + AF_INET6); if (hp) { char *dotp; p->name = strdup(hp->h_name); + if (p->name == NULL) + (*ndo->ndo_error)(ndo, + "getname6: strdup(hp->h_name)"); if (ndo->ndo_Nflag) { /* Remove domain qualifications */ dotp = strchr(p->name, '.'); @@ -329,11 +335,12 @@ getname6(netdissect_options *ndo, const return (p->name); } } - cp = inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf)); + cp = addrtostr6(ap, ntop_buf, sizeof(ntop_buf)); p->name = strdup(cp); + if (p->name == NULL) + (*ndo->ndo_error)(ndo, "getname6: strdup(cp)"); return (p->name); } -#endif /* INET6 */ static const char hex[] = "0123456789abcdef"; @@ -341,7 +348,7 @@ static const char hex[] = "0123456789abc /* Find the hash node that corresponds the ether address 'ep' */ static inline struct enamemem * -lookup_emem(const u_char *ep) +lookup_emem(netdissect_options *ndo, const u_char *ep) { register u_int i, j, k; struct enamemem *tp; @@ -363,7 +370,7 @@ lookup_emem(const u_char *ep) tp->e_addr2 = k; tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) - error("lookup_emem: calloc"); + (*ndo->ndo_error)(ndo, "lookup_emem: calloc"); return tp; } @@ -374,7 +381,8 @@ lookup_emem(const u_char *ep) */ static inline struct enamemem * -lookup_bytestring(register const u_char *bs, const unsigned int nlen) +lookup_bytestring(netdissect_options *ndo, register const u_char *bs, + const unsigned int nlen) { struct enamemem *tp; register u_int i, j, k; @@ -406,12 +414,12 @@ lookup_bytestring(register const u_char tp->e_bs = (u_char *) calloc(1, nlen + 1); if (tp->e_bs == NULL) - error("lookup_bytestring: calloc"); + (*ndo->ndo_error)(ndo, "lookup_bytestring: calloc"); memcpy(tp->e_bs, bs, nlen); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) - error("lookup_bytestring: calloc"); + (*ndo->ndo_error)(ndo, "lookup_bytestring: calloc"); return tp; } @@ -419,14 +427,15 @@ lookup_bytestring(register const u_char /* Find the hash node that corresponds the NSAP 'nsap' */ static inline struct enamemem * -lookup_nsap(register const u_char *nsap) +lookup_nsap(netdissect_options *ndo, register const u_char *nsap, + register u_int nsap_length) { register u_int i, j, k; - unsigned int nlen = *nsap; struct enamemem *tp; - const u_char *ensap = nsap + nlen - 6; + const u_char *ensap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 1 20:41:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2871CCCF4E; Wed, 1 Feb 2017 20:41:10 +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 83CED652; Wed, 1 Feb 2017 20:41:10 +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 v11Kf9xK074454; Wed, 1 Feb 2017 20:41:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11Kf9m6074450; Wed, 1 Feb 2017 20:41:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201702012041.v11Kf9m6074450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 1 Feb 2017 20:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313052 - in head/contrib/compiler-rt/lib: asan lsan sanitizer_common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 20:41:10 -0000 Author: dim Date: Wed Feb 1 20:41:09 2017 New Revision: 313052 URL: https://svnweb.freebsd.org/changeset/base/313052 Log: Pull in r293536 from upstream compiler-rt trunk: Recommit: Stop intercepting some malloc-related functions on FreeBSD and macOS Summary: In https://bugs.freebsd.org/215125 I was notified that some configure scripts attempt to test for the Linux-specific `mallinfo` and `mallopt` functions by compiling and linking small programs which references the functions, and observing whether that results in errors. FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions, so normally these tests would fail, but when sanitizers are enabled, they incorrectly succeed, because the sanitizers define interceptors for these functions. This also applies to some other malloc-related functions, such as `memalign`, `pvalloc` and `cfree`. Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`, `pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers. Also delete the non-functional `cfree` wrapper for Windows, to fix the test cases on that platform. Reviewers: emaste, kcc, rnk Subscribers: timurrrr, eugenis, hans, joerg, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D27654 This prevents autoconf scripts from incorrectly detecting that functions like mallinfo, mallopt, memalign, pvalloc and cfree are supported. PR: 215125, 215455 MFC after: 1 week Modified: head/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc head/contrib/compiler-rt/lib/asan/asan_malloc_win.cc head/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h Modified: head/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc Wed Feb 1 20:28:48 2017 (r313051) +++ head/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc Wed Feb 1 20:41:09 2017 (r313052) @@ -50,12 +50,14 @@ INTERCEPTOR(void, free, void *ptr) { asan_free(ptr, &stack, FROM_MALLOC); } +#if SANITIZER_INTERCEPT_CFREE INTERCEPTOR(void, cfree, void *ptr) { GET_STACK_TRACE_FREE; if (UNLIKELY(IsInDlsymAllocPool(ptr))) return; asan_free(ptr, &stack, FROM_MALLOC); } +#endif // SANITIZER_INTERCEPT_CFREE INTERCEPTOR(void*, malloc, uptr size) { if (UNLIKELY(!asan_inited)) @@ -85,22 +87,24 @@ INTERCEPTOR(void*, realloc, void *ptr, u return asan_realloc(ptr, size, &stack); } +#if SANITIZER_INTERCEPT_MEMALIGN INTERCEPTOR(void*, memalign, uptr boundary, uptr size) { GET_STACK_TRACE_MALLOC; return asan_memalign(boundary, size, &stack, FROM_MALLOC); } -INTERCEPTOR(void*, aligned_alloc, uptr boundary, uptr size) { - GET_STACK_TRACE_MALLOC; - return asan_memalign(boundary, size, &stack, FROM_MALLOC); -} - INTERCEPTOR(void*, __libc_memalign, uptr boundary, uptr size) { GET_STACK_TRACE_MALLOC; void *res = asan_memalign(boundary, size, &stack, FROM_MALLOC); DTLS_on_libc_memalign(res, size); return res; } +#endif // SANITIZER_INTERCEPT_MEMALIGN + +INTERCEPTOR(void*, aligned_alloc, uptr boundary, uptr size) { + GET_STACK_TRACE_MALLOC; + return asan_memalign(boundary, size, &stack, FROM_MALLOC); +} INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { GET_CURRENT_PC_BP_SP; @@ -108,6 +112,7 @@ INTERCEPTOR(uptr, malloc_usable_size, vo return asan_malloc_usable_size(ptr, pc, bp); } +#if SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO // We avoid including malloc.h for portability reasons. // man mallinfo says the fields are "long", but the implementation uses int. // It doesn't matter much -- we just need to make sure that the libc's mallinfo @@ -125,6 +130,7 @@ INTERCEPTOR(struct fake_mallinfo, mallin INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } +#endif // SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { GET_STACK_TRACE_MALLOC; @@ -137,10 +143,12 @@ INTERCEPTOR(void*, valloc, uptr size) { return asan_valloc(size, &stack); } +#if SANITIZER_INTERCEPT_PVALLOC INTERCEPTOR(void*, pvalloc, uptr size) { GET_STACK_TRACE_MALLOC; return asan_pvalloc(size, &stack); } +#endif // SANITIZER_INTERCEPT_PVALLOC INTERCEPTOR(void, malloc_stats, void) { __asan_print_accumulated_stats(); Modified: head/contrib/compiler-rt/lib/asan/asan_malloc_win.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_malloc_win.cc Wed Feb 1 20:28:48 2017 (r313051) +++ head/contrib/compiler-rt/lib/asan/asan_malloc_win.cc Wed Feb 1 20:41:09 2017 (r313052) @@ -56,11 +56,6 @@ void _free_base(void *ptr) { } ALLOCATION_FUNCTION_ATTRIBUTE -void cfree(void *ptr) { - CHECK(!"cfree() should not be used on Windows"); -} - -ALLOCATION_FUNCTION_ATTRIBUTE void *malloc(size_t size) { GET_STACK_TRACE_MALLOC; return asan_malloc(size, &stack); Modified: head/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc ============================================================================== --- head/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc Wed Feb 1 20:28:48 2017 (r313051) +++ head/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc Wed Feb 1 20:41:09 2017 (r313052) @@ -19,6 +19,7 @@ #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_linux.h" +#include "sanitizer_common/sanitizer_platform_interceptors.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "lsan.h" @@ -86,11 +87,26 @@ INTERCEPTOR(void*, realloc, void *q, upt return Reallocate(stack, q, size, 1); } +#if SANITIZER_INTERCEPT_MEMALIGN INTERCEPTOR(void*, memalign, uptr alignment, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return Allocate(stack, size, alignment, kAlwaysClearMemory); } +#define LSAN_MAYBE_INTERCEPT_MEMALIGN INTERCEPT_FUNCTION(memalign) + +INTERCEPTOR(void *, __libc_memalign, uptr alignment, uptr size) { + ENSURE_LSAN_INITED; + GET_STACK_TRACE_MALLOC; + void *res = Allocate(stack, size, alignment, kAlwaysClearMemory); + DTLS_on_libc_memalign(res, size); + return res; +} +#define LSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN INTERCEPT_FUNCTION(__libc_memalign) +#else +#define LSAN_MAYBE_INTERCEPT_MEMALIGN +#define LSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN +#endif // SANITIZER_INTERCEPT_MEMALIGN INTERCEPTOR(void*, aligned_alloc, uptr alignment, uptr size) { ENSURE_LSAN_INITED; @@ -106,14 +122,6 @@ INTERCEPTOR(int, posix_memalign, void ** return 0; } -INTERCEPTOR(void *, __libc_memalign, uptr alignment, uptr size) { - ENSURE_LSAN_INITED; - GET_STACK_TRACE_MALLOC; - void *res = Allocate(stack, size, alignment, kAlwaysClearMemory); - DTLS_on_libc_memalign(res, size); - return res; -} - INTERCEPTOR(void*, valloc, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; @@ -127,6 +135,7 @@ INTERCEPTOR(uptr, malloc_usable_size, vo return GetMallocUsableSize(ptr); } +#if SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO struct fake_mallinfo { int x[10]; }; @@ -136,11 +145,18 @@ INTERCEPTOR(struct fake_mallinfo, mallin internal_memset(&res, 0, sizeof(res)); return res; } +#define LSAN_MAYBE_INTERCEPT_MALLINFO INTERCEPT_FUNCTION(mallinfo) INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } +#define LSAN_MAYBE_INTERCEPT_MALLOPT INTERCEPT_FUNCTION(mallopt) +#else +#define LSAN_MAYBE_INTERCEPT_MALLINFO +#define LSAN_MAYBE_INTERCEPT_MALLOPT +#endif // SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO +#if SANITIZER_INTERCEPT_PVALLOC INTERCEPTOR(void*, pvalloc, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; @@ -152,8 +168,17 @@ INTERCEPTOR(void*, pvalloc, uptr size) { } return Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory); } +#define LSAN_MAYBE_INTERCEPT_PVALLOC INTERCEPT_FUNCTION(pvalloc) +#else +#define LSAN_MAYBE_INTERCEPT_PVALLOC +#endif // SANITIZER_INTERCEPT_PVALLOC +#if SANITIZER_INTERCEPT_CFREE INTERCEPTOR(void, cfree, void *p) ALIAS(WRAPPER_NAME(free)); +#define LSAN_MAYBE_INTERCEPT_CFREE INTERCEPT_FUNCTION(cfree) +#else +#define LSAN_MAYBE_INTERCEPT_CFREE +#endif // SANITIZER_INTERCEPT_CFREE #define OPERATOR_NEW_BODY \ ENSURE_LSAN_INITED; \ @@ -277,17 +302,18 @@ namespace __lsan { void InitializeInterceptors() { INTERCEPT_FUNCTION(malloc); INTERCEPT_FUNCTION(free); - INTERCEPT_FUNCTION(cfree); + LSAN_MAYBE_INTERCEPT_CFREE; INTERCEPT_FUNCTION(calloc); INTERCEPT_FUNCTION(realloc); - INTERCEPT_FUNCTION(memalign); + LSAN_MAYBE_INTERCEPT_MEMALIGN; + LSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN; + INTERCEPT_FUNCTION(aligned_alloc); INTERCEPT_FUNCTION(posix_memalign); - INTERCEPT_FUNCTION(__libc_memalign); INTERCEPT_FUNCTION(valloc); - INTERCEPT_FUNCTION(pvalloc); + LSAN_MAYBE_INTERCEPT_PVALLOC; INTERCEPT_FUNCTION(malloc_usable_size); - INTERCEPT_FUNCTION(mallinfo); - INTERCEPT_FUNCTION(mallopt); + LSAN_MAYBE_INTERCEPT_MALLINFO; + LSAN_MAYBE_INTERCEPT_MALLOPT; INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Feb 1 20:28:48 2017 (r313051) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Feb 1 20:41:09 2017 (r313052) @@ -318,4 +318,10 @@ #define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT #define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID + +#define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO (!SI_FREEBSD && !SI_MAC) +#define SANITIZER_INTERCEPT_MEMALIGN (!SI_FREEBSD && !SI_MAC) +#define SANITIZER_INTERCEPT_PVALLOC (!SI_FREEBSD && !SI_MAC) +#define SANITIZER_INTERCEPT_CFREE (!SI_FREEBSD && !SI_MAC) + #endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H From owner-svn-src-head@freebsd.org Wed Feb 1 21:40:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAE88CCB1A6; Wed, 1 Feb 2017 21:40:00 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EED01924; Wed, 1 Feb 2017 21:40:00 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 5BD75312; Wed, 1 Feb 2017 15:39:58 -0600 (CST) Date: Wed, 1 Feb 2017 15:39:57 -0600 From: Mark Linimon To: Slawa Olhovchenkov Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201213956.GA3765@lonesome.com> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201170950.GF79121@zxy.spb.ru> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:40:00 -0000 On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > Also, I am think current ports don't build on 4.x. I will personally guarantee, in writing, that current ports do not build on 4.x, nor have they done so for years. I personally removed the legacy cruft when 4.11 finally went EOL. > I am got complains about using ports on 8.x. I am 99% certain that ports will not work on either 8.x or 9.x. Legacy cruft was removed at the EOL in each of those cases. Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek medical attention at once. At the absolute least, that era spans 3 major versions of make(1) and two completely different package implementations. mcl From owner-svn-src-head@freebsd.org Wed Feb 1 21:48:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F88CCB79A; Wed, 1 Feb 2017 21:48:01 +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 95B6B7BB; Wed, 1 Feb 2017 21:48:01 +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 08D1B10A791; Wed, 1 Feb 2017 16:47:59 -0500 (EST) From: John Baldwin To: Mark Linimon Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Date: Wed, 01 Feb 2017 13:45:14 -0800 Message-ID: <1893823.eZvhe4dRmn@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170201213956.GA3765@lonesome.com> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 01 Feb 2017 16:47:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:48:01 -0000 On Wednesday, February 01, 2017 03:39:57 PM Mark Linimon wrote: > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > > Also, I am think current ports don't build on 4.x. > > I will personally guarantee, in writing, that current ports do not build > on 4.x, nor have they done so for years. I personally removed the legacy > cruft when 4.11 finally went EOL. > > > I am got complains about using ports on 8.x. > > I am 99% certain that ports will not work on either 8.x or 9.x. Legacy > cruft was removed at the EOL in each of those cases. > > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, 8.x, > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek medical > attention at once. At the absolute least, that era spans 3 major versions > of make(1) and two completely different package implementations. I think Slawa's point was that my suggestion that people with old hardware should run old releases means that they cannot use a modern ports checkout with those older systems. That point is correct, but you probably don't want to run newer, more bloated 3rd party software on such gear either. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 1 21:48:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CCECCB799; Wed, 1 Feb 2017 21:48:01 +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 90E7E7BA; Wed, 1 Feb 2017 21:48:01 +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 6268310A7B9; Wed, 1 Feb 2017 16:48:00 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Cc: Edward Tomasz Napierala , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys Date: Wed, 01 Feb 2017 12:36:31 -0800 Message-ID: <148601396.h8ndg2hV6R@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170201182337.GG3334@FreeBSD.org> References: <201701301257.v0UCvNrK065993@repo.freebsd.org> <3349880.lYJPXOWCO7@ralph.baldwin.cx> <20170201182337.GG3334@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 01 Feb 2017 16:48:00 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:48:01 -0000 On Wednesday, February 01, 2017 10:23:37 AM Gleb Smirnoff wrote: > On Tue, Jan 31, 2017 at 02:13:36PM -0800, John Baldwin wrote: > J> On Monday, January 30, 2017 12:57:23 PM Edward Tomasz Napierala wrote: > J> > Author: trasz > J> > Date: Mon Jan 30 12:57:22 2017 > J> > New Revision: 312988 > J> > URL: https://svnweb.freebsd.org/changeset/base/312988 > J> > > J> > Log: > J> > Add kern_listen(), kern_shutdown(), and kern_socket(), and use them > J> > instead of their sys_*() counterparts in various compats. The svr4 > J> > is left untouched, because there's no point. > J> > J> Note that you can compile test svr4 since it is still in the tree. > J> If we want to remove svr4, then we should remove it. However, we > J> should maintain code that is in the tree if it is still there. > > All we can do right now is maintain it as compilable. My example with > COMPAT_OLDSOCK shows that SVR4 simply doesn't work as kld, and nobody > complains. > > Okay, what if I say on freebsd-arch/freebsd-current that I am going > to remove it and wait for any objections for a month, and then do it? I would rather remove it than start skipping it in tree sweeps. We should strive to maintain code that is in our tree. If you can't get things tested, then we are better off removing the code instead of having it rot in the tree (cf the discussion on old ISA drivers). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 1 21:50:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C276CCBB4D; Wed, 1 Feb 2017 21:50:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D6C1215; Wed, 1 Feb 2017 21:50:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cZ2n1-000Ifb-5k; Thu, 02 Feb 2017 00:50:07 +0300 Date: Thu, 2 Feb 2017 00:50:07 +0300 From: Slawa Olhovchenkov To: Mark Linimon Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201215007.GA37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201213956.GA3765@lonesome.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:50:15 -0000 On Wed, Feb 01, 2017 at 03:39:57PM -0600, Mark Linimon wrote: > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > > Also, I am think current ports don't build on 4.x. > > I will personally guarantee, in writing, that current ports do not build > on 4.x, nor have they done so for years. I personally removed the legacy > cruft when 4.11 finally went EOL. > > > I am got complains about using ports on 8.x. > > I am 99% certain that ports will not work on either 8.x or 9.x. Legacy > cruft was removed at the EOL in each of those cases. > > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, 8.x, > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek medical > attention at once. At the absolute least, that era spans 3 major versions > of make(1) and two completely different package implementations. I am assume no problem to use new make on old system. May be posible use pkg too (not sure about pkg requirements to syscalls). From owner-svn-src-head@freebsd.org Wed Feb 1 21:54:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DE7CCC036; Wed, 1 Feb 2017 21:54:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245261C0E; Wed, 1 Feb 2017 21:54:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cZ2rg-000Io5-1w; Thu, 02 Feb 2017 00:54:56 +0300 Date: Thu, 2 Feb 2017 00:54:56 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Mark Linimon , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201215455.GB37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> <1893823.eZvhe4dRmn@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1893823.eZvhe4dRmn@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:54:58 -0000 On Wed, Feb 01, 2017 at 01:45:14PM -0800, John Baldwin wrote: > On Wednesday, February 01, 2017 03:39:57 PM Mark Linimon wrote: > > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > > > Also, I am think current ports don't build on 4.x. > > > > I will personally guarantee, in writing, that current ports do not build > > on 4.x, nor have they done so for years. I personally removed the legacy > > cruft when 4.11 finally went EOL. > > > > > I am got complains about using ports on 8.x. > > > > I am 99% certain that ports will not work on either 8.x or 9.x. Legacy > > cruft was removed at the EOL in each of those cases. > > > > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, 8.x, > > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek medical > > attention at once. At the absolute least, that era spans 3 major versions > > of make(1) and two completely different package implementations. > > I think Slawa's point was that my suggestion that people with old hardware > should run old releases means that they cannot use a modern ports checkout Yes. > with those older systems. That point is correct, but you probably don't > want to run newer, more bloated 3rd party software on such gear either. Not all software bloated, some software need to updated (for example, not sure about sshd in 4.x system. Or openssl). From owner-svn-src-head@freebsd.org Wed Feb 1 21:55:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2914CCC098 for ; Wed, 1 Feb 2017 21:55:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48A801D63 for ; Wed, 1 Feb 2017 21:55:53 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 2d40e750-e8c9-11e6-95b5-6dfd7dbb0ee5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 2d40e750-e8c9-11e6-95b5-6dfd7dbb0ee5; Wed, 01 Feb 2017 21:55:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v11Ltavn019737; Wed, 1 Feb 2017 14:55:36 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485986136.3017.89.camel@freebsd.org> Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... From: Ian Lepore To: Slawa Olhovchenkov , Mark Linimon Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , Takahashi Yoshihiro Date: Wed, 01 Feb 2017 14:55:36 -0700 In-Reply-To: <20170201215007.GA37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> <20170201215007.GA37974@zxy.spb.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 21:55:54 -0000 On Thu, 2017-02-02 at 00:50 +0300, Slawa Olhovchenkov wrote: > On Wed, Feb 01, 2017 at 03:39:57PM -0600, Mark Linimon wrote: > > > > > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > > > > > > Also, I am think current ports don't build on 4.x. > > I will personally guarantee, in writing, that current ports do not > > build > > on 4.x, nor have they done so for years.I personally removed the > > legacy > > cruft when 4.11 finally went EOL. > > > > > > > > I am got complains about using ports on 8.x. > > I am 99% certain that ports will not work on either 8.x or > > 9.x.Legacy > > cruft was removed at the EOL in each of those cases. > > > > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, > > 8.x, > > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek > > medical > > attention at once.At the absolute least, that era spans 3 major > > versions > > of make(1) and two completely different package implementations. > I am assume no problem to use new make on old system. > May be posible use pkg too (not sure about pkg requirements to > syscalls). > I can't say anything about 4.x, but I have no problems building current ports on 8.2. I have backported a few crucial changes to make, like handling :tl and :tu, and that's about it. It may not be officially supported, but it's not hard to make it work for those who have a need. I also still support systems that use true ISA-slot hardware, but that doesn't include any storage or network controllers. Mostly the ISA cards are proprietary things, plus one ancient 8-port uart expansion card that amazingly still works and can still be purchased. -- Ian From owner-svn-src-head@freebsd.org Wed Feb 1 22:04:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250F0CCC2D6; Wed, 1 Feb 2017 22:04:01 +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 C325A784; Wed, 1 Feb 2017 22:04:00 +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 v11M3xBu013914; Wed, 1 Feb 2017 22:03:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11M3xs2013913; Wed, 1 Feb 2017 22:03:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702012203.v11M3xs2013913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 1 Feb 2017 22:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313068 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 22:04:01 -0000 Author: gonzo Date: Wed Feb 1 22:03:59 2017 New Revision: 313068 URL: https://svnweb.freebsd.org/changeset/base/313068 Log: [am335x] Fallback to standard video interface bindings when using Linux dts Historically AM335x LCDC driver used non-standard "hdmi" property to refer to HDMI framer. There is no such thing in upstream DTS, so to handle both cases fallback to bindings described in bindings/media/video-interfaces.txt in Linux documentation. We still make some assumptions that are not universally true: we assume that if remote endpoint is available it's going to be HDMI framer. Which is true for AM335x-based devices currently supported but may be not true for some custom hardware. MFC after: 1 week Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Wed Feb 1 21:57:07 2017 (r313067) +++ head/sys/arm/ti/am335x/am335x_lcd.c Wed Feb 1 22:03:59 2017 (r313068) @@ -343,15 +343,46 @@ static void am335x_read_hdmi_property(device_t dev) { phandle_t node; + phandle_t endpoint; phandle_t hdmi_xref; struct am335x_lcd_softc *sc; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); - if (OF_getencprop(node, "hdmi", &hdmi_xref, sizeof(hdmi_xref)) == -1) - sc->sc_hdmi_framer = 0; - else - sc->sc_hdmi_framer = hdmi_xref; + sc->sc_hdmi_framer = 0; + + /* + * Old FreeBSD way of referencing to HDMI framer + */ + if (OF_getencprop(node, "hdmi", &hdmi_xref, sizeof(hdmi_xref)) != -1) { + sc->sc_hdmi_framer = hdmi_xref; + return; + } + + /* + * Use bindings described in Linux docs: + * bindings/media/video-interfaces.txt + * We assume that the only endpoint in LCDC node + * is HDMI framer. + */ + node = ofw_bus_find_child(node, "port"); + + /* No media bindings */ + if (node == 0) + return; + + for (endpoint = OF_child(node); endpoint != 0; endpoint = OF_peer(endpoint)) { + if (OF_getencprop(endpoint, "remote-endpoint", &node, sizeof(node)) != -1) { + /* port node of remote endpoint */ + node = OF_node_from_xref(node); + /* port/ node */ + node = OF_parent(node); + /* actual owner of port/endpoint, in our case HDMI framer */ + sc->sc_hdmi_framer = OF_parent(node); + if (sc->sc_hdmi_framer != 0) + return; + } + } } static int From owner-svn-src-head@freebsd.org Wed Feb 1 22:08:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58105CCC352; Wed, 1 Feb 2017 22:08:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E17AAC; Wed, 1 Feb 2017 22:08:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cZ34d-000JCx-1S; Thu, 02 Feb 2017 01:08:19 +0300 Date: Thu, 2 Feb 2017 01:08:19 +0300 From: Slawa Olhovchenkov To: Warner Losh Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201220818.GC37974@zxy.spb.ru> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170639.GY37974@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 22:08:21 -0000 On Wed, Feb 01, 2017 at 10:56:24AM -0700, Warner Losh wrote: > >> > > Fair enough. I haven't fully put away my 12 axe and am toying with > >> > > dropping any ISA-only storage and NIC drivers (and perhaps pccard-only > >> > > as well in that case). Hardware that wants to use ISA/pccard for > >> > > storage is probably happier running 4.x anyway. One question is if we > >> > > should drop ISA attachments in that case for drivers that support PCI > >> > > and ISA. However, there's a fair list of ISA-only adapters that would > >> > > be a good place to start anyway. One concern is to not drop any drivers > >> > > >> > ps/2 keyboard, mouse, touchpads, lm sensors, etc?... > >> > >> Those aren't storage or NICs. There are many "legacy" device still present > >> in modern systems that we obviously have to support. However, if you have > >> an ISA Adapter SCSI HBA in an ISA slot, the machine running that is probably > >> happier running 4.x than 12.0. > > > > My be I am missread, I think removed ISA bus and all devices attached > > to ISA bus. > > We will never ever ever remove the ISA bus on the i386 or amd64 ports. > That's simply not possible due to the legacy busses and the fact that > many devices are logically attached to the address space used by the > ISA bus even if there aren't physical plastic ISA slots. Ah, sorry, this is my missread. I am don't have any ISA cards in use many years. Only some ISA COM/LPT/sound cards in far-away box. PS: again, may be time to move all drivers to modules and load all GENERIC's devices from loader.conf? /boot/loader have good performance now. From owner-svn-src-head@freebsd.org Wed Feb 1 23:22:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0AD2CCC715; Wed, 1 Feb 2017 23:22:55 +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 6616615AF; Wed, 1 Feb 2017 23:22:55 +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 v11NMsq4046864; Wed, 1 Feb 2017 23:22:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11NMspn046862; Wed, 1 Feb 2017 23:22:54 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702012322.v11NMspn046862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 Feb 2017 23:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313069 - in head/etc/periodic: daily monthly weekly X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 23:22:55 -0000 Author: asomers Date: Wed Feb 1 23:22:54 2017 New Revision: 313069 URL: https://svnweb.freebsd.org/changeset/base/313069 Log: Allow 999.local to run scripts in any language If one of the scripts listed in (daily|weekly|monthly)_local is executable, 999.local should simply execute it. Only if the script isn't executable should 999.local assume it needs /bin/sh. Reviewed by: brian MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/etc/periodic/daily/999.local head/etc/periodic/monthly/999.local head/etc/periodic/weekly/999.local Modified: head/etc/periodic/daily/999.local ============================================================================== --- head/etc/periodic/daily/999.local Wed Feb 1 22:03:59 2017 (r313068) +++ head/etc/periodic/daily/999.local Wed Feb 1 23:22:54 2017 (r313069) @@ -20,7 +20,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" Modified: head/etc/periodic/monthly/999.local ============================================================================== --- head/etc/periodic/monthly/999.local Wed Feb 1 22:03:59 2017 (r313068) +++ head/etc/periodic/monthly/999.local Wed Feb 1 23:22:54 2017 (r313069) @@ -17,7 +17,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" Modified: head/etc/periodic/weekly/999.local ============================================================================== --- head/etc/periodic/weekly/999.local Wed Feb 1 22:03:59 2017 (r313068) +++ head/etc/periodic/weekly/999.local Wed Feb 1 23:22:54 2017 (r313069) @@ -17,7 +17,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" From owner-svn-src-head@freebsd.org Wed Feb 1 23:26:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E95CCC7B5; Wed, 1 Feb 2017 23:26:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13C751747; Wed, 1 Feb 2017 23:26:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5E93E39E0; Wed, 1 Feb 2017 23:26:21 +0000 (UTC) Date: Wed, 1 Feb 2017 23:26:21 +0000 From: Alexey Dokuchaev To: Mark Linimon Cc: Slawa Olhovchenkov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , Takahashi Yoshihiro , "svn-src-head@freebsd.org" , Warner Losh Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170201232621.GA20035@FreeBSD.org> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201213956.GA3765@lonesome.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2017 23:26:22 -0000 On Wed, Feb 01, 2017 at 03:39:57PM -0600, Mark Linimon wrote: > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: > > Also, I am think current ports don't build on 4.x. > > I will personally guarantee, in writing, that current ports do not build > on 4.x, nor have they done so for years. I personally removed the legacy > cruft when 4.11 finally went EOL. They don't build as is, but they still can be tamed (patched) to build and install nicely on 4.x with some effort. Most remaining 4.x installations are server ones which typically carry a well known selection of ports that are not hard to maintain locally for 4.x compatibility. One does not have to have *entire* tree to build flawlessly on 4.x. > > I am got complains about using ports on 8.x. > > I am 99% certain that ports will not work on either 8.x or 9.x. Legacy > cruft was removed at the EOL in each of those cases. That's quite wrong actually: most ports build and run just fine on 8.x (X.org stack is one major exception), with some fairly trivial changes. > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, 8.x, > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek medical > attention at once. Well, we're doing something more than devoid any support claims: we're deliberately breaking it, often for little to no reason. Things like r431746 are disgrace to FreeBSD and utter disrespect to our users. :-( > At the absolute least, that era spans 3 major versions of make(1) and > two completely different package implementations. That's largely irrelevant and hardly ever causing problems. All needed make(1) implementations are available in ports; I can still build modern ports in 8.x tinderbox with WITH_PKGNG=yes/PKGSUFFIX=.txz. ./danfe From owner-svn-src-head@freebsd.org Thu Feb 2 00:50:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 895F8CCB2B8; Thu, 2 Feb 2017 00:50:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519AE908; Thu, 2 Feb 2017 00:50:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v120ollU080172; Thu, 2 Feb 2017 00:50:47 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v120okJl080163; Thu, 2 Feb 2017 00:50:46 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201702020050.v120okJl080163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 2 Feb 2017 00:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313074 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test lib/libarchive lib/libarchive/t... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 00:50:48 -0000 Author: mm Date: Thu Feb 2 00:50:46 2017 New Revision: 313074 URL: https://svnweb.freebsd.org/changeset/base/313074 Log: MFV r313071: Sync libarchive with vendor Vendor changes (relevant to FreeBSD): - support extracting NFSv4 ACLs from Solaris tar archives - bugfixes and optimizations in the ACL code - multiple fixes in the test suite - typo and other small bugfixes Security fixes: - cab reader: endless loop when parsing MSZIP signature (OSS-Fuzz 335) - LHA reader: heap-buffer-overflow in lha_read_file_header_1() (CVE-2017-5601) - LZ4 reader: null-pointer dereference in lz4_filter_read_legacy_stream() (OSS-Fuzz 453) - mtree reader: heap-buffer-overflow in detect_form() (OSS-Fuzz 421, 443) - WARC reader: heap-buffer-overflow in xstrpisotime() (OSS-Fuzz 382, 458) Memory leak fixes: - ACL support: free memory allocated by acl_get_qualifier() - disk writer: missing free in create_filesystem_object() - file reader: fd leak (Coverity 1016755) - gnutar writer: fix free in archive_write_gnutar_header() (Coverity 101675) - iso 9660 reader: missing free in parse_file_info() (partial Coverity 1016754) - program reader: missing free in __archive_read_program() - program writer: missing free in __archive_write_program_free() - xar reader: missing free in xar_cleanup() - xar reader: missing frees in expat_xmlattr_setup() (Coverity 1229979-1229981) - xar writer: missing free in file_free() - zip reader: missing free in zip_read_local_file_header() MFC after: 1 week X-MFC with: 310866, 310868, 310870, 311899 Added: head/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c - copied unchanged from r313071, vendor/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c - copied unchanged from r313071, vendor/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c Deleted: head/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_acl_private.h head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry_strmode.c head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_random.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_open_filename.c head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_filter_program.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_open.3 head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_acl_text.c head/contrib/libarchive/libarchive/test/test_archive_string.c head/contrib/libarchive/libarchive/test/test_compat_gtar.c head/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c head/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c head/contrib/libarchive/libarchive/test/test_read_filter_lzop.c head/contrib/libarchive/libarchive/test/test_read_filter_lzop_multiple_parts.c head/contrib/libarchive/libarchive/test/test_read_format_zip.c head/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c head/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c head/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c head/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c head/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c head/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c head/contrib/libarchive/libarchive/test/test_write_filter_lz4.c head/contrib/libarchive/libarchive/test/test_write_filter_lzop.c head/contrib/libarchive/libarchive/test/test_write_format_zip_large.c head/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c head/contrib/libarchive/tar/test/test_option_uid_uname.c head/contrib/libarchive/tar/util.c head/lib/libarchive/config_freebsd.h head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/NEWS Thu Feb 2 00:50:46 2017 (r313074) @@ -1,3 +1,7 @@ +Jan 29, 2017: Limited NFSv4 ACL support for Mac OS (Darwin) + +Jan 10, 2017: POSIX.1e and NFSv4 ACL support for Solaris and derivates + Dec 27, 2016: NFSv4 ACL read and write support for pax Deprecated functions: archive_entry_acl_text(), archive_entry_acl_text_w() Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_acl.c Thu Feb 2 00:50:46 2017 (r313074) @@ -349,6 +349,15 @@ archive_acl_count(struct archive_acl *ac } /* + * Return a bitmask of stored ACL types in an ACL list + */ +int +archive_acl_types(struct archive_acl *acl) +{ + return (acl->acl_types); +} + +/* * Prepare for reading entries from the ACL data. Returns a count * of entries matching "want_type", or zero if there are no * non-extended ACL entries of that type. @@ -1144,7 +1153,7 @@ archive_acl_from_text_w(struct archive_a const wchar_t *s, *st; - int numfields, fields, n, r, ret; + int numfields, fields, n, r, sol, ret; int type, types, tag, permset, id; size_t len; wchar_t sep; @@ -1192,6 +1201,7 @@ archive_acl_from_text_w(struct archive_a } n = 0; + sol = 0; id = -1; permset = 0; name.start = name.end = NULL; @@ -1263,6 +1273,7 @@ archive_acl_from_text_w(struct archive_a && ismode_w(field[n + 1].start, field[n + 1].end, &permset)) { /* This is Solaris-style "other:rwx" */ + sol = 1; } else if (fields == (n + 3) && field[n + 1].start < field[n + 1].end) { /* Invalid mask or other field */ @@ -1287,9 +1298,12 @@ archive_acl_from_text_w(struct archive_a continue; } - /* Without "default:" we expect mode in field 2 */ - if (permset == 0 && !ismode_w(field[n + 2].start, - field[n + 2].end, &permset)) { + /* + * Without "default:" we expect mode in field 2 + * Exception: Solaris other and mask fields + */ + if (permset == 0 && !ismode_w(field[n + 2 - sol].start, + field[n + 2 - sol].end, &permset)) { /* Invalid mode, skip entry */ ret = ARCHIVE_WARN; continue; @@ -1615,7 +1629,7 @@ archive_acl_from_text_l(struct archive_a } field[6], name; const char *s, *st; - int numfields, fields, n, r, ret; + int numfields, fields, n, r, sol, ret; int type, types, tag, permset, id; size_t len; char sep; @@ -1663,6 +1677,7 @@ archive_acl_from_text_l(struct archive_a } n = 0; + sol = 0; id = -1; permset = 0; name.start = name.end = NULL; @@ -1734,6 +1749,7 @@ archive_acl_from_text_l(struct archive_a && ismode(field[n + 1].start, field[n + 1].end, &permset)) { /* This is Solaris-style "other:rwx" */ + sol = 1; } else if (fields == (n + 3) && field[n + 1].start < field[n + 1].end) { /* Invalid mask or other field */ @@ -1758,9 +1774,12 @@ archive_acl_from_text_l(struct archive_a continue; } - /* Without "default:" we expect mode in field 2 */ - if (permset == 0 && !ismode(field[n + 2].start, - field[n + 2].end, &permset)) { + /* + * Without "default:" we expect mode in field 3 + * Exception: Solaris other and mask fields + */ + if (permset == 0 && !ismode(field[n + 2 - sol].start, + field[n + 2 - sol].end, &permset)) { /* Invalid mode, skip entry */ ret = ARCHIVE_WARN; continue; Modified: head/contrib/libarchive/libarchive/archive_acl_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl_private.h Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_acl_private.h Thu Feb 2 00:50:46 2017 (r313074) @@ -56,6 +56,7 @@ struct archive_acl { void archive_acl_clear(struct archive_acl *); void archive_acl_copy(struct archive_acl *, struct archive_acl *); int archive_acl_count(struct archive_acl *, int); +int archive_acl_types(struct archive_acl *); int archive_acl_reset(struct archive_acl *, int); int archive_acl_next(struct archive *, struct archive_acl *, int, int *, int *, int *, int *, const char **); Modified: head/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.c Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_entry.c Thu Feb 2 00:50:46 2017 (r313074) @@ -1447,7 +1447,7 @@ archive_entry_acl_add_entry_w(struct arc int archive_entry_acl_types(struct archive_entry *entry) { - return ((&entry->acl)->acl_types); + return (archive_acl_types(&entry->acl)); } /* Modified: head/contrib/libarchive/libarchive/archive_entry_strmode.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_strmode.c Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_entry_strmode.c Thu Feb 2 00:50:46 2017 (r313074) @@ -80,7 +80,7 @@ archive_entry_strmode(struct archive_ent if (mode & 0001) bp[9] = 't'; else bp[9] = 'T'; } - if (archive_entry_acl_count(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)) + if (archive_entry_acl_types(entry) != 0) bp[10] = '+'; return (bp); Modified: head/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_platform.h Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_platform.h Thu Feb 2 00:50:46 2017 (r313074) @@ -147,8 +147,25 @@ * acl_set_file(), and ACL_USER, we assume it has the rest of the * POSIX.1e draft functions used in archive_read_extract.c. */ -#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE && HAVE_ACL_USER +#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE +#if HAVE_ACL_USER #define HAVE_POSIX_ACL 1 +#elif HAVE_ACL_TYPE_EXTENDED +#define HAVE_DARWIN_ACL 1 +#endif +#endif + +/* + * If this platform has , acl_get(), facl_get(), acl_set(), + * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions + */ +#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T +#define HAVE_SUN_ACL 1 +#endif + +/* Define if platform supports NFSv4 ACLs */ +#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL +#define HAVE_NFS4_ACL 1 #endif /* Modified: head/contrib/libarchive/libarchive/archive_random.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_random.c Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_random.c Thu Feb 2 00:50:46 2017 (r313074) @@ -80,7 +80,7 @@ archive_random(void *buf, size_t nbytes) success = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - if (!success && GetLastError() == NTE_BAD_KEYSET) { + if (!success && GetLastError() == (DWORD)NTE_BAD_KEYSET) { success = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); } Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Feb 2 00:37:21 2017 (r313073) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Feb 2 00:50:46 2017 (r313074) @@ -38,6 +38,11 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_ACL_H #include #endif +#ifdef HAVE_DARWIN_ACL +#include +#include +#include +#endif #ifdef HAVE_SYS_EXTATTR_H #include #endif @@ -118,6 +123,15 @@ __FBSDID("$FreeBSD$"); #define ACL_GET_PERM acl_get_perm_np #endif +/* NFSv4 platform ACL type */ +#if HAVE_SUN_ACL +#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACE_T +#elif HAVE_DARWIN_ACL +#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_EXTENDED +#elif HAVE_ACL_TYPE_NFS4 +#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_NFS4 +#endif + static int setup_acls(struct archive_read_disk *, struct archive_entry *, int *fd); static int setup_mac_metadata(struct archive_read_disk *, @@ -405,17 +419,38 @@ setup_mac_metadata(struct archive_read_d } #endif +#if HAVE_DARWIN_ACL +static int translate_guid(struct archive *, acl_entry_t, + int *, int *, const char **); + +static void add_trivial_nfs4_acl(struct archive_entry *); +#endif + +#if HAVE_SUN_ACL +static int +sun_acl_is_trivial(acl_t *, mode_t, int *trivialp); +#endif -#ifdef HAVE_POSIX_ACL +#if HAVE_POSIX_ACL || HAVE_NFS4_ACL static int translate_acl(struct archive_read_disk *a, - struct archive_entry *entry, acl_t acl, int archive_entry_acl_type); + struct archive_entry *entry, +#if HAVE_SUN_ACL + acl_t *acl, +#else + acl_t acl, +#endif + int archive_entry_acl_type); static int setup_acls(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { const char *accpath; - acl_t acl; +#if HAVE_SUN_ACL + acl_t *acl; +#else + acl_t acl; +#endif int r; accpath = archive_entry_sourcepath(entry); @@ -440,17 +475,20 @@ setup_acls(struct archive_read_disk *a, acl = NULL; -#ifdef ACL_TYPE_NFS4 +#if HAVE_NFS4_ACL /* Try NFSv4 ACL first. */ if (*fd >= 0) -#if HAVE_ACL_GET_FD_NP - acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); +#if HAVE_SUN_ACL + /* Solaris reads both POSIX.1e and NFSv4 ACL here */ + facl_get(*fd, 0, &acl); +#elif HAVE_ACL_GET_FD_NP + acl = acl_get_fd_np(*fd, ARCHIVE_PLATFORM_ACL_TYPE_NFS4); #else acl = acl_get_fd(*fd); #endif #if HAVE_ACL_GET_LINK_NP else if (!a->follow_symlinks) - acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); + acl = acl_get_link_np(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4); #else else if ((!a->follow_symlinks) && (archive_entry_filetype(entry) == AE_IFLNK)) @@ -459,12 +497,24 @@ setup_acls(struct archive_read_disk *a, acl = NULL; #endif else - acl = acl_get_file(accpath, ACL_TYPE_NFS4); +#if HAVE_SUN_ACL + /* Solaris reads both POSIX.1e and NFSv4 ACLs here */ + acl_get(accpath, 0, &acl); +#else + acl = acl_get_file(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4); +#endif -#if HAVE_ACL_IS_TRIVIAL_NP - if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { - /* Ignore "trivial" ACLs that just mirror the file mode. */ - if (r) { + +#if HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL) { +#if HAVE_SUN_ACL + if (sun_acl_is_trivial(acl, archive_entry_mode(entry), + &r) == 0 && r == 1) +#elif HAVE_ACL_IS_TRIVIAL_NP + if (acl_is_trivial_np(acl, &r) == 0 && r == 1) +#endif + { acl_free(acl); acl = NULL; /* @@ -474,17 +524,35 @@ setup_acls(struct archive_read_disk *a, return (ARCHIVE_OK); } } -#endif +#endif /* HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL */ if (acl != NULL) { r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); acl_free(acl); if (r != ARCHIVE_OK) { archive_set_error(&a->archive, errno, +#if HAVE_SUN_ACL + "Couldn't translate ACLs: %s", accpath); +#else "Couldn't translate NFSv4 ACLs: %s", accpath); +#endif } +#if HAVE_DARWIN_ACL + /* + * Because Mac OS doesn't support owner@, group@ and everyone@ + * ACLs we need to add NFSv4 ACLs mirroring the file mode to + * the archive entry. Otherwise extraction on non-Mac platforms + * would lead to an invalid file mode. + */ + if (archive_entry_acl_count(entry, + ARCHIVE_ENTRY_ACL_TYPE_NFS4) > 0) + add_trivial_nfs4_acl(entry); +#endif return (r); } -#endif /* ACL_TYPE_NFS4 */ +#endif /* HAVE_NFS4_ACL */ + +#if HAVE_POSIX_ACL + /* This code path is skipped on MacOS and Solaris */ /* Retrieve access ACL from file. */ if (*fd >= 0) @@ -513,8 +581,7 @@ setup_acls(struct archive_read_disk *a, #endif if (acl != NULL) { - r = translate_acl(a, entry, acl, - ARCHIVE_ENTRY_ACL_TYPE_ACCESS); + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); acl = NULL; if (r != ARCHIVE_OK) { @@ -544,71 +611,560 @@ setup_acls(struct archive_read_disk *a, } } } +#endif /* HAVE_POSIX_ACL */ return (ARCHIVE_OK); } /* - * Translate system ACL into libarchive internal structure. + * Translate system ACL permissions into libarchive internal structure */ - static struct { - int archive_perm; - int platform_perm; + int archive_perm; + int platform_perm; } acl_perm_map[] = { - {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, - {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, - {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, -#ifdef ACL_TYPE_NFS4 - {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, - {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, - {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, - {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, - {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, - {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, - {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, - {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, - {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, - {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, - {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, - {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, - {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, - {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, - {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, - {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +#if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */ + {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE}, + {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE} +#elif HAVE_DARWIN_ACL /* MacOS ACL permissions */ + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +#else /* POSIX.1e ACL permissions */ + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, + {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, +#if HAVE_ACL_TYPE_NFS4 /* FreeBSD NFSv4 ACL permissions */ + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} #endif +#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */ }; -#ifdef ACL_TYPE_NFS4 +#if HAVE_NFS4_ACL +/* + * Translate system NFSv4 inheritance flags into libarchive internal structure + */ static struct { - int archive_inherit; - int platform_inherit; + int archive_inherit; + int platform_inherit; } acl_inherit_map[] = { - {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, +#if HAVE_SUN_ACL /* Solaris ACL inheritance flags */ + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE} +#elif HAVE_DARWIN_ACL /* MacOS NFSv4 inheritance flags */ + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}, + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT} +#else /* FreeBSD NFSv4 ACL inheritance flags */ + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} +#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */ }; -#endif +#endif /* HAVE_NFS4_ACL */ + +#if HAVE_DARWIN_ACL +static int translate_guid(struct archive *a, acl_entry_t acl_entry, + int *ae_id, int *ae_tag, const char **ae_name) +{ + void *q; + uid_t ugid; + int r, idtype; + struct passwd *pwd; + struct group *grp; + + q = acl_get_qualifier(acl_entry); + if (q == NULL) + return (1); + r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype); + if (r != 0) { + acl_free(q); + return (1); + } + if (idtype == ID_TYPE_UID) { + *ae_tag = ARCHIVE_ENTRY_ACL_USER; + pwd = getpwuuid(q); + if (pwd == NULL) { + *ae_id = ugid; + *ae_name = NULL; + } else { + *ae_id = pwd->pw_uid; + *ae_name = archive_read_disk_uname(a, *ae_id); + } + } else if (idtype == ID_TYPE_GID) { + *ae_tag = ARCHIVE_ENTRY_ACL_GROUP; + grp = getgruuid(q); + if (grp == NULL) { + *ae_id = ugid; + *ae_name = NULL; + } else { + *ae_id = grp->gr_gid; + *ae_name = archive_read_disk_gname(a, *ae_id); + } + } else + r = 1; + + acl_free(q); + return (r); +} + +/* + * Add trivial NFSv4 ACL entries from mode + */ +static void +add_trivial_nfs4_acl(struct archive_entry *entry) +{ + mode_t mode; + int i; + const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA; + const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_APPEND_DATA; + const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE; + const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES | + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS | + ARCHIVE_ENTRY_ACL_READ_ACL | + ARCHIVE_ENTRY_ACL_SYNCHRONIZE; + const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES | + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS | + ARCHIVE_ENTRY_ACL_WRITE_ACL | + ARCHIVE_ENTRY_ACL_WRITE_OWNER; + + struct { + const int type; + const int tag; + int permset; + } tacl_entry[] = { + {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0}, + {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0}, + {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0}, + {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset}, + {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset}, + {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset} + }; + + mode = archive_entry_mode(entry); + + /* Permissions for everyone@ */ + if (mode & 0004) + tacl_entry[5].permset |= rperm; + if (mode & 0002) + tacl_entry[5].permset |= wperm; + if (mode & 0001) + tacl_entry[5].permset |= eperm; + + /* Permissions for group@ */ + if (mode & 0040) + tacl_entry[4].permset |= rperm; + else if (mode & 0004) + tacl_entry[2].permset |= rperm; + if (mode & 0020) + tacl_entry[4].permset |= wperm; + else if (mode & 0002) + tacl_entry[2].permset |= wperm; + if (mode & 0010) + tacl_entry[4].permset |= eperm; + else if (mode & 0001) + tacl_entry[2].permset |= eperm; + + /* Permissions for owner@ */ + if (mode & 0400) { + tacl_entry[3].permset |= rperm; + if (!(mode & 0040) && (mode & 0004)) + tacl_entry[0].permset |= rperm; + } else if ((mode & 0040) || (mode & 0004)) + tacl_entry[1].permset |= rperm; + if (mode & 0200) { + tacl_entry[3].permset |= wperm; + if (!(mode & 0020) && (mode & 0002)) + tacl_entry[0].permset |= wperm; + } else if ((mode & 0020) || (mode & 0002)) + tacl_entry[1].permset |= wperm; + if (mode & 0100) { + tacl_entry[3].permset |= eperm; + if (!(mode & 0010) && (mode & 0001)) + tacl_entry[0].permset |= eperm; + } else if ((mode & 0010) || (mode & 0001)) + tacl_entry[1].permset |= eperm; + + for (i = 0; i < 6; i++) { + if (tacl_entry[i].permset != 0) { + archive_entry_acl_add_entry(entry, + tacl_entry[i].type, tacl_entry[i].permset, + tacl_entry[i].tag, -1, NULL); + } + } + + return; +} +#elif HAVE_SUN_ACL +/* + * Check if acl is trivial + * This is a FreeBSD acl_is_trivial_np() implementation for Solaris + */ +static int +sun_acl_is_trivial(acl_t *acl, mode_t mode, int *trivialp) +{ + int i, p; + const uint32_t rperm = ACE_READ_DATA; + const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA; + const uint32_t eperm = ACE_EXECUTE; + const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS | + ACE_READ_ACL | ACE_SYNCHRONIZE; + const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES | + ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER; + + ace_t *ace; + ace_t tace[6]; + + if (acl == NULL || trivialp == NULL) + return (-1); + + *trivialp = 0; + + /* ACL_IS_TRIVIAL flag must be set for both POSIX.1e and NFSv4 ACLs */ + if ((acl->acl_flags & ACL_IS_TRIVIAL) == 0) + return (0); + + /* + * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with + * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries, + * incuding mask. + */ + if (acl->acl_type == ACLENT_T) { + if (acl->acl_cnt == 4) + *trivialp = 1; + return (0); + } + + if (acl->acl_type != ACE_T || acl->acl_entry_size != sizeof(ace_t)) + return (-1); + + /* + * Continue with checking NFSv4 ACLs + * + * Create list of trivial ace's to be compared + */ + + /* owner@ allow pre */ + tace[0].a_flags = ACE_OWNER; + tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + tace[0].a_access_mask = 0; + + /* owner@ deny */ + tace[1].a_flags = ACE_OWNER; + tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE; + tace[1].a_access_mask = 0; + + /* group@ deny */ + tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP; + tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE; + tace[2].a_access_mask = 0; + + /* owner@ allow */ + tace[3].a_flags = ACE_OWNER; + tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + tace[3].a_access_mask = ownset; + + /* group@ allow */ + tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP; + tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + tace[4].a_access_mask = pubset; + + /* everyone@ allow */ + tace[5].a_flags = ACE_EVERYONE; + tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + tace[5].a_access_mask = pubset; + + /* Permissions for everyone@ */ + if (mode & 0004) + tace[5].a_access_mask |= rperm; + if (mode & 0002) + tace[5].a_access_mask |= wperm; + if (mode & 0001) + tace[5].a_access_mask |= eperm; + + /* Permissions for group@ */ + if (mode & 0040) + tace[4].a_access_mask |= rperm; + else if (mode & 0004) + tace[2].a_access_mask |= rperm; + if (mode & 0020) + tace[4].a_access_mask |= wperm; + else if (mode & 0002) + tace[2].a_access_mask |= wperm; + if (mode & 0010) + tace[4].a_access_mask |= eperm; + else if (mode & 0001) + tace[2].a_access_mask |= eperm; + + /* Permissions for owner@ */ + if (mode & 0400) { + tace[3].a_access_mask |= rperm; + if (!(mode & 0040) && (mode & 0004)) + tace[0].a_access_mask |= rperm; + } else if ((mode & 0040) || (mode & 0004)) + tace[1].a_access_mask |= rperm; + if (mode & 0200) { + tace[3].a_access_mask |= wperm; + if (!(mode & 0020) && (mode & 0002)) + tace[0].a_access_mask |= wperm; + } else if ((mode & 0020) || (mode & 0002)) + tace[1].a_access_mask |= wperm; + if (mode & 0100) { + tace[3].a_access_mask |= eperm; + if (!(mode & 0010) && (mode & 0001)) + tace[0].a_access_mask |= eperm; + } else if ((mode & 0010) || (mode & 0001)) + tace[1].a_access_mask |= eperm; + + /* Check if the acl count matches */ + p = 3; + for (i = 0; i < 3; i++) { + if (tace[i].a_access_mask != 0) + p++; + } + if (acl->acl_cnt != p) + return (0); + + p = 0; + for (i = 0; i < 6; i++) { + if (tace[i].a_access_mask != 0) { + ace = &((ace_t *)acl->acl_aclp)[p]; + /* + * Illumos added ACE_DELETE_CHILD to write perms for + * directories. We have to check against that, too. + */ + if (ace->a_flags != tace[i].a_flags || + ace->a_type != tace[i].a_type || + (ace->a_access_mask != tace[i].a_access_mask && + ((acl->acl_flags & ACL_IS_DIR) == 0 || + (tace[i].a_access_mask & wperm) == 0 || + ace->a_access_mask != + (tace[i].a_access_mask | ACE_DELETE_CHILD)))) + return (0); + p++; + } + } + + *trivialp = 1; + return (0); +} +#endif /* HAVE_SUN_ACL */ + +#if HAVE_SUN_ACL +/* + * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL + */ +static int +translate_acl(struct archive_read_disk *a, + struct archive_entry *entry, acl_t *acl, int default_entry_acl_type) +{ + int e, i; + int ae_id, ae_tag, ae_perm; + int entry_acl_type; + const char *ae_name; + aclent_t *aclent; + ace_t *ace; + + (void)default_entry_acl_type; + + if (acl->acl_cnt <= 0) + return (ARCHIVE_OK); + + for (e = 0; e < acl->acl_cnt; e++) { + ae_name = NULL; + ae_tag = 0; + ae_perm = 0; + + if (acl->acl_type == ACE_T) { + ace = &((ace_t *)acl->acl_aclp)[e]; + ae_id = ace->a_who; + + switch(ace->a_type) { + case ACE_ACCESS_ALLOWED_ACE_TYPE: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; + break; + case ACE_ACCESS_DENIED_ACE_TYPE: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY; + break; + case ACE_SYSTEM_AUDIT_ACE_TYPE: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + break; + case ACE_SYSTEM_ALARM_ACE_TYPE: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; + break; + default: + /* Unknown entry type, skip */ + continue; + } + + if ((ace->a_flags & ACE_OWNER) != 0) + ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + else if ((ace->a_flags & ACE_GROUP) != 0) + ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + else if ((ace->a_flags & ACE_EVERYONE) != 0) + ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE; + else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) { + ae_tag = ARCHIVE_ENTRY_ACL_GROUP; + ae_name = archive_read_disk_gname(&a->archive, + ae_id); + } else { + ae_tag = ARCHIVE_ENTRY_ACL_USER; + ae_name = archive_read_disk_uname(&a->archive, + ae_id); + } + + for (i = 0; i < (int)(sizeof(acl_inherit_map) / + sizeof(acl_inherit_map[0])); ++i) { + if ((ace->a_flags & + acl_inherit_map[i].platform_inherit) != 0) + ae_perm |= + acl_inherit_map[i].archive_inherit; + } + + for (i = 0; i < (int)(sizeof(acl_perm_map) / + sizeof(acl_perm_map[0])); ++i) { + if ((ace->a_access_mask & + acl_perm_map[i].platform_perm) != 0) + ae_perm |= + acl_perm_map[i].archive_perm; + } + } else { + aclent = &((aclent_t *)acl->acl_aclp)[e]; + if ((aclent->a_type & ACL_DEFAULT) != 0) + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + else + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + ae_id = aclent->a_id; + + switch(aclent->a_type) { + case DEF_USER: + case USER: + ae_name = archive_read_disk_uname(&a->archive, + ae_id); + ae_tag = ARCHIVE_ENTRY_ACL_USER; + break; + case DEF_GROUP: + case GROUP: + ae_name = archive_read_disk_gname(&a->archive, + ae_id); + ae_tag = ARCHIVE_ENTRY_ACL_GROUP; + break; + case DEF_CLASS_OBJ: + case CLASS_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_MASK; + break; + case DEF_USER_OBJ: + case USER_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + break; + case DEF_GROUP_OBJ: + case GROUP_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + break; + case DEF_OTHER_OBJ: + case OTHER_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_OTHER; + break; + default: + /* Unknown tag type, skip */ + continue; + } + + if ((aclent->a_perm & 1) != 0) + ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE; + if ((aclent->a_perm & 2) != 0) + ae_perm |= ARCHIVE_ENTRY_ACL_WRITE; + if ((aclent->a_perm & 4) != 0) + ae_perm |= ARCHIVE_ENTRY_ACL_READ; + } /* default_entry_acl_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4 */ + + archive_entry_acl_add_entry(entry, entry_acl_type, + ae_perm, ae_tag, ae_id, ae_name); + } + return (ARCHIVE_OK); +} +#else /* !HAVE_SUN_ACL */ +/* + * Translate POSIX.1e (Linux), FreeBSD (both POSIX.1e and NFSv4) and + * MacOS (NFSv4 only) ACLs into libarchive internal structure + */ static int translate_acl(struct archive_read_disk *a, struct archive_entry *entry, acl_t acl, int default_entry_acl_type) { acl_tag_t acl_tag; -#ifdef ACL_TYPE_NFS4 +#if HAVE_ACL_TYPE_NFS4 acl_entry_type_t acl_type; - acl_flagset_t acl_flagset; int brand; #endif +#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL + acl_flagset_t acl_flagset; +#endif acl_entry_t acl_entry; acl_permset_t acl_permset; int i, entry_acl_type; int r, s, ae_id, ae_tag, ae_perm; +#if !HAVE_DARWIN_ACL + void *q; +#endif const char *ae_name; -#ifdef ACL_TYPE_NFS4 +#if HAVE_ACL_TYPE_NFS4 // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 // Make sure the "brand" on this ACL is consistent // with the default_entry_acl_type bits provided. @@ -643,14 +1199,19 @@ translate_acl(struct archive_read_disk * } #endif - s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); if (s == -1) { archive_set_error(&a->archive, errno, "Failed to get first ACL entry"); return (ARCHIVE_WARN); } - while (s == 1) { + +#if HAVE_DARWIN_ACL + while (s == 0) +#else /* FreeBSD, Linux */ + while (s == 1) +#endif + { ae_id = -1; ae_name = NULL; ae_perm = 0; @@ -661,14 +1222,25 @@ translate_acl(struct archive_read_disk * return (ARCHIVE_WARN); } switch (acl_tag) { +#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */ case ACL_USER: - ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); - ae_name = archive_read_disk_uname(&a->archive, ae_id); + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(uid_t *)q; + acl_free(q); + ae_name = archive_read_disk_uname(&a->archive, + ae_id); + } ae_tag = ARCHIVE_ENTRY_ACL_USER; break; case ACL_GROUP: - ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry); - ae_name = archive_read_disk_gname(&a->archive, ae_id); + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(gid_t *)q; + acl_free(q); + ae_name = archive_read_disk_gname(&a->archive, + ae_id); + } ae_tag = ARCHIVE_ENTRY_ACL_GROUP; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 2 01:33:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29C33CCCD8F; Thu, 2 Feb 2017 01:33:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB17D32; Thu, 2 Feb 2017 01:33:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v121X9eJ000792; Thu, 2 Feb 2017 01:33:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v121X95M000791; Thu, 2 Feb 2017 01:33:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702020133.v121X95M000791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Feb 2017 01:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313080 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 01:33:10 -0000 Author: mjg Date: Thu Feb 2 01:33:08 2017 New Revision: 313080 URL: https://svnweb.freebsd.org/changeset/base/313080 Log: i386: fixup fcmpset An incorrect output specifier was used which worked with clang by accident, but breaks with the in-tree gcc version. While here plug a whitespace nit. Reported by: bde Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Thu Feb 2 01:21:55 2017 (r313079) +++ head/sys/i386/include/atomic.h Thu Feb 2 01:33:08 2017 (r313080) @@ -225,9 +225,9 @@ atomic_fcmpset_int(volatile u_int *dst, " cmpxchgl %3,%1 ; " " sete %0 ; " "# atomic_cmpset_int" - : "=r" (res), /* 0 */ + : "=q" (res), /* 0 */ "+m" (*dst), /* 1 */ - "+a" (*expect) /* 2 */ + "+a" (*expect) /* 2 */ : "r" (src) /* 3 */ : "memory", "cc"); return (res); From owner-svn-src-head@freebsd.org Thu Feb 2 01:42:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B3BCCCB3DC; Thu, 2 Feb 2017 01:42:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::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 0F63912D9; Thu, 2 Feb 2017 01:42:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id u63so742613wmu.2; Wed, 01 Feb 2017 17:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GSHFNumzS5QN/8ZgHZ7rCbyGYOgZ6o+180vaVjkPfkM=; b=kqcFT2x80zSKnDPZZwnckz2cxXHF1pzkI35cUAv/BtrNtMxakASprVnghcPJemMyzp NAR419MzKMgvfXEfjm15l/9xV00nKDI+GL+VOOBJgCzSVVhyxk6anUBNHlMK0sCpwiyW 79s0ztw3H+kVeqj4rlMyYu9CfCW1LNyWHjK30qM1Cak9HsbmMXIait6erwzP3+lmK9Bk cEDhnwUuURlA4Qzh2tKvjT6FnKMbcHA67xzHu8LgBeB00bNY1lbiCHpsJifACb58lVI5 Fv3BpspYylXhswdhwVjebFd9KydzMphNAIbBecrYy1Wbu/vEXOKmbzW85rx09DyijyGB Nyxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GSHFNumzS5QN/8ZgHZ7rCbyGYOgZ6o+180vaVjkPfkM=; b=Ze6rLca/n/iVajEjqFxZ5jCuCzkHzOvaeOELd7c+GmkB5c7eVKKrSQ5uyLmCCrAvun zU6AQpL1wwXWbqEO3+j+oXJsNpNYdVbgbmkwr1GmLsxEhuCVYk07aq3BpGD4KrgBaccg IrfBCzpHfBcvAeASANw7mM4Rl8A5kbBMbo5vEXL7igDzrmV52TGKwvnqqqF+7qw5/A6E y2TSIYOcttjgkdqb0qRxiEvpGTanhCHw2y5fPrxFX8BjIsGW4ACjcsKGuqmcH5Y36UsL 5UC86zpgUV8+Zl8VeH/b2OtkMbCPyOd3wCC85wHWB22gyzCp0wbYOotslFFC9eCTqqwJ FvAA== X-Gm-Message-State: AIkVDXJPzQZDcVeqgmEQz+lHWqcqFx9nz/nUJpycNo1YKofV8Edg22sTbugp9MM3zL1jeA== X-Received: by 10.28.209.202 with SMTP id i193mr5512474wmg.20.1485999728343; Wed, 01 Feb 2017 17:42:08 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id c133sm262603wmd.13.2017.02.01.17.42.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 01 Feb 2017 17:42:07 -0800 (PST) Date: Thu, 2 Feb 2017 02:42:04 +0100 From: Mateusz Guzik To: Bruce Evans Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include Message-ID: <20170202014204.GA992@dft-labs.eu> References: <201701300224.v0U2Osj1010421@repo.freebsd.org> <20170130142123.V953@besplex.bde.org> <20170201214349.H1136@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170201214349.H1136@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 01:42:10 -0000 On Wed, Feb 01, 2017 at 10:12:57PM +1100, Bruce Evans wrote: > On Mon, 30 Jan 2017, Bruce Evans wrote: > > >On Mon, 30 Jan 2017, Mateusz Guzik wrote: > > > >>Log: > >> i386: add atomic_fcmpset > >> > >> Tested by: pho > > > >This is has some bugs and style bugs. > > This is still broken. The invalid asm breaks building at least atomic.o > with gcc-4.2.1. > > Tested fix: > > X Index: i386/include/atomic.h > X =================================================================== > X --- i386/include/atomic.h (revision 313007) > X +++ i386/include/atomic.h (working copy) > X @@ -225,9 +225,9 @@ > X " cmpxchgl %3,%1 ; " > X " sete %0 ; " > X "# atomic_cmpset_int" > X - : "=r" (res), /* 0 */ > X + : "=q" (res), /* 0 */ > X "+m" (*dst), /* 1 */ > X - "+a" (*expect) /* 2 */ > X + "+a" (*expect) /* 2 */ > X : "r" (src) /* 3 */ > X : "memory", "cc"); > X return (res); > Uh, I ended up with the same fix. Committed in r313080. Sorry for breakage in the first place. > The semantics of fcmpset seem to be undocumented. On x86, *expect is > updated non-atomically by a store in the output parameter. I think > cmpxchg updates the "a" register atomically, but then the output > parameter causes this to be stored non-atomically to *expect. A better > API would somehow return the "a" register and let the caller store it > if it wants. Ordinary cmpset can be built on this by not storing, and > the caller can do the store atomically to a different place if *expect > is too volatile to be atomic. > The primitive was modeled after atomic_compare_exchange_* from c11 atomics. I don't see what's the benefit of storing the result separately. As it is, the primitive fits nicely into loops like "inc not zero". Like this: r = *counter; for (;;) { if (r == 0) break; if (atomic_fcmpset_int(counter, &r, r + 1)) break; // r we can loop back to re-test r } > Maybe just decouple the input parameter from the output parameter. The > following works right (for an amd64 API): > > Y static __inline int > Y atomic_xfcmpset_long(volatile u_long *dst, u_long *expect_out, u_long expect_in, > Y u_long src) > Y { > Y u_long expect; > Y u_char res; > Y Y expect = expect_in; > Y __asm __volatile( > Y " " MPLOCKED " " > Y " cmpxchgq %3,%1 ; " > Y " sete %0 ; " > Y "# atomic_fcmpset_long" > Y : "=r" (res), /* 0 */ > Y "+m" (*dst), /* 1 */ > Y "+a" (expect) /* 2 */ > Y : "r" (src) /* 3 */ > Y : "memory", "cc"); > Y *expect_out = expect; > > If the caller doesn't want to use *expect_out, it passes a pointer to an > unused local variable. The compiler can then optimize away the store > since it is not hidden in the asm. > _fcmpset is specifically for callers who want the value back. Ones which don't can use the _cmpset variant. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Feb 2 03:30:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD54CCB2DD for ; Thu, 2 Feb 2017 03:30:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::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 450801750 for ; Thu, 2 Feb 2017 03:30:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id m98so22988811iod.2 for ; Wed, 01 Feb 2017 19:30:36 -0800 (PST) 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=OGKRJ4LRGV7uhR4C2wizwHO8FIVTvINc8WAJ5KLhDgU=; b=VCRW3V2h699E63v1/21bTZoRjQxQvAP4Pqpe1Ig0uh9u+6LBWNkXvab0nzmUKP5wbF wKyzh1mdfHeTge0LuZIwoSxaxLqfdCnnkIo6R6DxfQhi1408zmQDV7ORSnTupV/CqY9a 2A7PJ4bDJeuOPv6jS5zFgjHmS59zo3x3d2EBIZFNQ4EIYkJWoqewBoy5KXMh0dADaSuu 0KnHYDAM4M7Z1IR1erEdWFbCVzu+PsYWQdOWp4a+iJOjeTCiJj0wYLD016viJrLfgJpG hw1COMQsTIOmUFsm/XWBmZhR0+2qjzJE7fjTGhqHyiFYw9dr3GsKu9DxTM29Oh2BHqjf 5VIA== 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=OGKRJ4LRGV7uhR4C2wizwHO8FIVTvINc8WAJ5KLhDgU=; b=t+PBs/GzbI89IqSgAXLeIdFtQvMUDSI84STCquEPs3L5qX0r9gMFKK8PRL8j+4NUJX 07Skr/0of0ewbv6BgrAye0rRQyaLSdJoGb9LJdJJZSjaO4cZZ3mIG+iH3wSV6hDMP4SD 6jDv16X5qXA7cOT+HZrJJl/+jL0gKCbU+ZUMsEO1BSInnaIatL2J05nbnnDLSgBQg2he AD2c4TSwN+zePJfeGibZulcQwy+H6OCvw5E9DtORzdHA7OqGL+APbUUIi+tcJckln04N WLXUQ0Vd33BZNoPorFEiGGaFwlCXCPp6BJy8bwQo0Ta3Fy9vgPKF6cZoFuqsfokK30sc As6Q== X-Gm-Message-State: AIkVDXIWmAZtdGD3AcjydH1jLS3Y6FsxabmHn7bKVUXrTN7hsITn79GA/J4kFhzbz08F2GO6m1OX45r36CJUDQ== X-Received: by 10.107.139.131 with SMTP id n125mr5306910iod.166.1486006235508; Wed, 01 Feb 2017 19:30:35 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Wed, 1 Feb 2017 19:30:34 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <1485986136.3017.89.camel@freebsd.org> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> <20170201215007.GA37974@zxy.spb.ru> <1485986136.3017.89.camel@freebsd.org> From: Warner Losh Date: Wed, 1 Feb 2017 20:30:34 -0700 X-Google-Sender-Auth: Ax_4mNnqfOkXo_xyp82dPduF7lk Message-ID: Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... To: Ian Lepore Cc: Slawa Olhovchenkov , Mark Linimon , John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Takahashi Yoshihiro Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 03:30:36 -0000 On Wed, Feb 1, 2017 at 2:55 PM, Ian Lepore wrote: > On Thu, 2017-02-02 at 00:50 +0300, Slawa Olhovchenkov wrote: >> On Wed, Feb 01, 2017 at 03:39:57PM -0600, Mark Linimon wrote: >> >> > >> > On Wed, Feb 01, 2017 at 08:09:50PM +0300, Slawa Olhovchenkov wrote: >> > > >> > > Also, I am think current ports don't build on 4.x. >> > I will personally guarantee, in writing, that current ports do not >> > build >> > on 4.x, nor have they done so for years. I personally removed the >> > legacy >> > cruft when 4.11 finally went EOL. >> > >> > > >> > > I am got complains about using ports on 8.x. >> > I am 99% certain that ports will not work on either 8.x or >> > 9.x. Legacy >> > cruft was removed at the EOL in each of those cases. >> > >> > Anyone who think that we can support ports on 4.x, 5.x, 6.x, 7.x, >> > 8.x, >> > 9.x, 10.x, 11.x, and -current, all at the same time, needs to seek >> > medical >> > attention at once. At the absolute least, that era spans 3 major >> > versions >> > of make(1) and two completely different package implementations. >> I am assume no problem to use new make on old system. >> May be posible use pkg too (not sure about pkg requirements to >> syscalls). >> > > I can't say anything about 4.x, but I have no problems building current > ports on 8.2. I have backported a few crucial changes to make, like > handling :tl and :tu, and that's about it. It may not be officially > supported, but it's not hard to make it work for those who have a need. > > I also still support systems that use true ISA-slot hardware, but that > doesn't include any storage or network controllers. Mostly the ISA > cards are proprietary things, plus one ancient 8-port uart expansion > card that amazingly still works and can still be purchased. Yea, but those systems aren't quite pure ISA systems. They are SBCs with an ISA interface, but with PCI NICs and built in IDE controllers. We're not talking about breaking those. Your systems have 64MB or more of RAM, which is enough to run FreeBSD (should you guys ever forward port). Though, to be honest, I'm not sure if UART would work with that particular card... All the proprietary cards that I recall should still work, though there may be some hassle with the network stuff one of them does. Warner From owner-svn-src-head@freebsd.org Thu Feb 2 03:54:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0113ACCBFEF; Thu, 2 Feb 2017 03:54:45 +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 CFD3486A; Thu, 2 Feb 2017 03:54:44 +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 v123shpb058072; Thu, 2 Feb 2017 03:54:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v123shxF058071; Thu, 2 Feb 2017 03:54:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702020354.v123shxF058071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 2 Feb 2017 03:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313081 - head/tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 03:54:45 -0000 Author: ngie Date: Thu Feb 2 03:54:43 2017 New Revision: 313081 URL: https://svnweb.freebsd.org/changeset/base/313081 Log: Replace for/retry loops with "wait_for_ggate_device" calls and check results of commands As noted in r313008, the underlying issue was that geom_gate device creation wasn't created at ggatel command completion, but some short time after. ggatec(8) employs similar logic when creating geom_gate(4) devices. Switch from retry loops (after the ggatec/dd write calls) to wait_for_ggate_device function calls after calling ggatec(8) instead to detect the presence of the /dev/ggate* device, as this function is sufficient for determining whether or not the character device is ready for testing While here, use atf_check consistently with all dd calls to ensure that data output is as expected. MFC after: 1 week Reviewed by: asomers Differential Revision: D9409 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Thu Feb 2 01:33:08 2017 (r313080) +++ head/tests/sys/geom/class/gate/ggate_test.sh Thu Feb 2 03:54:43 2017 (r313081) @@ -4,7 +4,6 @@ PIDFILE=ggated.pid PLAINFILES=plainfiles PORT=33080 CONF=gg.exports -RETRIES=16 atf_test_case ggated cleanup ggated_head() @@ -21,31 +20,23 @@ ggated_body() work=$(alloc_md) src=$(alloc_md) - dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc - dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc echo $CONF >> $PLAINFILES echo "127.0.0.1 RW /dev/$work" > $CONF atf_check ggated -p $PORT -F $PIDFILE $CONF - for try in `jot $RETRIES`; do - ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work && break - # wait for ggated to be ready - sleep 0.25 - done - if [ "$try" -eq "$RETRIES" ]; then - atf_fail "ggatec create failed" - fi + atf_check ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work - for try in `jot $RETRIES`; do - dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=notrunc\ - && break - # Wait for /dev/ggate${us} to be ready - sleep 0.25 - done - if [ "$try" -eq "$RETRIES" ]; then - atf_fail "dd failed; /dev/ggate${us} isn't working" - fi + ggate_dev=/dev/ggate${us} + + wait_for_ggate_device ${ggate_dev} + + atf_check -e ignore -o ignore \ + dd if=/dev/${src} of=${ggate_dev} bs=1m count=1 conv=notrunc checksum /dev/$src /dev/$work } @@ -78,7 +69,8 @@ ggatel_file_body() wait_for_ggate_device ${ggate_dev} - dd if=src of=${ggate_dev} bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=src of=${ggate_dev} bs=1m count=1 conv=notrunc checksum src work } @@ -103,8 +95,10 @@ ggatel_md_body() work=$(alloc_md) src=$(alloc_md) - dd if=/dev/random of=$work bs=1m count=1 conv=notrunc - dd if=/dev/random of=$src bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=/dev/random of=$work bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=/dev/random of=$src bs=1m count=1 conv=notrunc atf_check ggatel create -u $us /dev/$work @@ -112,7 +106,8 @@ ggatel_md_body() wait_for_ggate_device ${ggate_dev} - dd if=/dev/$src of=${ggate_dev} bs=1m count=1 conv=notrunc + atf_check -e ignore -o ignore \ + dd if=/dev/$src of=${ggate_dev} bs=1m count=1 conv=notrunc checksum /dev/$src /dev/$work } From owner-svn-src-head@freebsd.org Thu Feb 2 04:50:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55E11CCDF1C; Thu, 2 Feb 2017 04:50:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 228C31EE4; Thu, 2 Feb 2017 04:50:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v124oK9n078710; Thu, 2 Feb 2017 04:50:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v124oKnM078709; Thu, 2 Feb 2017 04:50:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702020450.v124oKnM078709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 2 Feb 2017 04:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313082 - head/sys/dev/de X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 04:50:21 -0000 Author: imp Date: Thu Feb 2 04:50:20 2017 New Revision: 313082 URL: https://svnweb.freebsd.org/changeset/base/313082 Log: Remove dangling DE425 EISA card references in the de driver. They aren't used, and this doesn't change the supported hardware. Modified: head/sys/dev/de/dc21040reg.h Modified: head/sys/dev/de/dc21040reg.h ============================================================================== --- head/sys/dev/de/dc21040reg.h Thu Feb 2 03:54:43 2017 (r313081) +++ head/sys/dev/de/dc21040reg.h Thu Feb 2 04:50:20 2017 (r313082) @@ -494,20 +494,6 @@ typedef struct { #define PHYCTL_AUTONEG_RESTART 0x0200 #define PHYCTL_FULL_DUPLEX 0x0100 -/* - * Definitions for the DE425. - */ -#define DE425_CFID 0x08 /* Configuration Id */ -#define DE425_CFCS 0x0C /* Configuration Command-Status */ -#define DE425_CFRV 0x18 /* Configuration Revision */ -#define DE425_CFLT 0x1C /* Configuration Latency Timer */ -#define DE425_CBIO 0x28 /* Configuration Base IO Address */ -#define DE425_CFDA 0x2C /* Configuration Driver Area */ -#define DE425_ENETROM_OFFSET 0xC90 /* Offset in I/O space for ENETROM */ -#define DE425_CFG0 0xC88 /* IRQ register */ -#define DE425_EISAID 0x10a34250 /* EISA device id */ -#define DE425_EISA_IOSIZE 0x100 - #define DEC_VENDORID 0x1011 #define CHIPID_21040 0x0002 #define CHIPID_21140 0x0009 From owner-svn-src-head@freebsd.org Thu Feb 2 04:53:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3ED6CCD0BC; Thu, 2 Feb 2017 04:53:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6504C38E; Thu, 2 Feb 2017 04:53:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v124rX0o082545; Thu, 2 Feb 2017 04:53:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v124rXwp082544; Thu, 2 Feb 2017 04:53:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201702020453.v124rXwp082544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 2 Feb 2017 04:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313083 - head/usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 04:53:34 -0000 Author: glebius Date: Thu Feb 2 04:53:33 2017 New Revision: 313083 URL: https://svnweb.freebsd.org/changeset/base/313083 Log: Fix build with WITHOUT_INET6. Submitted by: Alex Deiter Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Thu Feb 2 04:50:20 2017 (r313082) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Thu Feb 2 04:53:33 2017 (r313083) @@ -36,6 +36,7 @@ SRCS= addrtoname.c \ print-ascii.c \ print-atalk.c \ print-atm.c \ + print-babel.c \ print-beep.c \ print-bfd.c \ print-bgp.c \ @@ -50,6 +51,7 @@ SRCS= addrtoname.c \ print-cnfp.c \ print-dccp.c \ print-decnet.c \ + print-dhcp6.c \ print-domain.c \ print-dtp.c \ print-dvmrp.c \ @@ -62,6 +64,7 @@ SRCS= addrtoname.c \ print-fddi.c \ print-forces.c \ print-fr.c \ + print-frag6.c \ print-ftp.c \ print-geneve.c \ print-geonet.c \ @@ -70,10 +73,12 @@ SRCS= addrtoname.c \ print-hsrp.c \ print-http.c \ print-icmp.c \ + print-icmp6.c \ print-igmp.c \ print-igrp.c \ print-ip.c \ print-ip6.c \ + print-ip6opts.c \ print-ipcomp.c \ print-ipfc.c \ print-ipnet.c \ @@ -96,6 +101,7 @@ SRCS= addrtoname.c \ print-m3ua.c \ print-medsa.c \ print-mobile.c \ + print-mobility.c \ print-mpcp.c \ print-mpls.c \ print-mptcp.c \ @@ -109,6 +115,7 @@ SRCS= addrtoname.c \ print-openflow.c \ print-openflow-1.0.c \ print-ospf.c \ + print-ospf6.c \ print-otv.c \ print-pgm.c \ print-pim.c \ @@ -121,9 +128,11 @@ SRCS= addrtoname.c \ print-raw.c \ print-resp.c \ print-rip.c \ + print-ripng.c \ print-rpki-rtr.c \ print-rrcp.c \ print-rsvp.c \ + print-rt6.c \ print-rtsp.c \ print-rx.c \ print-sctp.c \ @@ -171,15 +180,6 @@ CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -D_U_="__attribute__((unused))" .if ${MK_INET6_SUPPORT} != "no" -SRCS+= print-babel.c \ - print-dhcp6.c \ - print-frag6.c \ - print-icmp6.c \ - print-ip6opts.c \ - print-mobility.c \ - print-ospf6.c \ - print-ripng.c \ - print-rt6.c CFLAGS+= -DINET6 -DHAVE_OS_IPV6_SUPPORT .endif .if ${MACHINE_CPUARCH} != "i386" From owner-svn-src-head@freebsd.org Thu Feb 2 05:26:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE0BCCD9D0; Thu, 2 Feb 2017 05:26:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F53A1335; Thu, 2 Feb 2017 05:26:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v125QdTT094835; Thu, 2 Feb 2017 05:26:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125QdpX094834; Thu, 2 Feb 2017 05:26:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020526.v125QdpX094834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313084 - head/tools/tools/ath/athspectral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:26:40 -0000 Author: adrian Date: Thu Feb 2 05:26:39 2017 New Revision: 313084 URL: https://svnweb.freebsd.org/changeset/base/313084 Log: [athspectral] add a knob to expose the spectral scan priority. This is required for AR9380 and later chips.. please leave it at 0 for now. Modified: head/tools/tools/ath/athspectral/athspectral.c Modified: head/tools/tools/ath/athspectral/athspectral.c ============================================================================== --- head/tools/tools/ath/athspectral/athspectral.c Thu Feb 2 04:53:33 2017 (r313083) +++ head/tools/tools/ath/athspectral/athspectral.c Thu Feb 2 05:26:39 2017 (r313084) @@ -104,6 +104,9 @@ spectralset(struct spectralhandler *spec case SPECTRAL_PARAM_SS_SHORT_RPT: pe.ss_short_report = param; break; + case SPECTRAL_PARAM_SS_SPECTRAL_PRI: + pe.ss_spectral_pri = param; + break; } spectral->atd.ad_id = SPECTRAL_CONTROL_SET_PARAMS | ATH_DIAG_IN; @@ -138,6 +141,7 @@ spectral_get(struct spectralhandler *spe printf(" ss_fft_period: %d\n", pe.ss_fft_period); printf(" ss_period: %d\n", pe.ss_period); printf(" ss_short_report: %d\n", pe.ss_short_report); + printf(" ss_spectral_pri: %d\n", pe.ss_spectral_pri); printf(" radar_bin_thresh_sel: %d\n", pe.radar_bin_thresh_sel); } @@ -222,6 +226,8 @@ spectral_set_param(struct spectralhandle spectralset(spectral, SPECTRAL_PARAM_SS_PERIOD, v); } else if (strcmp(param, "ss_count") == 0) { spectralset(spectral, SPECTRAL_PARAM_SS_COUNT, v); + } else if (strcmp(param, "ss_spectral_pri") == 0) { + spectralset(spectral, SPECTRAL_PARAM_SS_SPECTRAL_PRI, v); } else { return (0); } From owner-svn-src-head@freebsd.org Thu Feb 2 05:27:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D66ACCDA24; Thu, 2 Feb 2017 05:27:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D00114C1; Thu, 2 Feb 2017 05:27:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v125R6E0094901; Thu, 2 Feb 2017 05:27:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125R6BW094900; Thu, 2 Feb 2017 05:27:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020527.v125R6BW094900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313085 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:27:07 -0000 Author: adrian Date: Thu Feb 2 05:27:06 2017 New Revision: 313085 URL: https://svnweb.freebsd.org/changeset/base/313085 Log: [ath] add spectral scan priority. Modified: head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Thu Feb 2 05:26:39 2017 (r313084) +++ head/sys/dev/ath/if_athioctl.h Thu Feb 2 05:27:06 2017 (r313085) @@ -432,6 +432,7 @@ struct ath_tx_radiotap_header { #define SPECTRAL_PARAM_SS_SHORT_RPT 4 #define SPECTRAL_PARAM_ENABLED 5 #define SPECTRAL_PARAM_ACTIVE 6 +#define SPECTRAL_PARAM_SS_SPECTRAL_PRI 7 /* * Spectral control parameters From owner-svn-src-head@freebsd.org Thu Feb 2 05:27:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE27DCCDA78; Thu, 2 Feb 2017 05:27:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DB281642; Thu, 2 Feb 2017 05:27:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v125RRKU094957; Thu, 2 Feb 2017 05:27:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125RRFw094956; Thu, 2 Feb 2017 05:27:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020527.v125RRFw094956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313086 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:27:28 -0000 Author: adrian Date: Thu Feb 2 05:27:27 2017 New Revision: 313086 URL: https://svnweb.freebsd.org/changeset/base/313086 Log: [ath_hal] add debugging level for spectral scan. Modified: head/sys/dev/ath/ath_hal/ah_debug.h Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Thu Feb 2 05:27:06 2017 (r313085) +++ head/sys/dev/ath/ath_hal/ah_debug.h Thu Feb 2 05:27:27 2017 (r313086) @@ -54,6 +54,7 @@ enum { HAL_DEBUG_PRINT_REG = 0x08000000, HAL_DEBUG_FCS_RTT = 0x10000000, HAL_DEBUG_BT_COEX = 0x20000000, + HAL_DEBUG_SPECTRAL = 0x40000000, HAL_DEBUG_UNMASKABLE = 0x80000000, /* always printed */ HAL_DEBUG_ANY = 0xffffffff From owner-svn-src-head@freebsd.org Thu Feb 2 05:27:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2907CCDAE2; Thu, 2 Feb 2017 05:27:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C245117A1; Thu, 2 Feb 2017 05:27:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v125Rmhp095018; Thu, 2 Feb 2017 05:27:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125RmBL095017; Thu, 2 Feb 2017 05:27:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020527.v125RmBL095017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313087 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:27:50 -0000 Author: adrian Date: Thu Feb 2 05:27:48 2017 New Revision: 313087 URL: https://svnweb.freebsd.org/changeset/base/313087 Log: [ath] ensure the NIC is woken up before changing the spectral scan parameters. Modified: head/sys/dev/ath/if_ath_spectral.c Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Thu Feb 2 05:27:27 2017 (r313086) +++ head/sys/dev/ath/if_ath_spectral.c Thu Feb 2 05:27:48 2017 (r313087) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -191,6 +192,10 @@ ath_ioctl_spectral(struct ath_softc *sc, if (! ath_hal_spectral_supported(sc->sc_ah)) return (EINVAL); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if (ad->ad_id & ATH_DIAG_IN) { /* * Copy in data. @@ -285,6 +290,10 @@ bad: free(indata, M_TEMP); if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) free(outdata, M_TEMP); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + return (error); } From owner-svn-src-head@freebsd.org Thu Feb 2 05:29:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D00ACCDB9E; Thu, 2 Feb 2017 05:29:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17CFA1961; Thu, 2 Feb 2017 05:29:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v125TNLA095119; Thu, 2 Feb 2017 05:29:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125TNMr095118; Thu, 2 Feb 2017 05:29:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020529.v125TNMr095118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313088 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:29:24 -0000 Author: adrian Date: Thu Feb 2 05:29:22 2017 New Revision: 313088 URL: https://svnweb.freebsd.org/changeset/base/313088 Log: [ath_hal] [ar9300] initial hacks to make spectral scan working on AR9380 and later NICs. * add debugging * disable the manual noise floor calibration and tracking done by the HAL; this interferes with the normal calibration path and will lock up the RX side * don't program short report / priority if they're provided as NOVAL. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c Thu Feb 2 05:27:48 2017 (r313087) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c Thu Feb 2 05:29:22 2017 (r313088) @@ -309,17 +309,27 @@ ar9300_noise_floor_power_get(struct ath_ void ar9300_configure_spectral_scan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss) { - u_int32_t val, i; + u_int32_t val; + //uint32_t i; struct ath_hal_9300 *ahp = AH9300(ah); HAL_BOOL asleep = ahp->ah_chip_full_sleep; - int16_t nf_buf[HAL_NUM_NF_READINGS]; + //int16_t nf_buf[HAL_NUM_NF_READINGS]; if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) { ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE); } + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "%s: called\n", __func__); + + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_fft_period=%d\n", ss->ss_fft_period); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_period=%d\n", ss->ss_period); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_count=%d\n", ss->ss_count); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_short_report=%d\n", ss->ss_short_report); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_spectral_pri=%d\n", ss->ss_spectral_pri); + ar9300_prep_spectral_scan(ah); +#if 0 if (ss->ss_spectral_pri) { for (i = 0; i < HAL_NUM_NF_READINGS; i++) { nf_buf[i] = NOISE_PWR_DBM_2_INT(ss->ss_nf_cal[i]); @@ -333,6 +343,7 @@ ar9300_configure_spectral_scan(struct at /*ar9300_disable_restart(ah);*/ #endif } +#endif val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); @@ -364,18 +375,22 @@ ar9300_configure_spectral_scan(struct at val |= SM(ss->ss_period, AR_PHY_SPECTRAL_SCAN_PERIOD); } + if (ss->ss_short_report != HAL_SPECTRAL_PARAM_NOVAL) { if (ss->ss_short_report == AH_TRUE) { val |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; } else { val &= ~AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; } + } /* if noise power cal, force high priority */ + if (ss->ss_spectral_pri != HAL_SPECTRAL_PARAM_NOVAL) { if (ss->ss_spectral_pri) { val |= AR_PHY_SPECTRAL_SCAN_PRIORITY_HI; } else { val &= ~AR_PHY_SPECTRAL_SCAN_PRIORITY_HI; } + } /* enable spectral scan */ OS_REG_WRITE(ah, AR_PHY_SPECTRAL_SCAN, val | AR_PHY_SPECTRAL_SCAN_ENABLE); @@ -400,6 +415,8 @@ ar9300_get_spectral_params(struct ath_ha struct ath_hal_9300 *ahp = AH9300(ah); HAL_BOOL asleep = ahp->ah_chip_full_sleep; + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "%s: called\n", __func__); + c = AH_PRIVATE(ah)->ah_curchan; if (c != NULL) chan = ath_hal_checkchannel(ah, c); @@ -416,6 +433,17 @@ ar9300_get_spectral_params(struct ath_ha ss->ss_count = MS(val, AR_PHY_SPECTRAL_SCAN_COUNT); ss->ss_short_report = (val & AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT) ? 1:0; ss->ss_spectral_pri = ( val & AR_PHY_SPECTRAL_SCAN_PRIORITY_HI) ? 1:0; + ss->ss_enabled = !! (val & AR_PHY_SPECTRAL_SCAN_ENABLE); + ss->ss_active = !! (val & AR_PHY_SPECTRAL_SCAN_ACTIVE); + + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_fft_period=%d\n", ss->ss_fft_period); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_period=%d\n", ss->ss_period); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_count=%d\n", ss->ss_count); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_short_report=%d\n", ss->ss_short_report); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_spectral_pri=%d\n", ss->ss_spectral_pri); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_enabled=%d\n", ss->ss_enabled); + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "ss_active=%d\n", ss->ss_active); + OS_MEMZERO(ss->ss_nf_cal, sizeof(ss->ss_nf_cal)); OS_MEMZERO(ss->ss_nf_pwr, sizeof(ss->ss_nf_cal)); ss->ss_nf_temp_data = 0; @@ -470,6 +498,8 @@ void ar9300_start_spectral_scan(struct a ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE); } + HALDEBUG(ah, HAL_DEBUG_SPECTRAL, "%s: called\n", __func__); + ar9300_prep_spectral_scan(ah); /* activate spectral scan */ From owner-svn-src-head@freebsd.org Thu Feb 2 06:07:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E97A3CCD383; Thu, 2 Feb 2017 06:07:40 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B954BBED; Thu, 2 Feb 2017 06:07:40 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1267dCU011517; Thu, 2 Feb 2017 06:07:39 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1267dAD011516; Thu, 2 Feb 2017 06:07:39 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201702020607.v1267dAD011516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 2 Feb 2017 06:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313089 - head/sys/dev/cesa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 06:07:41 -0000 Author: wma Date: Thu Feb 2 06:07:39 2017 New Revision: 313089 URL: https://svnweb.freebsd.org/changeset/base/313089 Log: Remove remaining ifdefs from CESA header Commit r312743 ("Use SoC ID - based detection in CESA") resulted in build failing for Marvell armv5 platforms, which don't support the newer version of CESA controller. This patch provides a fix by removing ifdefs around bitfields' definitions, so that they are known to all platforms. Submitted by: Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/dev/cesa/cesa.h Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Feb 2 05:29:22 2017 (r313088) +++ head/sys/dev/cesa/cesa.h Thu Feb 2 06:07:39 2017 (r313089) @@ -336,10 +336,7 @@ struct cesa_chain_info { #define CESA_TDMA_CR_ENABLE (1 << 12) #define CESA_TDMA_CR_FETCHND (1 << 13) #define CESA_TDMA_CR_ACTIVE (1 << 14) - -#if defined (SOC_MV_ARMADA38X) #define CESA_TDMA_NUM_OUTSTAND (2 << 16) -#endif #define CESA_TDMA_ECR 0x08C8 #define CESA_TDMA_ECR_MISS (1 << 0) @@ -361,10 +358,7 @@ struct cesa_chain_info { /* CESA SA registers definitions */ #define CESA_SA_CMD 0x0E00 #define CESA_SA_CMD_ACTVATE (1 << 0) - -#if defined (SOC_MV_ARMADA38X) #define CESA_SA_CMD_SHA2 (1 << 31) -#endif #define CESA_SA_DPR 0x0E04 From owner-svn-src-head@freebsd.org Thu Feb 2 06:14:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40B47CCD62B; Thu, 2 Feb 2017 06:14:48 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0528D1088; Thu, 2 Feb 2017 06:14:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v126ElqA015485; Thu, 2 Feb 2017 06:14:47 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v126Ei6m015457; Thu, 2 Feb 2017 06:14:44 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201702020614.v126Ei6m015457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 2 Feb 2017 06:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313090 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 06:14:48 -0000 Author: mmel Date: Thu Feb 2 06:14:44 2017 New Revision: 313090 URL: https://svnweb.freebsd.org/changeset/base/313090 Log: Remake support for SMP kernel on UP cpu: - Use new option SMP_ON_UP instead of (mis)using specific CPU type. By this, any SMP kernel can be compiled with SMP_ON_UP support. - Enable runtime detection of CPU multiprocessor extensions only if SMP_ON_UP option is used. In other cases (pure SMP or UP), statically compile only required variant. - Don't leak multiprocessor instructions to UP kernel. - Correctly handle data cache write back to point of unification. DCCMVAU is supported on all armv7 cpus. - For SMP_ON_UP kernels, detect proper TTB flags on runtime. Differential Revision: https://reviews.freebsd.org/D9133 Modified: head/sys/arm/allwinner/std.allwinner head/sys/arm/allwinner/std.allwinner_up head/sys/arm/altera/socfpga/std.socfpga head/sys/arm/amlogic/aml8726/std.aml8726 head/sys/arm/annapurna/alpine/std.alpine head/sys/arm/arm/cpufunc.c head/sys/arm/arm/pmap-v6.c head/sys/arm/broadcom/bcm2835/std.bcm2836 head/sys/arm/conf/GENERIC head/sys/arm/freescale/imx/std.imx51 head/sys/arm/freescale/imx/std.imx53 head/sys/arm/freescale/imx/std.imx6 head/sys/arm/freescale/vybrid/std.vybrid head/sys/arm/include/cpu-v6.h head/sys/arm/include/cpufunc.h head/sys/arm/include/intr.h head/sys/arm/include/sysreg.h head/sys/arm/mv/armada38x/std.armada38x head/sys/arm/nvidia/tegra124/std.tegra124 head/sys/arm/qemu/std.virt head/sys/arm/rockchip/std.rk30xx head/sys/arm/samsung/exynos/std.exynos5250 head/sys/arm/samsung/exynos/std.exynos5420 head/sys/arm/ti/am335x/std.am335x head/sys/arm/ti/omap4/std.omap4 head/sys/arm/xilinx/std.zynq7 head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/allwinner/std.allwinner ============================================================================== --- head/sys/arm/allwinner/std.allwinner Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/allwinner/std.allwinner Thu Feb 2 06:14:44 2017 (r313090) @@ -1,7 +1,7 @@ # Allwinner common options #$FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/allwinner/std.allwinner_up ============================================================================== --- head/sys/arm/allwinner/std.allwinner_up Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/allwinner/std.allwinner_up Thu Feb 2 06:14:44 2017 (r313090) @@ -1,7 +1,7 @@ # Allwinner Uniprocessor common options #$FreeBSD$ -cpu CPU_CORTEXA8 +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/std.socfpga Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/altera/socfpga/std.socfpga Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/amlogic/aml8726/std.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/std.aml8726 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/amlogic/aml8726/std.aml8726 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/annapurna/alpine/std.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/std.alpine Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/annapurna/alpine/std.alpine Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a -DAL_HAVE_TYPES" Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/arm/cpufunc.c Thu Feb 2 06:14:44 2017 (r313090) @@ -429,7 +429,7 @@ struct cpu_functions arm1176_cpufuncs = }; #endif /*CPU_ARM1176 */ -#if defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) struct cpu_functions cortexa_cpufuncs = { /* Cache operations */ @@ -450,7 +450,7 @@ struct cpu_functions cortexa_cpufuncs = /* Soft functions */ .cf_setup = cortexa_setup }; -#endif /* CPU_CORTEXA8 || CPU_CORTEXA_MP || CPU_KRAIT */ +#endif /* CPU_CORTEXA || CPU_KRAIT */ /* * Global constants also used by locore.s @@ -468,7 +468,7 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_FA526) || defined(CPU_MV_PJ4B) || \ defined(CPU_XSCALE_81342) || \ - defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) + defined(CPU_CORTEXA) || defined(CPU_KRAIT) /* Global cache line sizes, use 32 as default */ int arm_dcache_min_line_size = 32; @@ -659,7 +659,7 @@ set_cpufuncs(void) goto out; } #endif /* CPU_ARM1176 */ -#if defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) switch(cputype & CPU_ID_SCHEME_MASK) { case CPU_ID_CORTEXA5: case CPU_ID_CORTEXA7: @@ -677,7 +677,7 @@ set_cpufuncs(void) default: break; } -#endif /* CPU_CORTEXA8 || CPU_CORTEXA_MP || CPU_KRAIT */ +#endif /* CPU_CORTEXA || CPU_KRAIT */ #if defined(CPU_MV_PJ4B) if (cputype == CPU_ID_MV88SV581X_V7 || @@ -830,7 +830,7 @@ arm10_setup(void) #if defined(CPU_ARM1176) \ || defined(CPU_MV_PJ4B) \ - || defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) + || defined(CPU_CORTEXA) || defined(CPU_KRAIT) static __inline void cpu_scc_setup_ccnt(void) { @@ -900,7 +900,7 @@ pj4bv7_setup(void) } #endif /* CPU_MV_PJ4B */ -#if defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) void cortexa_setup(void) @@ -908,7 +908,7 @@ cortexa_setup(void) cpu_scc_setup_ccnt(); } -#endif /* CPU_CORTEXA8 || CPU_CORTEXA_MP || CPU_KRAIT */ +#endif /* CPU_CORTEXA || CPU_KRAIT */ #if defined(CPU_FA526) void Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/arm/pmap-v6.c Thu Feb 2 06:14:44 2017 (r313090) @@ -140,7 +140,6 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif - #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 #endif @@ -431,7 +430,9 @@ encode_ttb_flags(int idx) reg |= (inner & 0x1) << 6; reg |= (inner & 0x2) >> 1; #ifdef SMP - reg |= 1 << 1; + ARM_SMP_UP( + reg |= 1 << 1, + ); #endif return reg; } @@ -485,8 +486,9 @@ pmap_set_tex(void) /* Add shareable bits for normal memory in SMP case. */ #ifdef SMP - if (ARM_USE_MP_EXTENSIONS) - prrr |= PRRR_NS1; + ARM_SMP_UP( + prrr |= PRRR_NS1, + ); #endif cp15_prrr_set(prrr); cp15_nmrr_set(nmrr); Modified: head/sys/arm/broadcom/bcm2835/std.bcm2836 ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,7 +1,7 @@ # $FreeBSD$ machine arm armv6 -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options SOC_BCM2836 Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/conf/GENERIC Thu Feb 2 06:14:44 2017 (r313090) @@ -20,8 +20,8 @@ ident GENERIC -cpu CPU_CORTEXA_MP -cpu CPU_CORTEXA8 +cpu CPU_CORTEXA +options SMP_ON_UP machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/freescale/imx/std.imx51 ============================================================================== --- head/sys/arm/freescale/imx/std.imx51 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/freescale/imx/std.imx51 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ machine arm armv6 -cpu CPU_CORTEXA8 +cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/freescale/imx/std.imx53 ============================================================================== --- head/sys/arm/freescale/imx/std.imx53 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/freescale/imx/std.imx53 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ machine arm armv6 -cpu CPU_CORTEXA8 +cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/freescale/imx/std.imx6 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ machine arm armv6 -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options KERNVIRTADDR = 0xc2000000 Modified: head/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/std.vybrid Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/freescale/vybrid/std.vybrid Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/include/cpu-v6.h Thu Feb 2 06:14:44 2017 (r313090) @@ -41,24 +41,47 @@ #if __ARM_ARCH < 6 #error Only include this file for ARMv6 -#else +#endif + +/* + * Some kernel modules (dtrace all for example) are compiled + * unconditionally with -DSMP. Although it looks like a bug, + * handle this case here and in #elif condition in ARM_SMP_UP macro. + */ +#if __ARM_ARCH <= 6 && defined(SMP) && !defined(KLD_MODULE) +#error SMP option is not supported on ARMv6 +#endif + +#if __ARM_ARCH <= 6 && defined(SMP_ON_UP) +#error SMP_ON_UP option is only supported on ARMv7+ CPUs +#endif + +#if !defined(SMP) && defined(SMP_ON_UP) +#error SMP option must be defined for SMP_ON_UP option +#endif #define CPU_ASID_KERNEL 0 -#if __ARM_ARCH >= 7 -#if !defined(SMP) -/* No SMP so no need to use the MP extensions */ -#define ARM_USE_MP_EXTENSIONS 0 -#elif defined(CPU_CORTEXA8) && \ - (defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B)) -#define ARM_USE_MP_EXTENSIONS (cpuinfo.mp_ext != 0) -#elif defined(CPU_CORTEXA8) -#define ARM_USE_MP_EXTENSIONS 0 +#if defined(SMP_ON_UP) +#define ARM_SMP_UP(smp_code, up_code) \ +do { \ + if (cpuinfo.mp_ext != 0) { \ + smp_code; \ + } else { \ + up_code; \ + } \ +} while (0) +#elif defined(SMP) && __ARM_ARCH > 6 +#define ARM_SMP_UP(smp_code, up_code) \ +do { \ + smp_code; \ +} while (0) #else -#define ARM_USE_MP_EXTENSIONS 1 +#define ARM_SMP_UP(smp_code, up_code) \ +do { \ + up_code; \ +} while (0) #endif -#endif /* __ARM_ARCH >= 7 */ - void dcache_wbinv_poc_all(void); /* !!! NOT SMP coherent function !!! */ vm_offset_t dcache_wb_pou_checked(vm_offset_t, vm_size_t); @@ -126,15 +149,15 @@ fname(uint64_t reg) \ /* TLB */ _WF0(_CP15_TLBIALL, CP15_TLBIALL) /* Invalidate entire unified TLB */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) _WF0(_CP15_TLBIALLIS, CP15_TLBIALLIS) /* Invalidate entire unified TLB IS */ #endif _WF1(_CP15_TLBIASID, CP15_TLBIASID(%0)) /* Invalidate unified TLB by ASID */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) _WF1(_CP15_TLBIASIDIS, CP15_TLBIASIDIS(%0)) /* Invalidate unified TLB by ASID IS */ #endif _WF1(_CP15_TLBIMVAA, CP15_TLBIMVAA(%0)) /* Invalidate unified TLB by MVA, all ASID */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) _WF1(_CP15_TLBIMVAAIS, CP15_TLBIMVAAIS(%0)) /* Invalidate unified TLB by MVA, all ASID IS */ #endif _WF1(_CP15_TLBIMVA, CP15_TLBIMVA(%0)) /* Invalidate unified TLB by MVA */ @@ -144,7 +167,7 @@ _WF1(_CP15_TTB_SET, CP15_TTBR0(%0)) /* Cache and Branch predictor */ _WF0(_CP15_BPIALL, CP15_BPIALL) /* Branch predictor invalidate all */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) _WF0(_CP15_BPIALLIS, CP15_BPIALLIS) /* Branch predictor invalidate all IS */ #endif _WF1(_CP15_BPIMVA, CP15_BPIMVA(%0)) /* Branch predictor invalidate by MVA */ @@ -158,7 +181,7 @@ _WF1(_CP15_DCCSW, CP15_DCCSW(%0)) /* Da _WF1(_CP15_DCIMVAC, CP15_DCIMVAC(%0)) /* Data cache invalidate by MVA PoC */ _WF1(_CP15_DCISW, CP15_DCISW(%0)) /* Data cache invalidate by set/way */ _WF0(_CP15_ICIALLU, CP15_ICIALLU) /* Instruction cache invalidate all PoU */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) _WF0(_CP15_ICIALLUIS, CP15_ICIALLUIS) /* Instruction cache invalidate all PoU IS */ #endif _WF1(_CP15_ICIMVAU, CP15_ICIMVAU(%0)) /* Instruction cache invalidate */ @@ -360,17 +383,17 @@ tlb_flush_range_local(vm_offset_t va, vm } /* Broadcasting operations. */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) static __inline void tlb_flush_all(void) { dsb(); - if (ARM_USE_MP_EXTENSIONS) - _CP15_TLBIALLIS(); - else - _CP15_TLBIALL(); + ARM_SMP_UP( + _CP15_TLBIALLIS(), + _CP15_TLBIALL() + ); dsb(); } @@ -379,10 +402,10 @@ tlb_flush_all_ng(void) { dsb(); - if (ARM_USE_MP_EXTENSIONS) - _CP15_TLBIASIDIS(CPU_ASID_KERNEL); - else - _CP15_TLBIASID(CPU_ASID_KERNEL); + ARM_SMP_UP( + _CP15_TLBIASIDIS(CPU_ASID_KERNEL), + _CP15_TLBIASID(CPU_ASID_KERNEL) + ); dsb(); } @@ -393,10 +416,10 @@ tlb_flush(vm_offset_t va) KASSERT((va & PAGE_MASK) == 0, ("%s: va %#x not aligned", __func__, va)); dsb(); - if (ARM_USE_MP_EXTENSIONS) - _CP15_TLBIMVAAIS(va); - else - _CP15_TLBIMVA(va | CPU_ASID_KERNEL); + ARM_SMP_UP( + _CP15_TLBIMVAAIS(va), + _CP15_TLBIMVA(va | CPU_ASID_KERNEL) + ); dsb(); } @@ -410,13 +433,16 @@ tlb_flush_range(vm_offset_t va, vm_size size)); dsb(); - if (ARM_USE_MP_EXTENSIONS) { - for (; va < eva; va += PAGE_SIZE) - _CP15_TLBIMVAAIS(va); - } else { - for (; va < eva; va += PAGE_SIZE) - _CP15_TLBIMVA(va | CPU_ASID_KERNEL); - } + ARM_SMP_UP( + { + for (; va < eva; va += PAGE_SIZE) + _CP15_TLBIMVAAIS(va); + }, + { + for (; va < eva; va += PAGE_SIZE) + _CP15_TLBIMVA(va | CPU_ASID_KERNEL); + } + ); dsb(); } #else /* __ARM_ARCH < 7 */ @@ -440,23 +466,19 @@ icache_sync(vm_offset_t va, vm_size_t si dsb(); va &= ~cpuinfo.dcache_line_mask; + + for ( ; va < eva; va += cpuinfo.dcache_line_size) { #if __ARM_ARCH >= 7 - if (ARM_USE_MP_EXTENSIONS) { - for ( ; va < eva; va += cpuinfo.dcache_line_size) - _CP15_DCCMVAU(va); - } else -#endif - { - for ( ; va < eva; va += cpuinfo.dcache_line_size) - _CP15_DCCMVAC(va); + _CP15_DCCMVAU(va); +#else + _CP15_DCCMVAC(va); +#endif } dsb(); -#if __ARM_ARCH >= 7 - if (ARM_USE_MP_EXTENSIONS) - _CP15_ICIALLUIS(); - else -#endif - _CP15_ICIALLU(); + ARM_SMP_UP( + _CP15_ICIALLUIS(), + _CP15_ICIALLU() + ); dsb(); isb(); } @@ -465,12 +487,11 @@ icache_sync(vm_offset_t va, vm_size_t si static __inline void icache_inv_all(void) { -#if __ARM_ARCH >= 7 - if (ARM_USE_MP_EXTENSIONS) - _CP15_ICIALLUIS(); - else -#endif - _CP15_ICIALLU(); + + ARM_SMP_UP( + _CP15_ICIALLUIS(), + _CP15_ICIALLU() + ); dsb(); isb(); } @@ -479,12 +500,11 @@ icache_inv_all(void) static __inline void bpb_inv_all(void) { -#if __ARM_ARCH >= 7 - if (ARM_USE_MP_EXTENSIONS) - _CP15_BPIALLIS(); - else -#endif - _CP15_BPIALL(); + + ARM_SMP_UP( + _CP15_BPIALLIS(), + _CP15_BPIALL() + ); dsb(); isb(); } @@ -497,15 +517,12 @@ dcache_wb_pou(vm_offset_t va, vm_size_t dsb(); va &= ~cpuinfo.dcache_line_mask; + for ( ; va < eva; va += cpuinfo.dcache_line_size) { #if __ARM_ARCH >= 7 - if (ARM_USE_MP_EXTENSIONS) { - for ( ; va < eva; va += cpuinfo.dcache_line_size) - _CP15_DCCMVAU(va); - } else -#endif - { - for ( ; va < eva; va += cpuinfo.dcache_line_size) - _CP15_DCCMVAC(va); + _CP15_DCCMVAU(va); +#else + _CP15_DCCMVAC(va); +#endif } dsb(); } @@ -668,6 +685,5 @@ cp15_ats1cuw_check(vm_offset_t addr) isb(); return (cp15_par_get() & 0x01 ? EFAULT : 0); } -#endif /* !__ARM_ARCH < 6 */ #endif /* !MACHINE_CPU_V6_H */ Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/include/cpufunc.h Thu Feb 2 06:14:44 2017 (r313090) @@ -276,8 +276,7 @@ void sheeva_l2cache_wbinv_all (void); #if defined(CPU_MV_PJ4B) void armv6_idcache_wbinv_all (void); #endif -#if defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || \ - defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) void armv7_idcache_wbinv_all (void); void armv7_cpu_sleep (int); void armv7_setup (void); Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/include/intr.h Thu Feb 2 06:14:44 2017 (r313090) @@ -76,7 +76,7 @@ int intr_pic_ipi_setup(u_int, const char #elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) || \ defined(CPU_XSCALE_IXP435) #define NIRQ 64 -#elif defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) +#elif defined(CPU_CORTEXA) #define NIRQ 1020 #elif defined(CPU_KRAIT) #define NIRQ 288 Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/include/sysreg.h Thu Feb 2 06:14:44 2017 (r313090) @@ -140,7 +140,7 @@ /* * CP15 C7 registers */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) /* From ARMv7: */ #define CP15_ICIALLUIS p15, 0, r0, c7, c1, 0 /* Instruction cache invalidate all PoU, IS */ #define CP15_BPIALLIS p15, 0, r0, c7, c1, 6 /* Branch predictor invalidate all IS */ @@ -205,7 +205,7 @@ /* * CP15 C8 registers */ -#if __ARM_ARCH >= 7 +#if __ARM_ARCH >= 7 && defined(SMP) /* From ARMv7: */ #define CP15_TLBIALLIS p15, 0, r0, c8, c3, 0 /* Invalidate entire unified TLB IS */ #define CP15_TLBIMVAIS(rr) p15, 0, rr, c8, c3, 1 /* Invalidate unified TLB by MVA IS */ Modified: head/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/std.armada38x Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/mv/armada38x/std.armada38x Thu Feb 2 06:14:44 2017 (r313090) @@ -1,7 +1,7 @@ # $FreeBSD$ files "../mv/armada38x/files.armada38x" files "../mv/files.mv" -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/nvidia/tegra124/std.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/std.tegra124 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/nvidia/tegra124/std.tegra124 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,5 +1,5 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/qemu/std.virt ============================================================================== --- head/sys/arm/qemu/std.virt Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/qemu/std.virt Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ machine arm armv6 -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options KERNVIRTADDR = 0xc1000000 Modified: head/sys/arm/rockchip/std.rk30xx ============================================================================== --- head/sys/arm/rockchip/std.rk30xx Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/rockchip/std.rk30xx Thu Feb 2 06:14:44 2017 (r313090) @@ -1,7 +1,7 @@ # Rockchip rk30xx common options #$FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/samsung/exynos/std.exynos5250 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5250 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/samsung/exynos/std.exynos5250 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5420 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/samsung/exynos/std.exynos5420 Thu Feb 2 06:14:44 2017 (r313090) @@ -1,6 +1,6 @@ # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/ti/am335x/std.am335x ============================================================================== --- head/sys/arm/ti/am335x/std.am335x Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/ti/am335x/std.am335x Thu Feb 2 06:14:44 2017 (r313090) @@ -3,7 +3,7 @@ files "../ti/am335x/files.am335x" include "../ti/std.ti" -cpu CPU_CORTEXA8 +cpu CPU_CORTEXA options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0200000 Modified: head/sys/arm/ti/omap4/std.omap4 ============================================================================== --- head/sys/arm/ti/omap4/std.omap4 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/ti/omap4/std.omap4 Thu Feb 2 06:14:44 2017 (r313090) @@ -3,7 +3,7 @@ files "../ti/omap4/files.omap4" include "../ti/std.ti" -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0200000 Modified: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- head/sys/arm/xilinx/std.zynq7 Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/arm/xilinx/std.zynq7 Thu Feb 2 06:14:44 2017 (r313090) @@ -3,7 +3,7 @@ # # $FreeBSD$ -cpu CPU_CORTEXA_MP +cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/conf/files.arm Thu Feb 2 06:14:44 2017 (r313090) @@ -36,7 +36,7 @@ arm/arm/cpufunc_asm_arm11x6.S optional c arm/arm/cpufunc_asm_armv4.S optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_xscale_pxa2x0 | cpu_xscale_ixp425 | cpu_xscale_81342 arm/arm/cpufunc_asm_armv5_ec.S optional cpu_arm9e arm/arm/cpufunc_asm_armv6.S optional cpu_arm1176 -arm/arm/cpufunc_asm_armv7.S optional cpu_cortexa8 | cpu_cortexa_mp | cpu_krait | cpu_mv_pj4b +arm/arm/cpufunc_asm_armv7.S optional cpu_cortexa | cpu_krait | cpu_mv_pj4b arm/arm/cpufunc_asm_fa526.S optional cpu_fa526 arm/arm/cpufunc_asm_pj4b.S optional cpu_mv_pj4b arm/arm/cpufunc_asm_sheeva.S optional cpu_arm9e Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Thu Feb 2 06:07:39 2017 (r313089) +++ head/sys/conf/options.arm Thu Feb 2 06:14:44 2017 (r313090) @@ -11,8 +11,7 @@ CPSW_ETHERSWITCH opt_cpsw.h CPU_ARM9 opt_global.h CPU_ARM9E opt_global.h CPU_ARM1176 opt_global.h -CPU_CORTEXA8 opt_global.h # Support the Cortex-A8 (no MP extensions) -CPU_CORTEXA_MP opt_global.h # Support Cortex-A CPUs with MP extensions +CPU_CORTEXA opt_global.h CPU_KRAIT opt_global.h CPU_FA526 opt_global.h CPU_MV_PJ4B opt_global.h @@ -20,6 +19,7 @@ CPU_XSCALE_81342 opt_global.h CPU_XSCALE_IXP425 opt_global.h CPU_XSCALE_IXP435 opt_global.h CPU_XSCALE_PXA2X0 opt_global.h +SMP_ON_UP opt_global.h # Runtime detection of MP extensions DEV_GIC opt_global.h DEV_PMU opt_global.h EFI opt_platform.h From owner-svn-src-head@freebsd.org Thu Feb 2 07:08:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 510B6CCD201; Thu, 2 Feb 2017 07:08:12 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D908EAB0; Thu, 2 Feb 2017 07:08:11 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id v1277Yx9014897 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Feb 2017 18:07:39 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id v1277R21018681 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 18:07:27 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id v1277NhH018680; Thu, 2 Feb 2017 18:07:23 +1100 (AEDT) (envelope-from peter) Date: Thu, 2 Feb 2017 18:07:23 +1100 From: Peter Jeremy To: Alexey Dokuchaev Cc: Mark Linimon , Slawa Olhovchenkov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , Takahashi Yoshihiro , "svn-src-head@freebsd.org" , Warner Losh Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170202070723.GE30074@server.rulingia.com> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> <20170201232621.GA20035@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline In-Reply-To: <20170201232621.GA20035@FreeBSD.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 07:08:12 -0000 --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2017-Feb-01 23:26:21 +0000, Alexey Dokuchaev wrote: >Well, we're doing something more than devoid any support claims: we're >deliberately breaking it, often for little to no reason. Things like >r431746 are disgrace to FreeBSD and utter disrespect to our users. :-( Actually, that's an excellent commit and I commend amdmi3 on it. It will help both our users and our developers. It clearly states to users that their system is unsupported and explains how they can bypass the check if they know what they are doing. That's far better than users getting strange build or runtime failures that require investigation and potentially emails to work out what's wrong. >That's largely irrelevant and hardly ever causing problems. All needed >make(1) implementations are available in ports; I can still build modern >ports in 8.x tinderbox with WITH_PKGNG=3Dyes/PKGSUFFIX=3D.txz. And you are doing so in the clear knowledge that what you are doing is not supported by the FreeBSD Project. --=20 Peter Jeremy --8P1HSweYDcXXzwPJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJYktqrXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs042kP/jap5cD4dnRQON3MKbKRDE1c SLxcUQrJlKrGkDbbMwqlsOpnd3zbtMz9Eg0+cSGm25+5LydTtvGPK99yNH7WRkEM mQ56NfFO9Cffticfnmnf8hMXP/JPcP8PNf3OzqZ+ebQQKdF7RNlzYfD3YK663XJ0 DZ/fY2RIw4tZmx3MgRvZKPwK1q8KSjj41tBcfxodeoCh+uBGhvsoHDdkdodSe4SU Oo5f5Gi+JxPCKVl0vGht9iugSAI6Qse5O/viHuxUTIceB/C2F0JR/mEgtqX0EE5g /hLBtyxNHhZdvcL0YNXsFmvmoNiGC/IEZIDN+efg3EetuIjmu6PmVFa+LmInohCn LvTGcfwj+tuhP3Ub9CfWpw26kV3jIMcAnohr5DgFBMt0SQ6rAUMNLhkjyNz/rDX8 fRXQOl2URcTErDU9APcrmQ0VdfpoErh47JWtTcU0hU/sHBWfazWESHpZ4Hd2AicM hkYf4QY0u81KlbR1Gpe/XhvDnkq1zxsF5ya2ZAYVizAqvJkBqk8TfPVIU9UJ+5G0 xC1i6GpK9e6bothwcDIdRwnpU8aWH7RcpnZhMQeHhK9viLHQBNOIwEnUnCsNbHyV I09u49fBD4QQv/RdsX6y9WQCKLfUT7E/gTt/gb63byu7C2xQBQUiscB7xVVRCELz u2RziLiuZ8EghvWew53b =uQMw -----END PGP SIGNATURE----- --8P1HSweYDcXXzwPJ-- From owner-svn-src-head@freebsd.org Thu Feb 2 08:29:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CBC4CCCBDC; Thu, 2 Feb 2017 08:29:26 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailhost.dlr.de", Issuer "DLR CA - G02" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7106F175B; Thu, 2 Feb 2017 08:29:25 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by mailhost.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Feb 2017 09:29:16 +0100 Received: from DLREXMBX01.intra.dlr.de ([fe80::d198:77e5:d411:fccd]) by dlrexhub01.intra.dlr.de ([::1]) with mapi id 14.03.0319.002; Thu, 2 Feb 2017 09:29:20 +0100 From: To: CC: , , Subject: RE: svn commit: r313043 - head/sys/kern Thread-Topic: svn commit: r313043 - head/sys/kern Thread-Index: AQHSfIzUaHU0GSnLtUmrDysUntoftKFUYnQAgAD1jAA= Date: Thu, 2 Feb 2017 08:29:20 +0000 Message-ID: <611243783F62AF48AFB07BC25FA4B1061CED9FD9@DLREXMBX01.intra.dlr.de> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> <20170201180816.GF3334@FreeBSD.org> In-Reply-To: <20170201180816.GF3334@FreeBSD.org> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Content-Type: multipart/mixed; boundary="_002_611243783F62AF48AFB07BC25FA4B1061CED9FD9DLREXMBX01intra_" MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4255-8.100.1062-22860.005 X-TM-AS-Result: No--18.826300-5.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 08:29:26 -0000 --_002_611243783F62AF48AFB07BC25FA4B1061CED9FD9DLREXMBX01intra_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To be honest - I feared that when I saw your messages regarding this. Here = is my original message from july. Attached is also a small test program. Hi, I'm trying to use asio (that's boost::asio without boost) to handle listeni= ng sockets asynchronuosly. This appears not to work. There are also some re= ports on the net about this problem. I was able to reproduce the problem wi= th a small C-programm that does the same steps as asio. The relevant sequen= ce of system calls is: kqueue() =3D 3 (0x3) socket(PF_INET,SOCK_STREAM,6) =3D 4 (0x4) setsockopt(0x4,0xffff,0x800,0x7fffffffea2c,0x4) =3D 0 (0x0) kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_ADD|= EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) =3D 0 (0x0) setsockopt(0x4,0xffff,0x4,0x7fffffffea2c,0x4) =3D 0 (0x0) bind(4,{ AF_INET 0.0.0.0:8080 },16) =3D 0 (0x0) listen(0x4,0x80) =3D 0 (0x0) ioctl(4,FIONBIO,0xffffea2c) =3D 0 (0x0) kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_ADD|= EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) =3D 0 (0x0) kevent(3,0x0,0,0x7fffffffe5a0,32,0x0) ERR#4 'Interrupted system call' The problem here is that asio registers each file descriptor with EVFILT_RE= AD and EVFILT_WRITE as soon as it is opened (first kevent call).=20 After bringing the socket into the listening state and when async_accept() = is called it registers the socket a second time. According to the man page = this is perfectly legal and can be used to modify the registration. With this sequence of calls kevent() does not return when a connection is e= stablished successfully. I tracked down the problem and the reason is in soo_kqfilter(). This is cal= led for the first EVFILT_READ registration and decides based on the SO_ACCE= PTCONN flag which filter operations to use solisten_filtops or soread_filto= ps. In this case it chooses soread_filtops. The second EVFILT_READ registration does not call soo_kqfilter() again, but= just updates the filter from the data and fflags field so the listening so= cket ends up with the wrong filter operations. -----Original Message----- From: Gleb Smirnoff [mailto:glebius@FreeBSD.org]=20 Sent: Wednesday, February 01, 2017 7:08 PM To: Hartmut Brandt Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r313043 - head/sys/kern On Wed, Feb 01, 2017 at 01:12:07PM +0000, Hartmut Brandt wrote: H> Author: harti H> Date: Wed Feb 1 13:12:07 2017 H> New Revision: 313043 H> URL: https://svnweb.freebsd.org/changeset/base/313043 H>=20 H> Log: H> Merge filt_soread and filt_solisten and decide what to do when checkin= g H> for EVFILT_READ at the point of the check not when the event is regist= ers. H> This fixes a problem with asio when accepting a connection. H> =20 H> Reviewed by: kib@, Scott Mitchell This goes into opposite direction with what I am doing: https://reviews.freebsd.org/D9356 Can you please explain the problem with asio when accepting a connection? --=20 Totus tuus, Glebius. --_002_611243783F62AF48AFB07BC25FA4B1061CED9FD9DLREXMBX01intra_ Content-Type: text/plain; name="k.c" Content-Description: k.c Content-Disposition: attachment; filename="k.c"; size=1459; creation-date="Thu, 02 Feb 2017 07:47:39 GMT"; modification-date="Thu, 02 Feb 2017 07:47:39 GMT" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4NCiNpbmNsdWRl IDxzeXMvZXZlbnQuaD4NCiNpbmNsdWRlIDxzeXMvZmlsaW8uaD4NCg0KI2luY2x1ZGUgPHN5cy9p b2N0bC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2lu Y2x1ZGUgPHN0cmluZy5oPg0KI2luY2x1ZGUgPGVyci5oPg0KDQpzdGF0aWMgdm9pZA0Kd2FpdF9s b29wKGludCBrcSwgaW50IHNvY2spDQp7DQoJc3RydWN0IGtldmVudCBldlszMl07DQoJc3RydWN0 IHNvY2thZGRyX2luIGFkZHI7DQoJc29ja2xlbl90IHNvY2tsZW47DQoNCglmb3IgKDs7KSB7DQoJ CWludCBuZXYgPSBrZXZlbnQoa3EsIE5VTEwsIDAsIGV2LCAzMiwgTlVMTCk7DQoJCWlmIChuZXYg PCAxKQ0KCQkJZXJyKDEsICJrZXZlbnQiKTsNCgkJZm9yIChpbnQgaSA9IDA7IGkgPCBuZXY7ICsr aSkgew0KCQkJaWYgKGV2W2ldLmlkZW50ID09IHNvY2spIHsNCgkJCQlwcmludGYoImFjY2VwdFxu Iik7DQoJCQkJaW50IGZkID0gYWNjZXB0KGV2W2ldLmlkZW50LA0KCQkJCSAgICAoc3RydWN0IHNv Y2thZGRyICopJmFkZHIsICZzb2NrbGVuKTsNCgkJCQlpZiAoZmQgPT0gLTEpDQoJCQkJCWVycigx LCAiYWNjZXB0Iik7DQoJCQl9DQoJCX0NCgl9DQp9DQoNCmludA0KbWFpbigpDQp7DQoJc3RydWN0 IHNvY2thZGRyX2luIGFkZHI7DQoNCgkvKiBvcGVuIGEgVENQIHNvY2tldCAqLw0KCWludCBrcSA9 IGtxdWV1ZSgpOw0KDQoJaW50IHNvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIDAp Ow0KDQoJc3RydWN0IGtldmVudCBldlsyXTsNCglFVl9TRVQoJmV2WzBdLCBzb2NrLCBFVkZJTFRf UkVBRCwgRVZfQUREIHwgRVZfQ0xFQVIsIDAsIDAsIE5VTEwpOw0KCUVWX1NFVCgmZXZbMV0sIHNv Y2ssIEVWRklMVF9XUklURSwgRVZfQUREIHwgRVZfQ0xFQVIsIDAsIDAsIE5VTEwpOw0KDQoJaW50 IG9wdCA9IDE7DQoJc2V0c29ja29wdChzb2NrLCBTT0xfU09DS0VULCBTT19OT1NJR1BJUEUsICZv cHQsIHNpemVvZihvcHQpKTsNCg0KCWlmIChrZXZlbnQoa3EsIGV2LCAyLCBOVUxMLCAwLCBOVUxM KSA9PSAtMSkNCgkgICAgZXJyKDEsICJrZXZlbnQiKTsNCg0KCXNldHNvY2tvcHQoc29jaywgU09M X1NPQ0tFVCwgU09fUkVVU0VBRERSLCAmb3B0LCBzaXplb2Yob3B0KSk7DQoNCgltZW1zZXQoJmFk ZHIsIDAsIHNpemVvZihhZGRyKSk7DQoJYWRkci5zaW5fcG9ydCA9IGh0b25zKDEwMDAwKTsNCg0K CWJpbmQoc29jaywgKHN0cnVjdCBzb2NrYWRkciAqKSZhZGRyLCBzaXplb2YoYWRkcikpOw0KCWxp c3Rlbihzb2NrLCAweDgwKTsNCg0KCWlvY3RsKHNvY2ssIEZJT05CSU8sICZvcHQpOw0KDQoJaWYg KGtldmVudChrcSwgZXYsIDIsIE5VTEwsIDAsIE5VTEwpID09IC0xKQ0KCQllcnIoMSwgImtldmVu dCIpOw0KDQoJd2FpdF9sb29wKGtxLCBzb2NrKTsNCn0NCg== --_002_611243783F62AF48AFB07BC25FA4B1061CED9FD9DLREXMBX01intra_-- From owner-svn-src-head@freebsd.org Thu Feb 2 08:43:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246A8CCD135; Thu, 2 Feb 2017 08:43:20 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailhost.dlr.de", Issuer "DLR CA - G02" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B48F86C; Thu, 2 Feb 2017 08:43:19 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by mailhost.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Feb 2017 09:43:11 +0100 Received: from DLREXMBX01.intra.dlr.de ([fe80::d198:77e5:d411:fccd]) by dlrexhub01.intra.dlr.de ([::1]) with mapi id 14.03.0319.002; Thu, 2 Feb 2017 09:43:15 +0100 From: To: CC: , , Subject: RE: svn commit: r313043 - head/sys/kern Thread-Topic: svn commit: r313043 - head/sys/kern Thread-Index: AQHSfIzUaHU0GSnLtUmrDysUntoftKFUWKeAgAEO6VA= Date: Thu, 2 Feb 2017 08:43:14 +0000 Message-ID: <611243783F62AF48AFB07BC25FA4B1061CEDA047@DLREXMBX01.intra.dlr.de> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> <20170201173311.GY84308@strugglingcoder.info> In-Reply-To: <20170201173311.GY84308@strugglingcoder.info> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4255-8.100.1062-22860.005 X-TM-AS-Result: No--7.948800-5.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 08:43:20 -0000 Sure. Let's settle this a couple of days. harti -----Original Message----- From: hiren panchasara [mailto:hiren@strugglingcoder.info]=20 Sent: Wednesday, February 01, 2017 6:33 PM To: Hartmut Brandt Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r313043 - head/sys/kern On 02/01/17 at 01:12P, Hartmut Brandt wrote: > Author: harti > Date: Wed Feb 1 13:12:07 2017 > New Revision: 313043 > URL: https://svnweb.freebsd.org/changeset/base/313043 >=20 > Log: > Merge filt_soread and filt_solisten and decide what to do when checking > for EVFILT_READ at the point of the check not when the event is registe= rs. > This fixes a problem with asio when accepting a connection. > =20 > Reviewed by: kib@, Scott Mitchell >=20 > Modified: > head/sys/kern/uipc_socket.c Is it possible to MFC this back to 11? Cheers, Hiren From owner-svn-src-head@freebsd.org Thu Feb 2 09:16:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC77CCDF58; Thu, 2 Feb 2017 09:16:05 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41863175B; Thu, 2 Feb 2017 09:16:04 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 6198E15D; Thu, 2 Feb 2017 03:15:58 -0600 (CST) Date: Thu, 2 Feb 2017 03:15:57 -0600 From: Mark Linimon To: Peter Jeremy Cc: Alexey Dokuchaev , src-committers , John Baldwin , "svn-src-all@freebsd.org" , Takahashi Yoshihiro , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Warner Losh Subject: Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example... Message-ID: <20170202091557.GA6058@lonesome.com> References: <201701280222.v0S2MFSR022477@repo.freebsd.org> <3458844.3oruRKbrzH@ralph.baldwin.cx> <20170201103555.GA79121@zxy.spb.ru> <12386326.7GSpFTXsMZ@ralph.baldwin.cx> <20170201170950.GF79121@zxy.spb.ru> <20170201213956.GA3765@lonesome.com> <20170201232621.GA20035@FreeBSD.org> <20170202070723.GE30074@server.rulingia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170202070723.GE30074@server.rulingia.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 09:16:05 -0000 On Thu, Feb 02, 2017 at 06:07:23PM +1100, Peter Jeremy wrote: > It clearly states to users that their system is unsupported and > explains how they can bypass the check if they know what they are > doing. It also prevents us from making a promise that we have no intention of keeping (e.g., indefinite support). mcl From owner-svn-src-head@freebsd.org Thu Feb 2 09:19:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1975FCCDFFC; Thu, 2 Feb 2017 09:19:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C735C1906; Thu, 2 Feb 2017 09:19:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v129Jv6b090404; Thu, 2 Feb 2017 09:19:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v129Jvia090400; Thu, 2 Feb 2017 09:19:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020919.v129Jvia090400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 09:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313091 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 09:19:59 -0000 Author: adrian Date: Thu Feb 2 09:19:57 2017 New Revision: 313091 URL: https://svnweb.freebsd.org/changeset/base/313091 Log: [ath_hal] [ar9300] initial radar detection glue. * flesh out a "get default DFS parameters" routine * remove the stub that returns NULL * fix up the enable DFS method to do what FreeBSD does - specifically, allow pe_enabled to be set/cleared. This allows the radar pulse reporting code to function, but it doesn't yet do anything useful. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Feb 2 06:14:44 2017 (r313090) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Feb 2 09:19:57 2017 (r313091) @@ -1489,6 +1489,7 @@ extern HAL_BOOL ar9300_radar_wait(struc extern struct dfs_pulse * ar9300_get_dfs_radars(struct ath_hal *ah, u_int32_t dfsdomain, int *numradars, struct dfs_bin5pulse **bin5pulses, int *numb5radars, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar9300_get_default_dfs_thresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern void ar9300_adjust_difs(struct ath_hal *ah, u_int32_t val); extern u_int32_t ar9300_dfs_config_fft(struct ath_hal *ah, HAL_BOOL is_enable); extern void ar9300_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL enable); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Feb 2 06:14:44 2017 (r313090) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Feb 2 09:19:57 2017 (r313091) @@ -219,7 +219,7 @@ ar9300_attach_freebsd_ops(struct ath_hal /* DFS functions */ ah->ah_enableDfs = ar9300_enable_dfs; ah->ah_getDfsThresh = ar9300_get_dfs_thresh; - ah->ah_getDfsDefaultThresh = ar9300_freebsd_get_dfs_default_thresh; + ah->ah_getDfsDefaultThresh = ar9300_get_default_dfs_thresh; // procradarevent ah->ah_isFastClockEnabled = ar9300_is_fast_clock_enabled; ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy; @@ -696,16 +696,6 @@ ar9300_freebsd_get_mib_cycle_counts(stru return (AH_FALSE); } -HAL_BOOL -ar9300_freebsd_get_dfs_default_thresh(struct ath_hal *ah, - HAL_PHYERR_PARAM *pe) -{ - - /* XXX not yet */ - - return (AH_FALSE); -} - /* * Clear multicast filter by index - from FreeBSD ar5212_recv.c */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c Thu Feb 2 06:14:44 2017 (r313090) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c Thu Feb 2 09:19:57 2017 (r313091) @@ -235,7 +235,14 @@ ar9300_enable_dfs(struct ath_hal *ah, HA int reg_writes = 0; val = OS_REG_READ(ah, AR_PHY_RADAR_0); - val |= AR_PHY_RADAR_0_FFT_ENA | AR_PHY_RADAR_0_ENA; + val |= AR_PHY_RADAR_0_FFT_ENA; + + + if (pe->pe_enabled != HAL_PHYERR_PARAM_NOVAL) { + val &= ~AR_PHY_RADAR_0_ENA; + val |= SM(pe->pe_enabled, AR_PHY_RADAR_0_ENA); + } + if (pe->pe_firpwr != HAL_PHYERR_PARAM_NOVAL) { val &= ~AR_PHY_RADAR_0_FIRPWR; val |= SM(pe->pe_firpwr, AR_PHY_RADAR_0_FIRPWR); @@ -328,6 +335,7 @@ ar9300_get_dfs_thresh(struct ath_hal *ah pe->pe_height = MS(val, AR_PHY_RADAR_0_HEIGHT); pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI); pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND); + pe->pe_enabled = !! MS(val, AR_PHY_RADAR_0_ENA); val = OS_REG_READ(ah, AR_PHY_RADAR_1); @@ -425,6 +433,23 @@ ar9300_get_dfs_radars( return dfs_radars; } +HAL_BOOL +ar9300_get_default_dfs_thresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + pe->pe_firpwr = AR9300_DFS_FIRPWR; + pe->pe_rrssi = AR9300_DFS_RRSSI; + pe->pe_height = AR9300_DFS_HEIGHT; + pe->pe_prssi = AR9300_DFS_PRSSI; + /* see prssi comment above */ + + pe->pe_inband = AR9300_DFS_INBAND; + pe->pe_relpwr = AR9300_DFS_RELPWR; + pe->pe_relstep = AR9300_DFS_RELSTEP; + pe->pe_maxlen = AR9300_DFS_MAXLEN; + return (AH_TRUE); +} + void ar9300_adjust_difs(struct ath_hal *ah, u_int32_t val) { if (val == 0) { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Thu Feb 2 06:14:44 2017 (r313090) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Thu Feb 2 09:19:57 2017 (r313091) @@ -222,6 +222,7 @@ #define AR_PHY_TIMING5_RSSI_THR1A_ENA (0x1 << 15) /* BB_radar_detection) */ #define AR_PHY_RADAR_0_ENA 0x00000001 /* Enable radar detection */ +#define AR_PHY_RADAR_0_ENA_S 0 #define AR_PHY_RADAR_0_FFT_ENA 0x80000000 /* Enable FFT data */ #define AR_PHY_RADAR_0_INBAND 0x0000003e /* Inband pulse threshold */ #define AR_PHY_RADAR_0_INBAND_S 1 From owner-svn-src-head@freebsd.org Thu Feb 2 17:29:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F475CCD3F4; Thu, 2 Feb 2017 17:29:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3439772; Thu, 2 Feb 2017 17:29:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12HTGIk095210; Thu, 2 Feb 2017 17:29:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12HTGuX095209; Thu, 2 Feb 2017 17:29:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201702021729.v12HTGuX095209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 2 Feb 2017 17:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313097 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 17:29:17 -0000 Author: jhb Date: Thu Feb 2 17:29:15 2017 New Revision: 313097 URL: https://svnweb.freebsd.org/changeset/base/313097 Log: Require Data Layer Active reporting for native PCI-e HotPlug. Some PCI-e bridges report that they support HotPlug in the slot capabilities but do not report support for Data Layer Active events in the link capabilities register. These bridges do not work correctly when HotPlug is used. Further, while the description of HotPlug in the spec does not mention that DL active events are required, the description of the link capabilities register says that DL active is required for HotPlug. Thanks to Dave Baukus for finding that language in the spec. PR: 211699 Submitted by: Dave Baukus Reviewed by: vangyzen MFC after: 3 days Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Thu Feb 2 13:40:37 2017 (r313096) +++ head/sys/dev/pci/pci_pci.c Thu Feb 2 17:29:15 2017 (r313097) @@ -935,6 +935,8 @@ pcib_probe_hotplug(struct pcib_softc *sc if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) return; + if ((sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) == 0) + return; /* * Some devices report that they have an MRL when they actually From owner-svn-src-head@freebsd.org Thu Feb 2 17:43:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B184ECCD8ED; Thu, 2 Feb 2017 17:43:01 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80DA110A9; Thu, 2 Feb 2017 17:43:01 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12Hh0fv003257; Thu, 2 Feb 2017 17:43:00 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12Hh0ft003256; Thu, 2 Feb 2017 17:43:00 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201702021743.v12Hh0ft003256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Thu, 2 Feb 2017 17:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313098 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 17:43:01 -0000 Author: lidl Date: Thu Feb 2 17:43:00 2017 New Revision: 313098 URL: https://svnweb.freebsd.org/changeset/base/313098 Log: Fix compilation for mips64 platforms The hwpmc_mips24k / hwpmc_mips74k modules are only for mips 32-bit hosts. Reviewed by: adrian Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Feb 2 17:29:15 2017 (r313097) +++ head/sys/modules/Makefile Thu Feb 2 17:43:00 2017 (r313098) @@ -522,7 +522,7 @@ _cxgbe= cxgbe SUBDIR+= zfs .endif -.if ${MACHINE_CPUARCH} == "mips" +.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "") _hwpmc_mips24k= hwpmc_mips24k _hwpmc_mips74k= hwpmc_mips74k .endif From owner-svn-src-head@freebsd.org Thu Feb 2 17:44:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDECACCD9A6; Thu, 2 Feb 2017 17:44:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9E8122D; Thu, 2 Feb 2017 17:44:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12Hit5k003403; Thu, 2 Feb 2017 17:44:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12Hit3U003402; Thu, 2 Feb 2017 17:44:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702021744.v12Hit3U003402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 Feb 2017 17:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313099 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 17:44:56 -0000 Author: trasz Date: Thu Feb 2 17:44:55 2017 New Revision: 313099 URL: https://svnweb.freebsd.org/changeset/base/313099 Log: Ifdef out the unused vm_rr_selectdomain(). MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Feb 2 17:43:00 2017 (r313098) +++ head/sys/vm/vm_phys.c Thu Feb 2 17:44:55 2017 (r313099) @@ -270,6 +270,7 @@ vm_phys_fictitious_cmp(struct vm_phys_fi (uintmax_t)p1->end, (uintmax_t)p2->start, (uintmax_t)p2->end); } +#ifdef notyet static __inline int vm_rr_selectdomain(void) { @@ -285,6 +286,7 @@ vm_rr_selectdomain(void) return (0); #endif } +#endif /* notyet */ /* * Initialise a VM domain iterator. From owner-svn-src-head@freebsd.org Thu Feb 2 18:14:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2206ACCE4B3; Thu, 2 Feb 2017 18:14:25 +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 60BE0D54; Thu, 2 Feb 2017 18:14:24 +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 67EE910481BA; Fri, 3 Feb 2017 05:14:16 +1100 (AEDT) Date: Fri, 3 Feb 2017 05:14:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: Bruce Evans , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include In-Reply-To: <20170202014204.GA992@dft-labs.eu> Message-ID: <20170203040751.I2354@besplex.bde.org> References: <201701300224.v0U2Osj1010421@repo.freebsd.org> <20170130142123.V953@besplex.bde.org> <20170201214349.H1136@besplex.bde.org> <20170202014204.GA992@dft-labs.eu> 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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=ZHXAibqBrz8wDKC0GT4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 18:14:25 -0000 On Thu, 2 Feb 2017, Mateusz Guzik wrote: > On Wed, Feb 01, 2017 at 10:12:57PM +1100, Bruce Evans wrote: >> On Mon, 30 Jan 2017, Bruce Evans wrote: >> >>> On Mon, 30 Jan 2017, Mateusz Guzik wrote: >>> >>>> Log: >>>> i386: add atomic_fcmpset >>>> >>>> Tested by: pho >>> >>> This is has some bugs and style bugs. >> >> This is still broken. The invalid asm breaks building at least atomic.o >> with gcc-4.2.1. >> >> Tested fix: >> ... > > Uh, I ended up with the same fix. Committed in r313080. Thanks. > Sorry for breakage in the first place. > >> The semantics of fcmpset seem to be undocumented. On x86, *expect is >> updated non-atomically by a store in the output parameter. I think >> cmpxchg updates the "a" register atomically, but then the output >> parameter causes this to be stored non-atomically to *expect. A better >> API would somehow return the "a" register and let the caller store it >> if it wants. Ordinary cmpset can be built on this by not storing, and >> the caller can do the store atomically to a different place if *expect >> is too volatile to be atomic. >> > > The primitive was modeled after atomic_compare_exchange_* from c11 > atomics. I don't see what's the benefit of storing the result > separately. > > As it is, the primitive fits nicely into loops like "inc not zero". > > Like this: > r = *counter; > for (;;) { > if (r == 0) > break; > if (atomic_fcmpset_int(counter, &r, r + 1)) > break; > // r we can loop back to re-test r > } You won't want to ifdef this for SMP, so the i386 implementation has further bugs like I expected (fcmpset is not implemented in the CPU_DISABLE_CMPXCHG case). >> Maybe just decouple the input parameter from the output parameter. The >> following works right (for an amd64 API): >> >> Y static __inline int >> Y atomic_xfcmpset_long(volatile u_long *dst, u_long *expect_out, u_long expect_in, >> Y u_long src) The output parameter is not well named in this or in fcmpset, since when the comparison fails it holds the compared copy of *dst, not of *expect_in, and otherwise it is not useful and holds a copy of src. >> If the caller doesn't want to use *expect_out, it passes a pointer to an >> unused local variable. The compiler can then optimize away the store >> since it is not hidden in the asm. > > _fcmpset is specifically for callers who want the value back. Ones which > don't can use the _cmpset variant. The main caller of _xfcmpset would be the _cmpset variantL static __inline int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) { u_int dummy __unused; return (atomic_xfcmpset_int(dst, &dummy, expect, src)); } Actually, _cmpset can be built out of _fcmpset even more easily: static __inline int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) { return (atomic_fcmpset_int(dst, &expect, src)); } This has to be a function since a macro would expose *&expect to clobbering. Bruce From owner-svn-src-head@freebsd.org Thu Feb 2 18:43:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18EDDCCEA90; Thu, 2 Feb 2017 18:43:28 +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 A402267; Thu, 2 Feb 2017 18:43: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 v12IhLN1023558 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 20:43:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v12IhLN1023558 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v12IhLZf023557; Thu, 2 Feb 2017 20:43:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Feb 2017 20:43:21 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Mateusz Guzik , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include Message-ID: <20170202184321.GO2092@kib.kiev.ua> References: <201701300224.v0U2Osj1010421@repo.freebsd.org> <20170130142123.V953@besplex.bde.org> <20170201214349.H1136@besplex.bde.org> <20170202014204.GA992@dft-labs.eu> <20170203040751.I2354@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170203040751.I2354@besplex.bde.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 18:43:28 -0000 On Fri, Feb 03, 2017 at 05:14:15AM +1100, Bruce Evans wrote: > You won't want to ifdef this for SMP, so the i386 implementation has > further bugs like I expected (fcmpset is not implemented in the > CPU_DISABLE_CMPXCHG case). I think it is time to remove the option. It certainly outlived it usefulness: ... VmWare 3.x seems to emulate this instruction poorly, causing the guest OS to run very slowly. This problem appears to be fixed in VmWare 4.x, at least in version 4.5.2 ... From owner-svn-src-head@freebsd.org Thu Feb 2 18:48:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E9EBCCEB18; Thu, 2 Feb 2017 18:48:24 +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 9DC50262; Thu, 2 Feb 2017 18:48:23 +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 v12ImJrL024816 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 20:48:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v12ImJrL024816 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v12ImJUj024815; Thu, 2 Feb 2017 20:48:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Feb 2017 20:48:19 +0200 From: Konstantin Belousov To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern Message-ID: <20170202184819.GP2092@kib.kiev.ua> References: <201701310326.v0V3QW30024375@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701310326.v0V3QW30024375@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 18:48:24 -0000 On Tue, Jan 31, 2017 at 03:26:32AM +0000, Conrad E. Meyer wrote: > + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ BTW, new gcc has -mcrc32 option, but clang 3.9.1 apparently does not. From owner-svn-src-head@freebsd.org Thu Feb 2 19:24:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E55FDCCD567; Thu, 2 Feb 2017 19:24:04 +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 22B971A8C; Thu, 2 Feb 2017 19:24:04 +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 6FBBD42CFCD; Fri, 3 Feb 2017 06:23:54 +1100 (AEDT) Date: Fri, 3 Feb 2017 06:23:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Mateusz Guzik , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312975 - head/sys/i386/include In-Reply-To: <20170202184321.GO2092@kib.kiev.ua> Message-ID: <20170203062049.N2690@besplex.bde.org> References: <201701300224.v0U2Osj1010421@repo.freebsd.org> <20170130142123.V953@besplex.bde.org> <20170201214349.H1136@besplex.bde.org> <20170202014204.GA992@dft-labs.eu> <20170203040751.I2354@besplex.bde.org> <20170202184321.GO2092@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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=EiulhN8bn4RJF35M6TYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 19:24:05 -0000 On Thu, 2 Feb 2017, Konstantin Belousov wrote: > On Fri, Feb 03, 2017 at 05:14:15AM +1100, Bruce Evans wrote: >> You won't want to ifdef this for SMP, so the i386 implementation has >> further bugs like I expected (fcmpset is not implemented in the >> CPU_DISABLE_CMPXCHG case). > > I think it is time to remove the option. It certainly outlived it > usefulness: > > ... VmWare 3.x seems to emulate this instruction poorly, causing > the guest OS to run very slowly. This problem appears to be fixed in > VmWare 4.x, at least in version 4.5.2 ... Yes, it is probably not useful. Similarly for many old i386 options like NPX and SSE. NPX might as well be mandatory, and SSE always there but dynamically configured as it is now. Bruce From owner-svn-src-head@freebsd.org Thu Feb 2 19:24:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B21CCD59B; Thu, 2 Feb 2017 19:24:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 69B2A1AE8; Thu, 2 Feb 2017 19:24:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v12JOCk1023436 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 11:24:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v12JOBu6023435; Thu, 2 Feb 2017 11:24:11 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Feb 2017 11:24:11 -0800 From: Gleb Smirnoff To: Hartmut.Brandt@dlr.de Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313043 - head/sys/kern Message-ID: <20170202192411.GK3334@FreeBSD.org> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> <20170201180816.GF3334@FreeBSD.org> <611243783F62AF48AFB07BC25FA4B1061CED9FD9@DLREXMBX01.intra.dlr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <611243783F62AF48AFB07BC25FA4B1061CED9FD9@DLREXMBX01.intra.dlr.de> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 19:24:18 -0000 Hartmut, Thanks for explanation! Is there a test program available to reproduce the problem? I want to try the sequence on my branch. On Thu, Feb 02, 2017 at 08:29:20AM +0000, Hartmut.Brandt@dlr.de wrote: H> To be honest - I feared that when I saw your messages regarding this. Here is my original message from july. Attached is also a small test program. H> H> Hi, H> H> I'm trying to use asio (that's boost::asio without boost) to handle listening sockets asynchronuosly. This appears not to work. There are also some reports on the net about this problem. I was able to reproduce the problem with a small C-programm that does the same steps as asio. The relevant sequence of system calls is: H> H> kqueue() = 3 (0x3) H> socket(PF_INET,SOCK_STREAM,6) = 4 (0x4) H> setsockopt(0x4,0xffff,0x800,0x7fffffffea2c,0x4) = 0 (0x0) H> kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_ADD|EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) = 0 (0x0) H> setsockopt(0x4,0xffff,0x4,0x7fffffffea2c,0x4) = 0 (0x0) H> bind(4,{ AF_INET 0.0.0.0:8080 },16) = 0 (0x0) H> listen(0x4,0x80) = 0 (0x0) H> ioctl(4,FIONBIO,0xffffea2c) = 0 (0x0) H> kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_ADD|EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) = 0 (0x0) H> kevent(3,0x0,0,0x7fffffffe5a0,32,0x0) ERR#4 'Interrupted system call' H> H> The problem here is that asio registers each file descriptor with EVFILT_READ and EVFILT_WRITE as soon as it is opened (first kevent call). H> After bringing the socket into the listening state and when async_accept() is called it registers the socket a second time. According to the man page this is perfectly legal and can be used to modify the registration. H> H> With this sequence of calls kevent() does not return when a connection is established successfully. H> H> I tracked down the problem and the reason is in soo_kqfilter(). This is called for the first EVFILT_READ registration and decides based on the SO_ACCEPTCONN flag which filter operations to use solisten_filtops or soread_filtops. In this case it chooses soread_filtops. H> H> The second EVFILT_READ registration does not call soo_kqfilter() again, but just updates the filter from the data and fflags field so the listening socket ends up with the wrong filter operations. H> H> H> H> -----Original Message----- H> From: Gleb Smirnoff [mailto:glebius@FreeBSD.org] H> Sent: Wednesday, February 01, 2017 7:08 PM H> To: Hartmut Brandt H> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org H> Subject: Re: svn commit: r313043 - head/sys/kern H> H> On Wed, Feb 01, 2017 at 01:12:07PM +0000, Hartmut Brandt wrote: H> H> Author: harti H> H> Date: Wed Feb 1 13:12:07 2017 H> H> New Revision: 313043 H> H> URL: https://svnweb.freebsd.org/changeset/base/313043 H> H> H> H> Log: H> H> Merge filt_soread and filt_solisten and decide what to do when checking H> H> for EVFILT_READ at the point of the check not when the event is registers. H> H> This fixes a problem with asio when accepting a connection. H> H> H> H> Reviewed by: kib@, Scott Mitchell H> H> This goes into opposite direction with what I am doing: H> H> https://reviews.freebsd.org/D9356 H> H> Can you please explain the problem with asio when accepting a connection? H> H> -- H> Totus tuus, Glebius. H> H> #include H> #include H> #include H> #include H> H> #include H> #include H> #include H> #include H> #include H> H> static void H> wait_loop(int kq, int sock) H> { H> struct kevent ev[32]; H> struct sockaddr_in addr; H> socklen_t socklen; H> H> for (;;) { H> int nev = kevent(kq, NULL, 0, ev, 32, NULL); H> if (nev < 1) H> err(1, "kevent"); H> for (int i = 0; i < nev; ++i) { H> if (ev[i].ident == sock) { H> printf("accept\n"); H> int fd = accept(ev[i].ident, H> (struct sockaddr *)&addr, &socklen); H> if (fd == -1) H> err(1, "accept"); H> } H> } H> } H> } H> H> int H> main() H> { H> struct sockaddr_in addr; H> H> /* open a TCP socket */ H> int kq = kqueue(); H> H> int sock = socket(PF_INET, SOCK_STREAM, 0); H> H> struct kevent ev[2]; H> EV_SET(&ev[0], sock, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL); H> EV_SET(&ev[1], sock, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, NULL); H> H> int opt = 1; H> setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt)); H> H> if (kevent(kq, ev, 2, NULL, 0, NULL) == -1) H> err(1, "kevent"); H> H> setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); H> H> memset(&addr, 0, sizeof(addr)); H> addr.sin_port = htons(10000); H> H> bind(sock, (struct sockaddr *)&addr, sizeof(addr)); H> listen(sock, 0x80); H> H> ioctl(sock, FIONBIO, &opt); H> H> if (kevent(kq, ev, 2, NULL, 0, NULL) == -1) H> err(1, "kevent"); H> H> wait_loop(kq, sock); H> } -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Feb 2 19:56:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF455CCDCB0; Thu, 2 Feb 2017 19:56:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C85C38; Thu, 2 Feb 2017 19:56:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12JufSr057278; Thu, 2 Feb 2017 19:56:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12JufOv057273; Thu, 2 Feb 2017 19:56:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201702021956.v12JufOv057273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 2 Feb 2017 19:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313104 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 19:56:42 -0000 Author: glebius Date: Thu Feb 2 19:56:41 2017 New Revision: 313104 URL: https://svnweb.freebsd.org/changeset/base/313104 Log: Reduce diff to upstream using HAVE_CAPSICUM instead of __FreeBSD__. It'll also make it easier to upstream HAVE_CASPER patch. Modified: head/contrib/tcpdump/config.h.in head/contrib/tcpdump/configure head/contrib/tcpdump/configure.in head/contrib/tcpdump/tcpdump.c head/usr.sbin/tcpdump/tcpdump/config.h Modified: head/contrib/tcpdump/config.h.in ============================================================================== --- head/contrib/tcpdump/config.h.in Thu Feb 2 19:50:28 2017 (r313103) +++ head/contrib/tcpdump/config.h.in Thu Feb 2 19:56:41 2017 (r313104) @@ -9,8 +9,8 @@ /* Define to 1 if you have the `bpf_dump' function. */ #undef HAVE_BPF_DUMP -/* Casper library support available */ -#undef HAVE_CASPER +/* capsicum support available */ +#undef HAVE_CAPSICUM /* Define to 1 if you have the `cap_enter' function. */ #undef HAVE_CAP_ENTER Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Thu Feb 2 19:50:28 2017 (r313103) +++ head/contrib/tcpdump/configure Thu Feb 2 19:56:41 2017 (r313104) @@ -4593,7 +4593,7 @@ fi $as_echo_n "checking whether to sandbox using capsicum... " >&6; } if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then -$as_echo "#define HAVE_CASPER 1" >>confdefs.h +$as_echo "#define HAVE_CAPSICUM 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } Modified: head/contrib/tcpdump/configure.in ============================================================================== --- head/contrib/tcpdump/configure.in Thu Feb 2 19:50:28 2017 (r313103) +++ head/contrib/tcpdump/configure.in Thu Feb 2 19:56:41 2017 (r313104) @@ -228,7 +228,7 @@ if test ! -z "$with_sandbox-capsicum" && fi AC_MSG_CHECKING([whether to sandbox using capsicum]) if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then - AC_DEFINE(HAVE_CASPER, 1, [casper support available]) + AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Thu Feb 2 19:50:28 2017 (r313103) +++ head/contrib/tcpdump/tcpdump.c Thu Feb 2 19:56:41 2017 (r313104) @@ -75,18 +75,18 @@ The Regents of the University of Califor * to compile if has already been included; including the headers * in the opposite order works fine. */ -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM #include #include +#include +#include +#include #include #ifdef HAVE_CASPER #include #include -#include -#include -#include #endif /* HAVE_CASPER */ -#endif /* __FreeBSD__ */ +#endif /* HAVE_CAPSICUM */ #include #include #include @@ -249,7 +249,7 @@ struct dump_info { char *CurrentFileName; pcap_t *pd; pcap_dumper_t *p; -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM int dirfd; #endif }; @@ -789,7 +789,7 @@ tstamp_precision_to_string(int precision } #endif -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM /* * Ensure that, on a dump file's descriptor, we have all the rights * necessary to make the standard I/O library work with an fdopen()ed @@ -1188,10 +1188,10 @@ main(int argc, char **argv) #endif int status; FILE *VFile; -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM cap_rights_t rights; -#endif /* !__FreeBSD__ */ int cansandbox; +#endif /* HAVE_CAPSICUM */ int Oflag = 1; /* run filter code optimizer */ int yflag_dlt = -1; const char *yflag_dlt_name = NULL; @@ -1685,7 +1685,7 @@ main(int argc, char **argv) if (pd == NULL) error("%s", ebuf); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -1916,7 +1916,7 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; @@ -1966,11 +1966,11 @@ main(int argc, char **argv) #endif /* HAVE_LIBCAP_NG */ if (p == NULL) error("%s", pcap_geterr(pd)); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM set_dumper_capsicum_rights(p); #endif if (Cflag != 0 || Gflag != 0) { -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM dumpinfo.WFileName = strdup(basename(WFileName)); if (dumpinfo.WFileName == NULL) { error("Unable to allocate memory for file %s", @@ -1992,7 +1992,7 @@ main(int argc, char **argv) errno != ENOSYS) { error("unable to limit dump descriptor fcntls"); } -#else /* !__FreeBSD__ */ +#else /* !HAVE_CAPSICUM */ dumpinfo.WFileName = WFileName; #endif callback = dump_packet_and_trunc; @@ -2064,7 +2064,7 @@ main(int argc, char **argv) (void)fflush(stderr); } -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM cansandbox = (VFileName == NULL && zflag == NULL); #ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); @@ -2073,7 +2073,7 @@ main(int argc, char **argv) #endif /* HAVE_CASPER */ if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); -#endif /* __FreeBSD __ */ +#endif /* HAVE_CAPSICUM */ do { status = pcap_loop(pd, cnt, callback, pcap_userdata); @@ -2124,7 +2124,7 @@ main(int argc, char **argv) pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -2378,7 +2378,7 @@ dump_packet_and_trunc(u_char *user, cons /* If the time is greater than the specified window, rotate */ if (t - Gflag_time >= Gflag) { -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM FILE *fp; int fd; #endif @@ -2437,7 +2437,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); @@ -2451,7 +2451,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !__FreeBSD__ */ +#else /* !HAVE_CAPSICUM */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2460,7 +2460,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM set_dumper_capsicum_rights(dump_info->p); #endif } @@ -2477,7 +2477,7 @@ dump_packet_and_trunc(u_char *user, cons if (size == -1) error("ftell fails on output file"); if (size > Cflag) { -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM FILE *fp; int fd; #endif @@ -2509,7 +2509,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd < 0) { @@ -2522,7 +2522,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !__FreeBSD__ */ +#else /* !HAVE_CAPSICUM */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2531,7 +2531,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef __FreeBSD__ +#ifdef HAVE_CAPSICUM set_dumper_capsicum_rights(dump_info->p); #endif } Modified: head/usr.sbin/tcpdump/tcpdump/config.h ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/config.h Thu Feb 2 19:50:28 2017 (r313103) +++ head/usr.sbin/tcpdump/tcpdump/config.h Thu Feb 2 19:56:41 2017 (r313104) @@ -13,6 +13,9 @@ /* Define to 1 if you have the `bpf_dump' function. */ #define HAVE_BPF_DUMP 1 +/* capsicum support available */ +#define HAVE_CAPSICUM 1 + /* Casper library support available */ /* See Makefile */ /* #undef HAVE_CASPER */ From owner-svn-src-head@freebsd.org Thu Feb 2 20:00:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58AA1CCDD75; Thu, 2 Feb 2017 20:00:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAEC7E02; Thu, 2 Feb 2017 20:00:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12K02Go057513; Thu, 2 Feb 2017 20:00:02 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12K01wT057505; Thu, 2 Feb 2017 20:00:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201702022000.v12K01wT057505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 2 Feb 2017 20:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313105 - in head/contrib/byacc: . package package/debian package/pkgsrc test test/btyacc test/yacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 20:00:03 -0000 Author: jkim Date: Thu Feb 2 20:00:01 2017 New Revision: 313105 URL: https://svnweb.freebsd.org/changeset/base/313105 Log: MFV: r313101 Update byacc to 20170201. Added: head/contrib/byacc/test/btyacc/expr.oxout.error - copied unchanged from r313101, vendor/byacc/dist/test/btyacc/expr.oxout.error head/contrib/byacc/test/btyacc/expr.oxout.output - copied unchanged from r313101, vendor/byacc/dist/test/btyacc/expr.oxout.output head/contrib/byacc/test/btyacc/expr.oxout.tab.c - copied unchanged from r313101, vendor/byacc/dist/test/btyacc/expr.oxout.tab.c head/contrib/byacc/test/btyacc/expr.oxout.tab.h - copied unchanged from r313101, vendor/byacc/dist/test/btyacc/expr.oxout.tab.h head/contrib/byacc/test/expr.oxout.y - copied unchanged from r313101, vendor/byacc/dist/test/expr.oxout.y head/contrib/byacc/test/yacc/expr.oxout.error - copied unchanged from r313101, vendor/byacc/dist/test/yacc/expr.oxout.error head/contrib/byacc/test/yacc/expr.oxout.output - copied unchanged from r313101, vendor/byacc/dist/test/yacc/expr.oxout.output head/contrib/byacc/test/yacc/expr.oxout.tab.c - copied unchanged from r313101, vendor/byacc/dist/test/yacc/expr.oxout.tab.c head/contrib/byacc/test/yacc/expr.oxout.tab.h - copied unchanged from r313101, vendor/byacc/dist/test/yacc/expr.oxout.tab.h Modified: head/contrib/byacc/CHANGES head/contrib/byacc/MANIFEST head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/configure head/contrib/byacc/defs.h head/contrib/byacc/main.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/debian/copyright head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile head/contrib/byacc/reader.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/CHANGES Thu Feb 2 20:00:01 2017 (r313105) @@ -1,3 +1,33 @@ +2017-02-01 Thomas E. Dickey + + * test/btyacc/expr.oxout.error, test/btyacc/expr.oxout.output, test/btyacc/expr.oxout.tab.c, test/btyacc/expr.oxout.tab.h, test/yacc/expr.oxout.error, test/yacc/expr.oxout.output, test/yacc/expr.oxout.tab.c, test/yacc/expr.oxout.tab.h: + RCS_BASE + + * package/debian/copyright: update copyright + + * reader.c, defs.h, main.c: + avoid using regex.h since some low-end platforms do not have this + + * test/expr.oxout.y: RCS_BASE + + * configure: regen + + * aclocal.m4: quiet a strict gcc warning in CF_MKSTEMP + +2017-02-01 Tom.Shields + + * main.c, reader.c, defs.h: + process #line directives, like bison and flex + +2017-02-01 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2016-12-31 Thomas E. Dickey + + * config.guess, config.sub: 2017-01-01 + 2016-12-02 Thomas E. Dickey * test/btyacc/quote_calc4-s.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc /btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, btyaccpar.c: Modified: head/contrib/byacc/MANIFEST ============================================================================== --- head/contrib/byacc/MANIFEST Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/MANIFEST Thu Feb 2 20:00:01 2017 (r313105) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20161202, version t20161202 +MANIFEST for byacc-20170201, version t20170201 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 @@ -77,6 +77,22 @@ test/btyacc/btyacc_demo.error referenc test/btyacc/btyacc_demo.output reference output for testing test/btyacc/btyacc_demo.tab.c reference output for testing test/btyacc/btyacc_demo.tab.h reference output for testing +test/btyacc/btyacc_demo2.error reference output for testing +test/btyacc/btyacc_demo2.output reference output for testing +test/btyacc/btyacc_demo2.tab.c reference output for testing +test/btyacc/btyacc_demo2.tab.h reference output for testing +test/btyacc/btyacc_destroy1.error reference output for testing +test/btyacc/btyacc_destroy1.output reference output for testing +test/btyacc/btyacc_destroy1.tab.c reference output for testing +test/btyacc/btyacc_destroy1.tab.h reference output for testing +test/btyacc/btyacc_destroy2.error reference output for testing +test/btyacc/btyacc_destroy2.output reference output for testing +test/btyacc/btyacc_destroy2.tab.c reference output for testing +test/btyacc/btyacc_destroy2.tab.h reference output for testing +test/btyacc/btyacc_destroy3.error reference output for testing +test/btyacc/btyacc_destroy3.output reference output for testing +test/btyacc/btyacc_destroy3.tab.c reference output for testing +test/btyacc/btyacc_destroy3.tab.h reference output for testing test/btyacc/calc.error reference output for testing test/btyacc/calc.output reference output for testing test/btyacc/calc.tab.c reference output for testing @@ -256,6 +272,10 @@ test/btyacc/error.error referenc test/btyacc/error.output reference output for testing test/btyacc/error.tab.c reference output for testing test/btyacc/error.tab.h reference output for testing +test/btyacc/expr.oxout.error reference output for testing +test/btyacc/expr.oxout.output reference output for testing +test/btyacc/expr.oxout.tab.c reference output for testing +test/btyacc/expr.oxout.tab.h reference output for testing test/btyacc/grammar.dot reference output for testing test/btyacc/grammar.error reference output for testing test/btyacc/grammar.output reference output for testing @@ -359,6 +379,9 @@ test/btyacc/varsyntax_calc1.tab.h refer test subdirectory test/btyacc_calc1.y testcase for btyacc test/btyacc_demo.y testcase for btyacc +test/btyacc_destroy1.y btyacc test-case for %parse-param +test/btyacc_destroy2.y btyacc test-case for %parse-param +test/btyacc_destroy3.y btyacc test-case for %parse-param test/calc.y example from VMS freeware version of byacc test/calc1.y advanced example from Steve Johnson's paper. test/calc2.y test-cases and reference files for %lex-param / %parse-param @@ -403,6 +426,7 @@ test/err_syntax8.y testcase test/err_syntax8a.y testcase for used_reserved() test/err_syntax9.y testcase for tokenized_start() test/error.y original version of byacc - 1993 +test/expr.oxout.y test-case for "#line" feature test/grammar.y grammar from cproto test/inherit0.y testcase for btyacc test/inherit1.y testcase for btyacc @@ -577,6 +601,10 @@ test/yacc/error.error referenc test/yacc/error.output reference output for testing test/yacc/error.tab.c reference output for testing test/yacc/error.tab.h reference output for testing +test/yacc/expr.oxout.error reference output for testing +test/yacc/expr.oxout.output reference output for testing +test/yacc/expr.oxout.tab.c reference output for testing +test/yacc/expr.oxout.tab.h reference output for testing test/yacc/grammar.dot reference output for testing test/yacc/grammar.error reference output for testing test/yacc/grammar.output reference output for testing Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/VERSION Thu Feb 2 20:00:01 2017 (r313105) @@ -1 +1 @@ -20161202 +20170201 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/aclocal.m4 Thu Feb 2 20:00:01 2017 (r313105) @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.41 2016/12/02 13:03:06 tom Exp $ +dnl $Id: aclocal.m4,v 1.42 2017/02/01 10:12:21 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2015,2016 Thomas E. Dickey +dnl Copyright 2004-2016,2017 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -803,20 +803,26 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 9 updated: 2012/10/03 04:34:49 +dnl CF_MKSTEMP version: 10 updated: 2017/01/21 11:12:16 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ +AC_CHECK_HEADERS( \ +unistd.h \ +) AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf conftest* AC_TRY_RUN([ #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include #include -int main() +int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/config.guess Thu Feb 2 20:00:01 2017 (r313105) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-10-02' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." Modified: head/contrib/byacc/config.sub ============================================================================== --- head/contrib/byacc/config.sub Thu Feb 2 19:56:41 2017 (r313104) +++ head/contrib/byacc/config.sub Thu Feb 2 20:00:01 2017 (r313105) @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-11-19' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ Report bugs and patches to &5 +for ac_header in \ +unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:3919: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3925 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:3929: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3935: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:3954: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3922,15 +3972,18 @@ if test "$cross_compiling" = yes; then cf_cv_func_mkstemp=maybe else cat >conftest.$ac_ext <<_ACEOF -#line 3925 "configure" +#line 3975 "configure" #include "confdefs.h" #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include #include -int main() +int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; @@ -3960,15 +4013,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4016: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3966: \$? = $ac_status" >&5 + echo "$as_me:4019: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3968: \"$ac_try\"") >&5 + { (eval echo "$as_me:4021: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3971: \$? = $ac_status" >&5 + echo "$as_me:4024: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -3983,16 +4036,16 @@ rm -f core core.* *.core conftest$ac_exe fi fi -echo "$as_me:3986: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:4039: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xmaybe ; then - echo "$as_me:3989: checking for mkstemp" >&5 + echo "$as_me:4042: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3995 "configure" +#line 4048 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -4023,16 +4076,16 @@ f = mkstemp; /* workaround for ICC 12.0. } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4026: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4079: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4029: \$? = $ac_status" >&5 + echo "$as_me:4082: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4032: \"$ac_try\"") >&5 + { (eval echo "$as_me:4085: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4035: \$? = $ac_status" >&5 + echo "$as_me:4088: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -4042,7 +4095,7 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4045: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:4098: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 fi @@ -4057,13 +4110,13 @@ fi for ac_func in vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:4060: checking for $ac_func" >&5 +echo "$as_me:4113: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4066 "configure" +#line 4119 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -4094,16 +4147,16 @@ f = $ac_func; /* workaround for ICC 12.0 } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4097: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4150: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4100: \$? = $ac_status" >&5 + echo "$as_me:4153: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4103: \"$ac_try\"") >&5 + { (eval echo "$as_me:4156: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4106: \$? = $ac_status" >&5 + echo "$as_me:4159: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -4113,7 +4166,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4116: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:4169: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:4179: checking for maximum table size" >&5 echo $ECHO_N "checking for maximum table size... $ECHO_C" >&6 # Check whether --with-max-table-size or --without-max-table-size was given. @@ -4133,12 +4186,12 @@ if test "${with_max_table_size+set}" = s fi; if test -n "$with_max_table_size" then - echo "$as_me:4136: result: $with_max_table_size" >&5 + echo "$as_me:4189: result: $with_max_table_size" >&5 echo "${ECHO_T}$with_max_table_size" >&6 check=`expr "$with_max_table_size" + 0` if test "x$check" != "x$with_max_table_size" then - { { echo "$as_me:4141: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 + { { echo "$as_me:4194: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 echo "$as_me: error: invalid value for --with-max-table-size: $with_max_table_size" >&2;} { (exit 1); exit 1; }; } fi @@ -4148,11 +4201,11 @@ cat >>confdefs.h <&5 + echo "$as_me:4204: result: default" >&5 echo "${ECHO_T}default" >&6 fi -echo "$as_me:4155: checking if backtracking extension is wanted" >&5 +echo "$as_me:4208: checking if backtracking extension is wanted" >&5 echo $ECHO_N "checking if backtracking extension is wanted... $ECHO_C" >&6 # Check whether --enable-btyacc or --disable-btyacc was given. @@ -4160,7 +4213,7 @@ if test "${enable_btyacc+set}" = set; th enableval="$enable_btyacc" fi; -echo "$as_me:4163: result: $enable_btyacc" >&5 +echo "$as_me:4216: result: $enable_btyacc" >&5 echo "${ECHO_T}$enable_btyacc" >&6 if test "$enable_btyacc" = "yes"; then @@ -4175,7 +4228,7 @@ fi if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:4178: checking if you want to check for gcc warnings" >&5 +echo "$as_me:4231: checking if you want to check for gcc warnings" >&5 echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6 # Check whether --with-warnings or --without-warnings was given. @@ -4185,7 +4238,7 @@ if test "${with_warnings+set}" = set; th else cf_opt_with_warnings=no fi; -echo "$as_me:4188: result: $cf_opt_with_warnings" >&5 +echo "$as_me:4241: result: $cf_opt_with_warnings" >&5 echo "${ECHO_T}$cf_opt_with_warnings" >&6 if test "$cf_opt_with_warnings" != no ; then @@ -4207,10 +4260,10 @@ cat > conftest.i <&5 + { echo "$as_me:4263: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 + if { (eval echo "$as_me:4315: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4265: \$? = $ac_status" >&5 + echo "$as_me:4318: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4267: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:4320: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in @@ -4328,12 +4381,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in (linux*|gnu*) - echo "$as_me:4331: checking if this is really Intel C compiler" >&5 + echo "$as_me:4384: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 4336 "configure" +#line 4389 "configure" #include "confdefs.h" int @@ -4350,16 +4403,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4353: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4406: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4356: \$? = $ac_status" >&5 + echo "$as_me:4409: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4359: \"$ac_try\"") >&5 + { (eval echo "$as_me:4412: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4362: \$? = $ac_status" >&5 + echo "$as_me:4415: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" @@ -4370,7 +4423,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4373: result: $INTEL_COMPILER" >&5 + echo "$as_me:4426: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac @@ -4379,12 +4432,12 @@ fi CLANG_COMPILER=no if test "$GCC" = yes ; then - echo "$as_me:4382: checking if this is really Clang C compiler" >&5 + echo "$as_me:4435: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF -#line 4387 "configure" +#line 4440 "configure" #include "confdefs.h" int @@ -4401,16 +4454,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4404: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4457: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4407: \$? = $ac_status" >&5 + echo "$as_me:4460: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4410: \"$ac_try\"") >&5 + { (eval echo "$as_me:4463: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4413: \$? = $ac_status" >&5 + echo "$as_me:4466: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" @@ -4421,12 +4474,12 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4424: result: $CLANG_COMPILER" >&5 + echo "$as_me:4477: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi cat > conftest.$ac_ext <&5 + { echo "$as_me:4499: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -4459,12 +4512,12 @@ echo "$as_me: checking for $CC warning o wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4462: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4515: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4465: \$? = $ac_status" >&5 + echo "$as_me:4518: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4467: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4520: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -4473,7 +4526,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:4476: checking for $CC warning options..." >&5 + { echo "$as_me:4529: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -4497,12 +4550,12 @@ echo "$as_me: checking for $CC warning o Wundef $cf_gcc_warnings $cf_warn_CONST Wwrite-strings do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4500: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4553: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4503: \$? = $ac_status" >&5 + echo "$as_me:4556: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4505: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4558: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in (Wcast-qual) @@ -4513,7 +4566,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4516: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4569: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4523,7 +4576,7 @@ echo "${as_me:-configure}:4516: testing ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4526: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4579: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4539,7 +4592,7 @@ rm -rf conftest* fi fi -echo "$as_me:4542: checking if you want to see long compiling messages" >&5 +echo "$as_me:4595: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -4573,10 +4626,10 @@ else ECHO_CC='' fi; -echo "$as_me:4576: result: $enableval" >&5 +echo "$as_me:4629: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 -echo "$as_me:4579: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:4632: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. @@ -4593,7 +4646,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:4596: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:4649: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in @@ -4687,23 +4740,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:4690: checking for dmalloc.h" >&5 + echo "$as_me:4743: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4696 "configure" +#line 4749 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4700: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4753: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4706: \$? = $ac_status" >&5 + echo "$as_me:4759: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4722,11 +4775,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4725: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:4778: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then -echo "$as_me:4729: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:4782: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4734,7 +4787,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4737 "configure" +#line 4790 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4753,16 +4806,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4756: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4809: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4759: \$? = $ac_status" >&5 + echo "$as_me:4812: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4762: \"$ac_try\"") >&5 + { (eval echo "$as_me:4815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4765: \$? = $ac_status" >&5 + echo "$as_me:4818: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -4773,7 +4826,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4776: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:4829: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <&5 +echo "$as_me:4844: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. @@ -4805,7 +4858,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:4808: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:4861: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in @@ -4899,23 +4952,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:4902: checking for dbmalloc.h" >&5 + echo "$as_me:4955: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4908 "configure" +#line 4961 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4912: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4965: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4918: \$? = $ac_status" >&5 + echo "$as_me:4971: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4934,11 +4987,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4937: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:4990: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then -echo "$as_me:4941: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:4994: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4946,7 +4999,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4949 "configure" +#line 5002 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4965,16 +5018,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4968: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5021: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4971: \$? = $ac_status" >&5 + echo "$as_me:5024: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4974: \"$ac_try\"") >&5 + { (eval echo "$as_me:5027: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4977: \$? = $ac_status" >&5 + echo "$as_me:5030: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -4985,7 +5038,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4988: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:5041: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <&5 +echo "$as_me:5056: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. @@ -5017,7 +5070,7 @@ EOF else with_valgrind= fi; -echo "$as_me:5020: result: ${with_valgrind:-no}" >&5 +echo "$as_me:5073: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in @@ -5110,7 +5163,7 @@ fi ;; esac -echo "$as_me:5113: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:5166: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. @@ -5120,7 +5173,7 @@ if test "${enable_leaks+set}" = set; the else : ${with_no_leaks:=no} fi; -echo "$as_me:5123: result: $with_no_leaks" >&5 +echo "$as_me:5176: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then @@ -5137,7 +5190,7 @@ fi # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 -echo "$as_me:5140: checking for $ac_word" >&5 +echo "$as_me:5193: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5154,7 +5207,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5157: found $ac_dir/$ac_word" >&5 + echo "$as_me:5210: found $ac_dir/$ac_word" >&5 break fi done @@ -5166,16 +5219,16 @@ fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then - echo "$as_me:5169: result: $GROFF_PATH" >&5 + echo "$as_me:5222: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else - echo "$as_me:5172: result: no" >&5 + echo "$as_me:5225: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "nroff", so it can be a program name with args. set dummy nroff; ac_word=$2 -echo "$as_me:5178: checking for $ac_word" >&5 +echo "$as_me:5231: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5192,7 +5245,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5195: found $ac_dir/$ac_word" >&5 + echo "$as_me:5248: found $ac_dir/$ac_word" >&5 break fi done @@ -5204,10 +5257,10 @@ fi NROFF_PATH=$ac_cv_path_NROFF_PATH if test -n "$NROFF_PATH"; then - echo "$as_me:5207: result: $NROFF_PATH" >&5 + echo "$as_me:5260: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else - echo "$as_me:5210: result: no" >&5 + echo "$as_me:5263: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -5220,7 +5273,7 @@ else GROFF_NOTE= fi -echo "$as_me:5223: checking for program to convert manpage to html" >&5 +echo "$as_me:5276: checking for program to convert manpage to html" >&5 echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 # Check whether --with-man2html or --without-man2html was given. @@ -5235,11 +5288,11 @@ cf_with_groff=no case $cf_man2html in (yes) - echo "$as_me:5238: result: man2html" >&5 + echo "$as_me:5291: result: man2html" >&5 echo "${ECHO_T}man2html" >&6 # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 -echo "$as_me:5242: checking for $ac_word" >&5 +echo "$as_me:5295: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 2 20:01:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD8D0CCDE11; Thu, 2 Feb 2017 20:01:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3AA1152; Thu, 2 Feb 2017 20:01:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12K1sLj059125; Thu, 2 Feb 2017 20:01:54 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12K1s0Q059124; Thu, 2 Feb 2017 20:01:54 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201702022001.v12K1s0Q059124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 2 Feb 2017 20:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313106 - head/usr.bin/yacc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 20:01:55 -0000 Author: jkim Date: Thu Feb 2 20:01:54 2017 New Revision: 313106 URL: https://svnweb.freebsd.org/changeset/base/313106 Log: Update byacc regression tests to match 20170201. Modified: head/usr.bin/yacc/tests/Makefile Modified: head/usr.bin/yacc/tests/Makefile ============================================================================== --- head/usr.bin/yacc/tests/Makefile Thu Feb 2 20:00:01 2017 (r313105) +++ head/usr.bin/yacc/tests/Makefile Thu Feb 2 20:01:54 2017 (r313106) @@ -25,6 +25,9 @@ FILEStestDIR= ${TESTSDIR} FILEStest+= btyacc_calc1.y FILEStest+= btyacc_demo.y +FILEStest+= btyacc_destroy1.y +FILEStest+= btyacc_destroy2.y +FILEStest+= btyacc_destroy3.y FILEStest+= calc.y FILEStest+= calc1.y FILEStest+= calc2.y @@ -69,6 +72,7 @@ FILEStest+= err_syntax8.y FILEStest+= err_syntax8a.y FILEStest+= err_syntax9.y FILEStest+= error.y +FILEStest+= expr.oxout.y FILEStest+= grammar.y FILEStest+= inherit0.y FILEStest+= inherit1.y @@ -242,6 +246,10 @@ FILEStest_yacc+= error.error FILEStest_yacc+= error.output FILEStest_yacc+= error.tab.c FILEStest_yacc+= error.tab.h +FILEStest_yacc+= expr.oxout.error +FILEStest_yacc+= expr.oxout.output +FILEStest_yacc+= expr.oxout.tab.c +FILEStest_yacc+= expr.oxout.tab.h FILEStest_yacc+= grammar.dot FILEStest_yacc+= grammar.error FILEStest_yacc+= grammar.output From owner-svn-src-head@freebsd.org Thu Feb 2 20:29:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D30CCC5F5; Thu, 2 Feb 2017 20:29:13 +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 9B6001E8A; Thu, 2 Feb 2017 20:29:12 +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 8931F10559F; Fri, 3 Feb 2017 07:29:05 +1100 (AEDT) Date: Fri, 3 Feb 2017 07:29:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: <20170202184819.GP2092@kib.kiev.ua> Message-ID: <20170203062806.A2690@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170202184819.GP2092@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=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=gxlKNWXeVbEL2LKZ7v0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 20:29:14 -0000 On Thu, 2 Feb 2017, Konstantin Belousov wrote: > On Tue, Jan 31, 2017 at 03:26:32AM +0000, Conrad E. Meyer wrote: >> + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ > > BTW, new gcc has -mcrc32 option, but clang 3.9.1 apparently does not. I've almost finished fixing and optimizing this. I didn't manage to fix all the compiler pessimizations, but the result is within 5% of optimal for buffers larger than a few K. See the previous patch for -msse4 removal. It might be good to add -fno-unroll-functions to CFLAGS to prevent some clang pessimizations. Or -Os might work even better. X Index: libkern/x86/crc32_sse42.c X =================================================================== X --- libkern/x86/crc32_sse42.c (revision 313090) X +++ libkern/x86/crc32_sse42.c (working copy) X @@ -31,15 +31,41 @@ X */ X #ifdef USERSPACE_TESTING X #include X +#include X #else X #include X +#include X #include X -#include X -#include X #endif X X -#include X +static __inline uint32_t X +_mm_crc32_u8(uint32_t x, uint8_t y) X +{ X + /* X + * clang (at least 3.9.[0-1]) pessimizes "rm" (y) and "m" (y) X + * significantly and "r" (y) a lot by copying y to a different X + * local variable (on the stack or in a register), so only use X + * the latter. This costs a register and an instruction but X + * not a uop. X + */ X + __asm("crc32b %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} I haven't found a better fix. Even gcc likes to pessimize this by preferring the "r" constraint in "rm", so "r" should be disparaged. It does this to try to schedule loop control instructions in beteen the memory reference and the operation using it, but it gets this scheduling mostly wrong. -Os stops this for gcc, but clang keeps producing the large and slow explicit load (then a store to a different place in memory to use there if the constraint allows "m") even with -Os. X X +static __inline uint32_t X +_mm_crc32_u32(uint32_t x, uint32_t y) X +{ X + __asm("crc32l %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} X + X +static __inline uint64_t X +_mm_crc32_u64(uint64_t x, uint64_t y) X +{ X + __asm("crc32q %1,%0" : "+r" (x) : "r" (y)); X + return (x); X +} X + X /* CRC-32C (iSCSI) polynomial in reversed bit order. */ X #define POLY 0x82f63b78 X X @@ -47,12 +73,14 @@ X * Block sizes for three-way parallel crc computation. LONG and SHORT must X * both be powers of two. X */ X -#define LONG 8192 X -#define SHORT 256 X +#define LONG 128 X +#define SHORT 64 These are now the smallest that work right on Haswell. Practical values should be larger in case the timing is to different for the manual scheduling to work. Small buffers are still slow, so LONG = SHORT = 1024 (with no LONG loop) would be a good practical value, except for the annoying problem that the 3-way optimization doesn't work so well for normal power-of-2 buffer sizes. LONG = SHORT = 1024 is perfect for buffer sizes of a multiple of 3K. It does 4K as 3K + 1K, with the 3K part optimized and the 1K part unoptimized and taking as long as the 3K part. LONG = 1024 with SHORT = 64 does the residual 1K at almost full speed except for another residual of 192. X X /* Tables for hardware crc that shift a crc by LONG and SHORT zeros. */ X static uint32_t crc32c_long[4][256]; X +static uint32_t crc32c_2long[4][256]; X static uint32_t crc32c_short[4][256]; X +static uint32_t crc32c_2short[4][256]; X X /* X * Multiply a matrix times a vector over the Galois field of two elements, X @@ -171,7 +199,9 @@ X crc32c_init_hw(void) X { X crc32c_zeros(crc32c_long, LONG); X + crc32c_zeros(crc32c_2long, 2 * LONG); X crc32c_zeros(crc32c_short, SHORT); X + crc32c_zeros(crc32c_2short, 2 * SHORT); X } X #ifdef _KERNEL X SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32c_init_hw, NULL); X @@ -190,7 +220,11 @@ X const size_t align = 4; X #endif X const unsigned char *next, *end; X - uint64_t crc0, crc1, crc2; /* need to be 64 bits for crc32q */ X +#ifdef __amd64__ X + uint64_t crc0, crc1, crc2; X +#else X + uint32_t crc0, crc1, crc2; X +#endif X X next = buf; X crc0 = crc; The type system doesn't work well here. The crc32* instruction returns a 32-bit value in a register of unclear size. I think it is zero extended to full width, but my asms aren't written quite right to say this and neither are the instrinsics. The 64-bit intrinsic returns a 64-bit value which just gets in the way. The above has to declare the type as uint64_t for amd64, else pessimizations result. That gives smaller pessimizations, mainly with gcc, for expressions like (crc0 >> 24) where the 64-bit declaration doesn't make it clear that the top bits are zero, so extra zeroing operations may be necessary. I have barely tested the 32-bit case, but the 64-bit type is clearly wasted then (but easier to optimize away since no crc intrinsic returns it). LONG and SHORT should be about half as large in the 32-bit case, since they should scale with the number of crc32 operations in the inner loop. X @@ -202,6 +236,7 @@ X len--; X } X X +#if LONG > SHORT X /* X * Compute the crc on sets of LONG*3 bytes, executing three independent X * crc instructions, each on LONG bytes -- this is optimized for the X @@ -209,6 +244,7 @@ X * have a throughput of one crc per cycle, but a latency of three X * cycles. X */ X + crc = 0; X while (len >= LONG * 3) { X crc1 = 0; X crc2 = 0; X @@ -229,16 +265,64 @@ X #endif X next += align; X } while (next < end); X - crc0 = crc32c_shift(crc32c_long, crc0) ^ crc1; X - crc0 = crc32c_shift(crc32c_long, crc0) ^ crc2; X + /*- X + * Update the crc. Try to do it in parallel with the inner X + * loop. 'crc' is used to accumulate crc0 and crc1 X + * produced by the inner loop so that the next iteration X + * of the loop doesn't depend on anything except crc2. X + * X + * The full expression for the update is: X + * crc = S*S*S*crc + S*S*crc0 + S*crc1 X + * where the terms are polynomials modulo the CRC polynomial. X + * We regroup this subtly as: X + * crc = S*S * (S * crc + crc0) + S*crc1. X + * This has an extra dependency which reduces possible X + * parallelism for the expression, but it turns out to be X + * best to intentionally delay evaluation of this expression X + * so that it competes less with the inner loop. X + * X + * We also intentionally reduce parallelism by feedng back X + * crc2 to the inner loop as crc0 instead of accumulating X + * it in crc. This synchronizes the loop with crc update. X + * CPU and/or compiler schedulers produced bad order without X + * this. X + * X + * Shifts take about 12 cycles each, so 3 here with 2 X + * parallelizable take about 24 cycles and the crc update X + * takes slightly longer. 8 dependent crc32 instructions X + * can run in 24 cycles, so the 3-way blocking is worse X + * than useless for sizes less than 8 * = 64 X + * on amd64. In practice, SHORT = 32 confirms these X + * timing calculations by giving a small improvement X + * starting at size 96. Then the inner loop takes about X + * 12 cycles and the crc update about 24, but these are X + * partly in parallel so the total time is less than the X + * 36 cycles that 12 dependent crc32 instructions would X + * take. X + * X + * To have a chance of completely hiding the overhead for X + * the crc update, the inner loop must take considerably X + * longer than 24 cycles. LONG = 64 makes the inner loop X + * take about 24 cycles, so is not quite large enough. X + * LONG = 128 works OK. Unhideable overheads are about X + * 12 cycles per inner loop. All assuming timing like X + * Haswell. X + */ X + crc = crc32c_shift(crc32c_long, crc) ^ crc0; X + crc1 = crc32c_shift(crc32c_long, crc1); X + crc = crc32c_shift(crc32c_2long, crc) ^ crc1; X + crc0 = crc2; X next += LONG * 2; X len -= LONG * 3; X } X + crc0 ^= crc; X +#endif /* LONG > SHORT */ See the comment. Optimizing this was similar to optimizing polynomial expressions in libm. Higher power of S are best avoided, since the parallelism for combining results is limited. X X /* X * Do the same thing, but now on SHORT*3 blocks for the remaining data X * less than a LONG*3 block X */ X + crc = 0; X while (len >= SHORT * 3) { X crc1 = 0; X crc2 = 0; X @@ -259,11 +343,14 @@ X #endif X next += align; X } while (next < end); X - crc0 = crc32c_shift(crc32c_short, crc0) ^ crc1; X - crc0 = crc32c_shift(crc32c_short, crc0) ^ crc2; X + crc = crc32c_shift(crc32c_short, crc) ^ crc0; X + crc1 = crc32c_shift(crc32c_short, crc1); X + crc = crc32c_shift(crc32c_2short, crc) ^ crc1; X + crc0 = crc2; A simpler method that almost works is: crc0 = crc32c_shift(crc32c_2short, crc0); crc1 = crc32c_shift(crc32c_short, crc1); /* crc2 unchanged, and crc not used. */ These updates run in parallel, so the inner loop only has to wait half as long to restart. With the old SHORT = 256, the timing was approx. 96 cycles for the inner loop, then 24 cycles for the CRC update (33% overhead). This simpler change reduces the overhead to 17%). With the new LONG = 128, the inner loop takes about 48 cycles and the update about 24, mostly in parallel so that they have zero overhead except for the last iteration. Compiler "optimizations" of rearranging this code tend to break the parallelism. X next += SHORT * 2; X len -= SHORT * 3; X } X + crc0 ^= crc; X X /* Compute the crc on the remaining bytes at native word size. */ X end = next + (len - (len & (align - 1))); Bruce From owner-svn-src-head@freebsd.org Thu Feb 2 20:30:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFF3CCC780; Thu, 2 Feb 2017 20:30:52 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57D7C7; Thu, 2 Feb 2017 20:30:51 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12KUpqS072621; Thu, 2 Feb 2017 20:30:51 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12KUoxk072619; Thu, 2 Feb 2017 20:30:50 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201702022030.v12KUoxk072619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Thu, 2 Feb 2017 20:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313107 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 20:30:52 -0000 Author: danfe (ports committer) Date: Thu Feb 2 20:30:50 2017 New Revision: 313107 URL: https://svnweb.freebsd.org/changeset/base/313107 Log: Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8) There is one capability explicitly documented in gettytab(5) as stupid: he. And it is indeed. It was meant to facilitate system hostname modification, but is hardly usable in practice because it allows very limited editing (e.g., it depends on a particular hostname length, making it non-generic). Replace it with simple implementation that treats ``he'' as POSIX extended regular expression which is matched against the hostname. If there are no parenthesized subexpressions in the pattern, entire matched string is used as the final hostname. Otherwise, use the first matched subexpression. If the pattern does not match, the original hostname is not modified. Using regex(3) gives more freedom, does not complicate the code very much, and makes a lot more sense, in turn making ``he'' less stupid and actually useful (e.g., it is now possible to obtain node or domain names from the original hostname string, without knowing it in advance). Reviewed by: jilles, manpages (wblock) Approved by: jilles (implied) Differential Revision: https://reviews.freebsd.org/D9244 Modified: head/libexec/getty/gettytab.5 head/libexec/getty/subr.c Modified: head/libexec/getty/gettytab.5 ============================================================================== --- head/libexec/getty/gettytab.5 Thu Feb 2 20:01:54 2017 (r313106) +++ head/libexec/getty/gettytab.5 Thu Feb 2 20:30:50 2017 (r313107) @@ -28,7 +28,7 @@ .\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" " -.Dd April 19, 1994 +.Dd February 2, 2017 .Dt GETTYTAB 5 .Os .Sh NAME @@ -118,7 +118,7 @@ character .Em NOT hangup line on last close .It "he str" Ta Dv NULL Ta -.No "hostname editing string" +.No "hostname editing regular expression" .It "hn str hostname hostname" .It "ht bool false terminal has real tabs" .It "hw bool false do cts/rts hardware flow control" @@ -302,18 +302,13 @@ but may also be overridden by the table entry. In either case it may be edited with the .Va \&he -string. -A '@' in the -.Va \&he -string causes one character from the real hostname to -be copied to the final hostname. -A '#' in the -.Va \&he -string causes the next character of the real hostname -to be skipped. -Each character that -is neither '@' nor '#' is copied into the final hostname. -Surplus '@' and '#' characters are ignored. +POSIX +.Dq extended +regular expression, which is matched against the hostname. +If there are no parenthesized subexpressions in the pattern, +the entire matched string is used as the final hostname; +otherwise, the first matched subexpression is used instead. +If the pattern does not match, the original hostname is not modified. .It \&%t The tty name. .It "\&%m, \&%r, \&%s, \&%v" @@ -528,10 +523,6 @@ of the delay algorithms are not implemen The terminal driver should support sane delay settings. .Pp The -.Va \&he -capability is stupid. -.Pp -The .Xr termcap 5 format is horrid, something more rational should have been chosen. Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Thu Feb 2 20:01:54 2017 (r313106) +++ head/libexec/getty/subr.c Thu Feb 2 20:30:50 2017 (r313107) @@ -43,6 +43,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -53,8 +54,6 @@ static const char rcsid[] = #include "pathnames.h" #include "extern.h" - - /* * Get a table entry. */ @@ -469,42 +468,48 @@ adelay(int ms, struct delayval *dp) char editedhost[MAXHOSTNAMELEN]; void -edithost(const char *pat) +edithost(const char *pattern) { - const char *host = HN; - char *res = editedhost; - - if (!pat) - pat = ""; - while (*pat) { - switch (*pat) { - - case '#': - if (*host) - host++; - break; - - case '@': - if (*host) - *res++ = *host++; - break; - - default: - *res++ = *pat; - break; + regex_t regex; + regmatch_t *match; + int found; + + if (pattern == NULL || *pattern == '\0') + goto copyasis; + if (regcomp(®ex, pattern, REG_EXTENDED) != 0) + goto copyasis; + + match = calloc(regex.re_nsub + 1, sizeof(*match)); + if (match == NULL) { + regfree(®ex); + goto copyasis; + } + + found = !regexec(®ex, HN, regex.re_nsub + 1, match, 0); + if (found) { + size_t subex, totalsize; - } - if (res == &editedhost[sizeof editedhost - 1]) { - *res = '\0'; - return; - } - pat++; - } - if (*host) - strncpy(res, host, sizeof editedhost - (res - editedhost) - 1); - else - *res = '\0'; - editedhost[sizeof editedhost - 1] = '\0'; + /* + * We found a match. If there were no parenthesized + * subexpressions in the pattern, use entire matched + * string as ``editedhost''; otherwise use the first + * matched subexpression. + */ + subex = !!regex.re_nsub; + totalsize = match[subex].rm_eo - match[subex].rm_so + 1; + strlcpy(editedhost, HN + match[subex].rm_so, totalsize > + sizeof(editedhost) ? sizeof(editedhost) : totalsize); + } + free(match); + regfree(®ex); + if (found) + return; + /* + * In case of any errors, or if the pattern did not match, pass + * the original hostname as is. + */ + copyasis: + strlcpy(editedhost, HN, sizeof(editedhost)); } static struct speedtab { From owner-svn-src-head@freebsd.org Thu Feb 2 21:51:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91CAECCECFC; Thu, 2 Feb 2017 21:51:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44495C56; Thu, 2 Feb 2017 21:51:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id s58so265898qtc.2; Thu, 02 Feb 2017 13:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=S47RtRQKaix79LcFk5wQXomJ8MAmUXBX11ol1ccla8k=; b=MPrx4S4ObgzMyuV8fELj3Ge6DAPNxiFLbStLwWh3MSO6fC4Z6mP6D9yUllS53EsS9c OxIdXYlgKguUfdt4IFuWMh2yTYXCNumd8qFo12Ad36+5DlxMjcJHQ5s8WZnT9HSX5BDG qDMwZCuxogPH+6LH0RNsMyObkeHfZ/S1PF/agprRAc1WPZ3lEAHEZsOJdKzxdccCuOXJ 3BtkS1XL1QlwqFEUPV+wctmqm+hScXdmr+KzhmN2PRi0Xwtu1p88q3twOCiEUCBtLsVg gA8nWrhMwUskRwbsXutSD7sniIY/Zb7OZjeQfMh7PqN9S9S5mDh0TQRanRK8lAlIWZSt L6pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=S47RtRQKaix79LcFk5wQXomJ8MAmUXBX11ol1ccla8k=; b=TekTboP1D/K0dJWNeD+1PNO0mymz9VoX8gY+kdVolRzaKLJtzHVlxvgwVUDonLtgfM uiXFiYATxQjgMgPg6W+HZoiFxSVQoyDyDI8ZApbUM/cJ1SXHSUPHp+FjGQaSjBkiSf8e CkI5K10VNXb1j4ko/bfS/W0aJm1ukVI723HIyA3wth4thXaMkf7hsX4R2hahWvXooNLi 0myDgqf2Sul80PDzS/skRaN6D5KuiCDpFQWZF9ZdejAKxSumzdSJ3kPxHmrVMNd0JpOH gLd08pX3VDvggH2U1K03aZIvB9PgJfkis3i6CGs5D8/hZUAlWFCRJfzFh/bhdig8IL3X YHWg== X-Gm-Message-State: AIkVDXLl1FPFxi5mYnP2PlMMMvfrgONMEsWrqELVxjKWsOAzRq5IfVLluVmonRmZf334k4YrkvEU2JS4xFOIcQ== X-Received: by 10.200.36.207 with SMTP id t15mr10467707qtt.84.1486072288412; Thu, 02 Feb 2017 13:51:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.84.230 with HTTP; Thu, 2 Feb 2017 13:51:28 -0800 (PST) In-Reply-To: <201702021956.v12JufOv057273@repo.freebsd.org> References: <201702021956.v12JufOv057273@repo.freebsd.org> From: Ngie Cooper Date: Thu, 2 Feb 2017 13:51:28 -0800 Message-ID: Subject: Re: svn commit: r313104 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump To: Gleb Smirnoff 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 21:51:29 -0000 On Thu, Feb 2, 2017 at 11:56 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Feb 2 19:56:41 2017 > New Revision: 313104 > URL: https://svnweb.freebsd.org/changeset/base/313104 > > Log: > Reduce diff to upstream using HAVE_CAPSICUM instead of __FreeBSD__. It'll also > make it easier to upstream HAVE_CASPER patch. ... > -/* Casper library support available */ > -#undef HAVE_CASPER ... Hi glebius! Was removing this intentional? Thanks! -Ngie From owner-svn-src-head@freebsd.org Thu Feb 2 21:56:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D49CCED75; Thu, 2 Feb 2017 21:56:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::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 0CB34ECA; Thu, 2 Feb 2017 21:56:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x22b.google.com with SMTP id v23so2663602qtb.0; Thu, 02 Feb 2017 13:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=11jmnfDdnn5OGT0bx4mDVnHy9RUUpiYYYMBoA8eC3bA=; b=J8DH9sSwYrE0dTBKsggGq9AlpHqq/RJjJg+wZaw5w+0KVaio3qBz9feEXsR8q3Ysa4 RuSf3s6OTlGWy2jbrm+hg8CrT2JmsTbYtpE99Eh7aooaAtKLhKPWPL1PoViHEnCjLeOR nLEmFd295nJa4GFzRhW0KVzOQRDyGX4urGwQ/azqtwh3nFuqzddKW3uqBFoFWXCpxu0Q CfkLVgXG9FbuKGTAXKiTrER/x+TuJBMRzIWF38AaGRCxJLTcS+LYTn7Hp5C+1fBtw+qH CMqvRm6rZC0mFcunztySdzwUFB8CK6udqO4rUzkiVnLh4qpqqs79ENIHX98yyLDfYcRz O+iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=11jmnfDdnn5OGT0bx4mDVnHy9RUUpiYYYMBoA8eC3bA=; b=g9/g0BLoQLTj5YDZjLap0ntukQxDdYHFXs0q4iC1vhXtNOYDxnm8DRhH7V6OSUXthU 3eOlmvs/2PYxsN9C/4nyNXADxC/VAgCpqtTuzog9seSS7cYvSzt029JoN7qtdWZ80FTE uTYuCUOHecpzcP4eOOcM2JGgLYEXzzQ7Gim1b5eeaDamjeZAX/5bJzS1OnrxDaZ4hB5n tgScRp0B2rEPCKZxWTVVQ7v7qHaSDq6nBjqBK7O9bOq4BoGdmZxH/HTzPD+rKn4j6uUs 5qmdJjmhAmACjaJKsIix7QwzwSy+AeYkNtWLHuAcWLKDl8SomovqpEngY/ov3Gvx0o2n f9nQ== X-Gm-Message-State: AIkVDXI3prNKZ33qt8ceKaRYlQg5QpRhDq8RWnEkBn8tWYkmY2UG/p3AbxjdYEhxDX2jKOcnXFvzdhKXkiyiDQ== X-Received: by 10.200.36.207 with SMTP id t15mr10485955qtt.84.1486072592924; Thu, 02 Feb 2017 13:56:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.84.230 with HTTP; Thu, 2 Feb 2017 13:56:32 -0800 (PST) In-Reply-To: <201702022030.v12KUoxk072619@repo.freebsd.org> References: <201702022030.v12KUoxk072619@repo.freebsd.org> From: Ngie Cooper Date: Thu, 2 Feb 2017 13:56:32 -0800 Message-ID: Subject: Re: svn commit: r313107 - head/libexec/getty To: Alexey Dokuchaev 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 21:56:34 -0000 On Thu, Feb 2, 2017 at 12:30 PM, Alexey Dokuchaev wrote: > Author: danfe (ports committer) > Date: Thu Feb 2 20:30:50 2017 > New Revision: 313107 > URL: https://svnweb.freebsd.org/changeset/base/313107 > > Log: > Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8) > > There is one capability explicitly documented in gettytab(5) as stupid: he. > And it is indeed. It was meant to facilitate system hostname modification, > but is hardly usable in practice because it allows very limited editing > (e.g., it depends on a particular hostname length, making it non-generic). > > Replace it with simple implementation that treats ``he'' as POSIX extended > regular expression which is matched against the hostname. If there are no > parenthesized subexpressions in the pattern, entire matched string is used > as the final hostname. Otherwise, use the first matched subexpression. > If the pattern does not match, the original hostname is not modified. > > Using regex(3) gives more freedom, does not complicate the code very much, > and makes a lot more sense, in turn making ``he'' less stupid and actually > useful (e.g., it is now possible to obtain node or domain names from the > original hostname string, without knowing it in advance). > > Reviewed by: jilles, manpages (wblock) > Approved by: jilles (implied) > Differential Revision: https://reviews.freebsd.org/D9244 Cool! Does this deserve a "Relnotes: yes"? Thanks! -Ngie From owner-svn-src-head@freebsd.org Thu Feb 2 22:02:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8616ACCEFA9; Thu, 2 Feb 2017 22:02:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE1C13C8; Thu, 2 Feb 2017 22:02:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12M2Bkf010051; Thu, 2 Feb 2017 22:02:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12M2BQ0010048; Thu, 2 Feb 2017 22:02:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702022202.v12M2BQ0010048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 22:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313109 - in head/sys/i386: i386 isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 22:02:12 -0000 Author: kib Date: Thu Feb 2 22:02:10 2017 New Revision: 313109 URL: https://svnweb.freebsd.org/changeset/base/313109 Log: Use ANSI definitions for some i386 functions. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/isa/npx.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Feb 2 21:05:55 2017 (r313108) +++ head/sys/i386/i386/machdep.c Thu Feb 2 22:02:10 2017 (r313109) @@ -2164,8 +2164,7 @@ i386_kdb_init(void) } register_t -init386(first) - int first; +init386(int first) { struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Feb 2 21:05:55 2017 (r313108) +++ head/sys/i386/i386/vm_machdep.c Thu Feb 2 22:02:10 2017 (r313109) @@ -172,11 +172,7 @@ alloc_fpusave(int flags) * ready to run and return to user mode. */ void -cpu_fork(td1, p2, td2, flags) - register struct thread *td1; - register struct proc *p2; - struct thread *td2; - int flags; +cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) { register struct proc *p1; struct pcb *pcb2; Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Thu Feb 2 21:05:55 2017 (r313108) +++ head/sys/i386/isa/npx.c Thu Feb 2 22:02:10 2017 (r313109) @@ -542,8 +542,7 @@ SYSINIT(npxinitstate, SI_SUB_DRIVERS, SI * Free coprocessor (if we have it). */ void -npxexit(td) - struct thread *td; +npxexit(struct thread *td) { critical_enter(); @@ -573,7 +572,7 @@ npxexit(td) } int -npxformat() +npxformat(void) { if (!hw_float) @@ -953,7 +952,7 @@ npxresume(union savefpu *addr) } void -npxdrop() +npxdrop(void) { struct thread *td; @@ -1289,8 +1288,7 @@ fpu_clean_state(void) #endif /* CPU_ENABLE_SSE */ static void -fpurstor(addr) - union savefpu *addr; +fpurstor(union savefpu *addr) { #ifdef CPU_ENABLE_SSE From owner-svn-src-head@freebsd.org Thu Feb 2 22:19:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EBA1CCE1AC; Thu, 2 Feb 2017 22:19:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC1E1AF5; Thu, 2 Feb 2017 22:19:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A16FA635F; Thu, 2 Feb 2017 22:19:57 +0000 (UTC) Date: Thu, 2 Feb 2017 22:19:57 +0000 From: Alexey Dokuchaev To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r313107 - head/libexec/getty Message-ID: <20170202221957.GA82840@FreeBSD.org> References: <201702022030.v12KUoxk072619@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 22:19:58 -0000 On Thu, Feb 02, 2017 at 01:56:32PM -0800, Ngie Cooper wrote: > On Thu, Feb 2, 2017 at 12:30 PM, Alexey Dokuchaev wrote: > > Author: danfe (ports committer) > > Date: Thu Feb 2 20:30:50 2017 > > New Revision: 313107 > > URL: https://svnweb.freebsd.org/changeset/base/313107 > > > > Log: > > Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8) > > [...] > > > > Reviewed by: jilles, manpages (wblock) > > Approved by: jilles (implied) > > Differential Revision: https://reviews.freebsd.org/D9244 > > Cool! Does this deserve a "Relnotes: yes"? Not sure; I've thought of it, but eventually decided this change is too minor to warrant a dedicated release note, and none of the DR reviewers mentioned or requested it as well. ./danfe From owner-svn-src-head@freebsd.org Thu Feb 2 22:55:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E74CDCCEB4D; Thu, 2 Feb 2017 22:55:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CFCE01062; Thu, 2 Feb 2017 22:55:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v12MtPp0025101 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 14:55:25 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v12MtPT6025100; Thu, 2 Feb 2017 14:55:25 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Feb 2017 14:55:25 -0800 From: Gleb Smirnoff To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r313104 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump Message-ID: <20170202225525.GL3334@FreeBSD.org> References: <201702021956.v12JufOv057273@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 22:55:27 -0000 On Thu, Feb 02, 2017 at 01:51:28PM -0800, Ngie Cooper wrote: N> On Thu, Feb 2, 2017 at 11:56 AM, Gleb Smirnoff wrote: N> > Author: glebius N> > Date: Thu Feb 2 19:56:41 2017 N> > New Revision: 313104 N> > URL: https://svnweb.freebsd.org/changeset/base/313104 N> > N> > Log: N> > Reduce diff to upstream using HAVE_CAPSICUM instead of __FreeBSD__. It'll also N> > make it easier to upstream HAVE_CASPER patch. N> N> ... N> N> > -/* Casper library support available */ N> > -#undef HAVE_CASPER N> N> Hi glebius! N> Was removing this intentional? Yes. This define comes via Makefile. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Feb 2 23:04:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48A91CCED9D; Thu, 2 Feb 2017 23:04:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 188811672; Thu, 2 Feb 2017 23:04:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12N40BS035435; Thu, 2 Feb 2017 23:04:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12N409c035434; Thu, 2 Feb 2017 23:04:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702022304.v12N409c035434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 2 Feb 2017 23:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313111 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 23:04:01 -0000 Author: imp Date: Thu Feb 2 23:04:00 2017 New Revision: 313111 URL: https://svnweb.freebsd.org/changeset/base/313111 Log: Use aligned buffer for the firmware data. Otherwise, when loading a MAXPHYS bytes of data, the I/O would require MAXPHYS + PAGE_SIZE worth of pages to do the I/O and we'd hit an assertion in vm_fault_quick_hold_pages unless MAXPHYS was larger than 1M + PAGE_SIZE. Modified: head/sbin/nvmecontrol/firmware.c Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Thu Feb 2 23:01:29 2017 (r313110) +++ head/sbin/nvmecontrol/firmware.c Thu Feb 2 23:04:00 2017 (r313111) @@ -114,7 +114,7 @@ update_firmware(int fd, uint8_t *payload off = 0; resid = payload_size; - if ((chunk = malloc(NVME_MAX_XFER_SIZE)) == NULL) + if ((chunk = aligned_alloc(NVME_MAX_XFER_SIZE, PAGE_SIZE)) == NULL) errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE); while (resid > 0) { From owner-svn-src-head@freebsd.org Thu Feb 2 23:04:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54711CCEDDA; Thu, 2 Feb 2017 23:04:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23B6316B8; Thu, 2 Feb 2017 23:04:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12N46Rq035526; Thu, 2 Feb 2017 23:04:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12N460i035525; Thu, 2 Feb 2017 23:04:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702022304.v12N460i035525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 2 Feb 2017 23:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313113 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 23:04:07 -0000 Author: imp Date: Thu Feb 2 23:04:06 2017 New Revision: 313113 URL: https://svnweb.freebsd.org/changeset/base/313113 Log: Ensure that the passthrough request will fit in MAXPHYS bytes after it has been rounded to full pages. This avoids a panic in vm_fault_quick_hold_pages due to this off-by-one error passing one page too many into vmapbuf. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Feb 2 23:04:01 2017 (r313112) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Feb 2 23:04:06 2017 (r313113) @@ -874,8 +874,20 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c struct mtx *mtx; struct buf *buf = NULL; int ret = 0; + vm_offset_t addr, end; if (pt->len > 0) { + /* + * vmapbuf calls vm_fault_quick_hold_pages which only maps full + * pages. Ensure this request has fewer than MAXPHYS bytes when + * extended to full pages. + */ + addr = (vm_offset_t)pt->buf; + end = round_page(addr + pt->len); + addr = trunc_page(addr); + if (end - addr > MAXPHYS) + return EIO; + if (pt->len > ctrlr->max_xfer_size) { nvme_printf(ctrlr, "pt->len (%d) " "exceeds max_xfer_size (%d)\n", pt->len, From owner-svn-src-head@freebsd.org Fri Feb 3 03:22:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8FDCCE65E; Fri, 3 Feb 2017 03:22:48 +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 799EB1651; Fri, 3 Feb 2017 03:22:48 +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 v133Mlgj044463; Fri, 3 Feb 2017 03:22:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v133MlJr044461; Fri, 3 Feb 2017 03:22:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702030322.v133MlJr044461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 3 Feb 2017 03:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313133 - head/sys/cddl/dev/dtrace/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 03:22:49 -0000 Author: markj Date: Fri Feb 3 03:22:47 2017 New Revision: 313133 URL: https://svnweb.freebsd.org/changeset/base/313133 Log: Sync the x86 dis_tables.c with upstream. This corresponds to the following illumos issues: 5755 want support for Intel FMA instrs 5756 want support for Intel BMI1 instrs 5757 want support for Intel BMI2 instrs 5758 want support for Intel AVX2 instrs 7204 Want broadwell rdseed and adx support 7208 Want stac/clac disasm support 7733 Need SHA Instruction dis support 7756 dis can't handle x86 SSE 3 instructions 7757 want avx2 disasm tests 7758 want SSE 4.1 disasm tests MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c head/sys/cddl/dev/dtrace/x86/dis_tables.h Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Feb 3 01:32:04 2017 (r313132) +++ head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Feb 3 03:22:47 2017 (r313133) @@ -21,7 +21,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. */ /* @@ -87,6 +87,8 @@ typedef struct instable { uint_t it_always64:1; /* 64 bit when in 64 bit mode */ uint_t it_invalid32:1; /* invalid in IA32 */ uint_t it_stackop:1; /* push/pop stack operation */ + uint_t it_vexwoxmm:1; /* VEX instructions that don't use XMM/YMM */ + uint_t it_avxsuf:1; /* AVX suffix required */ } instable_t; /* @@ -219,6 +221,7 @@ enum { VEX_NONE, /* VEX no operand */ VEX_MO, /* VEX mod_rm -> implicit reg */ VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_VRMrX, /* VEX mod_rm, VEX.vvvv -> mod_rm */ VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ VEX_MX, /* VEX mod_rm -> mod_reg */ @@ -230,11 +233,16 @@ enum { VEX_RR, /* VEX mod_rm -> mod_reg */ VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RIM, /* VEX mod_reg, imm8 -> mod_rm */ VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ VEX_RMX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_SbVM, /* VEX SIB, VEX.vvvv -> mod_rm */ VMx, /* vmcall/vmlaunch/vmresume/vmxoff */ VMxo, /* VMx instruction with optional prefix */ - SVM /* AMD SVM instructions */ + SVM, /* AMD SVM instructions */ + BLS, /* BLSR, BLSMSK, BLSI */ + FMA, /* FMA instructions, all VEX_RMrX */ + ADX /* ADX instructions, support REX.w, mod_rm->mod_reg */ }; /* @@ -272,12 +280,14 @@ enum { * IND - indirect to another to another table * "T" - means to Terminate indirections (this is the final opcode) * "S" - means "operand length suffix required" + * "Sa" - means AVX2 suffix (d/q) required * "NS" - means "no suffix" which is the operand length suffix of the opcode * "Z" - means instruction size arg required * "u" - means the opcode is invalid in IA32 but valid in amd64 * "x" - means the opcode is invalid in amd64, but not IA32 * "y" - means the operand size is always 64 bits in 64 bit mode * "p" - means push/pop stack operation + * "vr" - means VEX instruction that operates on normal registers, not fpu */ #if defined(DIS_TEXT) && defined(DIS_MEM) @@ -290,11 +300,13 @@ enum { #define TNSyp(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0, 1} #define TNSZ(name, amode, sz) {TERM, amode, name, 0, sz, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, name, 0, sz, 0, 1, 0, 0} +#define TNSZvr(name, amode, sz) {TERM, amode, name, 0, sz, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, name, 1, 0, 0, 1, 0, 0} #define TSp(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 1} #define TSZ(name, amode, sz) {TERM, amode, name, 1, sz, 0, 0, 0, 0} +#define TSaZ(name, amode, sz) {TERM, amode, name, 1, sz, 0, 0, 0, 0, 0, 1} #define TSZx(name, amode, sz) {TERM, amode, name, 1, sz, 1, 0, 0, 0} #define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} @@ -308,11 +320,13 @@ enum { #define TNSyp(name, amode) {TERM, amode, name, 0, 0, 1, 0, 1} #define TNSZ(name, amode, sz) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, name, 0, 0, 1, 0, 0} +#define TNSZvr(name, amode, sz) {TERM, amode, name, 0, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, name, 1, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0} #define TSp(name, amode) {TERM, amode, name, 1, 0, 0, 0, 1} #define TSZ(name, amode, sz) {TERM, amode, name, 1, 0, 0, 0, 0} +#define TSaZ(name, amode, sz) {TERM, amode, name, 1, 0, 0, 0, 0, 0, 1} #define TSZx(name, amode, sz) {TERM, amode, name, 1, 1, 0, 0, 0} #define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} @@ -326,11 +340,13 @@ enum { #define TNSx(name, amode) {TERM, amode, 0, 1, 0, 0, 0} #define TNSZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} +#define TNSZvr(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, 0, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} #define TSp(name, amode) {TERM, amode, 0, 0, 0, 0, 1} #define TSZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0} +#define TSaZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0, 0, 1} #define TSZx(name, amode, sz) {TERM, amode, sz, 1, 0, 0, 0} #define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} @@ -344,11 +360,13 @@ enum { #define TNSx(name, amode) {TERM, amode, 1, 0, 0, 0} #define TNSZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, 0, 1, 0, 0} +#define TNSZvr(name, amode, sz) {TERM, amode, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, 0, 1, 0, 0} #define TSp(name, amode) {TERM, amode, 0, 0, 0, 1} #define TSZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0} +#define TSaZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0, 0, 1} #define TSZx(name, amode, sz) {TERM, amode, 1, 0, 0, 0} #define TSZy(name, amode, sz) {TERM, amode, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0} @@ -399,6 +417,12 @@ const char *const dis_addr64_mode12[16] const char *const dis_scale_factor[4] = { ")", ",2)", ",4)", ",8)" }; /* + * decode for scale from VSIB byte, note that we always include the scale factor + * to match gas. + */ +const char *const dis_vscale_factor[4] = { ",1)", ",2)", ",4)", ",8)" }; + +/* * register decoding for normal references to registers (ie. not addressing) */ const char *const dis_REG8[16] = { @@ -550,7 +574,7 @@ const instable_t dis_op0FC7[8] = { const instable_t dis_op0FC7m3[8] = { /* [0] */ INVALID, INVALID, INVALID, INVALID, -/* [4] */ INVALID, INVALID, TNS("rdrand",MG9), INVALID, +/* [4] */ INVALID, INVALID, TNS("rdrand",MG9), TNS("rdseed", MG9), }; /* @@ -669,7 +693,7 @@ const instable_t dis_opSIMDdata16[256] = /* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, /* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, /* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, -/* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), +/* [7C] */ TNSZ("haddpd",XMM,16), TNSZ("hsubpd",XMM,16), TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, @@ -696,7 +720,7 @@ const instable_t dis_opSIMDdata16[256] = /* [C8] */ INVALID, INVALID, INVALID, INVALID, /* [CC] */ INVALID, INVALID, INVALID, INVALID, -/* [D0] */ INVALID, TNSZ("psrlw",XMM,16), TNSZ("psrld",XMM,16), TNSZ("psrlq",XMM,16), +/* [D0] */ TNSZ("addsubpd",XMM,16),TNSZ("psrlw",XMM,16), TNSZ("psrld",XMM,16), TNSZ("psrlq",XMM,16), /* [D4] */ TNSZ("paddq",XMM,16), TNSZ("pmullw",XMM,16), TNSZ("movq",XMMS,8), TNS("pmovmskb",XMMX3), /* [D8] */ TNSZ("psubusb",XMM,16), TNSZ("psubusw",XMM,16), TNSZ("pminub",XMM,16), TNSZ("pand",XMM,16), /* [DC] */ TNSZ("paddusb",XMM,16), TNSZ("paddusw",XMM,16), TNSZ("pmaxub",XMM,16), TNSZ("pandn",XMM,16), @@ -803,7 +827,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [08] */ INVALID, INVALID, INVALID, INVALID, /* [0C] */ INVALID, INVALID, INVALID, INVALID, -/* [10] */ TNSZ("movsd",XMM,8), TNSZ("movsd",XMMS,8), INVALID, INVALID, +/* [10] */ TNSZ("movsd",XMM,8), TNSZ("movsd",XMMS,8), TNSZ("movddup",XMM,8), INVALID, /* [14] */ INVALID, INVALID, INVALID, INVALID, /* [18] */ INVALID, INVALID, INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, @@ -836,7 +860,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, /* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, -/* [7C] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("haddps",XMM,16), TNSZ("hsubps",XMM,16), INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, @@ -863,7 +887,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [C8] */ INVALID, INVALID, INVALID, INVALID, /* [CC] */ INVALID, INVALID, INVALID, INVALID, -/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D0] */ TNSZ("addsubps",XMM,16),INVALID, INVALID, INVALID, /* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, /* [D8] */ INVALID, INVALID, INVALID, INVALID, /* [DC] */ INVALID, INVALID, INVALID, INVALID, @@ -873,7 +897,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, -/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ TNS("lddqu",XMMM), INVALID, INVALID, INVALID, /* [F4] */ INVALID, INVALID, INVALID, INVALID, /* [F8] */ INVALID, INVALID, INVALID, INVALID, /* [FC] */ INVALID, INVALID, INVALID, INVALID, @@ -961,6 +985,251 @@ const instable_t dis_opAVXF20F[256] = { /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; +const instable_t dis_opAVXF20F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZvr("rorx",VEX_MXI,6),INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF20F38[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, TNSZvr("pdep",VEX_RMrX,5),TNSZvr("mulx",VEX_RMrX,5),TNSZvr("shrx",VEX_VRMrX,5), +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF30F38[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, TNSZvr("pext",VEX_RMrX,5),INVALID, TNSZvr("sarx",VEX_VRMrX,5), +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; /* * Decode table for SIMD instructions with the repz (0xf3) prefix. */ @@ -970,8 +1239,8 @@ const instable_t dis_opSIMDrepz[256] = { /* [08] */ INVALID, INVALID, INVALID, INVALID, /* [0C] */ INVALID, INVALID, INVALID, INVALID, -/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, -/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), TNSZ("movsldup",XMM,16),INVALID, +/* [14] */ INVALID, INVALID, TNSZ("movshdup",XMM,16),INVALID, /* [18] */ INVALID, INVALID, INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, @@ -1023,7 +1292,7 @@ const instable_t dis_opSIMDrepz[256] = { /* [B0] */ INVALID, INVALID, INVALID, INVALID, /* [B4] */ INVALID, INVALID, INVALID, INVALID, /* [B8] */ TS("popcnt",MRw), INVALID, INVALID, INVALID, -/* [BC] */ INVALID, TS("lzcnt",MRw), INVALID, INVALID, +/* [BC] */ TNSZ("tzcnt",MRw,5), TS("lzcnt",MRw), INVALID, INVALID, /* [C0] */ INVALID, INVALID, TNSZ("cmpss",XMMP,4), INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, @@ -1141,6 +1410,15 @@ const instable_t dis_op0F38F1[2] = { TS("movbe",MOVBE), }; +/* + * The following table is used to distinguish between adox and adcx which share + * the same opcodes. + */ +const instable_t dis_op0F38F6[2] = { +/* [00] */ TNS("adcx",ADX), + TNS("adox",ADX), +}; + const instable_t dis_op0F38[256] = { /* [00] */ TNSZ("pshufb",XMM_66o,16),TNSZ("phaddw",XMM_66o,16),TNSZ("phaddd",XMM_66o,16),TNSZ("phaddsw",XMM_66o,16), /* [04] */ TNSZ("pmaddubsw",XMM_66o,16),TNSZ("phsubw",XMM_66o,16), TNSZ("phsubd",XMM_66o,16),TNSZ("phsubsw",XMM_66o,16), @@ -1204,8 +1482,8 @@ const instable_t dis_op0F38[256] = { /* [C0] */ INVALID, INVALID, INVALID, INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, -/* [C8] */ INVALID, INVALID, INVALID, INVALID, -/* [CC] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ TNSZ("sha1nexte",XMM,16),TNSZ("sha1msg1",XMM,16),TNSZ("sha1msg2",XMM,16),TNSZ("sha256rnds2",XMM,16), +/* [CC] */ TNSZ("sha256msg1",XMM,16),TNSZ("sha256msg2",XMM,16),INVALID, INVALID, /* [D0] */ INVALID, INVALID, INVALID, INVALID, /* [D4] */ INVALID, INVALID, INVALID, INVALID, @@ -1217,7 +1495,7 @@ const instable_t dis_op0F38[256] = { /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, /* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, -/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, IND(dis_op0F38F6), INVALID, /* [F8] */ INVALID, INVALID, INVALID, INVALID, /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; @@ -1229,7 +1507,7 @@ const instable_t dis_opAVX660F38[256] = /* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), /* [10] */ INVALID, INVALID, INVALID, TNSZ("vcvtph2ps",VEX_MX,16), -/* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), +/* [14] */ INVALID, INVALID, TNSZ("vpermps",VEX_RMrX,16),TNSZ("vptest",VEX_RRI,16), /* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, /* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, @@ -1239,18 +1517,18 @@ const instable_t dis_opAVX660F38[256] = /* [2C] */ TNSZ("vmaskmovps",VEX_RMrX,8),TNSZ("vmaskmovpd",VEX_RMrX,16),TNSZ("vmaskmovps",VEX_RRM,8),TNSZ("vmaskmovpd",VEX_RRM,16), /* [30] */ TNSZ("vpmovzxbw",VEX_MX,16),TNSZ("vpmovzxbd",VEX_MX,16),TNSZ("vpmovzxbq",VEX_MX,16),TNSZ("vpmovzxwd",VEX_MX,16), -/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),INVALID, TNSZ("vpcmpgtq",VEX_RMrX,16), +/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),TNSZ("vpermd",VEX_RMrX,16),TNSZ("vpcmpgtq",VEX_RMrX,16), /* [38] */ TNSZ("vpminsb",VEX_RMrX,16),TNSZ("vpminsd",VEX_RMrX,16),TNSZ("vpminuw",VEX_RMrX,16),TNSZ("vpminud",VEX_RMrX,16), /* [3C] */ TNSZ("vpmaxsb",VEX_RMrX,16),TNSZ("vpmaxsd",VEX_RMrX,16),TNSZ("vpmaxuw",VEX_RMrX,16),TNSZ("vpmaxud",VEX_RMrX,16), /* [40] */ TNSZ("vpmulld",VEX_RMrX,16),TNSZ("vphminposuw",VEX_MX,16),INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, TSaZ("vpsrlv",VEX_RMrX,16),TNSZ("vpsravd",VEX_RMrX,16),TSaZ("vpsllv",VEX_RMrX,16), /* [48] */ INVALID, INVALID, INVALID, INVALID, /* [4C] */ INVALID, INVALID, INVALID, INVALID, /* [50] */ INVALID, INVALID, INVALID, INVALID, /* [54] */ INVALID, INVALID, INVALID, INVALID, -/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vpbroadcastd",VEX_MX,16),TNSZ("vpbroadcastq",VEX_MX,16),TNSZ("vbroadcasti128",VEX_MX,16),INVALID, /* [5C] */ INVALID, INVALID, INVALID, INVALID, /* [60] */ INVALID, INVALID, INVALID, INVALID, @@ -1260,28 +1538,28 @@ const instable_t dis_opAVX660F38[256] = /* [70] */ INVALID, INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("vpbroadcastb",VEX_MX,16),TNSZ("vpbroadcastw",VEX_MX,16),INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, -/* [8C] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ TSaZ("vpmaskmov",VEX_RMrX,16),INVALID, TSaZ("vpmaskmov",VEX_RRM,16),INVALID, -/* [90] */ INVALID, INVALID, INVALID, INVALID, -/* [94] */ INVALID, INVALID, INVALID, INVALID, -/* [98] */ INVALID, INVALID, INVALID, INVALID, -/* [9C] */ INVALID, INVALID, INVALID, INVALID, +/* [90] */ TNSZ("vpgatherd",VEX_SbVM,16),TNSZ("vpgatherq",VEX_SbVM,16),TNSZ("vgatherdp",VEX_SbVM,16),TNSZ("vgatherqp",VEX_SbVM,16), +/* [94] */ INVALID, INVALID, TNSZ("vfmaddsub132p",FMA,16),TNSZ("vfmsubadd132p",FMA,16), +/* [98] */ TNSZ("vfmadd132p",FMA,16),TNSZ("vfmadd132s",FMA,16),TNSZ("vfmsub132p",FMA,16),TNSZ("vfmsub132s",FMA,16), +/* [9C] */ TNSZ("vfnmadd132p",FMA,16),TNSZ("vfnmadd132s",FMA,16),TNSZ("vfnmsub132p",FMA,16),TNSZ("vfnmsub132s",FMA,16), /* [A0] */ INVALID, INVALID, INVALID, INVALID, -/* [A4] */ INVALID, INVALID, INVALID, INVALID, -/* [A8] */ INVALID, INVALID, INVALID, INVALID, -/* [AC] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, TNSZ("vfmaddsub213p",FMA,16),TNSZ("vfmsubadd213p",FMA,16), +/* [A8] */ TNSZ("vfmadd213p",FMA,16),TNSZ("vfmadd213s",FMA,16),TNSZ("vfmsub213p",FMA,16),TNSZ("vfmsub213s",FMA,16), +/* [AC] */ TNSZ("vfnmadd213p",FMA,16),TNSZ("vfnmadd213s",FMA,16),TNSZ("vfnmsub213p",FMA,16),TNSZ("vfnmsub213s",FMA,16), /* [B0] */ INVALID, INVALID, INVALID, INVALID, -/* [B4] */ INVALID, INVALID, INVALID, INVALID, -/* [B8] */ INVALID, INVALID, INVALID, INVALID, -/* [BC] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, TNSZ("vfmaddsub231p",FMA,16),TNSZ("vfmsubadd231p",FMA,16), +/* [B8] */ TNSZ("vfmadd231p",FMA,16),TNSZ("vfmadd231s",FMA,16),TNSZ("vfmsub231p",FMA,16),TNSZ("vfmsub231s",FMA,16), +/* [BC] */ TNSZ("vfnmadd231p",FMA,16),TNSZ("vfnmadd231s",FMA,16),TNSZ("vfnmsub231p",FMA,16),TNSZ("vfnmsub231s",FMA,16), /* [C0] */ INVALID, INVALID, INVALID, INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, @@ -1298,7 +1576,7 @@ const instable_t dis_opAVX660F38[256] = /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, /* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, -/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, TNSZvr("shlx",VEX_VRMrX,5), /* [F8] */ INVALID, INVALID, INVALID, INVALID, /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; @@ -1367,7 +1645,7 @@ const instable_t dis_op0F3A[256] = { /* [C0] */ INVALID, INVALID, INVALID, INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, /* [C8] */ INVALID, INVALID, INVALID, INVALID, -/* [CC] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ TNSZ("sha1rnds4",XMMP,16),INVALID, INVALID, INVALID, /* [D0] */ INVALID, INVALID, INVALID, INVALID, /* [D4] */ INVALID, INVALID, INVALID, INVALID, @@ -1386,7 +1664,7 @@ const instable_t dis_op0F3A[256] = { }; const instable_t dis_opAVX660F3A[256] = { -/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [00] */ TNSZ("vpermq",VEX_MXI,16),TNSZ("vpermpd",VEX_MXI,16),TNSZ("vpblendd",VEX_RMRX,16),INVALID, /* [04] */ TNSZ("vpermilps",VEX_MXI,8),TNSZ("vpermilpd",VEX_MXI,16),TNSZ("vperm2f128",VEX_RMRX,16),INVALID, /* [08] */ TNSZ("vroundps",VEX_MXI,16),TNSZ("vroundpd",VEX_MXI,16),TNSZ("vroundss",VEX_RMRX,16),TNSZ("vroundsd",VEX_RMRX,16), /* [0C] */ TNSZ("vblendps",VEX_RMRX,16),TNSZ("vblendpd",VEX_RMRX,16),TNSZ("vpblendw",VEX_RMRX,16),TNSZ("vpalignr",VEX_RMRX,16), @@ -1403,11 +1681,11 @@ const instable_t dis_opAVX660F3A[256] = /* [30] */ INVALID, INVALID, INVALID, INVALID, /* [34] */ INVALID, INVALID, INVALID, INVALID, -/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ TNSZ("vinserti128",VEX_RMRX,16),TNSZ("vextracti128",VEX_RIM,16),INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, /* [40] */ TNSZ("vdpps",VEX_RMRX,16),TNSZ("vdppd",VEX_RMRX,16),TNSZ("vmpsadbw",VEX_RMRX,16),INVALID, -/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, INVALID, INVALID, +/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, TNSZ("vperm2i128",VEX_RMRX,16),INVALID, /* [48] */ INVALID, INVALID, TNSZ("vblendvps",VEX_RMRX,8), TNSZ("vblendvpd",VEX_RMRX,16), /* [4C] */ TNSZ("vpblendvb",VEX_RMRX,16),INVALID, INVALID, INVALID, @@ -1468,6 +1746,15 @@ const instable_t dis_opAVX660F3A[256] = }; /* + * Decode table for 0x0F0D which uses the first byte of the mod_rm to + * indicate a sub-code. + */ +const instable_t dis_op0F0D[8] = { +/* [00] */ INVALID, TNS("prefetchw",PREF), TNS("prefetchwt1",PREF),INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +}; + +/* * Decode table for 0x0F opcodes */ @@ -1476,7 +1763,7 @@ const instable_t dis_op0F[16][16] = { /* [00] */ IND(dis_op0F00), IND(dis_op0F01), TNS("lar",MR), TNS("lsl",MR), /* [04] */ INVALID, TNS("syscall",NORM), TNS("clts",NORM), TNS("sysret",NORM), /* [08] */ TNS("invd",NORM), TNS("wbinvd",NORM), INVALID, TNS("ud2",NORM), -/* [0C] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, IND(dis_op0F0D), INVALID, INVALID, }, { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), @@ -1631,8 +1918,8 @@ const instable_t dis_opAVX0F[16][16] = { /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, }, { -/* [F0] */ INVALID, INVALID, INVALID, INVALID, -/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ INVALID, INVALID, TNSZvr("andn",VEX_RMrX,5),TNSZvr("bls",BLS,5), +/* [F4] */ INVALID, TNSZvr("bzhi",VEX_VRMrX,5),INVALID, TNSZvr("bextr",VEX_VRMrX,5), /* [F8] */ INVALID, INVALID, INVALID, INVALID, /* [FC] */ INVALID, INVALID, INVALID, INVALID, } }; @@ -1795,19 +2082,19 @@ const instable_t dis_opFP1n2[8][8] = { /* [2,0] */ TNS("fiaddl",M), TNS("fimull",M), TNS("ficoml",M), TNS("ficompl",M), /* [2,4] */ TNS("fisubl",M), TNS("fisubrl",M), TNS("fidivl",M), TNS("fidivrl",M), }, { -/* [3,0] */ TNS("fildl",M), INVALID, TNS("fistl",M), TNS("fistpl",M), +/* [3,0] */ TNS("fildl",M), TNSZ("tisttpl",M,4), TNS("fistl",M), TNS("fistpl",M), /* [3,4] */ INVALID, TNSZ("fldt",M,10), INVALID, TNSZ("fstpt",M,10), }, { /* [4,0] */ TNSZ("faddl",M,8), TNSZ("fmull",M,8), TNSZ("fcoml",M,8), TNSZ("fcompl",M,8), /* [4,1] */ TNSZ("fsubl",M,8), TNSZ("fsubrl",M,8), TNSZ("fdivl",M,8), TNSZ("fdivrl",M,8), }, { -/* [5,0] */ TNSZ("fldl",M,8), INVALID, TNSZ("fstl",M,8), TNSZ("fstpl",M,8), +/* [5,0] */ TNSZ("fldl",M,8), TNSZ("fisttpll",M,8), TNSZ("fstl",M,8), TNSZ("fstpl",M,8), /* [5,4] */ TNSZ("frstor",M,108), INVALID, TNSZ("fnsave",M,108), TNSZ("fnstsw",M,2), }, { /* [6,0] */ TNSZ("fiadd",M,2), TNSZ("fimul",M,2), TNSZ("ficom",M,2), TNSZ("ficomp",M,2), /* [6,4] */ TNSZ("fisub",M,2), TNSZ("fisubr",M,2), TNSZ("fidiv",M,2), TNSZ("fidivr",M,2), }, { -/* [7,0] */ TNSZ("fild",M,2), INVALID, TNSZ("fist",M,2), TNSZ("fistp",M,2), +/* [7,0] */ TNSZ("fild",M,2), TNSZ("fisttp",M,2), TNSZ("fist",M,2), TNSZ("fistp",M,2), /* [7,4] */ TNSZ("fbld",M,10), TNSZ("fildll",M,8), TNSZ("fbstp",M,10), TNSZ("fistpll",M,8), } }; @@ -2039,6 +2326,80 @@ static int isize64[] = {1, 2, 4, 8}; #define YMM_OPND 9 /* "value" used to indicate a ymm reg */ /* + * The AVX2 gather instructions are a bit of a mess. While there's a pattern, + * there's not really a consistent scheme that we can use to know what the mode + * is supposed to be for a given type. Various instructions, like VPGATHERDD, + * always match the value of VEX_L. Other instructions like VPGATHERDQ, have + * some registers match VEX_L, but the VSIB is always XMM. + * + * The simplest way to deal with this is to just define a table based on the + * instruction opcodes, which are 0x90-0x93, so we subtract 0x90 to index into + * them. + * + * We further have to subdivide this based on the value of VEX_W and the value + * of VEX_L. The array is constructed to be indexed as: + * [opcode - 0x90][VEX_W][VEX_L]. + */ +/* w = 0, 0x90 */ +typedef struct dis_gather_regs { + uint_t dgr_arg0; /* src reg */ + uint_t dgr_arg1; /* vsib reg */ + uint_t dgr_arg2; /* dst reg */ + char *dgr_suffix; /* suffix to append */ +} dis_gather_regs_t; + +static dis_gather_regs_t dis_vgather[4][2][2] = { + { + /* op 0x90, W.0 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "d" }, + { YMM_OPND, YMM_OPND, YMM_OPND, "d" } + }, + /* op 0x90, W.1 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "q" }, + { YMM_OPND, XMM_OPND, YMM_OPND, "q" } + } + }, + { + /* op 0x91, W.0 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "d" }, + { XMM_OPND, YMM_OPND, XMM_OPND, "d" }, + }, + /* op 0x91, W.1 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "q" }, + { YMM_OPND, YMM_OPND, YMM_OPND, "q" }, + } + }, + { + /* op 0x92, W.0 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "s" }, + { YMM_OPND, YMM_OPND, YMM_OPND, "s" } + }, + /* op 0x92, W.1 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "d" }, + { YMM_OPND, XMM_OPND, YMM_OPND, "d" } + } + }, + { + /* op 0x93, W.0 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "s" }, + { XMM_OPND, YMM_OPND, XMM_OPND, "s" } + }, + /* op 0x93, W.1 */ + { + { XMM_OPND, XMM_OPND, XMM_OPND, "d" }, + { YMM_OPND, YMM_OPND, YMM_OPND, "d" } + } + } +}; + +/* * Get the next byte and separate the op code into the high and low nibbles. */ static int @@ -2409,16 +2770,29 @@ dtrace_get_operand(dis86_t *x, uint_t mo } else { uint_t need_paren = 0; char **regs; + char **bregs; + const char *const *sf; if (x->d86_mode == SIZE32) /* NOTE this is not addr_size! */ regs = (char **)dis_REG32; else regs = (char **)dis_REG64; + if (x->d86_vsib != 0) { + if (wbit == YMM_OPND) /* NOTE this is not addr_size! */ + bregs = (char **)dis_YMMREG; + else + bregs = (char **)dis_XMMREG; + sf = dis_vscale_factor; + } else { + bregs = regs; + sf = dis_scale_factor; + } + /* * print the base (if any) */ if (base == EBP_REGNO && mode == 0) { - if (index != ESP_REGNO) { + if (index != ESP_REGNO || x->d86_vsib != 0) { (void) strlcat(opnd, "(", OPLEN); need_paren = 1; } @@ -2431,10 +2805,10 @@ dtrace_get_operand(dis86_t *x, uint_t mo /* * print the index (if any) */ - if (index != ESP_REGNO) { + if (index != ESP_REGNO || x->d86_vsib) { (void) strlcat(opnd, ",", OPLEN); - (void) strlcat(opnd, regs[index], OPLEN); - (void) strlcat(opnd, dis_scale_factor[ss], OPLEN); + (void) strlcat(opnd, bregs[index], OPLEN); + (void) strlcat(opnd, sf[ss], OPLEN); } else if (need_paren) (void) strlcat(opnd, ")", OPLEN); @@ -2581,7 +2955,12 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod uint_t vex_B = 1; uint_t vex_W = 0; uint_t vex_L; + dis_gather_regs_t *vreg; +#ifdef DIS_TEXT + /* Instruction name for BLS* family of instructions */ + char *blsinstr; +#endif size_t off; @@ -2605,6 +2984,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod x->d86_rex_prefix = 0; x->d86_got_modrm = 0; x->d86_memsize = 0; + x->d86_vsib = 0; if (cpu_mode == SIZE16) { opnd_size = SIZE16; @@ -2802,6 +3182,10 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod dp = (instable_t *) &dis_opAVXF30F [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F38) { + dp = (instable_t *) + &dis_opAVXF30F38 + [(opcode1 << 4) | opcode2]; } else { goto error; } @@ -2811,6 +3195,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod dp = (instable_t *) &dis_opAVXF20F [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F3A) { + dp = (instable_t *) + &dis_opAVXF20F3A + [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F38) { + dp = (instable_t *) + &dis_opAVXF20F38 + [(opcode1 << 4) | opcode2]; } else { goto error; } @@ -2822,10 +3214,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod } } if (vex_prefix) { - if (vex_L) - wbit = YMM_OPND; - else - wbit = XMM_OPND; + if (dp->it_vexwoxmm) { + wbit = LONG_OPND; + } else { + if (vex_L) + wbit = YMM_OPND; + else + wbit = XMM_OPND; + } } /* @@ -2894,6 +3290,8 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod goto error; #endif switch (dp->it_adrmode) { + case XMMP: + break; case XMMP_66r: case XMMPRM_66r: case XMM3PM_66r: @@ -2935,11 +3333,50 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod dp++; } } + + /* + * The adx family of instructions (adcx and adox) + * continue the classic Intel tradition of abusing + * arbitrary prefixes without actually meaning the + * prefix bit. Therefore, if we find either the + * opnd_size_prefix or rep_prefix we end up zeroing it + * out after making our determination so as to ensure + * that we don't get confused and accidentally print + * repz prefixes and the like on these instructions. + * + * In addition, these instructions are actually much + * closer to AVX instructions in semantics. Importantly, + * they always default to having 32-bit operands. + * However, if the CPU is in 64-bit mode, then and only + * then, does it use REX.w promotes things to 64-bits + * and REX.r allows 64-bit mode to use register r8-r15. + */ + if (dp->it_indirect == (instable_t *)dis_op0F38F6) { + dp = dp->it_indirect; + if (opnd_size_prefix == 0 && + rep_prefix == 0xf3) { + /* It is adox */ + dp++; + } else if (opnd_size_prefix != 0x66 && + rep_prefix != 0) { + /* It isn't adcx */ + goto error; + } + opnd_size_prefix = 0; + rep_prefix = 0; + opnd_size = SIZE32; + if (rex_prefix & REX_W) + opnd_size = SIZE64; + } + #ifdef DIS_TEXT if (strcmp(dp->it_name, "INVALID") == 0) goto error; #endif switch (dp->it_adrmode) { + case ADX: + case XMM: + break; case RM_66r: case XMM_66r: case XMMM_66r: @@ -3029,9 +3466,12 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod goto error; /* - * deal with MMX/SSE opcodes which are changed by prefixes + * Deal with MMX/SSE opcodes which are changed by prefixes. Note, we do + * need to include UNKNOWN below, as we may have instructions that + * actually have a prefix, but don't exist in any other form. */ switch (dp->it_adrmode) { + case UNKNOWN: case MMO: case MMOIMPL: case MMO3P: @@ -3220,7 +3660,10 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod if (strcmp(dp->it_name, "INVALID") == 0) goto error; (void) strlcat(x->d86_mnem, dp->it_name, OPLEN); - if (dp->it_suffix) { + if (dp->it_avxsuf && dp->it_suffix) { + (void) strlcat(x->d86_mnem, vex_W != 0 ? "q" : "d", + OPLEN); + } else if (dp->it_suffix) { char *types[] = {"", "w", "l", "q"}; if (opcode_bytes == 2 && opcode4 == 4) { /* It's a cmovx.yy. Replace the suffix x */ @@ -3341,6 +3784,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod /* memory or register operand to register, with 'w' bit */ case MRw: + case ADX: wbit = WBIT(opcode2); STANDARD_MODRM(x, mode, reg, r_m, rex_prefix, wbit, 0); break; @@ -3640,6 +4084,18 @@ just_mem: #endif NOMEM; break; + } else if (r_m == 2) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "clac", OPLEN); +#endif + NOMEM; + break; + } else if (r_m == 3) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "stac", OPLEN); +#endif + NOMEM; + break; } else { goto error; } @@ -4337,11 +4793,31 @@ xmmprm: dtrace_get_operand(x, mode, r_m, wbit, 0); break; case VEX_RMrX: + case FMA: /* ModR/M.reg := op(VEX.vvvv, ModR/M.r/m) */ x->d86_numopnds = 3; dtrace_get_modrm(x, &mode, ®, &r_m); dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + /* + * In classic Intel fashion, the opcodes for all of the FMA + * instructions all have two possible mnemonics which vary by + * one letter, which is selected based on the value of the wbit. + * When wbit is one, they have the 'd' suffix and when 'wbit' is + * 0, they have the 's' suffix. Otherwise, the FMA instructions + * are all a standard VEX_RMrX. + */ +#ifdef DIS_TEXT + if (dp->it_adrmode == FMA) { + size_t len = strlen(dp->it_name); + (void) strncpy(x->d86_mnem, dp->it_name, OPLEN); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 3 03:57:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF10CCEC98; Fri, 3 Feb 2017 03:57:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 587DE6C3; Fri, 3 Feb 2017 03:57:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v133v6DC056689; Fri, 3 Feb 2017 03:57:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v133v6GL056688; Fri, 3 Feb 2017 03:57:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702030357.v133v6GL056688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Feb 2017 03:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313134 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 03:57:07 -0000 Author: adrian Date: Fri Feb 3 03:57:06 2017 New Revision: 313134 URL: https://svnweb.freebsd.org/changeset/base/313134 Log: [ath_hal] [ar9300] initial radar decode for AR9380 and later chips. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Feb 3 03:22:47 2017 (r313133) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Feb 3 03:57:06 2017 (r313134) @@ -109,6 +109,201 @@ ar9300_freebsd_set_tsf64(struct ath_hal OS_REG_WRITE(ah, AR_TSF_U32, (tsf64 >> 32) & 0xffffffff); } +/* Flags for pulse_bw_info */ +#define PRI_CH_RADAR_FOUND 0x01 +#define EXT_CH_RADAR_FOUND 0x02 +#define EXT_CH_RADAR_EARLY_FOUND 0x04 + +static HAL_BOOL +ar9300_freebsd_proc_radar_event(struct ath_hal *ah, struct ath_rx_status *rxs, + uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event) +{ + HAL_BOOL doDfsExtCh; + HAL_BOOL doDfsEnhanced; + HAL_BOOL doDfsCombinedRssi; + + uint8_t rssi = 0, ext_rssi = 0; + uint8_t pulse_bw_info = 0, pulse_length_ext = 0, pulse_length_pri = 0; + uint32_t dur = 0; + int pri_found = 1, ext_found = 0; + int early_ext = 0; + int is_dc = 0; + uint16_t datalen; /* length from the RX status field */ + + /* Check whether the given phy error is a radar event */ + if ((rxs->rs_phyerr != HAL_PHYERR_RADAR) && + (rxs->rs_phyerr != HAL_PHYERR_FALSE_RADAR_EXT)) { + return AH_FALSE; + } + + /* Grab copies of the capabilities; just to make the code clearer */ + doDfsExtCh = AH_PRIVATE(ah)->ah_caps.halExtChanDfsSupport; + doDfsEnhanced = AH_PRIVATE(ah)->ah_caps.halEnhancedDfsSupport; + doDfsCombinedRssi = AH_PRIVATE(ah)->ah_caps.halUseCombinedRadarRssi; + + datalen = rxs->rs_datalen; + + /* If hardware supports it, use combined RSSI, else use chain 0 RSSI */ + if (doDfsCombinedRssi) + rssi = (uint8_t) rxs->rs_rssi; + else + rssi = (uint8_t) rxs->rs_rssi_ctl[0]; + + /* Set this; but only use it if doDfsExtCh is set */ + ext_rssi = (uint8_t) rxs->rs_rssi_ext[0]; + + /* Cap it at 0 if the RSSI is a negative number */ + if (rssi & 0x80) + rssi = 0; + + if (ext_rssi & 0x80) + ext_rssi = 0; + + /* + * Fetch the relevant data from the frame + */ + if (doDfsExtCh) { + if (datalen < 3) + return AH_FALSE; + + /* Last three bytes of the frame are of interest */ + pulse_length_pri = *(buf + datalen - 3); + pulse_length_ext = *(buf + datalen - 2); + pulse_bw_info = *(buf + datalen - 1); + HALDEBUG(ah, HAL_DEBUG_DFS, "%s: rssi=%d, ext_rssi=%d, pulse_length_pri=%d," + " pulse_length_ext=%d, pulse_bw_info=%x\n", + __func__, rssi, ext_rssi, pulse_length_pri, pulse_length_ext, + pulse_bw_info); + } else { + /* The pulse width is byte 0 of the data */ + if (datalen >= 1) + dur = ((uint8_t) buf[0]) & 0xff; + else + dur = 0; + + if (dur == 0 && rssi == 0) { + HALDEBUG(ah, HAL_DEBUG_DFS, "%s: dur and rssi are 0\n", __func__); + return AH_FALSE; + } + + HALDEBUG(ah, HAL_DEBUG_DFS, "%s: rssi=%d, dur=%d\n", __func__, rssi, dur); + + /* Single-channel only */ + pri_found = 1; + ext_found = 0; + } + + /* + * If doing extended channel data, pulse_bw_info must + * have one of the flags set. + */ + if (doDfsExtCh && pulse_bw_info == 0x0) + return AH_FALSE; + + /* + * If the extended channel data is available, calculate + * which to pay attention to. + */ + if (doDfsExtCh) { + /* If pulse is on DC, take the larger duration of the two */ + if ((pulse_bw_info & EXT_CH_RADAR_FOUND) && + (pulse_bw_info & PRI_CH_RADAR_FOUND)) { + is_dc = 1; + if (pulse_length_ext > pulse_length_pri) { + dur = pulse_length_ext; + pri_found = 0; + ext_found = 1; + } else { + dur = pulse_length_pri; + pri_found = 1; + ext_found = 0; + } + } else if (pulse_bw_info & EXT_CH_RADAR_EARLY_FOUND) { + dur = pulse_length_ext; + pri_found = 0; + ext_found = 1; + early_ext = 1; + } else if (pulse_bw_info & PRI_CH_RADAR_FOUND) { + dur = pulse_length_pri; + pri_found = 1; + ext_found = 0; + } else if (pulse_bw_info & EXT_CH_RADAR_FOUND) { + dur = pulse_length_ext; + pri_found = 0; + ext_found = 1; + } + + } + + /* + * For enhanced DFS (Merlin and later), pulse_bw_info has + * implications for selecting the correct RSSI value. + */ + if (doDfsEnhanced) { + switch (pulse_bw_info & 0x03) { + case 0: + /* No radar? */ + rssi = 0; + break; + case PRI_CH_RADAR_FOUND: + /* Radar in primary channel */ + /* Cannot use ctrl channel RSSI if ext channel is stronger */ + if (ext_rssi >= (rssi + 3)) { + rssi = 0; + } + break; + case EXT_CH_RADAR_FOUND: + /* Radar in extended channel */ + /* Cannot use ext channel RSSI if ctrl channel is stronger */ + if (rssi >= (ext_rssi + 12)) { + rssi = 0; + } else { + rssi = ext_rssi; + } + break; + case (PRI_CH_RADAR_FOUND | EXT_CH_RADAR_FOUND): + /* When both are present, use stronger one */ + if (rssi < ext_rssi) + rssi = ext_rssi; + break; + } + } + + /* + * If not doing enhanced DFS, choose the ext channel if + * it is stronger than the main channel + */ + if (doDfsExtCh && !doDfsEnhanced) { + if ((ext_rssi > rssi) && (ext_rssi < 128)) + rssi = ext_rssi; + } + + /* + * XXX what happens if the above code decides the RSSI + * XXX wasn't valid, an sets it to 0? + */ + + /* + * Fill out dfs_event structure. + */ + event->re_full_ts = fulltsf; + event->re_ts = rxs->rs_tstamp; + event->re_rssi = rssi; + event->re_dur = dur; + + event->re_flags = 0; + if (pri_found) + event->re_flags |= HAL_DFS_EVENT_PRICH; + if (ext_found) + event->re_flags |= HAL_DFS_EVENT_EXTCH; + if (early_ext) + event->re_flags |= HAL_DFS_EVENT_EXTEARLY; + if (is_dc) + event->re_flags |= HAL_DFS_EVENT_ISDC; + + return AH_TRUE; +} + void ar9300_attach_freebsd_ops(struct ath_hal *ah) { @@ -220,7 +415,7 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_enableDfs = ar9300_enable_dfs; ah->ah_getDfsThresh = ar9300_get_dfs_thresh; ah->ah_getDfsDefaultThresh = ar9300_get_default_dfs_thresh; - // procradarevent + ah->ah_procRadarEvent = ar9300_freebsd_proc_radar_event; ah->ah_isFastClockEnabled = ar9300_is_fast_clock_enabled; ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy; From owner-svn-src-head@freebsd.org Fri Feb 3 04:36:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A1B7CCD7AD; Fri, 3 Feb 2017 04:36:08 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE7BE1793; Fri, 3 Feb 2017 04:36:07 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id c85so1624210wmi.1; Thu, 02 Feb 2017 20:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:references:to:reply-to:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=0O83LRpKiFHGGOZ1/mmgdSFPHJ8C9DQNvjjCDxZ3Zvk=; b=B4RQlOg61NrsnI5pm1sxHzEDCVgICJWzZNHqp/6CniY0lXCFZS0hiCxi9C2pxxx9tF 0JDCp9NHx3iXhZx6lVjbtpBCmz9sdIfwLmoUuxZTf2V3vERQqMsyV1yExsxBG6aGiKXB HIBCbOO/tZrzJ8BbRRmM4QEaiLxuqE9BpwNf08nfLvQtMxCZUHYJmmtRSEugrhJpF0i/ 3kZFoh2z3XYbwVK9hlwFSexmtdxswVlg75GaUoSRBzn3EJkjEJXbhe4Nyk+tMam5Ydfx 0o0LlUUO0aJ7giox+WRdBVoFbpN1DspJJ0ceWJs+0NBbH3UMSYvOVpbI3p23xkx1juAC 7i7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:references:to:reply-to:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0O83LRpKiFHGGOZ1/mmgdSFPHJ8C9DQNvjjCDxZ3Zvk=; b=aT+D8DJe2Y5fbuiUCm6fqrT5+118AfMe8052Tqy1tVvhMp1Vys1Ga/d52NGeO49vSm fjJkNWHHtl5N2d4jbX8PWfNmMpC89htfF1ilDjNtKnKFs/Eik9QkM/q4CTash7uZ6Ro5 pq2T/QwI2UKEJoArQSai2AK0XLuP2rzrE9jm7b06GSj2/OIT6QWm+ga5Gy74YGS6hQag DYLN8ZhkXnmOSmFD8dXJNHWTS8cZo57sELKHkANT7ze4W7Gxd+AYbjA0YZ50aqEjlwpo eQ5TNXoPEFWJdefjfFFw0rACL12hcDI6KIk47Zx5aIIYij3UH2zBmqKioDUe8uhkeqAJ Om8w== X-Gm-Message-State: AIkVDXK+GeYi1USYbXRx7MB/cv1Zlukb+VnLb38mjBTazlLkdDliAVsz1q0WsQRlY5SPnA== X-Received: by 10.223.147.1 with SMTP id 1mr10352840wro.60.1486096564567; Thu, 02 Feb 2017 20:36:04 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id s26sm42788736wra.26.2017.02.02.20.36.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 20:36:04 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Subject: Re: svn commit: r313042 - in head/sys/boot: efi/include efi/libefi efi/loader forth References: <201702010846.v118kxNk070776@repo.freebsd.org> To: Toomas Soome , svn-src-head@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: mmel@freebsd.org Message-ID: <38c02260-7a34-7820-6507-6f240cf8a18c@freebsd.org> Date: Fri, 3 Feb 2017 05:36:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <201702010846.v118kxNk070776@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 04:36:08 -0000 On 01.02.2017 9:46, Toomas Soome wrote: > Author: tsoome > Date: Wed Feb 1 08:46:59 2017 > New Revision: 313042 > URL: https://svnweb.freebsd.org/changeset/base/313042 > > Log: > loader.efi environment related cleanups > > Since we have dedicated libefi/env.c file for variable support, the following > changes are done: > > Simple cstyle changes in env.c > Moved efi variable related commands from loader/main.c to libefi/env.c > Did create function to set "efi-version" environment variable in env.c. > > This function does serve two purposes: for first a small clean up of the > loader main(), and for second, it does replace the otherwise unused > efi_variable_support hack. > A bit of cleanup of ficl backend functions. The TEST_MAIN has no meaning, > and removed few memory leaks. > > The forth code is updated to use "efi-version" variable, instead of ficl > environment check. > > Reviewed by: imp > Approved by: imp (mentor) > Differential Revision: https://reviews.freebsd.org/D9165 > > Added: > head/sys/boot/efi/libefi/wchar.c (contents, props changed) > Modified: > head/sys/boot/efi/include/efilib.h > head/sys/boot/efi/libefi/Makefile > head/sys/boot/efi/libefi/env.c > head/sys/boot/efi/loader/main.c > head/sys/boot/forth/loader.4th > This breaks armv6 buildworld: /usr/src/sys/boot/efi/libefi/env.c:97:50: error: format specifies type 'unsigned long' but the argument has type 'EFI_STATUS' (aka 'unsigned int') [-Werror,-Wformat] printf("Can't get the variable: error %#lx\n", status); ~~~~ ^~~~~~ %#x /usr/src/sys/boot/efi/libefi/env.c:104:50: error: format specifies type 'unsigned long' but the argument has type 'EFI_STATUS' (aka 'unsigned int') [-Werror,-Wformat] printf("Can't get the variable: error %#lx\n", status); ~~~~ ^~~~~~ %#x /usr/src/sys/boot/efi/libefi/env.c:109:35: error: format specifies type 'wchar_t *' (aka 'unsigned int *') but the argument has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] printf("%s 0x%x %S", str, attr, varnamearg); ~~ ^~~~~~~~~~ /usr/src/sys/boot/efi/libefi/env.c:111:36: error: format specifies type 'wchar_t *' (aka 'unsigned int *') but the argument has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] printf("%s 0x%x %S=", str, attr, varnamearg); ~~ ^~~~~~~~~~ Michal > Modified: head/sys/boot/efi/include/efilib.h > ============================================================================== > --- head/sys/boot/efi/include/efilib.h Wed Feb 1 05:24:17 2017 (r313041) > +++ head/sys/boot/efi/include/efilib.h Wed Feb 1 08:46:59 2017 (r313042) > @@ -65,4 +65,12 @@ EFI_STATUS main(int argc, CHAR16 *argv[] > void exit(EFI_STATUS status); > void delay(int usecs); > > +/* EFI environment initialization. */ > +void efi_init_environment(void); > + > +/* CHAR16 utility functions. */ > +int wcscmp(CHAR16 *, CHAR16 *); > +void cpy8to16(const char *, CHAR16 *, size_t); > +void cpy16to8(const CHAR16 *, char *, size_t); > + > #endif /* _LOADER_EFILIB_H */ > > Modified: head/sys/boot/efi/libefi/Makefile > ============================================================================== > --- head/sys/boot/efi/libefi/Makefile Wed Feb 1 05:24:17 2017 (r313041) > +++ head/sys/boot/efi/libefi/Makefile Wed Feb 1 08:46:59 2017 (r313042) > @@ -3,6 +3,7 @@ > .include > > .if ${MK_FORTH} != "no" > +CFLAGS+= -DBOOT_FORTH > .include "${.CURDIR}/../../Makefile.ficl" > .endif > > @@ -10,17 +11,14 @@ LIB= efi > INTERNALLIB= > WARNS?= 2 > > -SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c errno.c \ > - handles.c libefi.c > +SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ > + handles.c wchar.c libefi.c > > .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" > SRCS+= time.c > .elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" > SRCS+= time_event.c > .endif > -.if ${MK_FORTH} != "no" > -SRCS+= env.c > -.endif > > # We implement a slightly non-standard %S in that it always takes a > # CHAR16 that's common in UEFI-land instead of a wchar_t. This only > > Modified: head/sys/boot/efi/libefi/env.c > ============================================================================== > --- head/sys/boot/efi/libefi/env.c Wed Feb 1 05:24:17 2017 (r313041) > +++ head/sys/boot/efi/libefi/env.c Wed Feb 1 08:46:59 2017 (r313042) > @@ -26,15 +26,17 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include > #include > #include > #include > #include > #include > +#include > #include "bootstrap.h" > +#ifdef BOOT_FORTH > #include "ficl.h" > - > -int efi_variable_support = 1; > +#endif > > /* > * Simple wrappers to the underlying UEFI functions. > @@ -42,36 +44,348 @@ int efi_variable_support = 1; > * for details. > */ > EFI_STATUS > -efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, EFI_GUID *vendor_guid) > +efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, > + EFI_GUID *vendor_guid) > { > - return RS->GetNextVariableName(variable_name_size, variable_name, vendor_guid); > + return (RS->GetNextVariableName(variable_name_size, variable_name, > + vendor_guid)); > } > > EFI_STATUS > -efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 *attributes, UINTN *data_size, > - void *data) > +efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, > + UINT32 *attributes, UINTN *data_size, void *data) > { > - return RS->GetVariable(variable_name, vendor_guid, attributes, data_size, data); > + return (RS->GetVariable(variable_name, vendor_guid, attributes, > + data_size, data)); > } > > EFI_STATUS > -efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 attributes, UINTN data_size, > - void *data) > +efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, > + UINT32 attributes, UINTN data_size, void *data) > +{ > + return (RS->SetVariable(variable_name, vendor_guid, attributes, > + data_size, data)); > +} > + > +void > +efi_init_environment(void) > +{ > + char var[128]; > + > + snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, > + ST->Hdr.Revision & 0xffff); > + env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); > +} > + > +COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); > + > +static int > +efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) > { > - return RS->SetVariable(variable_name, vendor_guid, attributes, data_size, data); > + UINTN datasz, i; > + EFI_STATUS status; > + UINT32 attr; > + CHAR16 *data; > + char *str; > + uint32_t uuid_status; > + int is_ascii; > + > + datasz = 0; > + status = RS->GetVariable(varnamearg, matchguid, &attr, > + &datasz, NULL); > + if (status != EFI_BUFFER_TOO_SMALL) { > + printf("Can't get the variable: error %#lx\n", status); > + return (CMD_ERROR); > + } > + data = malloc(datasz); > + status = RS->GetVariable(varnamearg, matchguid, &attr, > + &datasz, data); > + if (status != EFI_SUCCESS) { > + printf("Can't get the variable: error %#lx\n", status); > + return (CMD_ERROR); > + } > + uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); > + if (lflag) { > + printf("%s 0x%x %S", str, attr, varnamearg); > + } else { > + printf("%s 0x%x %S=", str, attr, varnamearg); > + is_ascii = 1; > + free(str); > + str = (char *)data; > + for (i = 0; i < datasz - 1; i++) { > + /* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */ > + if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) { > + is_ascii = 0; > + break; > + } > + } > + if (str[datasz - 1] != '\0') > + is_ascii = 0; > + if (is_ascii) > + printf("%s", str); > + else { > + for (i = 0; i < datasz / 2; i++) { > + if (isalnum(data[i]) || isspace(data[i])) > + printf("%c", data[i]); > + else > + printf("\\x%02x", data[i]); > + } > + } > + } > + free(data); > + if (pager_output("\n")) > + return (CMD_WARN); > + return (CMD_OK); > } > > +static int > +command_efi_show(int argc, char *argv[]) > +{ > + /* > + * efi-show [-a] > + * print all the env > + * efi-show -u UUID > + * print all the env vars tagged with UUID > + * efi-show -v var > + * search all the env vars and print the ones matching var > + * eif-show -u UUID -v var > + * eif-show UUID var > + * print all the env vars that match UUID and var > + */ > + /* NB: We assume EFI_GUID is the same as uuid_t */ > + int aflag = 0, gflag = 0, lflag = 0, vflag = 0; > + int ch, rv; > + unsigned i; > + EFI_STATUS status; > + EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; > + EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; > + uint32_t uuid_status; > + CHAR16 *varname; > + CHAR16 *newnm; > + CHAR16 varnamearg[128]; > + UINTN varalloc; > + UINTN varsz; > + > + while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { > + switch (ch) { > + case 'a': > + aflag = 1; > + break; > + case 'g': > + gflag = 1; > + uuid_from_string(optarg, (uuid_t *)&matchguid, > + &uuid_status); > + if (uuid_status != uuid_s_ok) { > + printf("uid %s could not be parsed\n", optarg); > + return (CMD_ERROR); > + } > + break; > + case 'l': > + lflag = 1; > + break; > + case 'v': > + vflag = 1; > + if (strlen(optarg) >= nitems(varnamearg)) { > + printf("Variable %s is longer than %zd characters\n", > + optarg, nitems(varnamearg)); > + return (CMD_ERROR); > + } > + for (i = 0; i < strlen(optarg); i++) > + varnamearg[i] = optarg[i]; > + varnamearg[i] = 0; > + break; > + default: > + printf("Invalid argument %c\n", ch); > + return (CMD_ERROR); > + } > + } > + > + if (aflag && (gflag || vflag)) { > + printf("-a isn't compatible with -v or -u\n"); > + return (CMD_ERROR); > + } > + > + if (aflag && optind < argc) { > + printf("-a doesn't take any args\n"); > + return (CMD_ERROR); > + } > + > + if (optind == argc) > + aflag = 1; > + > + argc -= optind; > + argv += optind; > + > + pager_open(); > + if (vflag && gflag) { > + rv = efi_print_var(varnamearg, &matchguid, lflag); > + pager_close(); > + return (rv); > + } > + > + if (argc == 2) { > + optarg = argv[0]; > + if (strlen(optarg) >= nitems(varnamearg)) { > + printf("Variable %s is longer than %zd characters\n", > + optarg, nitems(varnamearg)); > + pager_close(); > + return (CMD_ERROR); > + } > + for (i = 0; i < strlen(optarg); i++) > + varnamearg[i] = optarg[i]; > + varnamearg[i] = 0; > + optarg = argv[1]; > + uuid_from_string(optarg, (uuid_t *)&matchguid, > + &uuid_status); > + if (uuid_status != uuid_s_ok) { > + printf("uid %s could not be parsed\n", optarg); > + pager_close(); > + return (CMD_ERROR); > + } > + rv = efi_print_var(varnamearg, &matchguid, lflag); > + pager_close(); > + return (rv); > + } > + > + if (argc > 0) { > + printf("Too many args %d\n", argc); > + pager_close(); > + return (CMD_ERROR); > + } > + > + /* > + * Initiate the search -- note the standard takes pain > + * to specify the initial call must be a poiner to a NULL > + * character. > + */ > + varalloc = 1024; > + varname = malloc(varalloc); > + if (varname == NULL) { > + printf("Can't allocate memory to get variables\n"); > + pager_close(); > + return (CMD_ERROR); > + } > + varname[0] = 0; > + while (1) { > + varsz = varalloc; > + status = RS->GetNextVariableName(&varsz, varname, &varguid); > + if (status == EFI_BUFFER_TOO_SMALL) { > + varalloc = varsz; > + newnm = realloc(varname, varalloc); > + if (newnm == NULL) { > + printf("Can't allocate memory to get variables\n"); > + free(varname); > + pager_close(); > + return (CMD_ERROR); > + } > + varname = newnm; > + continue; /* Try again with bigger buffer */ > + } > + if (status != EFI_SUCCESS) > + break; > + if (aflag) { > + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > + break; > + continue; > + } > + if (vflag) { > + if (wcscmp(varnamearg, varname) == 0) { > + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > + break; > + continue; > + } > + } > + if (gflag) { > + if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) { > + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > + break; > + continue; > + } > + } > + } > + free(varname); > + pager_close(); > + > + return (CMD_OK); > +} > + > +COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set); > + > +static int > +command_efi_set(int argc, char *argv[]) > +{ > + char *uuid, *var, *val; > + CHAR16 wvar[128]; > + EFI_GUID guid; > + uint32_t status; > + EFI_STATUS err; > + > + if (argc != 4) { > + printf("efi-set uuid var new-value\n"); > + return (CMD_ERROR); > + } > + uuid = argv[1]; > + var = argv[2]; > + val = argv[3]; > + uuid_from_string(uuid, (uuid_t *)&guid, &status); > + if (status != uuid_s_ok) { > + printf("Invalid uuid %s %d\n", uuid, status); > + return (CMD_ERROR); > + } > + cpy8to16(var, wvar, sizeof(wvar)); > + err = RS->SetVariable(wvar, &guid, > + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS, > + strlen(val) + 1, val); > + if (EFI_ERROR(err)) { > + printf("Failed to set variable: error %lu\n", EFI_ERROR_CODE(err)); > + return (CMD_ERROR); > + } > + return (CMD_OK); > +} > + > +COMMAND_SET(efiunset, "efi-unset", "delete / unset EFI variables", command_efi_unset); > + > +static int > +command_efi_unset(int argc, char *argv[]) > +{ > + char *uuid, *var; > + CHAR16 wvar[128]; > + EFI_GUID guid; > + uint32_t status; > + EFI_STATUS err; > + > + if (argc != 3) { > + printf("efi-unset uuid var\n"); > + return (CMD_ERROR); > + } > + uuid = argv[1]; > + var = argv[2]; > + uuid_from_string(uuid, (uuid_t *)&guid, &status); > + if (status != uuid_s_ok) { > + printf("Invalid uuid %s\n", uuid); > + return (CMD_ERROR); > + } > + cpy8to16(var, wvar, sizeof(wvar)); > + err = RS->SetVariable(wvar, &guid, 0, 0, NULL); > + if (EFI_ERROR(err)) { > + printf("Failed to unset variable: error %lu\n", EFI_ERROR_CODE(err)); > + return (CMD_ERROR); > + } > + return (CMD_OK); > +} > + > +#ifdef BOOT_FORTH > /* > - * FreeBSD's loader interaction words and extras > + * FreeBSD's loader interaction words and extras > * > - * efi-setenv ( value n name n guid n attr -- 0 | -1) > - * efi-getenv ( guid n addr n -- addr' n' | -1 ) > - * efi-unsetenv ( name n guid n'' -- ) > + * efi-setenv ( value n name n guid n attr -- 0 | -1) > + * efi-getenv ( guid n addr n -- addr' n' | -1 ) > + * efi-unsetenv ( name n guid n'' -- ) > */ > > /* > * efi-setenv > - * efi-setenv ( value n name n guid n attr -- 0 | -1) > + * efi-setenv ( value n name n guid n attr -- 0 | -1) > * > * Set environment variables using the SetVariable EFI runtime service. > * > @@ -87,19 +401,18 @@ efi_set_variable(CHAR16 *variable_name, > * 4 Run time access > * (corresponding to the same bits in the UEFI spec). > */ > -void > +static void > ficlEfiSetenv(FICL_VM *pVM) > { > -#ifndef TESTMAIN > char *value = NULL, *guid = NULL; > CHAR16 *name = NULL; > int i; > -#endif > char *namep, *valuep, *guidp; > int names, values, guids, attr; > - int status; > + EFI_STATUS status; > uuid_t u; > uint32_t ustatus; > + bool error = true; > > #if FICL_ROBUST > 1 > vmCheckStack(pVM, 6, 0); > @@ -112,10 +425,9 @@ ficlEfiSetenv(FICL_VM *pVM) > values = stackPopINT(pVM->pStack); > valuep = (char*)stackPopPtr(pVM->pStack); > > -#ifndef TESTMAIN > guid = (char*)ficlMalloc(guids); > if (guid == NULL) > - vmThrowErr(pVM, "Error: out of memory"); > + goto out; > memcpy(guid, guidp, guids); > uuid_from_string(guid, &u, &ustatus); > if (ustatus != uuid_s_ok) { > @@ -123,16 +435,16 @@ ficlEfiSetenv(FICL_VM *pVM) > goto out; > } > > - name = (CHAR16 *)ficlMalloc((names + 1) * sizeof(CHAR16)); > + name = ficlMalloc((names + 1) * sizeof(CHAR16)); > if (name == NULL) > - vmThrowErr(pVM, "Error: out of memory"); > + goto out; > for (i = 0; i < names; i++) > name[i] = namep[i]; > - name[names] = (CHAR16)0; > + name[names] = 0; > > - value = (char*)ficlMalloc(values + 1); > + value = ficlMalloc(values + 1); > if (value == NULL) > - vmThrowErr(pVM, "Error: out of memory"); > + goto out; > memcpy(value, valuep, values); > > status = efi_set_variable(name, (EFI_GUID *)&u, attr, values, value); > @@ -140,21 +452,20 @@ ficlEfiSetenv(FICL_VM *pVM) > stackPushINT(pVM->pStack, 0); > else > stackPushINT(pVM->pStack, -1); > + error = false; > out: > ficlFree(name); > ficlFree(value); > ficlFree(guid); > -#endif > > - return; > + if (error == true) > + vmThrowErr(pVM, "Error: out of memory"); > } > > -void > +static void > ficlEfiGetenv(FICL_VM *pVM) > { > -#ifndef TESTMAIN > char *name, *value; > -#endif > char *namep; > int names; > > @@ -164,7 +475,6 @@ ficlEfiGetenv(FICL_VM *pVM) > names = stackPopINT(pVM->pStack); > namep = (char*) stackPopPtr(pVM->pStack); > > -#ifndef TESTMAIN > name = (char*) ficlMalloc(names+1); > if (name == NULL) > vmThrowErr(pVM, "Error: out of memory"); > @@ -178,18 +488,13 @@ ficlEfiGetenv(FICL_VM *pVM) > stackPushPtr(pVM->pStack, value); > stackPushINT(pVM->pStack, strlen(value)); > } else > -#endif > stackPushINT(pVM->pStack, -1); > - > - return; > } > > -void > +static void > ficlEfiUnsetenv(FICL_VM *pVM) > { > -#ifndef TESTMAIN > char *name; > -#endif > char *namep; > int names; > > @@ -199,7 +504,6 @@ ficlEfiUnsetenv(FICL_VM *pVM) > names = stackPopINT(pVM->pStack); > namep = (char*) stackPopPtr(pVM->pStack); > > -#ifndef TESTMAIN > name = (char*) ficlMalloc(names+1); > if (name == NULL) > vmThrowErr(pVM, "Error: out of memory"); > @@ -208,9 +512,6 @@ ficlEfiUnsetenv(FICL_VM *pVM) > > unsetenv(name); > ficlFree(name); > -#endif > - > - return; > } > > /************************************************************************** > @@ -218,17 +519,14 @@ ficlEfiUnsetenv(FICL_VM *pVM) > **************************************************************************/ > void ficlEfiCompilePlatform(FICL_SYSTEM *pSys) > { > - FICL_DICT *dp = pSys->dp; > - assert (dp); > - > - dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); > - dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); > - dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); > + FICL_DICT *dp = pSys->dp; > + assert (dp); > > - /* Would like to export the EFI version, but this will do for now */ > - ficlSetEnv(pSys, "efi-boot", 1); > - > - return; > + dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); > + dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); > + dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); > } > > FICL_COMPILE_SET(ficlEfiCompilePlatform); > + > +#endif /* BOOT_FORTH */ > > Added: head/sys/boot/efi/libefi/wchar.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/boot/efi/libefi/wchar.c Wed Feb 1 08:46:59 2017 (r313042) > @@ -0,0 +1,73 @@ > +/*- > + * Copyright 2016 Netflix, Inc. All Rights Reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 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 > + > +/* > + * CHAR16 related functions moved from loader. > + * Perhaps we should move those to libstand afterall, but they are > + * needed only by UEFI. > + */ > + > +int > +wcscmp(CHAR16 *a, CHAR16 *b) > +{ > + > + while (*a && *b && *a == *b) { > + a++; > + b++; > + } > + return *a - *b; > +} > + > +/* > + * cpy8to16 copies a traditional C string into a CHAR16 string and > + * 0 terminates it. len is the size of *dst in bytes. > + */ > +void > +cpy8to16(const char *src, CHAR16 *dst, size_t len) > +{ > + len <<= 1; /* Assume CHAR16 is 2 bytes */ > + while (len > 0 && *src) { > + *dst++ = *src++; > + len--; > + } > + *dst++ = (CHAR16)0; > +} > + > +void > +cpy16to8(const CHAR16 *src, char *dst, size_t len) > +{ > + size_t i; > + > + for (i = 0; i < len && src[i]; i++) > + dst[i] = (char)src[i]; > + if (i < len) > + dst[i] = '\0'; > +} > > Modified: head/sys/boot/efi/loader/main.c > ============================================================================== > --- head/sys/boot/efi/loader/main.c Wed Feb 1 05:24:17 2017 (r313041) > +++ head/sys/boot/efi/loader/main.c Wed Feb 1 08:46:59 2017 (r313042) > @@ -52,22 +52,6 @@ __FBSDID("$FreeBSD$"); > > extern char bootprog_info[]; > > -#ifdef BOOT_FORTH > -/* > - * Normally, efi.o from libefi.a would be brought in due to a function we call > - * there that's defined there. However, none of its functions are callable from > - * here since it just adds words to the FORTH environment or implement those > - * words. So, add a reference to a symbol in efi.o to force it to be be brought > - * in so the init function there gets added to the "compile" linker set happens > - * correctly. > - * > - * This assumes there's no global analysys that notices dummy1 isn't used > - * anywhere and tries to eliminate it. > - */ > -extern int efi_variable_support; > -int *dummy1 = &efi_variable_support; > -#endif > - > struct arch_switch archsw; /* MI/MD interface boundary */ > > EFI_GUID acpi = ACPI_TABLE_GUID; > @@ -88,32 +72,6 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PRO > static void efi_zfs_probe(void); > #endif > > -/* > - * cpy8to16 copies a traditional C string into a CHAR16 string and > - * 0 terminates it. len is the size of *dst in bytes. > - */ > -static void > -cpy8to16(const char *src, CHAR16 *dst, size_t len) > -{ > - len <<= 1; /* Assume CHAR16 is 2 bytes */ > - while (len > 0 && *src) { > - *dst++ = *src++; > - len--; > - } > - *dst++ = (CHAR16)0; > -} > - > -static void > -cpy16to8(const CHAR16 *src, char *dst, size_t len) > -{ > - size_t i; > - > - for (i = 0; i < len && src[i]; i++) > - dst[i] = (char)src[i]; > - if (i < len) > - dst[i] = '\0'; > -} > - > static int > has_keyboard(void) > { > @@ -455,9 +413,7 @@ main(int argc, CHAR16 *argv[]) > } > } > > - snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, > - ST->Hdr.Revision & 0xffff); > - env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); > + efi_init_environment(); > setenv("LINES", "24", 1); /* optional */ > > for (k = 0; k < ST->NumberOfTableEntries; k++) { > @@ -476,19 +432,6 @@ main(int argc, CHAR16 *argv[]) > return (EFI_SUCCESS); /* keep compiler happy */ > } > > -/* XXX move to lib stand ? */ > -static int > -wcscmp(CHAR16 *a, CHAR16 *b) > -{ > - > - while (*a && *b && *a == *b) { > - a++; > - b++; > - } > - return *a - *b; > -} > - > - > COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); > > static int > @@ -770,305 +713,6 @@ command_reloadbe(int argc, char *argv[]) > } > #endif > > -COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); > - > -static int > -efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) > -{ > - UINTN datasz, i; > - EFI_STATUS status; > - UINT32 attr; > - CHAR16 *data; > - char *str; > - uint32_t uuid_status; > - int is_ascii; > - > - datasz = 0; > - status = RS->GetVariable(varnamearg, matchguid, &attr, > - &datasz, NULL); > - if (status != EFI_BUFFER_TOO_SMALL) { > - printf("Can't get the variable: error %#lx\n", status); > - return (CMD_ERROR); > - } > - data = malloc(datasz); > - status = RS->GetVariable(varnamearg, matchguid, &attr, > - &datasz, data); > - if (status != EFI_SUCCESS) { > - printf("Can't get the variable: error %#lx\n", status); > - return (CMD_ERROR); > - } > - uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); > - if (lflag) { > - printf("%s 0x%x %S", str, attr, varnamearg); > - } else { > - printf("%s 0x%x %S=", str, attr, varnamearg); > - is_ascii = 1; > - free(str); > - str = (char *)data; > - for (i = 0; i < datasz - 1; i++) { > - /* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */ > - if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) { > - is_ascii = 0; > - break; > - } > - } > - if (str[datasz - 1] != '\0') > - is_ascii = 0; > - if (is_ascii) > - printf("%s", str); > - else { > - for (i = 0; i < datasz / 2; i++) { > - if (isalnum(data[i]) || isspace(data[i])) > - printf("%c", data[i]); > - else > - printf("\\x%02x", data[i]); > - } > - } > - } > - free(data); > - if (pager_output("\n")) > - return (CMD_WARN); > - return (CMD_OK); > -} > - > -static int > -command_efi_show(int argc, char *argv[]) > -{ > - /* > - * efi-show [-a] > - * print all the env > - * efi-show -u UUID > - * print all the env vars tagged with UUID > - * efi-show -v var > - * search all the env vars and print the ones matching var > - * eif-show -u UUID -v var > - * eif-show UUID var > - * print all the env vars that match UUID and var > - */ > - /* NB: We assume EFI_GUID is the same as uuid_t */ > - int aflag = 0, gflag = 0, lflag = 0, vflag = 0; > - int ch, rv; > - unsigned i; > - EFI_STATUS status; > - EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; > - EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; > - uint32_t uuid_status; > - CHAR16 *varname; > - CHAR16 *newnm; > - CHAR16 varnamearg[128]; > - UINTN varalloc; > - UINTN varsz; > - > - while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { > - switch (ch) { > - case 'a': > - aflag = 1; > - break; > - case 'g': > - gflag = 1; > - uuid_from_string(optarg, (uuid_t *)&matchguid, > - &uuid_status); > - if (uuid_status != uuid_s_ok) { > - printf("uid %s could not be parsed\n", optarg); > - return (CMD_ERROR); > - } > - break; > - case 'l': > - lflag = 1; > - break; > - case 'v': > - vflag = 1; > - if (strlen(optarg) >= nitems(varnamearg)) { > - printf("Variable %s is longer than %zd characters\n", > - optarg, nitems(varnamearg)); > - return (CMD_ERROR); > - } > - for (i = 0; i < strlen(optarg); i++) > - varnamearg[i] = optarg[i]; > - varnamearg[i] = 0; > - break; > - default: > - printf("Invalid argument %c\n", ch); > - return (CMD_ERROR); > - } > - } > - > - if (aflag && (gflag || vflag)) { > - printf("-a isn't compatible with -v or -u\n"); > - return (CMD_ERROR); > - } > - > - if (aflag && optind < argc) { > - printf("-a doesn't take any args"); > - return (CMD_ERROR); > - } > - > - if (optind == argc) > - aflag = 1; > - > - argc -= optind; > - argv += optind; > - > - pager_open(); > - if (vflag && gflag) { > - rv = efi_print_var(varnamearg, &matchguid, lflag); > - pager_close(); > - return (rv); > - } > - > - if (argc == 2) { > - optarg = argv[0]; > - if (strlen(optarg) >= nitems(varnamearg)) { > - printf("Variable %s is longer than %zd characters\n", > - optarg, nitems(varnamearg)); > - pager_close(); > - return (CMD_ERROR); > - } > - for (i = 0; i < strlen(optarg); i++) > - varnamearg[i] = optarg[i]; > - varnamearg[i] = 0; > - optarg = argv[1]; > - uuid_from_string(optarg, (uuid_t *)&matchguid, > - &uuid_status); > - if (uuid_status != uuid_s_ok) { > - printf("uid %s could not be parsed\n", optarg); > - pager_close(); > - return (CMD_ERROR); > - } > - rv = efi_print_var(varnamearg, &matchguid, lflag); > - pager_close(); > - return (rv); > - } > - > - if (argc > 0) { > - printf("Too many args %d\n", argc); > - pager_close(); > - return (CMD_ERROR); > - } > - > - /* > - * Initiate the search -- note the standard takes pain > - * to specify the initial call must be a poiner to a NULL > - * character. > - */ > - varalloc = 1024; > - varname = malloc(varalloc); > - if (varname == NULL) { > - printf("Can't allocate memory to get variables\n"); > - pager_close(); > - return (CMD_ERROR); > - } > - varname[0] = 0; > - while (1) { > - varsz = varalloc; > - status = RS->GetNextVariableName(&varsz, varname, &varguid); > - if (status == EFI_BUFFER_TOO_SMALL) { > - varalloc = varsz; > - newnm = malloc(varalloc); > - if (newnm == NULL) { > - printf("Can't allocate memory to get variables\n"); > - free(varname); > - pager_close(); > - return (CMD_ERROR); > - } > - memcpy(newnm, varname, varsz); > - free(varname); > - varname = newnm; > - continue; /* Try again with bigger buffer */ > - } > - if (status != EFI_SUCCESS) > - break; > - if (aflag) { > - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > - break; > - continue; > - } > - if (vflag) { > - if (wcscmp(varnamearg, varname) == 0) { > - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > - break; > - continue; > - } > - } > - if (gflag) { > - if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) { > - if (efi_print_var(varname, &varguid, lflag) != CMD_OK) > - break; > - continue; > - } > - } > - } > - free(varname); > - pager_close(); > - > - return (CMD_OK); > -} > - > -COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set); > - > -static int > -command_efi_set(int argc, char *argv[]) > -{ > - char *uuid, *var, *val; > - CHAR16 wvar[128]; > - EFI_GUID guid; > - uint32_t status; > - EFI_STATUS err; > - > - if (argc != 4) { > - printf("efi-set uuid var new-value\n"); > - return (CMD_ERROR); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Fri Feb 3 05:15:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 556D7CCE019; Fri, 3 Feb 2017 05:15:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1AF8790; Fri, 3 Feb 2017 05:15:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v135F9Uc089044; Fri, 3 Feb 2017 05:15:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v135F84O089041; Fri, 3 Feb 2017 05:15:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702030515.v135F84O089041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Feb 2017 05:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313135 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 05:15:10 -0000 Author: adrian Date: Fri Feb 3 05:15:08 2017 New Revision: 313135 URL: https://svnweb.freebsd.org/changeset/base/313135 Log: [ath_hal] prepare for CAC quiet time. To support DFS, the NIC needs to be very quiet during this time. No transmissions including ACKs are allowed. This is just the initial HAL glue. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Feb 3 03:57:06 2017 (r313134) +++ head/sys/dev/ath/ath_hal/ah.c Fri Feb 3 05:15:08 2017 (r313135) @@ -1429,6 +1429,21 @@ ath_hal_getcca(struct ath_hal *ah) } /* + * Set the current state of self-generated ACK and RTS/CTS frames. + * + * For correct DFS operation, the device should not even /ACK/ frames + * that are sent to it during CAC or CSA. + */ +void +ath_hal_set_dfs_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL ena) +{ + + if (ah->ah_setDfsCacTxQuiet == NULL) + return; + ah->ah_setDfsCacTxQuiet(ah, ena); +} + +/* * This routine is only needed when supporting EEPROM-in-RAM setups * (eg embedded SoCs and on-board PCI/PCIe devices.) */ Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Feb 3 03:57:06 2017 (r313134) +++ head/sys/dev/ath/ath_hal/ah.h Fri Feb 3 05:15:08 2017 (r313135) @@ -1395,6 +1395,7 @@ struct ath_hal { struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); HAL_BOOL __ahdecl(*ah_isFastClockEnabled)(struct ath_hal *ah); + void __ahdecl(*ah_setDfsCacTxQuiet)(struct ath_hal *, HAL_BOOL); /* Spectral Scan functions */ void __ahdecl(*ah_spectralConfigure)(struct ath_hal *ah, @@ -1660,6 +1661,11 @@ void __ahdecl ath_hal_setcca(struct ath_ int __ahdecl ath_hal_getcca(struct ath_hal *ah); /* + * Enable/disable and get self-gen frame (ACK, CTS) for CAC. + */ +void __ahdecl ath_hal_set_dfs_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL ena); + +/* * Read EEPROM data from ah_eepromdata */ HAL_BOOL __ahdecl ath_hal_EepromDataRead(struct ath_hal *ah, From owner-svn-src-head@freebsd.org Fri Feb 3 05:15:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B59CCE05D; Fri, 3 Feb 2017 05:15:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBC898D5; Fri, 3 Feb 2017 05:15:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v135Farn089115; Fri, 3 Feb 2017 05:15:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v135FZQ6089112; Fri, 3 Feb 2017 05:15:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702030515.v135FZQ6089112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Feb 2017 05:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313136 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 05:15:37 -0000 Author: adrian Date: Fri Feb 3 05:15:35 2017 New Revision: 313136 URL: https://svnweb.freebsd.org/changeset/base/313136 Log: [ath_hal] [ar9300] link in the CAC enable/diable methods and expose it via the HAL. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Feb 3 05:15:08 2017 (r313135) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Feb 3 05:15:35 2017 (r313136) @@ -417,7 +417,8 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_getDfsDefaultThresh = ar9300_get_default_dfs_thresh; ah->ah_procRadarEvent = ar9300_freebsd_proc_radar_event; ah->ah_isFastClockEnabled = ar9300_is_fast_clock_enabled; - ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy; + ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy; + ah->ah_setDfsCacTxQuiet = ar9300_cac_tx_quiet; /* Spectral Scan Functions */ ah->ah_spectralConfigure = ar9300_configure_spectral_scan; Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Fri Feb 3 05:15:08 2017 (r313135) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Fri Feb 3 05:15:35 2017 (r313136) @@ -649,11 +649,12 @@ ar9300_set_quiet(struct ath_hal *ah, u_i return status; #undef TU_TO_USEC } -#ifdef ATH_SUPPORT_DFS + +//#ifdef ATH_SUPPORT_DFS void ar9300_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL enable) { - u32 reg1, reg2; + uint32_t reg1, reg2; reg1 = OS_REG_READ(ah, AR_MAC_PCU_OFFSET(MAC_PCU_MISC_MODE)); reg2 = OS_REG_READ(ah, AR_MAC_PCU_OFFSET(MAC_PCU_QUIET_TIME_1)); @@ -671,7 +672,7 @@ ar9300_cac_tx_quiet(struct ath_hal *ah, reg2 | AR_QUIET1_QUIET_ACK_CTS_ENABLE); } } -#endif /* ATH_SUPPORT_DFS */ +//#endif /* ATH_SUPPORT_DFS */ void ar9300_set_pcu_config(struct ath_hal *ah) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Feb 3 05:15:08 2017 (r313135) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Feb 3 05:15:35 2017 (r313136) @@ -4263,11 +4263,11 @@ ar9300_init_user_settings(struct ath_hal if (ahp->ah_beacon_rssi_threshold != 0) { ar9300_set_hw_beacon_rssi_threshold(ah, ahp->ah_beacon_rssi_threshold); } -#ifdef ATH_SUPPORT_DFS +//#ifdef ATH_SUPPORT_DFS if (ahp->ah_cac_quiet_enabled) { ar9300_cac_tx_quiet(ah, 1); } -#endif /* ATH_SUPPORT_DFS */ +//#endif /* ATH_SUPPORT_DFS */ } int From owner-svn-src-head@freebsd.org Fri Feb 3 06:04:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9885FCCEBC2; Fri, 3 Feb 2017 06:04:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 431DE1DC3; Fri, 3 Feb 2017 06:04:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13646Ni009842; Fri, 3 Feb 2017 06:04:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13646eL009841; Fri, 3 Feb 2017 06:04:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702030604.v13646eL009841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Feb 2017 06:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313137 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 06:04:07 -0000 Author: adrian Date: Fri Feb 3 06:04:06 2017 New Revision: 313137 URL: https://svnweb.freebsd.org/changeset/base/313137 Log: [net80211] don't update quiet time counter values every probe request. The quiet time counter update is happening each time the IE is added, which also means it happens for each quiet time IE addition to the probe response. Only update the countdown if we request ie (ie, beacon updates.) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Feb 3 05:15:35 2017 (r313136) +++ head/sys/net80211/ieee80211_output.c Fri Feb 3 06:04:06 2017 (r313137) @@ -2016,16 +2016,23 @@ ieee80211_add_supportedchannels(uint8_t * Add an 11h Quiet time element to a frame. */ static uint8_t * -ieee80211_add_quiet(uint8_t *frm, struct ieee80211vap *vap) +ieee80211_add_quiet(uint8_t *frm, struct ieee80211vap *vap, int update) { struct ieee80211_quiet_ie *quiet = (struct ieee80211_quiet_ie *) frm; quiet->quiet_ie = IEEE80211_ELEMID_QUIET; quiet->len = 6; - if (vap->iv_quiet_count_value == 1) - vap->iv_quiet_count_value = vap->iv_quiet_count; - else if (vap->iv_quiet_count_value > 1) - vap->iv_quiet_count_value--; + + /* + * Only update every beacon interval - otherwise probe responses + * would update the quiet count value. + */ + if (update) { + if (vap->iv_quiet_count_value == 1) + vap->iv_quiet_count_value = vap->iv_quiet_count; + else if (vap->iv_quiet_count_value > 1) + vap->iv_quiet_count_value--; + } if (vap->iv_quiet_count_value == 0) { /* value 0 is reserved as per 802.11h standerd */ @@ -2812,7 +2819,7 @@ ieee80211_alloc_proberesp(struct ieee802 if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { if (vap->iv_quiet) - frm = ieee80211_add_quiet(frm, vap); + frm = ieee80211_add_quiet(frm, vap, 0); } } if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) @@ -3161,7 +3168,7 @@ ieee80211_beacon_construct(struct mbuf * if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { if (vap->iv_quiet) - frm = ieee80211_add_quiet(frm,vap); + frm = ieee80211_add_quiet(frm,vap, 0); } } else bo->bo_quiet = frm; @@ -3596,7 +3603,7 @@ ieee80211_beacon_update(struct ieee80211 if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS) ){ if (vap->iv_quiet) - ieee80211_add_quiet(bo->bo_quiet, vap); + ieee80211_add_quiet(bo->bo_quiet, vap, 1); } if (isset(bo->bo_flags, IEEE80211_BEACON_ERP)) { /* From owner-svn-src-head@freebsd.org Fri Feb 3 07:51:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D32CCD05D; Fri, 3 Feb 2017 07:51:34 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.33]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailhost.dlr.de", Issuer "DLR CA - G02" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9D5C1128; Fri, 3 Feb 2017 07:51:33 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from DLREXHUB02.intra.dlr.de (172.21.152.140) by mailhost.dlr.de (172.21.163.101) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 3 Feb 2017 08:51:18 +0100 Received: from DLREXMBX01.intra.dlr.de ([fe80::d198:77e5:d411:fccd]) by dlrexhub02.intra.dlr.de ([::1]) with mapi id 14.03.0319.002; Fri, 3 Feb 2017 08:51:24 +0100 From: To: CC: , , Subject: RE: svn commit: r313043 - head/sys/kern Thread-Topic: svn commit: r313043 - head/sys/kern Thread-Index: AQHSfIzUaHU0GSnLtUmrDysUntoftKFUYnQAgAD1jACAALH/gIAA4GAA Date: Fri, 3 Feb 2017 07:51:24 +0000 Message-ID: <611243783F62AF48AFB07BC25FA4B1061CEDA7DC@DLREXMBX01.intra.dlr.de> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> <20170201180816.GF3334@FreeBSD.org> <611243783F62AF48AFB07BC25FA4B1061CED9FD9@DLREXMBX01.intra.dlr.de> <20170202192411.GK3334@FreeBSD.org> In-Reply-To: <20170202192411.GK3334@FreeBSD.org> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Content-Type: multipart/mixed; boundary="_002_611243783F62AF48AFB07BC25FA4B1061CEDA7DCDLREXMBX01intra_" MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4283-8.100.1062-22862.005 X-TM-AS-Result: No--25.031400-5.000000-31 X-TM-AS-MatchedID: 150567-147015-700133-703829-106420-105700-702358-700767-7 09251-706290-700173-700324-707066-704852-706247-704421-703454-700398-711109 -843079-139006-708497-704746-106660-700107-709584-700970-186035-703747-7000 75-703788-702020-700476-700316-706891-705388-863828-701674-700486-700294-70 0693-711608-700516-702920-709512-701162-702367-701708-703712-704179-703283- 703969-704425-702037-706817-139705-701305-707027-705901-105250-703566-70147 5-187067-702560-106230-148035-148050-23116-42003 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 07:51:34 -0000 --_002_611243783F62AF48AFB07BC25FA4B1061CEDA7DCDLREXMBX01intra_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It was attached to my mail, but maybe got removed somewhere. Here it is. It= does not use asio, but reproduces the same sequence of system calls. You s= tart it and the try to connect with telnet to port 10000. harti #include #include #include #include #include #include #include #include #include static void wait_loop(int kq, int sock) { struct kevent ev[32]; struct sockaddr_in addr; socklen_t socklen; for (;;) { int nev =3D kevent(kq, NULL, 0, ev, 32, NULL); if (nev < 1) err(1, "kevent"); for (int i =3D 0; i < nev; ++i) { if (ev[i].ident =3D=3D sock) { printf("accept\n"); int fd =3D accept(ev[i].ident, (struct sockaddr *)&addr, &socklen); if (fd =3D=3D -1) err(1, "accept"); } } } } int main() { struct sockaddr_in addr; /* open a TCP socket */ int kq =3D kqueue(); int sock =3D socket(PF_INET, SOCK_STREAM, 0); struct kevent ev[2]; EV_SET(&ev[0], sock, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL); EV_SET(&ev[1], sock, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, NULL); int opt =3D 1; setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt)); if (kevent(kq, ev, 2, NULL, 0, NULL) =3D=3D -1) err(1, "kevent"); setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); memset(&addr, 0, sizeof(addr)); addr.sin_port =3D htons(10000); bind(sock, (struct sockaddr *)&addr, sizeof(addr)); listen(sock, 0x80); ioctl(sock, FIONBIO, &opt); if (kevent(kq, ev, 2, NULL, 0, NULL) =3D=3D -1) err(1, "kevent"); wait_loop(kq, sock); } -----Original Message----- From: Gleb Smirnoff [mailto:glebius@FreeBSD.org]=20 Sent: Thursday, February 02, 2017 8:24 PM To: Brandt, Hartmut Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r313043 - head/sys/kern Hartmut, Thanks for explanation! Is there a test program available to reproduce th= e problem? I want to try the sequence on my branch. On Thu, Feb 02, 2017 at 08:29:20AM +0000, Hartmut.Brandt@dlr.de wrote: H> To be honest - I feared that when I saw your messages regarding this. He= re is my original message from july. Attached is also a small test program. H>=20 H> Hi, H>=20 H> I'm trying to use asio (that's boost::asio without boost) to handle list= ening sockets asynchronuosly. This appears not to work. There are also some= reports on the net about this problem. I was able to reproduce the problem= with a small C-programm that does the same steps as asio. The relevant seq= uence of system calls is: H>=20 H> kqueue() =3D 3 (0x3) H> socket(PF_INET,SOCK_STREAM,6) =3D 4 (0x4) H> setsockopt(0x4,0xffff,0x800,0x7fffffffea2c,0x4) =3D 0 (0x0) H> kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_A= DD|EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) =3D 0 (0x0) H> setsockopt(0x4,0xffff,0x4,0x7fffffffea2c,0x4) =3D 0 (0x0) H> bind(4,{ AF_INET 0.0.0.0:8080 },16) =3D 0 (0x0) H> listen(0x4,0x80) =3D 0 (0x0) H> ioctl(4,FIONBIO,0xffffea2c) =3D 0 (0x0) H> kevent(3,{ 4,EVFILT_READ,EV_ADD|EV_CLEAR,0x0,0x0,0x0 4,EVFILT_WRITE,EV_A= DD|EV_CLEAR,0x0,0x0,0x0 },2,0x0,0,0x0) =3D 0 (0x0) H> kevent(3,0x0,0,0x7fffffffe5a0,32,0x0) ERR#4 'Interrupted system call' H>=20 H> The problem here is that asio registers each file descriptor with EVFILT= _READ and EVFILT_WRITE as soon as it is opened (first kevent call).=20 H> After bringing the socket into the listening state and when async_accept= () is called it registers the socket a second time. According to the man pa= ge this is perfectly legal and can be used to modify the registration. H>=20 H> With this sequence of calls kevent() does not return when a connection i= s established successfully. H>=20 H> I tracked down the problem and the reason is in soo_kqfilter(). This is = called for the first EVFILT_READ registration and decides based on the SO_A= CCEPTCONN flag which filter operations to use solisten_filtops or soread_fi= ltops. In this case it chooses soread_filtops. H>=20 H> The second EVFILT_READ registration does not call soo_kqfilter() again, = but just updates the filter from the data and fflags field so the listening= socket ends up with the wrong filter operations. H>=20 H>=20 H>=20 H> -----Original Message----- H> From: Gleb Smirnoff [mailto:glebius@FreeBSD.org] H> Sent: Wednesday, February 01, 2017 7:08 PM H> To: Hartmut Brandt H> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org;=20 H> svn-src-head@freebsd.org H> Subject: Re: svn commit: r313043 - head/sys/kern H>=20 H> On Wed, Feb 01, 2017 at 01:12:07PM +0000, Hartmut Brandt wrote: H> H> Author: harti H> H> Date: Wed Feb 1 13:12:07 2017 H> H> New Revision: 313043 H> H> URL: https://svnweb.freebsd.org/changeset/base/313043 H> H>=20 H> H> Log: H> H> Merge filt_soread and filt_solisten and decide what to do when chec= king H> H> for EVFILT_READ at the point of the check not when the event is reg= isters. H> H> This fixes a problem with asio when accepting a connection. H> H> =20 H> H> Reviewed by: kib@, Scott Mitchell H>=20 H> This goes into opposite direction with what I am doing: H>=20 H> https://reviews.freebsd.org/D9356 H>=20 H> Can you please explain the problem with asio when accepting a connection= ? H>=20 H> -- H> Totus tuus, Glebius. H>=20 H> #include H> #include H> #include H> #include H>=20 H> #include H> #include H> #include H> #include H> #include H>=20 H> static void H> wait_loop(int kq, int sock) H> { H> struct kevent ev[32]; H> struct sockaddr_in addr; H> socklen_t socklen; H>=20 H> for (;;) { H> int nev =3D kevent(kq, NULL, 0, ev, 32, NULL); H> if (nev < 1) H> err(1, "kevent"); H> for (int i =3D 0; i < nev; ++i) { H> if (ev[i].ident =3D=3D sock) { H> printf("accept\n"); H> int fd =3D accept(ev[i].ident, H> (struct sockaddr *)&addr, &socklen); H> if (fd =3D=3D -1) H> err(1, "accept"); H> } H> } H> } H> } H>=20 H> int H> main() H> { H> struct sockaddr_in addr; H>=20 H> /* open a TCP socket */ H> int kq =3D kqueue(); H>=20 H> int sock =3D socket(PF_INET, SOCK_STREAM, 0); H>=20 H> struct kevent ev[2]; H> EV_SET(&ev[0], sock, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL); H> EV_SET(&ev[1], sock, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, NULL); H>=20 H> int opt =3D 1; H> setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt)); H>=20 H> if (kevent(kq, ev, 2, NULL, 0, NULL) =3D=3D -1) H> err(1, "kevent"); H>=20 H> setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); H>=20 H> memset(&addr, 0, sizeof(addr)); H> addr.sin_port =3D htons(10000); H>=20 H> bind(sock, (struct sockaddr *)&addr, sizeof(addr)); H> listen(sock, 0x80); H>=20 H> ioctl(sock, FIONBIO, &opt); H>=20 H> if (kevent(kq, ev, 2, NULL, 0, NULL) =3D=3D -1) H> err(1, "kevent"); H>=20 H> wait_loop(kq, sock); H> } --=20 Totus tuus, Glebius. --_002_611243783F62AF48AFB07BC25FA4B1061CEDA7DCDLREXMBX01intra_ Content-Type: text/plain; name="k.c" Content-Description: k.c Content-Disposition: attachment; filename="k.c"; size=1459; creation-date="Fri, 03 Feb 2017 07:47:17 GMT"; modification-date="Fri, 03 Feb 2017 07:47:17 GMT" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4NCiNpbmNsdWRl IDxzeXMvZXZlbnQuaD4NCiNpbmNsdWRlIDxzeXMvZmlsaW8uaD4NCg0KI2luY2x1ZGUgPHN5cy9p b2N0bC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2lu Y2x1ZGUgPHN0cmluZy5oPg0KI2luY2x1ZGUgPGVyci5oPg0KDQpzdGF0aWMgdm9pZA0Kd2FpdF9s b29wKGludCBrcSwgaW50IHNvY2spDQp7DQoJc3RydWN0IGtldmVudCBldlszMl07DQoJc3RydWN0 IHNvY2thZGRyX2luIGFkZHI7DQoJc29ja2xlbl90IHNvY2tsZW47DQoNCglmb3IgKDs7KSB7DQoJ CWludCBuZXYgPSBrZXZlbnQoa3EsIE5VTEwsIDAsIGV2LCAzMiwgTlVMTCk7DQoJCWlmIChuZXYg PCAxKQ0KCQkJZXJyKDEsICJrZXZlbnQiKTsNCgkJZm9yIChpbnQgaSA9IDA7IGkgPCBuZXY7ICsr aSkgew0KCQkJaWYgKGV2W2ldLmlkZW50ID09IHNvY2spIHsNCgkJCQlwcmludGYoImFjY2VwdFxu Iik7DQoJCQkJaW50IGZkID0gYWNjZXB0KGV2W2ldLmlkZW50LA0KCQkJCSAgICAoc3RydWN0IHNv Y2thZGRyICopJmFkZHIsICZzb2NrbGVuKTsNCgkJCQlpZiAoZmQgPT0gLTEpDQoJCQkJCWVycigx LCAiYWNjZXB0Iik7DQoJCQl9DQoJCX0NCgl9DQp9DQoNCmludA0KbWFpbigpDQp7DQoJc3RydWN0 IHNvY2thZGRyX2luIGFkZHI7DQoNCgkvKiBvcGVuIGEgVENQIHNvY2tldCAqLw0KCWludCBrcSA9 IGtxdWV1ZSgpOw0KDQoJaW50IHNvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIDAp Ow0KDQoJc3RydWN0IGtldmVudCBldlsyXTsNCglFVl9TRVQoJmV2WzBdLCBzb2NrLCBFVkZJTFRf UkVBRCwgRVZfQUREIHwgRVZfQ0xFQVIsIDAsIDAsIE5VTEwpOw0KCUVWX1NFVCgmZXZbMV0sIHNv Y2ssIEVWRklMVF9XUklURSwgRVZfQUREIHwgRVZfQ0xFQVIsIDAsIDAsIE5VTEwpOw0KDQoJaW50 IG9wdCA9IDE7DQoJc2V0c29ja29wdChzb2NrLCBTT0xfU09DS0VULCBTT19OT1NJR1BJUEUsICZv cHQsIHNpemVvZihvcHQpKTsNCg0KCWlmIChrZXZlbnQoa3EsIGV2LCAyLCBOVUxMLCAwLCBOVUxM KSA9PSAtMSkNCgkgICAgZXJyKDEsICJrZXZlbnQiKTsNCg0KCXNldHNvY2tvcHQoc29jaywgU09M X1NPQ0tFVCwgU09fUkVVU0VBRERSLCAmb3B0LCBzaXplb2Yob3B0KSk7DQoNCgltZW1zZXQoJmFk ZHIsIDAsIHNpemVvZihhZGRyKSk7DQoJYWRkci5zaW5fcG9ydCA9IGh0b25zKDEwMDAwKTsNCg0K CWJpbmQoc29jaywgKHN0cnVjdCBzb2NrYWRkciAqKSZhZGRyLCBzaXplb2YoYWRkcikpOw0KCWxp c3Rlbihzb2NrLCAweDgwKTsNCg0KCWlvY3RsKHNvY2ssIEZJT05CSU8sICZvcHQpOw0KDQoJaWYg KGtldmVudChrcSwgZXYsIDIsIE5VTEwsIDAsIE5VTEwpID09IC0xKQ0KCQllcnIoMSwgImtldmVu dCIpOw0KDQoJd2FpdF9sb29wKGtxLCBzb2NrKTsNCn0NCg== --_002_611243783F62AF48AFB07BC25FA4B1061CEDA7DCDLREXMBX01intra_-- From owner-svn-src-head@freebsd.org Fri Feb 3 08:26:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BC4CCE02B; Fri, 3 Feb 2017 08:26:56 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7B41847; Fri, 3 Feb 2017 08:26:55 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id n13so3133903qtc.0; Fri, 03 Feb 2017 00:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D6cxxxfO/7Ovb9R6n/rvYz3KaDEogdGDx9ZxM8NxjAk=; b=lTLSLjK63kVEhKYKIME+adKf4FoL9ZFDEPF//n+KJaijX52GQw6FMap/HBHsLU5lMZ kfgkA0qEael8Rgygl9yDxo2dDfzmHit3PhNG+WBi2XNoDl9n0J35l2wVAgR17B1iObAT /xYEjm0xUGE1XcXGddRmZfSxhoWQvmiY5C0cTKaK2T51KZxF5ISVlND2kIsyHSg2w1Cl f0HJQbjOdHivta/J7Ad4LyC9GA8P6xE4yl4qVW+EVeJDXy1gUpn1iKRH0fxwq3dMVTpj 9Kzip63Pe1PH6QgF/QTK0xauHR9yzs/QqYn4X2enVDLkM3suUT0WWVThSyIfG2rOIVZY Nadw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=D6cxxxfO/7Ovb9R6n/rvYz3KaDEogdGDx9ZxM8NxjAk=; b=RX1tG8QxgNH1z7DPagYkcgiuQcR+z2Frjwc2FbJa2lRka74IYS6dJeHOTMpqDhTZro EKntf9z+ZB1dKIxydDkHtmIpLylZbV37ODNYe6wWxzlWDNkNjqmEqOQOJhUWtCD+e50Y vasCvEHxEk6bEnujALwqinfalKlrdmDVwRKtuwA5mrQKkL/aCN2kZQWmZiZQjMy7YOzs u4YuszZ0SrRworTxI1f25TRVB8GIllrG1o5h3+wGj3F4e8vRAIShNYPjp/b5bhIlYGLw gYjsn2B0KKmXtBKQSgXpxsJEAywgKaqsp7yS8r3+/Kz48cD4cJ52Ksq/qdBVbx57mGo3 akuw== X-Gm-Message-State: AIkVDXKI06ZSHootOVv2YbA8h7Y+3/gXfOj9rbLowc9eYgUbGd9oH5NAVQkaGNtoLd8GJA== X-Received: by 10.233.237.13 with SMTP id c13mr13232117qkg.227.1486110414997; Fri, 03 Feb 2017 00:26:54 -0800 (PST) Received: from mbp.home ([200.236.247.6]) by smtp.gmail.com with ESMTPSA id l53sm23790052qtl.41.2017.02.03.00.26.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 00:26:53 -0800 (PST) Sender: Renato Botelho Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313048 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump From: Renato Botelho In-Reply-To: <201702012026.v11KQgS3069932@repo.freebsd.org> Date: Fri, 3 Feb 2017 06:26:49 -0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201702012026.v11KQgS3069932@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 08:26:56 -0000 > On 1 Feb 2017, at 18:26, Gleb Smirnoff wrote: > > Author: glebius > Date: Wed Feb 1 20:26:42 2017 > New Revision: 313048 > URL: https://svnweb.freebsd.org/changeset/base/313048 > > Log: > Update tcpdump to 4.9.0. > > It fixes many buffer overflow in different protocol parsers, but none of > them are critical, even in absense of Capsicum. > > Security: CVE-2016-7922, CVE-2016-7923, CVE-2016-7924, CVE-2016-7925 > Security: CVE-2016-7926, CVE-2016-7927, CVE-2016-7928, CVE-2016-7929 > Security: CVE-2016-7930, CVE-2016-7931, CVE-2016-7932, CVE-2016-7933 > Security: CVE-2016-7934, CVE-2016-7935, CVE-2016-7936, CVE-2016-7937 > Security: CVE-2016-7938, CVE-2016-7939, CVE-2016-7940, CVE-2016-7973 > Security: CVE-2016-7974, CVE-2016-7975, CVE-2016-7983, CVE-2016-7984 > Security: CVE-2016-7985, CVE-2016-7986, CVE-2016-7992, CVE-2016-7993 > Security: CVE-2016-8574, CVE-2016-8575, CVE-2017-5202, CVE-2017-5203 > Security: CVE-2017-5204, CVE-2017-5205, CVE-2017-5341, CVE-2017-5342 > Security: CVE-2017-5482, CVE-2017-5483, CVE-2017-5484, CVE-2017-5485 > Security: CVE-2017-5486 Hi Gleb, Do you plan to MFC it to stable/11 and stable/10? -- Renato Botelho From owner-svn-src-head@freebsd.org Fri Feb 3 08:32:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9DC4CCE364; Fri, 3 Feb 2017 08:32:30 +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 83E92100F; Fri, 3 Feb 2017 08:32:30 +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 689721FE025; Fri, 3 Feb 2017 09:31:42 +0100 (CET) Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern To: Bruce Evans References: <201701310326.v0V3QW30024375@repo.freebsd.org> <20170131153411.G1061@besplex.bde.org> <20170131175309.N1418@besplex.bde.org> <20170201005009.E2504@besplex.bde.org> Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <553e4199-c80e-88dd-109a-cc1cd1520d6a@selasky.org> Date: Fri, 3 Feb 2017 09:31:48 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170201005009.E2504@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 08:32:30 -0000 On 01/31/17 16:36, Bruce Evans wrote: >> gcc-4.2.1 is an ancient compiler. Good riddance. > > I prefer it. This change also breaks compilation with clang v3.6 (FYI) --HPS From owner-svn-src-head@freebsd.org Fri Feb 3 10:04:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5903CCCBEE; Fri, 3 Feb 2017 10:04:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 759DD8C4; Fri, 3 Feb 2017 10:04:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13A4HBV009692; Fri, 3 Feb 2017 10:04:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13A4HfA009691; Fri, 3 Feb 2017 10:04:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702031004.v13A4HfA009691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Feb 2017 10:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313141 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 10:04:18 -0000 Author: andrew Date: Fri Feb 3 10:04:17 2017 New Revision: 313141 URL: https://svnweb.freebsd.org/changeset/base/313141 Log: Only define atomic_fcmpset_long in the kernel. We may include machine/atomic.h in userspace, however atomic_fcmpset_32 is unimplemented there. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Fri Feb 3 08:15:23 2017 (r313140) +++ head/sys/arm/include/atomic-v4.h Fri Feb 3 10:04:17 2017 (r313141) @@ -463,6 +463,8 @@ atomic_cmpset_long(volatile u_long *dst, return (atomic_cmpset_32((volatile uint32_t *)dst, old, newe)); } +#ifdef _KERNEL +/* atomic_fcmpset_32 is only defined for the kernel */ static __inline u_long atomic_fcmpset_long(volatile u_long *dst, u_long *old, u_long newe) { @@ -470,6 +472,7 @@ atomic_fcmpset_long(volatile u_long *dst return (atomic_fcmpset_32((volatile uint32_t *)dst, (uint32_t *)old, newe)); } +#endif static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) From owner-svn-src-head@freebsd.org Fri Feb 3 11:47:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF8B7CCE2BC; Fri, 3 Feb 2017 11:47:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F209DB3; Fri, 3 Feb 2017 11:47:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13Blv9F050859; Fri, 3 Feb 2017 11:47:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13BlvsB050858; Fri, 3 Feb 2017 11:47:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702031147.v13BlvsB050858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Feb 2017 11:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313145 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 11:47:58 -0000 Author: andrew Date: Fri Feb 3 11:47:57 2017 New Revision: 313145 URL: https://svnweb.freebsd.org/changeset/base/313145 Log: Remove an old use of _ARM_ARCH_6, we are moving to using the standard __ARM_ARCH >= 6 spelling. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/asmacros.h Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Fri Feb 3 11:18:34 2017 (r313144) +++ head/sys/arm/include/asmacros.h Fri Feb 3 11:47:57 2017 (r313145) @@ -35,7 +35,7 @@ #ifdef LOCORE -#ifdef _ARM_ARCH_6 +#if __ARM_ARCH >= 6 #define GET_CURTHREAD_PTR(tmp) \ mrc p15, 0, tmp, c13, c0, 4 #else From owner-svn-src-head@freebsd.org Fri Feb 3 11:51:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F305CCE6F1; Fri, 3 Feb 2017 11:51:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C97D412D9; Fri, 3 Feb 2017 11:51:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13Bp6JQ051943; Fri, 3 Feb 2017 11:51:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13Bp6Xl051942; Fri, 3 Feb 2017 11:51:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702031151.v13Bp6Xl051942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Feb 2017 11:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313146 - head/lib/libc/aarch64/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 11:51:08 -0000 Author: andrew Date: Fri Feb 3 11:51:06 2017 New Revision: 313146 URL: https://svnweb.freebsd.org/changeset/base/313146 Log: Fix the comment showing the meaning of the first argument to sigprocmask. Sponsored by: ABT Systems Ltd Modified: head/lib/libc/aarch64/gen/setjmp.S Modified: head/lib/libc/aarch64/gen/setjmp.S ============================================================================== --- head/lib/libc/aarch64/gen/setjmp.S Fri Feb 3 11:47:57 2017 (r313145) +++ head/lib/libc/aarch64/gen/setjmp.S Fri Feb 3 11:51:06 2017 (r313146) @@ -82,7 +82,7 @@ ENTRY(longjmp) /* Restore the signal mask */ mov x2, #0 /* oset */ add x1, x0, #(_JB_SIGMASK * 8) /* set */ - mov x0, #3 /* SIG_BLOCK */ + mov x0, #3 /* SIG_SETMASK */ bl sigprocmask ldr x1, [sp, #16] From owner-svn-src-head@freebsd.org Fri Feb 3 12:51:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B5ACCD88E; Fri, 3 Feb 2017 12:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A63451; Fri, 3 Feb 2017 12:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13Cpg4N078967; Fri, 3 Feb 2017 12:51:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13Cpexi078938; Fri, 3 Feb 2017 12:51:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702031251.v13Cpexi078938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Feb 2017 12:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313154 - in head/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 12:51:43 -0000 Author: kib Date: Fri Feb 3 12:51:40 2017 New Revision: 313154 URL: https://svnweb.freebsd.org/changeset/base/313154 Log: For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE and device npx. This means that FPU is always initialized and handled when available, and SSE+ register file and exception are handled when available. This makes the kernel FPU code much easier to maintain by the cost of slight bloat for CPUs older than 25 years. CPU_DISABLE_CMPXCHG outlived its usefulness, see the removed comment explaining the original purpose. Suggested by and discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/conf/files.i386 head/sys/conf/options.i386 head/sys/i386/conf/DEFAULTS head/sys/i386/conf/NOTES head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/exception.s head/sys/i386/i386/initcpu.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/pmap.c head/sys/i386/i386/ptrace_machdep.c head/sys/i386/i386/support.s head/sys/i386/i386/swtch.s head/sys/i386/i386/trap.c head/sys/i386/i386/vm86bios.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/atomic.h head/sys/i386/isa/npx.c head/sys/i386/linux/linux_ptrace.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/identcpu.c Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/conf/files.i386 Fri Feb 3 12:51:40 2017 (r313154) @@ -530,7 +530,7 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/elink.c optional ep | ie -i386/isa/npx.c optional npx +i386/isa/npx.c standard i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/conf/options.i386 Fri Feb 3 12:51:40 2017 (r313154) @@ -50,8 +50,6 @@ CPU_BTB_EN opt_cpu.h CPU_CYRIX_NO_LOCK opt_cpu.h CPU_DIRECT_MAPPED_CACHE opt_cpu.h CPU_DISABLE_5X86_LSSER opt_cpu.h -CPU_DISABLE_CMPXCHG opt_global.h # XXX global, unlike other CPU_* -CPU_DISABLE_SSE opt_cpu.h CPU_ELAN opt_cpu.h CPU_ELAN_PPS opt_cpu.h CPU_ELAN_XTAL opt_cpu.h @@ -113,7 +111,6 @@ NETGRAPH_CRONYX opt_ng_cronyx.h # Device options DEV_APIC opt_apic.h DEV_ATPIC opt_atpic.h -DEV_NPX opt_npx.h # Debugging NPX_DEBUG opt_npx.h Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/conf/DEFAULTS Fri Feb 3 12:51:40 2017 (r313154) @@ -9,9 +9,6 @@ machine i386 device isa options ISAPNP -# Floating point support. -device npx - # Pseudo devices. device mem # Memory and kernel memory devices device io # I/O device Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/conf/NOTES Fri Feb 3 12:51:40 2017 (r313154) @@ -115,15 +115,6 @@ cpu I686_CPU # aka Pentium Pro(tm) # reorder). This option should not be used if you use memory mapped # I/O device(s). # -# CPU_DISABLE_CMPXCHG disables the CMPXCHG instruction on > i386 IA32 -# machines. VmWare 3.x seems to emulate this instruction poorly, causing -# the guest OS to run very slowly. This problem appears to be fixed in -# VmWare 4.x, at least in version 4.5.2, so that enabling this option with -# VmWare 4.x will result in locking operations to be 20-30 times slower. -# Enabling this with an SMP kernel will cause the kernel to be unusable. -# -# CPU_DISABLE_SSE explicitly prevents I686_CPU from turning on SSE. -# # CPU_ELAN enables support for AMDs ElanSC520 CPU. # CPU_ELAN_PPS enables precision timestamp code. # CPU_ELAN_XTAL sets the clock crystal frequency in Hz. @@ -201,8 +192,6 @@ options CPU_BLUELIGHTNING_FPU_OP_CACHE options CPU_BTB_EN options CPU_DIRECT_MAPPED_CACHE options CPU_DISABLE_5X86_LSSER -options CPU_DISABLE_CMPXCHG -#options CPU_DISABLE_SSE options CPU_ELAN options CPU_ELAN_PPS options CPU_ELAN_XTAL=32768000 @@ -313,7 +302,7 @@ device apm_saver # Requires APM # # ISA bus # -device isa # Required by npx(4) +device isa # # Options for `isa': @@ -395,8 +384,7 @@ device dpms # DPMS suspend & resume vi options X86BIOS # -# The Numeric Processing eXtension driver. This is non-optional. -device npx +# Hints for the non-optional Numeric Processing eXtension driver. hint.npx.0.flags="0x0" hint.npx.0.irq="13" Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/elf_machdep.c Fri Feb 3 12:51:40 2017 (r313154) @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -143,13 +139,10 @@ SYSINIT(kelf32, SI_SUB_EXEC, SI_ORDER_AN void elf32_dump_thread(struct thread *td, void *dst, size_t *off) { -#ifdef CPU_ENABLE_SSE void *buf; -#endif size_t len; len = 0; -#ifdef CPU_ENABLE_SSE if (use_xsave) { if (dst != NULL) { npxgetregs(td); @@ -162,7 +155,6 @@ elf32_dump_thread(struct thread *td, voi len += elf32_populate_note(NT_X86_XSTATE, NULL, NULL, cpu_max_ext_state_size, NULL); } -#endif *off = len; } Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/exception.s Fri Feb 3 12:51:40 2017 (r313154) @@ -37,7 +37,6 @@ #include "opt_apic.h" #include "opt_atpic.h" #include "opt_hwpmc_hooks.h" -#include "opt_npx.h" #include #include Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/initcpu.c Fri Feb 3 12:51:40 2017 (r313154) @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - #ifdef I486_CPU static void init_5x86(void); static void init_bluelightning(void); @@ -742,12 +738,10 @@ initializecpu(void) default: break; } -#if defined(CPU_ENABLE_SSE) if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { load_cr4(rcr4() | CR4_FXSR | CR4_XMM); cpu_fxsr = hw_instruction_sse = 1; } -#endif #if defined(PAE) || defined(PAE_TABLES) if ((amd_feature & AMDID_NX) != 0) { uint64_t msr; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/machdep.c Fri Feb 3 12:51:40 2017 (r313154) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_maxmem.h" #include "opt_mp_watchdog.h" -#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_platform.h" #include "opt_xbox.h" @@ -162,10 +161,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern register_t init386(int first); extern void dblfault_handler(void); -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - static void cpu_startup(void *); static void fpstate_drop(struct thread *td); static void get_fpcontext(struct thread *td, mcontext_t *mcp, @@ -621,14 +616,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs = td->td_frame; oonstack = sigonstack(regs->tf_esp); -#ifdef CPU_ENABLE_SSE if (cpu_max_ext_state_size > sizeof(union savefpu) && use_xsave) { xfpusave_len = cpu_max_ext_state_size - sizeof(union savefpu); xfpusave = __builtin_alloca(xfpusave_len); } else { -#else - { -#endif xfpusave_len = 0; xfpusave = NULL; } @@ -2169,9 +2160,7 @@ init386(int first) struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; -#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; -#endif int late_console; thread0.td_kstack = proc0kstack; @@ -2424,9 +2413,7 @@ init386(int first) i386_kdb_init(); msgbufinit(msgbufp, msgbufsize); -#ifdef DEV_NPX npxinit(true); -#endif /* * Set up thread0 pcb after npxinit calculated pcb + fpu save * area size. Zero out the extended state header in fpu save @@ -2434,13 +2421,11 @@ init386(int first) */ thread0.td_pcb = get_pcb_td(&thread0); bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); -#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + 1); xhdr->xstate_bv = xsave_mask; } -#endif PCPU_SET(curpcb, thread0.td_pcb); /* Move esp0 in the tss to its final place. */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ @@ -2707,17 +2692,11 @@ fill_fpregs(struct thread *td, struct fp KASSERT(td == curthread || TD_IS_SUSPENDED(td) || P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); -#ifdef DEV_NPX npxgetregs(td); -#else - bzero(fpregs, sizeof(*fpregs)); -#endif -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) npx_fill_fpregs_xmm(&get_pcb_user_save_td(td)->sv_xmm, (struct save87 *)fpregs); else -#endif /* CPU_ENABLE_SSE */ bcopy(&get_pcb_user_save_td(td)->sv_87, fpregs, sizeof(*fpregs)); return (0); @@ -2727,17 +2706,13 @@ int set_fpregs(struct thread *td, struct fpreg *fpregs) { -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) npx_set_fpregs_xmm((struct save87 *)fpregs, &get_pcb_user_save_td(td)->sv_xmm); else -#endif /* CPU_ENABLE_SSE */ bcopy(fpregs, &get_pcb_user_save_td(td)->sv_87, sizeof(*fpregs)); -#ifdef DEV_NPX npxuserinited(td); -#endif return (0); } @@ -2846,20 +2821,12 @@ static void get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave, size_t xfpusave_len) { -#ifdef CPU_ENABLE_SSE size_t max_len, len; -#endif -#ifndef DEV_NPX - mcp->mc_fpformat = _MC_FPFMT_NODEV; - mcp->mc_ownedfp = _MC_FPOWNED_NONE; - bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); -#else mcp->mc_ownedfp = npxgetregs(td); bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); -#ifdef CPU_ENABLE_SSE if (!use_xsave || xfpusave_len == 0) return; max_len = cpu_max_ext_state_size - sizeof(union savefpu); @@ -2871,8 +2838,6 @@ get_fpcontext(struct thread *td, mcontex mcp->mc_flags |= _MC_HASFPXSTATE; mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); -#endif -#endif } static int @@ -2893,16 +2858,10 @@ set_fpcontext(struct thread *td, mcontex error = 0; } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { -#ifdef DEV_NPX fpstate = (union savefpu *)&mcp->mc_fpstate; -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; -#endif error = npxsetregs(td, fpstate, xfpustate, xfpustate_len); -#else - error = EINVAL; -#endif } else return (EINVAL); return (error); @@ -2914,10 +2873,8 @@ fpstate_drop(struct thread *td) KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); -#ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) npxdrop(); -#endif /* * XXX force a full drop of the npx. The above only drops it if we * owned it. npxgetregs() has the same bug in the !cpu_fxsr case. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/mp_machdep.c Fri Feb 3 12:51:40 2017 (r313154) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #ifndef DEV_APIC #error The apic device is required for SMP, add "device apic" to your config file. #endif -#if defined(CPU_DISABLE_CMPXCHG) && !defined(COMPILING_LINT) -#error SMP not supported with CPU_DISABLE_CMPXCHG -#endif #endif /* not lint */ #include Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/pmap.c Fri Feb 3 12:51:40 2017 (r313154) @@ -152,10 +152,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 #endif @@ -4217,11 +4213,9 @@ pagezero(void *page) { #if defined(I686_CPU) if (cpu_class == CPUCLASS_686) { -#if defined(CPU_ENABLE_SSE) if (cpu_feature & CPUID_SSE2) sse2_pagezero(page); else -#endif i686_pagezero(page); } else #endif Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/ptrace_machdep.c Fri Feb 3 12:51:40 2017 (r313154) @@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - -#ifdef CPU_ENABLE_SSE static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) { @@ -114,12 +109,10 @@ cpu_ptrace_xstate(struct thread *td, int return (error); } -#endif static int cpu_ptrace_xmm(struct thread *td, int req, void *addr, int data) { -#ifdef CPU_ENABLE_SSE struct savexmm *fpstate; int error; @@ -152,9 +145,6 @@ cpu_ptrace_xmm(struct thread *td, int re } return (error); -#else - return (EINVAL); -#endif } int Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/support.s Fri Feb 3 12:51:40 2017 (r313154) @@ -29,8 +29,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" - #include #include #include Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/swtch.s Fri Feb 3 12:51:40 2017 (r313154) @@ -32,7 +32,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" #include "opt_sched.h" #include @@ -150,7 +149,6 @@ ENTRY(cpu_switch) movl %eax,PCB_DR0(%edx) 1: -#ifdef DEV_NPX /* have we used fp, and need a save? */ cmpl %ecx,PCPU(FPCURTHREAD) jne 1f @@ -158,7 +156,6 @@ ENTRY(cpu_switch) call npxsave /* do it in a big C function */ popl %eax 1: -#endif /* Save is done. Now fire up new thread. Leave old vmspace. */ movl 4(%esp),%edi Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/trap.c Fri Feb 3 12:51:40 2017 (r313154) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_isa.h" #include "opt_kdb.h" -#include "opt_npx.h" #include "opt_stack.h" #include "opt_trap.h" @@ -335,13 +334,9 @@ user_trctrap_out: break; case T_ARITHTRAP: /* arithmetic trap */ -#ifdef DEV_NPX ucode = npxtrap_x87(); if (ucode == -1) goto userout; -#else - ucode = 0; -#endif i = SIGFPE; break; @@ -475,13 +470,11 @@ user_trctrap_out: break; case T_DNA: -#ifdef DEV_NPX KASSERT(PCB_USER_FPU(td->td_pcb), ("kernel FPU ctx has leaked")); /* transparent fault (due to context switch "late") */ if (npxdna()) goto userout; -#endif uprintf("pid %d killed due to lack of floating point\n", p->p_pid); i = SIGKILL; @@ -494,13 +487,9 @@ user_trctrap_out: break; case T_XMMFLT: /* SIMD floating-point exception */ -#if defined(DEV_NPX) && !defined(CPU_DISABLE_SSE) && defined(I686_CPU) ucode = npxtrap_sse(); if (ucode == -1) goto userout; -#else - ucode = 0; -#endif i = SIGFPE; break; #ifdef KDTRACE_HOOKS @@ -524,12 +513,10 @@ user_trctrap_out: goto out; case T_DNA: -#ifdef DEV_NPX if (PCB_USER_FPU(td->td_pcb)) panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; -#endif break; case T_ARITHTRAP: /* arithmetic trap */ Modified: head/sys/i386/i386/vm86bios.s ============================================================================== --- head/sys/i386/i386/vm86bios.s Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/vm86bios.s Fri Feb 3 12:51:40 2017 (r313154) @@ -26,8 +26,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" - #include /* miscellaneous asm macros */ #include @@ -63,7 +61,6 @@ ENTRY(vm86_bioscall) pushl %edi pushl %gs -#ifdef DEV_NPX pushfl cli movl PCPU(CURTHREAD),%ecx @@ -77,7 +74,6 @@ ENTRY(vm86_bioscall) popl %edx /* recover our pcb */ 1: popfl -#endif movl SCR_VMFRAME(%edx),%ebx /* target frame location */ movl %ebx,%edi /* destination */ Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/i386/vm_machdep.c Fri Feb 3 12:51:40 2017 (r313154) @@ -99,10 +99,6 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), @@ -152,18 +148,14 @@ void * alloc_fpusave(int flags) { void *res; -#ifdef CPU_ENABLE_SSE struct savefpu_ymm *sf; -#endif res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags); -#ifdef CPU_ENABLE_SSE if (use_xsave) { sf = (struct savefpu_ymm *)res; bzero(&sf->sv_xstate.sx_hd, sizeof(sf->sv_xstate.sx_hd)); sf->sv_xstate.sx_hd.xstate_bv = xsave_mask; } -#endif return (res); } /* @@ -203,12 +195,10 @@ cpu_fork(struct thread *td1, struct proc /* Ensure that td1's pcb is up to date. */ if (td1 == curthread) td1->td_pcb->pcb_gs = rgs(); -#ifdef DEV_NPX critical_enter(); if (PCPU_GET(fpcurthread) == td1) npxsave(td1->td_pcb->pcb_save); critical_exit(); -#endif /* Point the pcb to the top of the stack */ pcb2 = get_pcb_td(td2); @@ -346,12 +336,10 @@ void cpu_thread_exit(struct thread *td) { -#ifdef DEV_NPX critical_enter(); if (td == PCPU_GET(fpcurthread)) npxdrop(); critical_exit(); -#endif /* Disable any hardware breakpoints. */ if (td->td_pcb->pcb_flags & PCB_DBREGS) { @@ -392,21 +380,17 @@ void cpu_thread_alloc(struct thread *td) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; -#endif td->td_pcb = pcb = get_pcb_td(td); td->td_frame = (struct trapframe *)((caddr_t)pcb - 16) - 1; pcb->pcb_ext = NULL; pcb->pcb_save = get_pcb_user_save_pcb(pcb); -#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1); bzero(xhdr, sizeof(*xhdr)); xhdr->xstate_bv = xsave_mask; } -#endif } void Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/include/atomic.h Fri Feb 3 12:51:40 2017 (r313154) @@ -170,33 +170,6 @@ struct __hack * Returns 0 on failure, non-zero on success */ -#ifdef CPU_DISABLE_CMPXCHG - -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) -{ - u_char res; - - __asm __volatile( - " pushfl ; " - " cli ; " - " cmpl %3,%1 ; " - " jne 1f ; " - " movl %2,%1 ; " - "1: " - " sete %0 ; " - " popfl ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "+m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "r" (expect) /* 3 */ - : "memory"); - return (res); -} - -#else /* !CPU_DISABLE_CMPXCHG */ - static __inline int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) { @@ -233,8 +206,6 @@ atomic_fcmpset_int(volatile u_int *dst, return (res); } -#endif /* CPU_DISABLE_CMPXCHG */ - /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Fri Feb 3 12:48:44 2017 (r313153) +++ head/sys/i386/isa/npx.c Fri Feb 3 12:51:40 2017 (r313154) @@ -74,10 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - /* * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. */ @@ -93,7 +89,6 @@ __FBSDID("$FreeBSD$"); #define fp_divide_by_0() __asm __volatile( \ "fldz; fld1; fdiv %st,%st(1); fnop") #define frstor(addr) __asm __volatile("frstor %0" : : "m" (*(addr))) -#ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) @@ -130,7 +125,6 @@ xsaveopt(char *addr, uint64_t mask) __asm __volatile("xsaveopt %0" : "=m" (*addr) : "a" (low), "d" (hi) : "memory"); } -#endif #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -141,7 +135,6 @@ void fnstcw(caddr_t addr); void fnstsw(caddr_t addr); void fp_divide_by_0(void); void frstor(caddr_t addr); -#ifdef CPU_ENABLE_SSE void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); @@ -149,14 +142,12 @@ void stmxcsr(u_int *csr); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); void xsaveopt(char *addr, uint64_t mask); -#endif #endif /* __GNUCLIKE_ASM && !lint */ #define start_emulating() load_cr0(rcr0() | CR0_TS) #define stop_emulating() clts() -#ifdef CPU_ENABLE_SSE #define GET_FPU_CW(thread) \ (cpu_fxsr ? \ (thread)->td_pcb->pcb_save->sv_xmm.sv_env.en_cw : \ @@ -171,16 +162,7 @@ void xsaveopt(char *addr, uint64_t mask) else \ (savefpu)->sv_87.sv_env.en_cw = (value); \ } while (0) -#else /* CPU_ENABLE_SSE */ -#define GET_FPU_CW(thread) \ - (thread->td_pcb->pcb_save->sv_87.sv_env.en_cw) -#define GET_FPU_SW(thread) \ - (thread->td_pcb->pcb_save->sv_87.sv_env.en_sw) -#define SET_FPU_CW(savefpu, value) \ - (savefpu)->sv_87.sv_env.en_cw = (value) -#endif /* CPU_ENABLE_SSE */ -#ifdef CPU_ENABLE_SSE CTASSERT(sizeof(union savefpu) == 512); CTASSERT(sizeof(struct xstate_hdr) == 64); CTASSERT(sizeof(struct savefpu_ymm) == 832); @@ -200,7 +182,6 @@ CTASSERT(X86_XSTATE_XCR0_OFFSET >= offse X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savexmm)); static void fpu_clean_state(void); -#endif static void fpusave(union savefpu *); static void fpurstor(union savefpu *); @@ -210,21 +191,17 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); -#ifdef CPU_ENABLE_SSE int use_xsave; uint64_t xsave_mask; -#endif static uma_zone_t fpu_save_area_zone; static union savefpu *npx_initialstate; -#ifdef CPU_ENABLE_SSE struct xsave_area_elm_descr { u_int offset; u_int size; } *xsave_area_desc; static int use_xsaveopt; -#endif static volatile u_int npx_traps_while_probing; @@ -332,7 +309,6 @@ cleanup: return (hw_float); } -#ifdef CPU_ENABLE_SSE /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. @@ -368,7 +344,7 @@ npxinit_bsp1(void) if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) use_xsaveopt = 1; } -#endif + /* * Calculate the fpu save area size. @@ -376,7 +352,6 @@ npxinit_bsp1(void) static void npxinit_bsp2(void) { -#ifdef CPU_ENABLE_SSE u_int cp[4]; if (use_xsave) { @@ -389,7 +364,6 @@ npxinit_bsp2(void) do_cpuid(1, cp); cpu_feature2 = cp[2]; } else -#endif cpu_max_ext_state_size = sizeof(union savefpu); } @@ -401,25 +375,19 @@ npxinit(bool bsp) { static union savefpu dummy; register_t saveintr; -#ifdef CPU_ENABLE_SSE u_int mxcsr; -#endif u_short control; if (bsp) { if (!npx_probe()) return; -#ifdef CPU_ENABLE_SSE npxinit_bsp1(); -#endif } -#ifdef CPU_ENABLE_SSE if (use_xsave) { load_cr4(rcr4() | CR4_XSAVE); load_xcr(XCR0, xsave_mask); } -#endif /* * XCR0 shall be set up before CPU can report the save area size. @@ -436,20 +404,16 @@ npxinit(bool bsp) */ saveintr = intr_disable(); stop_emulating(); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fninit(); else -#endif fnsave(&dummy); control = __INITIAL_NPXCW__; fldcw(control); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) { mxcsr = __INITIAL_MXCSR__; ldmxcsr(mxcsr); } -#endif start_emulating(); intr_restore(saveintr); } @@ -463,9 +427,7 @@ static void npxinitstate(void *arg __unused) { register_t saveintr; -#ifdef CPU_ENABLE_SSE int cp[4], i, max_ext_n; -#endif if (!hw_float) return; @@ -476,7 +438,6 @@ npxinitstate(void *arg __unused) stop_emulating(); fpusave(npx_initialstate); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) { if (npx_initialstate->sv_xmm.sv_env.en_mxcsr_mask) cpu_mxcsr_mask = @@ -498,11 +459,9 @@ npxinitstate(void *arg __unused) bzero(npx_initialstate->sv_xmm.sv_xmm, sizeof(npx_initialstate->sv_xmm.sv_xmm)); } else -#endif bzero(npx_initialstate->sv_87.sv_ac, sizeof(npx_initialstate->sv_87.sv_ac)); -#ifdef CPU_ENABLE_SSE /* * Create a table describing the layout of the CPU Extended * Save Area. @@ -527,7 +486,6 @@ npxinitstate(void *arg __unused) xsave_area_desc[i].size = cp[0]; } } -#endif fpu_save_area_zone = uma_zcreate("FPU_save_area", cpu_max_ext_state_size, NULL, NULL, NULL, NULL, @@ -577,10 +535,8 @@ npxformat(void) if (!hw_float) return (_MC_FPFMT_NODEV); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) return (_MC_FPFMT_XMM); -#endif return (_MC_FPFMT_387); } @@ -801,7 +757,6 @@ npxtrap_x87(void) return (fpetable[status & ((~control & 0x3f) | 0x40)]); } -#ifdef CPU_ENABLE_SSE int npxtrap_sse(void) { @@ -821,7 +776,6 @@ npxtrap_sse(void) critical_exit(); return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } -#endif /* * Implement device not available (DNA) exception @@ -860,10 +814,8 @@ npxdna(void) */ PCPU_SET(fpcurthread, curthread); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpu_clean_state(); -#endif if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* @@ -905,11 +857,9 @@ npxsave(addr) { stop_emulating(); -#ifdef CPU_ENABLE_SSE if (use_xsaveopt) xsaveopt((char *)addr, xsave_mask); else -#endif fpusave(addr); start_emulating(); PCPU_SET(fpcurthread, NULL); @@ -960,9 +910,7 @@ npxdrop(void) * Discard pending exceptions in the !cpu_fxsr case so that unmasked * ones don't cause a panic on the next frstor. */ -#ifdef CPU_ENABLE_SSE if (!cpu_fxsr) -#endif fnclex(); td = PCPU_GET(fpcurthread); @@ -982,11 +930,9 @@ int npxgetregs(struct thread *td) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE uint64_t *xstate_bv, bit; char *sa; int max_ext_n, i; -#endif int owned; if (!hw_float) @@ -1003,9 +949,7 @@ npxgetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread)) { fpusave(get_pcb_user_save_pcb(pcb)); -#ifdef CPU_ENABLE_SSE if (!cpu_fxsr) -#endif /* * fnsave initializes the FPU and destroys whatever * context it contains. Make sure the FPU owner @@ -1017,7 +961,6 @@ npxgetregs(struct thread *td) owned = _MC_FPOWNED_PCB; } critical_exit(); -#ifdef CPU_ENABLE_SSE if (use_xsave) { /* * Handle partially saved state. @@ -1040,7 +983,6 @@ npxgetregs(struct thread *td) *xstate_bv |= bit; } } -#endif return (owned); } @@ -1055,7 +997,6 @@ npxuserinited(struct thread *td) pcb->pcb_flags |= PCB_NPXUSERINITDONE; } -#ifdef CPU_ENABLE_SSE int npxsetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size) { @@ -1093,16 +1034,13 @@ npxsetxstate(struct thread *td, char *xf return (0); } -#endif int npxsetregs(struct thread *td, union savefpu *addr, char *xfpustate, size_t xfpustate_size) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE int error; -#endif if (!hw_float) return (ENXIO); @@ -1110,14 +1048,12 @@ npxsetregs(struct thread *td, union save pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { -#ifdef CPU_ENABLE_SSE error = npxsetxstate(td, xfpustate, xfpustate_size); if (error != 0) { critical_exit(); return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 3 16:08:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D361CCF36D; Fri, 3 Feb 2017 16:08:59 +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 6A068239; Fri, 3 Feb 2017 16:08:59 +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 v13G8wUm060981; Fri, 3 Feb 2017 16:08:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13G8wwa060980; Fri, 3 Feb 2017 16:08:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702031608.v13G8wwa060980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2017 16:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313160 - head/sbin/resolvconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:08:59 -0000 Author: pfg Date: Fri Feb 3 16:08:58 2017 New Revision: 313160 URL: https://svnweb.freebsd.org/changeset/base/313160 Log: resolvconf: restore RESTARTCMD=, CMD1=, CMD2= and sed pattern as before. r312992 removed RESTARTCMD_WITH_ARG for @RESTARTCMD something@ but reverted the sed to be '@RESTARTCMD \(.*\)@' and RESTARTCMD= to be the value of RESTARTCMD_WITH_ARG. Submitted by: Guy Yur x_MFC with: r312992 Modified: head/sbin/resolvconf/Makefile Modified: head/sbin/resolvconf/Makefile ============================================================================== --- head/sbin/resolvconf/Makefile Fri Feb 3 13:07:24 2017 (r313159) +++ head/sbin/resolvconf/Makefile Fri Feb 3 16:08:58 2017 (r313160) @@ -20,16 +20,16 @@ SBINDIR= /sbin # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. -CMD1= \1 onestatus >/dev/null 2>\&1 -CMD2= \1 restart -RESTARTCMD= /usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2} +CMD1= \\$$1 onestatus >/dev/null 2>\&1 +CMD2= \\$$1 restart +RESTARTCMD= "/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}" .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: ${f}.in sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ - -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \ + -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ -e 's:@SBINDIR@:${SBINDIR}:g' \ -e 's: vpn : ng[0-9]*&:g' \ From owner-svn-src-head@freebsd.org Fri Feb 3 16:21:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D55CCCCFA00; Fri, 3 Feb 2017 16:21:31 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A275A1A4; Fri, 3 Feb 2017 16:21:31 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13GLUtJ068987; Fri, 3 Feb 2017 16:21:30 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13GLUVT068986; Fri, 3 Feb 2017 16:21:30 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201702031621.v13GLUVT068986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 3 Feb 2017 16:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313162 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:21:31 -0000 Author: wblock (doc committer) Date: Fri Feb 3 16:21:30 2017 New Revision: 313162 URL: https://svnweb.freebsd.org/changeset/base/313162 Log: Replace Cyrillic characters with Latin (normal) ones. PR: 216534 Submitted by: eborisch+FreeBSD@gmail.com MFC after: 1 week Sponsored by: iXsystems Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Fri Feb 3 16:15:06 2017 (r313161) +++ head/usr.sbin/ctladm/ctladm.8 Fri Feb 3 16:21:30 2017 (r313162) @@ -888,8 +888,8 @@ client through the selection of appropri The default value is "restricted". It improves data integrity, but may introduce some additional delays. .It Va serseq -Set to "on" to serialize conseсutive reads/writes. -Set to "read" to serialize conseсutive reads. +Set to "on" to serialize consecutive reads/writes. +Set to "read" to serialize consecutive reads. Set to "off" to allow them be issued in parallel. Parallel issue of consecutive operations may confuse logic of the backing file system, hurting performance; but it may improve performance From owner-svn-src-head@freebsd.org Fri Feb 3 16:27:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E3ACCFBB6; Fri, 3 Feb 2017 16:27:25 +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 08A84985; Fri, 3 Feb 2017 16:27:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13GROSB069422; Fri, 3 Feb 2017 16:27:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13GROMH069421; Fri, 3 Feb 2017 16:27:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702031627.v13GROMH069421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Feb 2017 16:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313163 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:27:25 -0000 Author: bdrewery Date: Fri Feb 3 16:27:23 2017 New Revision: 313163 URL: https://svnweb.freebsd.org/changeset/base/313163 Log: native-xtools: Add missing readelf. The switch to elftoolchain's readelf in r280859 caused native-xtools to no longer build readelf. This fixes poudriere builds not using a native readelf when expected. Reported by: strejda on freenode MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 3 16:21:30 2017 (r313162) +++ head/Makefile.inc1 Fri Feb 3 16:27:23 2017 (r313163) @@ -1950,6 +1950,7 @@ native-xtools: .PHONY usr.bin/mktemp \ usr.bin/mt \ usr.bin/patch \ + usr.bin/readelf \ usr.bin/sed \ usr.bin/sort \ usr.bin/tar \ From owner-svn-src-head@freebsd.org Fri Feb 3 16:39:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B967BCCFEA3; Fri, 3 Feb 2017 16:39:11 +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 6C98E123C; Fri, 3 Feb 2017 16:39:11 +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 v13GdAQh074032; Fri, 3 Feb 2017 16:39:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13GdAXQ074031; Fri, 3 Feb 2017 16:39:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201702031639.v13GdAXQ074031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 3 Feb 2017 16:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313166 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:39:11 -0000 Author: tsoome Date: Fri Feb 3 16:39:10 2017 New Revision: 313166 URL: https://svnweb.freebsd.org/changeset/base/313166 Log: loader: libefi/env.c warnings in arm build The arm build has revealed some of the warnings, the fix for CHAR16 warning is to switch the warning off for env.c (same as for efinet.c). For error code we need to use macro. Reported by: gjb Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D9422 Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/env.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:36:14 2017 (r313165) +++ head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:39:10 2017 (r313166) @@ -26,6 +26,7 @@ SRCS+= time_event.c # of a short. There's no good cast to use here so just ignore the # warnings for now. CWARNFLAGS.efinet.c+= -Wno-format +CWARNFLAGS.env.c+= -Wno-format .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -msoft-float -mgeneral-regs-only Modified: head/sys/boot/efi/libefi/env.c ============================================================================== --- head/sys/boot/efi/libefi/env.c Fri Feb 3 16:36:14 2017 (r313165) +++ head/sys/boot/efi/libefi/env.c Fri Feb 3 16:39:10 2017 (r313166) @@ -94,14 +94,16 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU status = RS->GetVariable(varnamearg, matchguid, &attr, &datasz, NULL); if (status != EFI_BUFFER_TOO_SMALL) { - printf("Can't get the variable: error %#lx\n", status); + printf("Can't get the variable: error %#lx\n", + EFI_ERROR_CODE(status)); return (CMD_ERROR); } data = malloc(datasz); status = RS->GetVariable(varnamearg, matchguid, &attr, &datasz, data); if (status != EFI_SUCCESS) { - printf("Can't get the variable: error %#lx\n", status); + printf("Can't get the variable: error %#lx\n", + EFI_ERROR_CODE(status)); return (CMD_ERROR); } uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); From owner-svn-src-head@freebsd.org Fri Feb 3 16:47:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D20CCE31F for ; Fri, 3 Feb 2017 16:47:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D40C1B7F for ; Fri, 3 Feb 2017 16:47:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6fc5cc85-ea30-11e6-b3c2-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 6fc5cc85-ea30-11e6-b3c2-c9f38144898e; Fri, 03 Feb 2017 16:47:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v13GlR1l024277; Fri, 3 Feb 2017 09:47:27 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1486140447.3017.189.camel@freebsd.org> Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 03 Feb 2017 09:47:27 -0700 In-Reply-To: <201702031639.v13GdAXQ074031@repo.freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:47:30 -0000 On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: > Author: tsoome > Date: Fri Feb3 16:39:10 2017 > New Revision: 313166 > URL: https://svnweb.freebsd.org/changeset/base/313166 > > Log: > loader: libefi/env.c warnings in arm build > > The arm build has revealed some of the warnings, the fix for CHAR16 > warning is to switch the warning off for env.c (same as for > efinet.c). > How is disabling the warning instead of just fixing it the right thing to do? I think disabling a printf format warning is never the right thing to do, it just turns a compile warning into a runtime failure. -- Ian > For error code we need to use macro. > > Reported by: gjb > Reviewed by: imp > Approved by: imp (mentor) > Differential Revision: https://reviews.freebsd.org/D9422 > > Modified: > head/sys/boot/efi/libefi/Makefile > head/sys/boot/efi/libefi/env.c > > Modified: head/sys/boot/efi/libefi/Makefile > ===================================================================== > ========= > --- head/sys/boot/efi/libefi/Makefile Fri Feb3 16:36:14 2017 > (r313165) > +++ head/sys/boot/efi/libefi/Makefile Fri Feb3 16:39:10 2017 > (r313166) > @@ -26,6 +26,7 @@ SRCS+= time_event.c > # of a short. There's no good cast to use here so just ignore the > # warnings for now. > CWARNFLAGS.efinet.c+= -Wno-format > +CWARNFLAGS.env.c+= -Wno-format > > .if ${MACHINE_CPUARCH} == "aarch64" > CFLAGS+= -msoft-float -mgeneral-regs-only > > Modified: head/sys/boot/efi/libefi/env.c > ===================================================================== > ========= > --- head/sys/boot/efi/libefi/env.c Fri Feb3 16:36:14 2017 > (r313165) > +++ head/sys/boot/efi/libefi/env.c Fri Feb3 16:39:10 2017 > (r313166) > @@ -94,14 +94,16 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU > status = RS->GetVariable(varnamearg, matchguid, &attr, > &datasz, NULL); > if (status != EFI_BUFFER_TOO_SMALL) { > - printf("Can't get the variable: error %#lx\n", > status); > + printf("Can't get the variable: error %#lx\n", > + EFI_ERROR_CODE(status)); > return (CMD_ERROR); > } > data = malloc(datasz); > status = RS->GetVariable(varnamearg, matchguid, &attr, > &datasz, data); > if (status != EFI_SUCCESS) { > - printf("Can't get the variable: error %#lx\n", > status); > + printf("Can't get the variable: error %#lx\n", > + EFI_ERROR_CODE(status)); > return (CMD_ERROR); > } > uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); > From owner-svn-src-head@freebsd.org Fri Feb 3 16:49:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1DACCE3B0 for ; Fri, 3 Feb 2017 16:49:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4891D19 for ; Fri, 3 Feb 2017 16:49:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id e137so2187463itc.0 for ; Fri, 03 Feb 2017 08:49:28 -0800 (PST) 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=9Bqg0sdApvwXTZQRFDJK/1JtfJnK2GKvsRHavnGPzvI=; b=CNsL9y+8veBDI6BXsTunVYR2FoLAI+EgcPgonH0sdFqIapjX6Bxfh46icHHhmWIEwT T0kdfx8TxhoQptgbesFBc87T1wqoeNCYcJ61TcJFhbjY2VuYeMhEWCpyFwAib1UQzrhf qNwqTtqra43Mn1cmqf1sw6wL6/iv3+VzpprHJioRefORXSL0FbyT4ydIR/27N6EhYnzN hy9eDzLl0uzvdFo9Rg6qRyzYiSeTWUa465TUtxQbmkw5y2xxLsfRJxfEl4Wu952cfaXa AB32k70qdXFQRWIjovTRtlf/ta4IzYy+h9vmXa0HzIyB+eLfZMus5WmSV5O9EcX1uNCy Db1A== 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=9Bqg0sdApvwXTZQRFDJK/1JtfJnK2GKvsRHavnGPzvI=; b=QHzzLkUGH4CuWrv4968e9AwdEQkI8VoHWa0brNJ4nhLjyAa8okm0kpxBlWGm0uNYHK sx1AM2fw4Ffsyhuyb1ymAZlfHZOoEUOLSr53vogQEMRfvG9SXFOTeQG5ydBpR96n+Dyb Dguatvuf5ygxrwAmWA4csBQug09x8HSZICtogEbhO2T5FBREJZE+tOr2UrftW/sjh+vh h3QfGdWrH0g6jSBls7kHrizK9XRt3V9TAyUZmB6CZAvuGoLIDlXf7UvRgcIw00f/iNdb peqsBdtynAdZFRdlG3qVpxZYfUaw9lplD4B/rD63qRGt91eEv0w/GLKqqhFxzVevegOr A8Pg== X-Gm-Message-State: AIkVDXJ2OaAmx7uF8yKyAXg95iACqp01lE7aGDzeXK0TTsNuDX4ztvVbsDuu/8aXdT84rO86Opz4t2sPr1/UrA== X-Received: by 10.36.135.194 with SMTP id f185mr1729441ite.85.1486140567619; Fri, 03 Feb 2017 08:49:27 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Fri, 3 Feb 2017 08:49:27 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <1486140447.3017.189.camel@freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> From: Warner Losh Date: Fri, 3 Feb 2017 09:49:27 -0700 X-Google-Sender-Auth: drL7QisL4-XDiROGwtxjolJ7lZM Message-ID: Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi To: Ian Lepore Cc: Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:49:28 -0000 On Fri, Feb 3, 2017 at 9:47 AM, Ian Lepore wrote: > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Fri Feb 3 16:39:10 2017 >> New Revision: 313166 >> URL: https://svnweb.freebsd.org/changeset/base/313166 >> >> Log: >> loader: libefi/env.c warnings in arm build >> >> The arm build has revealed some of the warnings, the fix for CHAR16 >> warning is to switch the warning off for env.c (same as for >> efinet.c). >> > > How is disabling the warning instead of just fixing it the right thing > to do? I think disabling a printf format warning is never the right > thing to do, it just turns a compile warning into a runtime failure. Because clang's understanding of %S in the bootloader doesn't match how it's actually used and there's no casting that will fix that. Warner > -- Ian > >> For error code we need to use macro. >> >> Reported by: gjb >> Reviewed by: imp >> Approved by: imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D9422 >> >> Modified: >> head/sys/boot/efi/libefi/Makefile >> head/sys/boot/efi/libefi/env.c >> >> Modified: head/sys/boot/efi/libefi/Makefile >> ===================================================================== >> ========= >> --- head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:36:14 2017 >> (r313165) >> +++ head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:39:10 2017 >> (r313166) >> @@ -26,6 +26,7 @@ SRCS+= time_event.c >> # of a short. There's no good cast to use here so just ignore the >> # warnings for now. >> CWARNFLAGS.efinet.c+= -Wno-format >> +CWARNFLAGS.env.c+= -Wno-format >> >> .if ${MACHINE_CPUARCH} == "aarch64" >> CFLAGS+= -msoft-float -mgeneral-regs-only >> >> Modified: head/sys/boot/efi/libefi/env.c >> ===================================================================== >> ========= >> --- head/sys/boot/efi/libefi/env.c Fri Feb 3 16:36:14 2017 >> (r313165) >> +++ head/sys/boot/efi/libefi/env.c Fri Feb 3 16:39:10 2017 >> (r313166) >> @@ -94,14 +94,16 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU >> status = RS->GetVariable(varnamearg, matchguid, &attr, >> &datasz, NULL); >> if (status != EFI_BUFFER_TOO_SMALL) { >> - printf("Can't get the variable: error %#lx\n", >> status); >> + printf("Can't get the variable: error %#lx\n", >> + EFI_ERROR_CODE(status)); >> return (CMD_ERROR); >> } >> data = malloc(datasz); >> status = RS->GetVariable(varnamearg, matchguid, &attr, >> &datasz, data); >> if (status != EFI_SUCCESS) { >> - printf("Can't get the variable: error %#lx\n", >> status); >> + printf("Can't get the variable: error %#lx\n", >> + EFI_ERROR_CODE(status)); >> return (CMD_ERROR); >> } >> uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); >> > From owner-svn-src-head@freebsd.org Fri Feb 3 16:52:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A71CCE728; Fri, 3 Feb 2017 16:52:54 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp002.me.com (st13p35im-asmtp002.me.com [17.164.199.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0DE7394; Fri, 3 Feb 2017 16:52:54 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp002.me.com by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OKT00C005ES0H00@st13p35im-asmtp002.me.com>; Fri, 03 Feb 2017 16:52:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1486140768; bh=Nq/fDc7Y6OSrZ5c5SjailiQAqZTp0Fyf0BJL3z9+QOw=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=dz75ThfSYabfgeLC8qttlPnB0oejmY5t7IpJgdW0j0Bb2ZxtSsaXSvqF8qybpisq8 IaViPtwvsFBkeRJNL31+dXvbXYBqvlQ6IrJ4v7ScPgjl41Fc3Bhlz91GLyl9nf751l FkUISg3x88ksHNJinRzgWjBfksof8KPWlDmVAcGMxG2+w1Oc03pmpK8dfpQJGz1J4u +Jl2kzAghQzytsaXzYisQtfw1RV38dTzZlIdQ0cKp6Y+Qag4zWTBWgfc+uNVX3YkW6 QgpZ/UgTrkHyrIlJDTCnGWm4/5yauOky5vrhgKHRCT5sanO4/toBoDjxy8O/0owPsF 5tbHnbNj6yUzA== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OKT0036M5JXSS40@st13p35im-asmtp002.me.com>; Fri, 03 Feb 2017 16:52:48 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-03_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1702030162 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi From: Toomas Soome In-reply-to: <1486140447.3017.189.camel@freebsd.org> Date: Fri, 03 Feb 2017 18:52:45 +0200 Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 16:52:55 -0000 > On 3. veebr 2017, at 18:47, Ian Lepore wrote: >=20 > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Fri Feb 3 16:39:10 2017 >> New Revision: 313166 >> URL: https://svnweb.freebsd.org/changeset/base/313166 >>=20 >> Log: >> loader: libefi/env.c warnings in arm build >> =20 >> The arm build has revealed some of the warnings, the fix for CHAR16 >> warning is to switch the warning off for env.c (same as for >> efinet.c). >> =20 >=20 > How is disabling the warning instead of just fixing it the right thing > to do? I think disabling a printf format warning is never the right > thing to do, it just turns a compile warning into a runtime failure. I would love to see the correct fix - as all UEFI chars are 2 byte; but = thats up to arm experts. I just do not know the details why the arm is = stuck with 4 byte wchar_t there - Im sure they do not have this just for = fun:) rgds, toomas >=20 > -- Ian >=20 >> For error code we need to use macro. >> =20 >> Reported by: gjb >> Reviewed by: imp >> Approved by: imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D9422 >>=20 >> Modified: >> head/sys/boot/efi/libefi/Makefile >> head/sys/boot/efi/libefi/env.c >>=20 >> Modified: head/sys/boot/efi/libefi/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:36:14 2017 >> (r313165) >> +++ head/sys/boot/efi/libefi/Makefile Fri Feb 3 16:39:10 2017 >> (r313166) >> @@ -26,6 +26,7 @@ SRCS+=3D time_event.c >> # of a short. There's no good cast to use here so just ignore the >> # warnings for now. >> CWARNFLAGS.efinet.c+=3D -Wno-format >> +CWARNFLAGS.env.c+=3D -Wno-format >> =20 >> .if ${MACHINE_CPUARCH} =3D=3D "aarch64" >> CFLAGS+=3D -msoft-float -mgeneral-regs-only >>=20 >> Modified: head/sys/boot/efi/libefi/env.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/efi/libefi/env.c Fri Feb 3 16:36:14 2017=09 >> (r313165) >> +++ head/sys/boot/efi/libefi/env.c Fri Feb 3 16:39:10 2017=09 >> (r313166) >> @@ -94,14 +94,16 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU >> status =3D RS->GetVariable(varnamearg, matchguid, &attr, >> &datasz, NULL); >> if (status !=3D EFI_BUFFER_TOO_SMALL) { >> - printf("Can't get the variable: error %#lx\n", >> status); >> + printf("Can't get the variable: error %#lx\n", >> + EFI_ERROR_CODE(status)); >> return (CMD_ERROR); >> } >> data =3D malloc(datasz); >> status =3D RS->GetVariable(varnamearg, matchguid, &attr, >> &datasz, data); >> if (status !=3D EFI_SUCCESS) { >> - printf("Can't get the variable: error %#lx\n", >> status); >> + printf("Can't get the variable: error %#lx\n", >> + EFI_ERROR_CODE(status)); >> return (CMD_ERROR); >> } >> uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); >>=20 From owner-svn-src-head@freebsd.org Fri Feb 3 17:02:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF70BCCEA79; Fri, 3 Feb 2017 17:02:58 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED6FBD3; Fri, 3 Feb 2017 17:02:58 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13H2vVr085601; Fri, 3 Feb 2017 17:02:57 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13H2v8m085599; Fri, 3 Feb 2017 17:02:57 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201702031702.v13H2v8m085599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Fri, 3 Feb 2017 17:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313168 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 17:02:58 -0000 Author: pkelsey Date: Fri Feb 3 17:02:57 2017 New Revision: 313168 URL: https://svnweb.freebsd.org/changeset/base/313168 Log: Fix VIMAGE-related bugs in TFO. The autokey callout vnet context was not being initialized, and the per-vnet fastopen context was only being initialized for the default vnet. PR: 216613 Reported by: Alex Deiter MFC after: 1 week Modified: head/sys/netinet/tcp_fastopen.c head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Fri Feb 3 16:57:14 2017 (r313167) +++ head/sys/netinet/tcp_fastopen.c Fri Feb 3 17:02:57 2017 (r313168) @@ -209,6 +209,7 @@ tcp_fastopen_init(void) rm_init(&V_tcp_fastopen_keylock, "tfo_keylock"); callout_init_rm(&V_tcp_fastopen_autokey_ctx.c, &V_tcp_fastopen_keylock, 0); + V_tcp_fastopen_autokey_ctx.v = curvnet; V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Feb 3 16:57:14 2017 (r313167) +++ head/sys/netinet/tcp_subr.c Fri Feb 3 17:02:57 2017 (r313168) @@ -679,6 +679,10 @@ tcp_init(void) V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +#ifdef TCP_RFC7413 + tcp_fastopen_init(); +#endif + /* Skip initialization of globals for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; @@ -732,10 +736,6 @@ tcp_init(void) #ifdef TCPPCAP tcp_pcap_init(); #endif - -#ifdef TCP_RFC7413 - tcp_fastopen_init(); -#endif } #ifdef VIMAGE From owner-svn-src-head@freebsd.org Fri Feb 3 18:20:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D70F9CCF980 for ; Fri, 3 Feb 2017 18:20:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA38114 for ; Fri, 3 Feb 2017 18:20:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 67f13715-ea3d-11e6-b3c2-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 67f13715-ea3d-11e6-b3c2-c9f38144898e; Fri, 03 Feb 2017 18:20:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v13IKHx1024545; Fri, 3 Feb 2017 11:20:17 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1486146017.3017.193.camel@freebsd.org> Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi From: Ian Lepore To: Toomas Soome Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 03 Feb 2017 11:20:17 -0700 In-Reply-To: <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 18:20:25 -0000 On Fri, 2017-02-03 at 18:52 +0200, Toomas Soome wrote: > > > > On 3. veebr 2017, at 18:47, Ian Lepore wrote: > > > > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: > > > > > > Author: tsoome > > > Date: Fri Feb3 16:39:10 2017 > > > New Revision: 313166 > > > URL: https://svnweb.freebsd.org/changeset/base/313166 > > > > > > Log: > > > loader: libefi/env.c warnings in arm build > > > > > > The arm build has revealed some of the warnings, the fix for > > > CHAR16 > > > warning is to switch the warning off for env.c (same as for > > > efinet.c). > > > > > How is disabling the warning instead of just fixing it the right > > thing > > to do?I think disabling a printf format warning is never the > > right > > thing to do, it just turns a compile warning into a runtime > > failure. > > I would love to see the correct fix - as all UEFI chars are 2 byte; > but thats up to arm experts. I just do not know the details why the > arm is stuck with 4 byte wchar_t there - Im sure they do not have > this just for fun:) > > rgds, > toomas Hmm, looks like the right fix is to add -fshort-wchar to CFLAGS, but it's got to be consistant across all the libraries that get linked, and some of them are used in the non-efi case too. I'll have a closer look at whether we can fix it properly over the next few days. -- Ian From owner-svn-src-head@freebsd.org Fri Feb 3 19:09:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEFE3CCF644; Fri, 3 Feb 2017 19:09:48 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6C756B9; Fri, 3 Feb 2017 19:09:48 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13J9l9s035895; Fri, 3 Feb 2017 19:09:47 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13J9kGN035880; Fri, 3 Feb 2017 19:09:46 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201702031909.v13J9kGN035880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 3 Feb 2017 19:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313169 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:09:49 -0000 Author: wblock (doc committer) Date: Fri Feb 3 19:09:46 2017 New Revision: 313169 URL: https://svnweb.freebsd.org/changeset/base/313169 Log: Clarify some option descriptions, add a line of text to makeman to add the slightest hint of a shade of a clue of what it does. Sponsored by: iXsystems Modified: head/tools/build/options/WITHOUT_BLACKLIST head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP head/tools/build/options/WITHOUT_CROSS_COMPILER head/tools/build/options/WITHOUT_DIALOG head/tools/build/options/WITHOUT_DMAGENT head/tools/build/options/WITHOUT_DOCCOMPRESS head/tools/build/options/WITHOUT_GPL_DTC head/tools/build/options/WITHOUT_INSTALLLIB head/tools/build/options/WITHOUT_KERBEROS head/tools/build/options/WITH_CCACHE_BUILD head/tools/build/options/WITH_DIRDEPS_BUILD head/tools/build/options/WITH_INSTALL_AS_USER head/tools/build/options/WITH_META_MODE head/tools/build/options/WITH_STAGING_MAN head/tools/build/options/makeman Modified: head/tools/build/options/WITHOUT_BLACKLIST ============================================================================== --- head/tools/build/options/WITHOUT_BLACKLIST Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_BLACKLIST Fri Feb 3 19:09:46 2017 (r313169) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set this if you do not want to build blacklistd / blacklistctl. +Set this if you do not want to build blacklistd/blacklistctl. Modified: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP Fri Feb 3 19:09:46 2017 (r313169) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. -You must enable either gcc or clang bootstrap to be able to build the system, -unless an alternative compiler is provided via -XCC. +Set to not build the Clang C/C++ compiler during the bootstrap phase of +the build. +To be able to build the system, either gcc or clang bootstrap must be +enabled unless an alternate compiler is provided via XCC. Modified: head/tools/build/options/WITHOUT_CROSS_COMPILER ============================================================================== --- head/tools/build/options/WITHOUT_CROSS_COMPILER Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_CROSS_COMPILER Fri Feb 3 19:09:46 2017 (r313169) @@ -1,10 +1,10 @@ .\" $FreeBSD$ Set to not build any cross compiler in the cross-tools stage of buildworld. -If you are compiling a different version of +When compiling a different version of .Fx -than what is installed on the system, you will need to provide an alternate +than what is installed on the system, provide an alternate compiler with XCC to ensure success. -If you are compiling with an identical version of +When compiling with an identical version of .Fx to the host, this option may be safely used. This option may also be safe when the host version of Modified: head/tools/build/options/WITHOUT_DIALOG ============================================================================== --- head/tools/build/options/WITHOUT_DIALOG Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_DIALOG Fri Feb 3 19:09:46 2017 (r313169) @@ -1,2 +1,7 @@ .\" $FreeBSD$ -Set to not build dialog(1), dialog(1,3), and dpv(1,3). +Set to not build +.Xr dialog 1 , +.Xr dialog 3 , +.Xr dpv 1 , +and +.Xr dpv 3 . Modified: head/tools/build/options/WITHOUT_DMAGENT ============================================================================== --- head/tools/build/options/WITHOUT_DMAGENT Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_DMAGENT Fri Feb 3 19:09:46 2017 (r313169) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build dma Mail Transport Agent +Set to not build dma Mail Transport Agent. Modified: head/tools/build/options/WITHOUT_DOCCOMPRESS ============================================================================== --- head/tools/build/options/WITHOUT_DOCCOMPRESS Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_DOCCOMPRESS Fri Feb 3 19:09:46 2017 (r313169) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to not to install compressed system documentation. +Set to not install compressed system documentation. Only the uncompressed version will be installed. Modified: head/tools/build/options/WITHOUT_GPL_DTC ============================================================================== --- head/tools/build/options/WITHOUT_GPL_DTC Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_GPL_DTC Fri Feb 3 19:09:46 2017 (r313169) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to build the BSD licensed version of the device tree compiler, instead of the -GPL'd one from elinux.org. +Set to build the BSD licensed version of the device tree compiler rather +than the GPLed one from elinux.org. Modified: head/tools/build/options/WITHOUT_INSTALLLIB ============================================================================== --- head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 19:09:46 2017 (r313169) @@ -1,6 +1,6 @@ .\" $FreeBSD$ -Set this if you do not want to install optional libraries. -For example when creating a +Set this if to not install optional libraries. +For example, when creating a .Xr nanobsd 8 image. .Bf -symbolic Modified: head/tools/build/options/WITHOUT_KERBEROS ============================================================================== --- head/tools/build/options/WITHOUT_KERBEROS Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITHOUT_KERBEROS Fri Feb 3 19:09:46 2017 (r313169) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set this if you do not want to build Kerberos 5 (KTH Heimdal). +Set this to not build Kerberos 5 (KTH Heimdal). Modified: head/tools/build/options/WITH_CCACHE_BUILD ============================================================================== --- head/tools/build/options/WITH_CCACHE_BUILD Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITH_CCACHE_BUILD Fri Feb 3 19:09:46 2017 (r313169) @@ -5,9 +5,9 @@ for the build. No configuration is required except to install the .Sy devel/ccache package. -Using with -.Xr distcc 1 -should set +When using with +.Xr distcc 1 , +set .Sy CCACHE_PREFIX=/usr/local/bin/distcc . The default cache directory of .Pa $HOME/.ccache Modified: head/tools/build/options/WITH_DIRDEPS_BUILD ============================================================================== --- head/tools/build/options/WITH_DIRDEPS_BUILD Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITH_DIRDEPS_BUILD Fri Feb 3 19:09:46 2017 (r313169) @@ -11,23 +11,24 @@ Makefile.depend files found in each dire .Pp The build can be started from anywhere, and behaves the same. The initial instance of -.Xr make 1 +.Xr make 1 recursively reads .Va DIRDEPS -from Makefile.depend +from +.Pa Makefile.depend , computing a graph of tree dependencies from the current origin. Setting .Va NO_DIRDEPS -will skip checking dirdep dependencies and will only build in the current +skips checking dirdep dependencies and will only build in the current and child directories. .Va NO_DIRDEPS_BELOW -will skip building any dirdeps and only build the current directory. +skips building any dirdeps and only build the current directory. .Pp This also utilizes the .Va WITH_META_MODE logic for incremental builds. .Pp -The build will hide commands ran unless +The build hides commands executed unless .Va NO_SILENT is defined. .Pp Modified: head/tools/build/options/WITH_INSTALL_AS_USER ============================================================================== --- head/tools/build/options/WITH_INSTALL_AS_USER Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITH_INSTALL_AS_USER Fri Feb 3 19:09:46 2017 (r313169) @@ -4,6 +4,6 @@ files with owner and group attributes se the .Xr make 1 command. -The user still has to set the +The user still must set the .Va DESTDIR variable to point to a directory where the user has write permissions. Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITH_META_MODE Fri Feb 3 19:09:46 2017 (r313169) @@ -1,22 +1,22 @@ .\" $FreeBSD$ -Creates +Create .Xr make 1 meta files when building, which can provide a reliable incremental build when using .Xr filemon 4 . -The meta file is created in the OBJDIR as +The meta file is created in OBJDIR as .Pa target.meta . -These meta files track the command ran, its output, and the current directory. +These meta files track the command that was executed, its output, and the +current directory. The .Xr filemon 4 module is required unless .Va NO_FILEMON is defined. -When the module is loaded, any files used by the commands executed will be -tracked as -dependencies for the target in its meta file. -The target will be considered out-of-date and rebuilt if any of the following -are true compared to the last build: +When the module is loaded, any files used by the commands executed are +tracked as dependencies for the target in its meta file. +The target is considered out-of-date and rebuilt if any of these +conditions are true compared to the last build: .Bl -bullet -compact .It The command to execute changes. @@ -38,10 +38,10 @@ Files read, written, executed or linked .El The meta files can also be useful for debugging. .Pp -The build will hide commands ran unless +The build hides commands that are executed unless .Va NO_SILENT is defined. -Errors will cause +Errors cause .Xr make 1 to show some of its environment for further debugging. .Pp Modified: head/tools/build/options/WITH_STAGING_MAN ============================================================================== --- head/tools/build/options/WITH_STAGING_MAN Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/WITH_STAGING_MAN Fri Feb 3 19:09:46 2017 (r313169) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Enable staging of MAN pages to stage tree. +Enable staging of man pages to stage tree. Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Fri Feb 3 17:02:57 2017 (r313168) +++ head/tools/build/options/makeman Fri Feb 3 19:09:46 2017 (r313169) @@ -8,7 +8,7 @@ export LC_ALL=C ident='$FreeBSD$' t=$(mktemp -d -t makeman) -trap 'test -d $t && rm -rf $t' exit +# trap 'test -d $t && rm -rf $t' exit srcdir=$(realpath ../../..) make="make -C $srcdir -m $srcdir/share/mk" @@ -124,6 +124,7 @@ show() main() { + echo "building src.conf.5 man page from files in ${PWD}" >&2 ident=${ident#$} ident=${ident% $} @@ -217,11 +218,11 @@ even if they would be set to .Dq Li FALSE or .Dq Li NO . -Just the existence of an option will cause -it to be honoured by +The presence of an option causes +it to be honored by .Xr make 1 . .Pp -The following list provides a name and short description for variables +This list provides a name and short description for variables that can be used for source builds. .Bl -tag -width indent EOF @@ -246,7 +247,7 @@ EOF sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} if [ -n "${targets}" ] ; then echo '.Pp' - echo 'It is a default setting on' + echo 'This is a default setting on' echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). fi @@ -278,7 +279,7 @@ EOF havedeps=0 if [ -s $t/deps ] ; then havedeps=1 - echo 'When set, it also enforces the following options:' + echo 'When set, it enforces these options:' echo '.Pp' echo '.Bl -item -compact' while read opt2 ; do @@ -292,7 +293,7 @@ EOF if [ ${havedeps} -eq 1 ] ; then echo '.Pp' fi - echo 'When set, the following options are also in effect:' + echo 'When set, these options are also in effect:' echo '.Pp' echo '.Bl -inset -compact' while read opt2 ; do From owner-svn-src-head@freebsd.org Fri Feb 3 19:17:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B98CCF9BA; Fri, 3 Feb 2017 19:17:26 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7371E8E; Fri, 3 Feb 2017 19:17:25 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cZjMC-0001Uy-So; Fri, 03 Feb 2017 20:17:17 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Warren Block" Subject: Re: svn commit: r313169 - head/tools/build/options References: <201702031909.v13J9kGN035880@repo.freebsd.org> Date: Fri, 03 Feb 2017 20:17:16 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201702031909.v13J9kGN035880@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: a8ecdd0179e5342c74548fafd5461917 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:17:26 -0000 On Fri, 03 Feb 2017 20:09:46 +0100, Warren Block wrote: > Modified: head/tools/build/options/WITHOUT_INSTALLLIB > ============================================================================== > --- head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 17:02:57 > 2017 (r313168) > +++ head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 19:09:46 > 2017 (r313169) > @@ -1,6 +1,6 @@ > .\" $FreeBSD$ > -Set this if you do not want to install optional libraries. > -For example when creating a > +Set this if to not install optional libraries. > +For example, when creating a > .Xr nanobsd 8 > image. > .Bf -symbolic I think this sentence did not become what you meant it to be. Cheers, Ronald. From owner-svn-src-head@freebsd.org Fri Feb 3 19:21:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BFF5CCFA7D; Fri, 3 Feb 2017 19:21:29 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 390C718E; Fri, 3 Feb 2017 19:21:29 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13JLSQh042969; Fri, 3 Feb 2017 19:21:28 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13JLSXT042968; Fri, 3 Feb 2017 19:21:28 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201702031921.v13JLSXT042968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 3 Feb 2017 19:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313172 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:21:29 -0000 Author: wblock (doc committer) Date: Fri Feb 3 19:21:28 2017 New Revision: 313172 URL: https://svnweb.freebsd.org/changeset/base/313172 Log: Decromulate an extra "if". Reported by: rpokala Sponsored by: iXsystems Modified: head/tools/build/options/WITHOUT_INSTALLLIB Modified: head/tools/build/options/WITHOUT_INSTALLLIB ============================================================================== --- head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 19:15:53 2017 (r313171) +++ head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 19:21:28 2017 (r313172) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set this if to not install optional libraries. +Set this to not install optional libraries. For example, when creating a .Xr nanobsd 8 image. From owner-svn-src-head@freebsd.org Fri Feb 3 19:27:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E08CCFC7F; Fri, 3 Feb 2017 19:27:10 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 524CF8B0; Fri, 3 Feb 2017 19:27:10 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v13JR8aO035801 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Feb 2017 12:27:08 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v13JR8cq035798; Fri, 3 Feb 2017 12:27:08 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Fri, 3 Feb 2017 12:27:08 -0700 (MST) From: Warren Block To: Ronald Klop cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warren Block Subject: Re: svn commit: r313169 - head/tools/build/options In-Reply-To: Message-ID: References: <201702031909.v13J9kGN035880@repo.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Fri, 03 Feb 2017 12:27:08 -0700 (MST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:27:10 -0000 On Fri, 3 Feb 2017, Ronald Klop wrote: > On Fri, 03 Feb 2017 20:09:46 +0100, Warren Block wrote: > >> Modified: head/tools/build/options/WITHOUT_INSTALLLIB >> ============================================================================== >> --- head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 17:02:57 >> 2017 (r313168) >> +++ head/tools/build/options/WITHOUT_INSTALLLIB Fri Feb 3 19:09:46 >> 2017 (r313169) >> @@ -1,6 +1,6 @@ >> .\" $FreeBSD$ >> -Set this if you do not want to install optional libraries. >> -For example when creating a >> +Set this if to not install optional libraries. >> +For example, when creating a >> .Xr nanobsd 8 >> image. >> .Bf -symbolic > > I think this sentence did not become what you meant it to be. Er... yes. Already decromulated. But please keep an eye out for others. Thanks! From owner-svn-src-head@freebsd.org Fri Feb 3 19:36:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58670CCFEA2; Fri, 3 Feb 2017 19:36:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 413A3D5C; Fri, 3 Feb 2017 19:36:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v13Ja5OD008616 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Feb 2017 11:36:05 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v13Ja5NS008615; Fri, 3 Feb 2017 11:36:05 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 3 Feb 2017 11:36:04 -0800 From: Gleb Smirnoff To: Hartmut.Brandt@dlr.de Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313043 - head/sys/kern Message-ID: <20170203193604.GC2556@FreeBSD.org> References: <201702011312.v11DC7WJ085025@repo.freebsd.org> <20170201180816.GF3334@FreeBSD.org> <611243783F62AF48AFB07BC25FA4B1061CED9FD9@DLREXMBX01.intra.dlr.de> <20170202192411.GK3334@FreeBSD.org> <611243783F62AF48AFB07BC25FA4B1061CEDA7DC@DLREXMBX01.intra.dlr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <611243783F62AF48AFB07BC25FA4B1061CEDA7DC@DLREXMBX01.intra.dlr.de> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:36:16 -0000 On Fri, Feb 03, 2017 at 07:51:24AM +0000, Hartmut.Brandt@dlr.de wrote: H> It was attached to my mail, but maybe got removed somewhere. Here it is. It does not use asio, but reproduces the same sequence of system calls. You start it and the try to connect with telnet to port 10000. I was blind, sorry :( And thanks for all replies. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 3 19:36:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C5D1CCFEE6; Fri, 3 Feb 2017 19:36:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E89C3E87; Fri, 3 Feb 2017 19:36:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v13JaVDa008631 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Feb 2017 11:36:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v13JaVUJ008630; Fri, 3 Feb 2017 11:36:31 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 3 Feb 2017 11:36:31 -0800 From: Gleb Smirnoff To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313048 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump Message-ID: <20170203193631.GD2556@FreeBSD.org> References: <201702012026.v11KQgS3069932@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 19:36:33 -0000 On Fri, Feb 03, 2017 at 06:26:49AM -0200, Renato Botelho wrote: R> > Author: glebius R> > Date: Wed Feb 1 20:26:42 2017 R> > New Revision: 313048 R> > URL: https://svnweb.freebsd.org/changeset/base/313048 R> > R> > Log: R> > Update tcpdump to 4.9.0. R> > R> > It fixes many buffer overflow in different protocol parsers, but none of R> > them are critical, even in absense of Capsicum. R> > R> > Security: CVE-2016-7922, CVE-2016-7923, CVE-2016-7924, CVE-2016-7925 R> > Security: CVE-2016-7926, CVE-2016-7927, CVE-2016-7928, CVE-2016-7929 R> > Security: CVE-2016-7930, CVE-2016-7931, CVE-2016-7932, CVE-2016-7933 R> > Security: CVE-2016-7934, CVE-2016-7935, CVE-2016-7936, CVE-2016-7937 R> > Security: CVE-2016-7938, CVE-2016-7939, CVE-2016-7940, CVE-2016-7973 R> > Security: CVE-2016-7974, CVE-2016-7975, CVE-2016-7983, CVE-2016-7984 R> > Security: CVE-2016-7985, CVE-2016-7986, CVE-2016-7992, CVE-2016-7993 R> > Security: CVE-2016-8574, CVE-2016-8575, CVE-2017-5202, CVE-2017-5203 R> > Security: CVE-2017-5204, CVE-2017-5205, CVE-2017-5341, CVE-2017-5342 R> > Security: CVE-2017-5482, CVE-2017-5483, CVE-2017-5484, CVE-2017-5485 R> > Security: CVE-2017-5486 R> R> Hi Gleb, R> R> Do you plan to MFC it to stable/11 and stable/10? Yes, after 3 days. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 3 20:14:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19B1CCE995; Fri, 3 Feb 2017 20:14:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B430C12B5; Fri, 3 Feb 2017 20:14:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id e4so2206041pfg.0; Fri, 03 Feb 2017 12:14:21 -0800 (PST) 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=GQ2XoclVG0jP1Ebu0b4YAwtvEZBVuyFVmCtLSqmUrY8=; b=DqZhRx7Trx8UPLg1vi/3z2BTSvAwmoPhX/JCa/W2kX2YuHtBzmMc/7H3MAnrcJinx4 /4Ea8WvSZdSXmfe5byPGh3VJHDpW3ImT+YFzofDZLbRG1SZ01XoUpjq0qslcz4khMoJi Rd6pYJkPjXsU65m8XWwwLT7mSl3S0Dse1a54/6TV2FLhltLM7auRLlVQzrrUUxcGJSfl bPc9l4Vfn3qJ3mAlWzGR4DtYJQcfCND43a/ohDhZa6gbM5/6sr5G9YOroPtzA4VSA7dT Jzsa+luNxQO8MD7+lhYwfmNUBYNcqgArb0FYLa4x/CQ4X3gyOfBJY2L3MVQ2LJsyi+WQ HyTg== 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=GQ2XoclVG0jP1Ebu0b4YAwtvEZBVuyFVmCtLSqmUrY8=; b=rhwcHmFWhmUkEjzOTiGKn9rjvel2FBKJJcV8779HmJRGI17V37YpXHOwtHn2xH2+36 3619d29AU46WHpbyz1dGSObUr52DbfXRHARsd2DsSIzanTw4SN7gENuWYfCGMbqiHkzI fo+0IZq6+YJyMs6vpUPvvIkNqC6DWHhxRQWj/Xv3E5OflbdXDN9O55WAmDW7gbeF0X3Y 4uKTZa+f5H+X85Qa40hw/YFalHlEF3gwmSKKQNdMD8Xcu9q1qhhV1JQ8Y6goLqM9XhGA Fz7GWY2ud5LQYDi/iUIpSn3dJmghpzv+RcvLsYQCqRu2fzLvgRGEFAtNLrjQXAgxhTlb mBcQ== X-Gm-Message-State: AIkVDXIjGlW/iihRlLDR1Au3NvhTjvfxFzrFamBMFZfH/NjKOTcnSd8YdWLv9FJQzSec0g== X-Received: by 10.99.64.69 with SMTP id n66mr20300577pga.1.1486152861061; Fri, 03 Feb 2017 12:14:21 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v4sm69247914pfb.36.2017.02.03.12.14.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 12:14:20 -0800 (PST) Subject: Re: svn commit: r313169 - head/tools/build/options Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DD5A81EA-6F64-4AF1-92FB-1D6798D2118A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201702031909.v13J9kGN035880@repo.freebsd.org> Date: Fri, 3 Feb 2017 12:14:20 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201702031909.v13J9kGN035880@repo.freebsd.org> To: Warren Block X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:14:22 -0000 --Apple-Mail=_DD5A81EA-6F64-4AF1-92FB-1D6798D2118A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 3, 2017, at 11:09, Warren Block wrote: >=20 > Author: wblock (doc committer) > Date: Fri Feb 3 19:09:46 2017 > New Revision: 313169 > URL: https://svnweb.freebsd.org/changeset/base/313169 >=20 > Log: > Clarify some option descriptions, add a line of text to makeman to > add the slightest hint of a shade of a clue of what it does. >=20 > Sponsored by: iXsystems >=20 > Modified: > head/tools/build/options/WITHOUT_BLACKLIST > head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP > head/tools/build/options/WITHOUT_CROSS_COMPILER > head/tools/build/options/WITHOUT_DIALOG > head/tools/build/options/WITHOUT_DMAGENT > head/tools/build/options/WITHOUT_DOCCOMPRESS > head/tools/build/options/WITHOUT_GPL_DTC > head/tools/build/options/WITHOUT_INSTALLLIB > head/tools/build/options/WITHOUT_KERBEROS > head/tools/build/options/WITH_CCACHE_BUILD > head/tools/build/options/WITH_DIRDEPS_BUILD > head/tools/build/options/WITH_INSTALL_AS_USER > head/tools/build/options/WITH_META_MODE > head/tools/build/options/WITH_STAGING_MAN > head/tools/build/options/makeman I=E2=80=99m ok with the overall change, but next time, could changes to = makeman be committed separately from the WITH* options to make it easier = to MFC? Also, speaking of MFCing the change, will this ever be MFCed? Thanks, -Ngie --Apple-Mail=_DD5A81EA-6F64-4AF1-92FB-1D6798D2118A 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 iQIcBAEBCgAGBQJYlOSdAAoJEPWDqSZpMIYVIcQP/jgL4yjz57XP3NKCBxZ+WYKH SfQNrn7Eq/ZTzgIvEQ4Zmzn5pfZ/AqmKTUwZry6+1Os82BQIwLQiwzpWkJqI3naW QcTIf2t78XH1bcsf75rnbsKoE0eg8ON/KkCcMVU58ur2cJLC2FrQbcUXiZLSZOIl vgzW+SYZjQAjXdGyXOq3kwxeemYb1+a5iL6+DV2/4Y5RIQnFesbGV3GiLToOb/5w EXlr2bS7CnUUnxyrLo+nRQPBTTJmF0jET13IiSbDkazA4GX2Yk+Hzk7x/1lnL/Vv +QhHBYubcv3x9G/76Gror+jMkV+/j7U70ZT+M2F2U6df3qsNWYLnqOe/ysu//SXw lX2qvTgarazDNKo3zR/2wzE1SV4cV2lYQZDhhO4K/QjFzFzHB/r2GiijC4XOPOZe 554nY5PPBPwQQve4K3Q5GjnKe0JBblROcFPSxaOVSh+CM8gQ+XofrKDyH43Mv/Qx EpMPs/RFtqMoKrz2uAAYsrOj13cUCbrCDyHqe9OI9AZ6G1ihYh2RD7/j0FaOKxpF 6LmXLzV5Si23tYZ+5d8BuCQWGw+P9rG9X7ZRfhsAqirBdp/1G03z81PWJUMgb5vH DTeF6tevpXlYYRbM5SiswCeI8fL/cd6eu11fPj3aNOnOVm2Jj/fc/6QPbaMjxpva 5KbkzJowO5AYknOaCBSz =69Xj -----END PGP SIGNATURE----- --Apple-Mail=_DD5A81EA-6F64-4AF1-92FB-1D6798D2118A-- From owner-svn-src-head@freebsd.org Fri Feb 3 20:17:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C4A3CCEB28; Fri, 3 Feb 2017 20:17:55 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 596111502; Fri, 3 Feb 2017 20:17:55 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13KHsru064170; Fri, 3 Feb 2017 20:17:54 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13KHsQx064169; Fri, 3 Feb 2017 20:17:54 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201702032017.v13KHsQx064169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 3 Feb 2017 20:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313173 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:17:55 -0000 Author: wblock (doc committer) Date: Fri Feb 3 20:17:54 2017 New Revision: 313173 URL: https://svnweb.freebsd.org/changeset/base/313173 Log: Re-enable an accidentally-disabled temp directory creation test. Reported by: bjk Sponsored by: iXsystems Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Fri Feb 3 19:21:28 2017 (r313172) +++ head/tools/build/options/makeman Fri Feb 3 20:17:54 2017 (r313173) @@ -8,7 +8,7 @@ export LC_ALL=C ident='$FreeBSD$' t=$(mktemp -d -t makeman) -# trap 'test -d $t && rm -rf $t' exit +trap 'test -d $t && rm -rf $t' exit srcdir=$(realpath ../../..) make="make -C $srcdir -m $srcdir/share/mk" From owner-svn-src-head@freebsd.org Fri Feb 3 20:26:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47177CCEF71 for ; Fri, 3 Feb 2017 20:26:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED3C1C45 for ; Fri, 3 Feb 2017 20:26:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id m98so3365255iod.2 for ; Fri, 03 Feb 2017 12:26:01 -0800 (PST) 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=PNm/6vxbSaOYpJ4dWEjHZYYaviKRz9VLA2rwDvT0NQQ=; b=IM9Ao80b0+U1QfD2JKHJr3RiMLGIqiAgOoq8aCn5a3TRbBfDtRvbvyd7TQe6nYhoMB h/7dl2qaG9/S8jb/fWBSljsLGV4fStkfl7nM70QQYgLnz5MVScDzZQCd5pfUAtt425ih nX2OWwcz2ukyqpHUDygwlm5NuwhiwZdRd1wgBm5diP7TgnTCE1fZeRZqWdaXlOrIU64z dhUdFhN6OS8XbQjV2Y84gp7DiYXWha81KzP8JEnxR8WVfKce2mF1BqN8hQhjkoNEsHFJ uUq8fYwc89vO9/G9nNL94st6/sfNNBErEKrLkmnlrQIZojqzbQPStfR0yi2tvBOkLzPz uIww== 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=PNm/6vxbSaOYpJ4dWEjHZYYaviKRz9VLA2rwDvT0NQQ=; b=WcdcRvws7Sidcsdc0lMYmw8t/+UEjRaBW4sd2N0/uEj3HMsazkoHmkTK6++JkVvW+n 66XV9Dm7DThpPqlDu0SVKHXAs0gRfbK8FOnx9vuegu4WrwE7m1ga+OOVUBtep0waPRTh Kp5aJyZZhgkoDnN18b1G0fNURgyeaN9pnR8l+JIfR2AvEMEpCBEQsIn7vpxAipRE+Tuc +XrRrq0yL6zScqktbCzpF5Up9LOy1Yp+gYOYiy29r9R/OCc7tXM8axPH1cGYSjutl9ra xKcyggMEfQFzatMjveY/fXeU3iQO5ZCajKPicCCL5L//dTF3eIjAFc2WkqPSwRA1cWZb 1qNg== X-Gm-Message-State: AIkVDXJkOs/+ZhPUdW3t3hD+Dea+WA0LkPs0zh6QvieN3M39MUnV48jvo7EY/AdAek2IiS6JVrgwNhBsjJoSWA== X-Received: by 10.107.139.131 with SMTP id n125mr13027983iod.166.1486153560353; Fri, 03 Feb 2017 12:26:00 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Fri, 3 Feb 2017 12:25:59 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <1486146017.3017.193.camel@freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> <1486146017.3017.193.camel@freebsd.org> From: Warner Losh Date: Fri, 3 Feb 2017 13:25:59 -0700 X-Google-Sender-Auth: bA3BXWXgoFG-1d6GGfEowPTF958 Message-ID: Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi To: Ian Lepore Cc: Toomas Soome , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:26:01 -0000 On Fri, Feb 3, 2017 at 11:20 AM, Ian Lepore wrote: > On Fri, 2017-02-03 at 18:52 +0200, Toomas Soome wrote: >> > >> > On 3. veebr 2017, at 18:47, Ian Lepore wrote: >> > >> > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: >> > > >> > > Author: tsoome >> > > Date: Fri Feb 3 16:39:10 2017 >> > > New Revision: 313166 >> > > URL: https://svnweb.freebsd.org/changeset/base/313166 >> > > >> > > Log: >> > > loader: libefi/env.c warnings in arm build >> > > >> > > The arm build has revealed some of the warnings, the fix for >> > > CHAR16 >> > > warning is to switch the warning off for env.c (same as for >> > > efinet.c). >> > > >> > How is disabling the warning instead of just fixing it the right >> > thing >> > to do? I think disabling a printf format warning is never the >> > right >> > thing to do, it just turns a compile warning into a runtime >> > failure. >> >> I would love to see the correct fix - as all UEFI chars are 2 byte; >> but thats up to arm experts. I just do not know the details why the >> arm is stuck with 4 byte wchar_t there - Im sure they do not have >> this just for fun:) >> >> rgds, >> toomas > > Hmm, looks like the right fix is to add -fshort-wchar to CFLAGS, but > it's got to be consistant across all the libraries that get linked, and > some of them are used in the non-efi case too. I'll have a closer look > at whether we can fix it properly over the next few days. I just wonder why that isn't the default.... And the consistency matters only of wchar_t is used in the library... Lemme know what you come up with... Warner From owner-svn-src-head@freebsd.org Fri Feb 3 20:33:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E10CCF146; Fri, 3 Feb 2017 20:33:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CED9F1FE; Fri, 3 Feb 2017 20:33:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13KXNmI072387; Fri, 3 Feb 2017 20:33:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13KXNhI072385; Fri, 3 Feb 2017 20:33:23 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201702032033.v13KXNhI072385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 3 Feb 2017 20:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313174 - in head: lib/libc/sys share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:33:25 -0000 Author: jilles Date: Fri Feb 3 20:33:23 2017 New Revision: 313174 URL: https://svnweb.freebsd.org/changeset/base/313174 Log: Clean up documentation of AF_UNIX control messages. Document AF_UNIX control messages in unix(4) only, not split between unix(4) and recv(2). Also, warn about LOCAL_CREDS effective uid/gid fields, since the write could be from a setuid or setgid program (with the explicit SCM_CREDS and LOCAL_PEERCRED, the credentials are read at such a time that it can be assumed that the process intends for them to be used in this context). Reviewed by: wblock MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9298 Modified: head/lib/libc/sys/recv.2 head/share/man/man4/unix.4 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Fri Feb 3 20:17:54 2017 (r313173) +++ head/lib/libc/sys/recv.2 Fri Feb 3 20:33:23 2017 (r313174) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd August 18, 2016 +.Dd February 3, 2017 .Dt RECV 2 .Os .Sh NAME @@ -266,57 +266,10 @@ with no data buffer provided immediately .Fn accept system call. .Pp -Open file descriptors are now passed as ancillary data for +With .Dv AF_UNIX -domain sockets, with -.Fa cmsg_level -set to -.Dv SOL_SOCKET -and -.Fa cmsg_type -set to -.Dv SCM_RIGHTS . -The close-on-exec flag on received descriptors is set according to the -.Dv MSG_CMSG_CLOEXEC -flag passed to -.Fn recvmsg . -.Pp -Process credentials can also be passed as ancillary data for -.Dv AF_UNIX -domain sockets using a -.Fa cmsg_type -of -.Dv SCM_CREDS . -In this case, -.Fa cmsg_data -should be a structure of type -.Fa cmsgcred , -which is defined in -.In sys/socket.h -as follows: -.Bd -literal -struct cmsgcred { - pid_t cmcred_pid; /* PID of sending process */ - uid_t cmcred_uid; /* real UID of sending process */ - uid_t cmcred_euid; /* effective UID of sending process */ - gid_t cmcred_gid; /* real GID of sending process */ - short cmcred_ngroups; /* number or groups */ - gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ -}; -.Ed -.Pp -If a sender supplies ancillary data with enough space for the above struct -tagged as -.Dv SCM_CREDS -control message type to the -.Fn sendmsg -system call, then kernel will fill in the credential information of the -sending process and deliver it to the receiver. -Since receiver usually has no control over a sender, this method of retrieving -credential information isn't reliable. -For reliable retrieval of remote side credentials it is advised to use the -.Dv LOCAL_CREDS -socket option on the receiving socket. +domain sockets, ancillary data can be used to pass file descriptors and +process credentials. See .Xr unix 4 for details. Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Fri Feb 3 20:17:54 2017 (r313173) +++ head/share/man/man4/unix.4 Fri Feb 3 20:33:23 2017 (r313174) @@ -28,7 +28,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd February 3, 2017 .Dt UNIX 4 .Os .Sh NAME @@ -119,12 +119,12 @@ of a or .Xr sendto 2 must be writable. -.Sh PASSING FILE DESCRIPTORS +.Sh CONTROL MESSAGES The .Ux Ns -domain sockets support the communication of .Ux -file descriptors through the use of the +file descriptors and process credentials through the use of the .Va msg_control field in the .Fa msg @@ -132,13 +132,12 @@ argument to .Xr sendmsg 2 and .Xr recvmsg 2 . -.Pp -Any valid descriptor may be sent in a message. -The file descriptor(s) to be passed are described using a +The items to be passed are described using a .Vt "struct cmsghdr" that is defined in the include file .In sys/socket.h . -The type of the message is +.Pp +To send file descriptors, the type of the message is .Dv SCM_RIGHTS , and the data portion of the messages is an array of integers representing the file descriptors to be passed. @@ -161,6 +160,39 @@ call. Descriptors that are awaiting delivery, or that are purposely not received, are automatically closed by the system when the destination socket is closed. +.Pp +Credentials of the sending process can be transmitted explicitly using a +control message of type +.Dv SCM_CREDS +with a data portion of type +.Vt "struct cmsgcred" , +defined in +.In sys/socket.h +as follows: +.Bd -literal +struct cmsgcred { + pid_t cmcred_pid; /* PID of sending process */ + uid_t cmcred_uid; /* real UID of sending process */ + uid_t cmcred_euid; /* effective UID of sending process */ + gid_t cmcred_gid; /* real GID of sending process */ + short cmcred_ngroups; /* number of groups */ + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ +}; +.Ed +.Pp +The sender should pass a zeroed buffer which will be filled in by the system. +.Pp +The group list is truncated to at most +.Dv CMGROUP_MAX +GIDs. +.Pp +The process ID +.Fa cmcred_pid +should not be looked up (such as via the +.Dv KERN_PROC_PID +sysctl) for making security decisions. +The sending process could have exited and its process ID already been +reused for a new process. .Sh SOCKET OPTIONS .Tn UNIX domain sockets support a number of socket options which can be set with @@ -176,7 +208,13 @@ or a .Dv SOCK_STREAM socket. This option provides a mechanism for the receiver to -receive the credentials of the process as a +receive the credentials of the process calling +.Xr write 2 , +.Xr send 2 , +.Xr sendto 2 +or +.Xr sendmsg 2 +as a .Xr recvmsg 2 control message. The @@ -201,6 +239,10 @@ struct sockcred { }; .Ed .Pp +The current implementation truncates the group list to at most +.Dv CMGROUP_MAX +groups. +.Pp The .Fn SOCKCREDSIZE macro computes the size of the @@ -221,7 +263,28 @@ On and .Dv SOCK_SEQPACKET sockets credentials are passed only on the first read from a socket, -then system clears the option on socket. +then the system clears the option on the socket. +.Pp +This option and the above explicit +.Vt "struct cmsgcred" +both use the same value +.Dv SCM_CREDS +but incompatible control messages. +If this option is enabled and the sender attached a +.Dv SCM_CREDS +control message with a +.Vt "struct cmsgcred" , +it will be discarded and a +.Vt "struct sockcred" +will be included. +.Pp +Many setuid programs will +.Xr write 2 +data at least partially controlled by the invoker, +such as error messages. +Therefore, a message accompanied by a particular +.Fa sc_euid +value should not be trusted as being from that user. .It Dv LOCAL_CONNWAIT Used with .Dv SOCK_STREAM From owner-svn-src-head@freebsd.org Fri Feb 3 20:44:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 868E0CCF48A for ; Fri, 3 Feb 2017 20:44:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6800CA6A for ; Fri, 3 Feb 2017 20:44:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9cc4439b-ea51-11e6-b3c2-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 9cc4439b-ea51-11e6-b3c2-c9f38144898e; Fri, 03 Feb 2017 20:44:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v13KiujP024845; Fri, 3 Feb 2017 13:44:56 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1486154696.3017.201.camel@freebsd.org> Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi From: Ian Lepore To: Warner Losh Cc: Toomas Soome , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Fri, 03 Feb 2017 13:44:56 -0700 In-Reply-To: References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> <1486146017.3017.193.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:44:59 -0000 On Fri, 2017-02-03 at 13:25 -0700, Warner Losh wrote: > On Fri, Feb 3, 2017 at 11:20 AM, Ian Lepore wrote: > > > > On Fri, 2017-02-03 at 18:52 +0200, Toomas Soome wrote: > > > > > > > > > > > > > > > On 3. veebr 2017, at 18:47, Ian Lepore wrote: > > > > > > > > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: > > > > > > > > > > > > > > > Author: tsoome > > > > > Date: Fri Feb3 16:39:10 2017 > > > > > New Revision: 313166 > > > > > URL: https://svnweb.freebsd.org/changeset/base/313166 > > > > > > > > > > Log: > > > > > loader: libefi/env.c warnings in arm build > > > > > > > > > > The arm build has revealed some of the warnings, the fix > > > > > for > > > > > CHAR16 > > > > > warning is to switch the warning off for env.c (same as for > > > > > efinet.c). > > > > > > > > > How is disabling the warning instead of just fixing it the > > > > right > > > > thing > > > > to do?I think disabling a printf format warning is never the > > > > right > > > > thing to do, it just turns a compile warning into a runtime > > > > failure. > > > I would love to see the correct fix - as all UEFI chars are 2 > > > byte; > > > but thats up to arm experts. I just do not know the details why > > > the > > > arm is stuck with 4 byte wchar_t there - Im sure they do not have > > > this just for fun:) > > > > > > rgds, > > > toomas > > Hmm, looks like the right fix is to add -fshort-wchar to CFLAGS, > > but > > it's got to be consistant across all the libraries that get linked, > > and > > some of them are used in the non-efi case too.I'll have a closer > > look > > at whether we can fix it properly over the next few days. > I just wonder why that isn't the default.... And the consistency > matters only of wchar_t is used in the library... Lemme know what you > come up with... > > Warner ARM's abi definition requires 4-byte wchar_t, but allows "certain virtual environments" to use different sizes (without any explanation about what that might mean or how to achieve it). I'm not sure about the "only matters if" part -- the linker was spitting out hundreds of warnings about mismatched wchar_t sizes, as if it were part of object file metadata that failed a sanity check or something (or there are a lot more references to wchar_t in libstand and libfdt than I would have imagined). -- Ian From owner-svn-src-head@freebsd.org Fri Feb 3 20:48:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29DB0CCF5C2 for ; Fri, 3 Feb 2017 20:48:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4936CBB for ; Fri, 3 Feb 2017 20:48:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id o185so2774440itb.1 for ; Fri, 03 Feb 2017 12:48:56 -0800 (PST) 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=5RyxMGoWjX6TlCVwAbLNDF+FG5pXSLEPzXkarUcTghY=; b=RuQZYvtPqlKyBknN7rZIlsdOLTbAOT9K7KPCFvnCxbzFh/TlWRrugMAMBjUl9Nivlr YP/RmbjdCGC1DqhcVTgHE1OQmkgHmPT+Ix/WqKIFxu/NAOEg3Jx/byl6HSSajj9d1N/K Fc1StqTyLhcbJTXOmP9p1ynbiHJ3qh0uRgEhmmOoJWUo6DGtdxlT5yajEe4xIYHf1nAX i6fep9OWKbdF+AeYhseJiiQjMePvqrqX3qmw3IrH7c5Zx4iJyuebcd/sriFSHhx8ApIn nFgtnrRABqHM0zNkvfAsrDkAK4sQf3QX9ACjyV8QZioPHj/DAauDKggK/gXO+6jp9Mv6 wqiw== 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=5RyxMGoWjX6TlCVwAbLNDF+FG5pXSLEPzXkarUcTghY=; b=eKUTNWO387MTeU4kIm5M75Ux0Ef5sdO1+l6uJ65VG1VAfib32vjoaKqYI7sXkfx48u TLpbFdLKLEWSLFIwp9wGjtVQnw1Gqgq9zN90TL2RYQTBI3b4LLFWyqJ09Y3Hasz+W08G yDVHzEvpayq2ICYXhCTo9DFWeyQbZeAPW3LfQe8eK6UmCdYJb3scLb0c9WtBfBdQyMuO LWRmYS/LCajJOzwkgo1SaBBPWWFYmUvUwQbNee+XgsRfoWqyvgMHIcyI271wUK7qMKDq fRUrnJleC9KIyB0+UXpZIK7CGbNQwONI310TjyIKLkkW/5GcG85BM31y2hNUmDiLwsPJ I9Yg== X-Gm-Message-State: AIkVDXJ/1r1SAWyjX7uTnGSjQF1FRxytykdnmy9CQcvDjl4wI3P8KVKhFK7IKN9yVT/KaS73crk7gu9L/mjFzA== X-Received: by 10.36.93.213 with SMTP id w204mr2790486ita.60.1486154936234; Fri, 03 Feb 2017 12:48:56 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.217 with HTTP; Fri, 3 Feb 2017 12:48:55 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <1486154696.3017.201.camel@freebsd.org> References: <201702031639.v13GdAXQ074031@repo.freebsd.org> <1486140447.3017.189.camel@freebsd.org> <19994E26-42EE-4E12-9867-1E53FA2A7F81@me.com> <1486146017.3017.193.camel@freebsd.org> <1486154696.3017.201.camel@freebsd.org> From: Warner Losh Date: Fri, 3 Feb 2017 13:48:55 -0700 X-Google-Sender-Auth: TSI_To4bZNgaldyhQ93jzaSq4y0 Message-ID: Subject: Re: svn commit: r313166 - head/sys/boot/efi/libefi To: Ian Lepore Cc: Toomas Soome , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 20:48:57 -0000 On Fri, Feb 3, 2017 at 1:44 PM, Ian Lepore wrote: > On Fri, 2017-02-03 at 13:25 -0700, Warner Losh wrote: >> On Fri, Feb 3, 2017 at 11:20 AM, Ian Lepore wrote: >> > >> > On Fri, 2017-02-03 at 18:52 +0200, Toomas Soome wrote: >> > > >> > > > >> > > > >> > > > On 3. veebr 2017, at 18:47, Ian Lepore wrote: >> > > > >> > > > On Fri, 2017-02-03 at 16:39 +0000, Toomas Soome wrote: >> > > > > >> > > > > >> > > > > Author: tsoome >> > > > > Date: Fri Feb 3 16:39:10 2017 >> > > > > New Revision: 313166 >> > > > > URL: https://svnweb.freebsd.org/changeset/base/313166 >> > > > > >> > > > > Log: >> > > > > loader: libefi/env.c warnings in arm build >> > > > > >> > > > > The arm build has revealed some of the warnings, the fix >> > > > > for >> > > > > CHAR16 >> > > > > warning is to switch the warning off for env.c (same as for >> > > > > efinet.c). >> > > > > >> > > > How is disabling the warning instead of just fixing it the >> > > > right >> > > > thing >> > > > to do? I think disabling a printf format warning is never the >> > > > right >> > > > thing to do, it just turns a compile warning into a runtime >> > > > failure. >> > > I would love to see the correct fix - as all UEFI chars are 2 >> > > byte; >> > > but thats up to arm experts. I just do not know the details why >> > > the >> > > arm is stuck with 4 byte wchar_t there - Im sure they do not have >> > > this just for fun:) >> > > >> > > rgds, >> > > toomas >> > Hmm, looks like the right fix is to add -fshort-wchar to CFLAGS, >> > but >> > it's got to be consistant across all the libraries that get linked, >> > and >> > some of them are used in the non-efi case too. I'll have a closer >> > look >> > at whether we can fix it properly over the next few days. >> I just wonder why that isn't the default.... And the consistency >> matters only of wchar_t is used in the library... Lemme know what you >> come up with... >> >> Warner > > ARM's abi definition requires 4-byte wchar_t, but allows "certain > virtual environments" to use different sizes (without any explanation > about what that might mean or how to achieve it). > > I'm not sure about the "only matters if" part -- the linker was > spitting out hundreds of warnings about mismatched wchar_t sizes, as if > it were part of object file metadata that failed a sanity check or > something (or there are a lot more references to wchar_t in libstand > and libfdt than I would have imagined). Gotcha. I know the linker records various details in the .o's for sanity checking. Didn't think this was one of them, so, yea, it looks like you're right. We may have to build a separate copy of such libraries for UEFI since it has a different ABI. Warner From owner-svn-src-head@freebsd.org Fri Feb 3 22:13:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA02CCFEE4; Fri, 3 Feb 2017 22:13:38 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA56685; Fri, 3 Feb 2017 22:13:37 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v13MDbsb078223 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Feb 2017 15:13:37 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v13MDauK078220; Fri, 3 Feb 2017 15:13:37 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Fri, 3 Feb 2017 15:13:36 -0700 (MST) From: Warren Block To: "Ngie Cooper (yaneurabeya)" cc: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313169 - head/tools/build/options In-Reply-To: Message-ID: References: <201702031909.v13J9kGN035880@repo.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Fri, 03 Feb 2017 15:13:37 -0700 (MST) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:13:38 -0000 On Fri, 3 Feb 2017, Ngie Cooper (yaneurabeya) wrote: > >> On Feb 3, 2017, at 11:09, Warren Block wrote: >> >> Author: wblock (doc committer) >> Date: Fri Feb 3 19:09:46 2017 >> New Revision: 313169 >> URL: https://svnweb.freebsd.org/changeset/base/313169 >> >> Log: >> Clarify some option descriptions, add a line of text to makeman to >> add the slightest hint of a shade of a clue of what it does. >> >> Sponsored by: iXsystems >> >> Modified: >> head/tools/build/options/WITHOUT_BLACKLIST >> head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP >> head/tools/build/options/WITHOUT_CROSS_COMPILER >> head/tools/build/options/WITHOUT_DIALOG >> head/tools/build/options/WITHOUT_DMAGENT >> head/tools/build/options/WITHOUT_DOCCOMPRESS >> head/tools/build/options/WITHOUT_GPL_DTC >> head/tools/build/options/WITHOUT_INSTALLLIB >> head/tools/build/options/WITHOUT_KERBEROS >> head/tools/build/options/WITH_CCACHE_BUILD >> head/tools/build/options/WITH_DIRDEPS_BUILD >> head/tools/build/options/WITH_INSTALL_AS_USER >> head/tools/build/options/WITH_META_MODE >> head/tools/build/options/WITH_STAGING_MAN >> head/tools/build/options/makeman > > I’m ok with the overall change, but next time, could changes to makeman be committed separately from the WITH* options to make it easier to MFC? Also, speaking of MFCing the change, will this ever be MFCed? Sorry, was not planning on MFCing the makeman change, although it wouldn't hurt. From owner-svn-src-head@freebsd.org Fri Feb 3 22:26:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF00CCCF24E; Fri, 3 Feb 2017 22:26:21 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E92EE01; Fri, 3 Feb 2017 22:26:21 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13MQKjC018115; Fri, 3 Feb 2017 22:26:20 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13MQKHG018109; Fri, 3 Feb 2017 22:26:20 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201702032226.v13MQKHG018109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 3 Feb 2017 22:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313176 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys modules/dtrace/dtrace modules/dtrace/fasttrap modules/dtrace/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:26:21 -0000 Author: gnn Date: Fri Feb 3 22:26:19 2017 New Revision: 313176 URL: https://svnweb.freebsd.org/changeset/base/313176 Log: Replace the implementation of DTrace's RAND subroutine for generating low-quality random numbers with a modern implementation (xoroshiro128+) that is capable of generating better quality randomness without compromising performance. Submitted by: Graeme Jenkinson Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9051 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/dtrace/systrace/Makefile Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Feb 3 21:37:27 2017 (r313175) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Feb 3 22:26:19 2017 (r313176) @@ -124,6 +124,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,8 @@ #include "dtrace_debug.c" #endif +#include "dtrace_xoroshiro128_plus.h" + /* * DTrace Tunable Variables * @@ -298,7 +301,6 @@ static kmutex_t dtrace_meta_lock; /* me #define vuprintf vprintf #define ttoproc(_a) ((_a)->td_proc) #define crgetzoneid(_a) 0 -#define NCPU MAXCPU #define SNOCD 0 #define CPU_ON_INTR(_a) 0 @@ -4236,7 +4238,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, switch (subr) { case DIF_SUBR_RAND: - regs[rd] = (dtrace_gethrtime() * 2416 + 374441) % 1771875; + regs[rd] = dtrace_xoroshiro128_plus_next( + state->dts_rstate[curcpu]); break; #ifdef illumos @@ -14495,6 +14498,7 @@ dtrace_state_create(struct cdev *dev, st dtrace_state_t *state; dtrace_optval_t *opt; int bufsize = NCPU * sizeof (dtrace_buffer_t), i; + int cpu_it; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(MUTEX_HELD(&cpu_lock)); @@ -14550,6 +14554,21 @@ dtrace_state_create(struct cdev *dev, st state->dts_buffer = kmem_zalloc(bufsize, KM_SLEEP); state->dts_aggbuffer = kmem_zalloc(bufsize, KM_SLEEP); + /* + * Allocate and initialise the per-process per-CPU random state. + * SI_SUB_RANDOM < SI_SUB_DTRACE_ANON therefore entropy device is + * assumed to be seeded at this point (if from Fortuna seed file). + */ + (void) read_random(&state->dts_rstate[0], 2 * sizeof(uint64_t)); + for (cpu_it = 1; cpu_it < NCPU; cpu_it++) { + /* + * Each CPU is assigned a 2^64 period, non-overlapping + * subsequence. + */ + dtrace_xoroshiro128_plus_jump(state->dts_rstate[cpu_it-1], + state->dts_rstate[cpu_it]); + } + #ifdef illumos state->dts_cleaner = CYCLIC_NONE; state->dts_deadman = CYCLIC_NONE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Fri Feb 3 21:37:27 2017 (r313175) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Fri Feb 3 22:26:19 2017 (r313176) @@ -50,6 +50,7 @@ extern "C" { */ #include + #ifndef illumos #ifdef __sparcv9 typedef uint32_t pc_t; @@ -65,6 +66,10 @@ typedef u_long greg_t; #define DTRACE_MAXPROPLEN 128 #define DTRACE_DYNVAR_CHUNKSIZE 256 +#ifdef __FreeBSD__ +#define NCPU MAXCPU +#endif /* __FreeBSD__ */ + struct dtrace_probe; struct dtrace_ecb; struct dtrace_predicate; @@ -1169,6 +1174,7 @@ struct dtrace_state { dtrace_cred_t dts_cred; /* credentials */ size_t dts_nretained; /* number of retained enabs */ int dts_getf; /* number of getf() calls */ + uint64_t dts_rstate[NCPU][2]; /* per-CPU random state */ }; struct dtrace_provider { Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Fri Feb 3 21:37:27 2017 (r313175) +++ head/sys/modules/dtrace/dtrace/Makefile Fri Feb 3 22:26:19 2017 (r313176) @@ -12,6 +12,7 @@ ARCHDIR= ${MACHINE_CPUARCH} KMOD= dtrace SRCS= dtrace.c \ + dtrace_xoroshiro128_plus.c \ dtrace_asm.S \ dtrace_subr.c @@ -42,6 +43,7 @@ CFLAGS+= -I${SYSDIR}/cddl/compat/opensol -I${SYSDIR}/cddl/dev/dtrace \ -I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR}/cddl/contrib/opensolaris/common/util \ -I${SYSDIR} -DDIS_MEM Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Fri Feb 3 21:37:27 2017 (r313175) +++ head/sys/modules/dtrace/fasttrap/Makefile Fri Feb 3 22:26:19 2017 (r313176) @@ -10,6 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Modified: head/sys/modules/dtrace/systrace/Makefile ============================================================================== --- head/sys/modules/dtrace/systrace/Makefile Fri Feb 3 21:37:27 2017 (r313175) +++ head/sys/modules/dtrace/systrace/Makefile Fri Feb 3 22:26:19 2017 (r313176) @@ -10,6 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR} .include From owner-svn-src-head@freebsd.org Fri Feb 3 22:39:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9AAFCCF565; Fri, 3 Feb 2017 22:39:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7934F687; Fri, 3 Feb 2017 22:39:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id AEF222DC8; Fri, 3 Feb 2017 22:39:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id A3E762BEF1; Fri, 3 Feb 2017 22:39:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ftn9_fQLGwBI; Fri, 3 Feb 2017 22:39:35 +0000 (UTC) Subject: Re: svn commit: r313169 - head/tools/build/options DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 731FA2BED4 To: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702031909.v13J9kGN035880@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> Date: Fri, 3 Feb 2017 14:39:36 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <201702031909.v13J9kGN035880@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wOVs3qouTqtiEPQUEdeqPPbhq1UU61trs" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:39:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wOVs3qouTqtiEPQUEdeqPPbhq1UU61trs Content-Type: multipart/mixed; boundary="ARnJpJSNhUu2qNocdUNOIociResLgItfG"; protected-headers="v1" From: Bryan Drewery To: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> Subject: Re: svn commit: r313169 - head/tools/build/options References: <201702031909.v13J9kGN035880@repo.freebsd.org> In-Reply-To: <201702031909.v13J9kGN035880@repo.freebsd.org> --ARnJpJSNhUu2qNocdUNOIociResLgItfG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/3/2017 11:09 AM, Warren Block wrote: > Modified: head/tools/build/options/makeman > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/tools/build/options/makeman Fri Feb 3 17:02:57 2017 (r313168)= > +++ head/tools/build/options/makeman Fri Feb 3 19:09:46 2017 (r313169)= > @@ -8,7 +8,7 @@ export LC_ALL=3DC > ident=3D'$FreeBSD$' > =20 > t=3D$(mktemp -d -t makeman) > -trap 'test -d $t && rm -rf $t' exit > +# trap 'test -d $t && rm -rf $t' exit Woops, you committed a debug change. --=20 Regards, Bryan Drewery --ARnJpJSNhUu2qNocdUNOIociResLgItfG-- --wOVs3qouTqtiEPQUEdeqPPbhq1UU61trs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJYlQaoAAoJEDXXcbtuRpfPYRMH/inaMGRjT8LCxrrCGGg+v1xi fIeVmgXUMHZNhGyjbksyJYmw9VLUZ8pNbYxuJmGO3WU8Om0p0pUQw/gxyDUw48LR IOlQX7ST4qzBBI2LZkVGcmSDSSQq18JzihzsP4YAZzbwNeqpeMVkH9dv2J6CmYeg XohkDKVEO0qAkSJPqowgj4wFRG4YDlyNlubVvg3Cmp8cr3I+t1wVAlT0/nU136rZ 072H/OhkTokTl+f/U0M5OyVaEvUzpzyO5QFHN89PpKzN6vhH4FBO1A9HS7hZaN+T qbdkZiNAr6g9/X+DrypS7+8bsmg02fonPi6i6lurAKv21/4RBKzE8bzQkaGaE/Q= =cdor -----END PGP SIGNATURE----- --wOVs3qouTqtiEPQUEdeqPPbhq1UU61trs-- From owner-svn-src-head@freebsd.org Fri Feb 3 22:40:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A56ECCF5C3; Fri, 3 Feb 2017 22:40:15 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E05A17FC; Fri, 3 Feb 2017 22:40:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13MeEnx022197; Fri, 3 Feb 2017 22:40:14 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13MeDg1022196; Fri, 3 Feb 2017 22:40:13 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201702032240.v13MeDg1022196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 3 Feb 2017 22:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313177 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:40:15 -0000 Author: gnn Date: Fri Feb 3 22:40:13 2017 New Revision: 313177 URL: https://svnweb.freebsd.org/changeset/base/313177 Log: Files which implement the new random number system code for DTrace Submitted by: Graeme Jenkinson MFC after: 2 weeks Sponsored by: DARPA, AFRL Added: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h (contents, props changed) Added: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c Fri Feb 3 22:40:13 2017 (r313177) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2016 (Graeme Jenkinson) + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * 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 + +#include "dtrace_xoroshiro128_plus.h" + +static __inline uint64_t +rotl(const uint64_t x, int k) +{ + return (x << k) | (x >> (64 - k)); +} + +/* + * This is the jump function for the generator. It is equivalent to 2^64 calls + * to next(); it can be used to generate 2^64 non-overlapping subsequences for + * parallel computations. + */ +void +dtrace_xoroshiro128_plus_jump(uint64_t * const state, + uint64_t * const jump_state) +{ + static const uint64_t JUMP[] = { 0xbeac0467eba5facb, + 0xd86b048b86aa9922 }; + + uint64_t s0 = 0; + uint64_t s1 = 0; + int i = 0; + int b = 0; + for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++) { + for (b = 0; b < 64; b++) { + if (JUMP[i] & 1ULL << b) { + s0 ^= state[0]; + s1 ^= state[1]; + } + dtrace_xoroshiro128_plus_next(state); + } + } + jump_state[0] = s0; + jump_state[1] = s1; +} + +/* + * xoroshiro128+ - XOR/rotate/shift/rotate + * xorshift.di.unimi.it + */ +uint64_t +dtrace_xoroshiro128_plus_next(uint64_t * const state) +{ + const uint64_t s0 = state[0]; + uint64_t s1 = state[1]; + uint64_t result; + result = s0 + s1; + + s1 ^= s0; + state[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14); + state[1] = rotl(s1, 36); + + return result; +} Added: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h Fri Feb 3 22:40:13 2017 (r313177) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2016 (Graeme Jenkinson) + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * 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. + * + */ + +#ifndef _DTRACE_XOROSHIRO128_PLUS_H +#define _DTRACE_XOROSHIRO128_PLUS_H +#endif + +#include + +extern void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const); +extern uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const); From owner-svn-src-head@freebsd.org Fri Feb 3 22:42:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0546FCCF752; Fri, 3 Feb 2017 22:42:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4CC6BC1; Fri, 3 Feb 2017 22:42:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id F182B3013; Fri, 3 Feb 2017 22:42:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 225422BF23; Fri, 3 Feb 2017 22:42:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id vhjeDDcexArF; Fri, 3 Feb 2017 22:41:56 +0000 (UTC) Subject: Re: svn commit: r313169 - head/tools/build/options DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A85D92BF1D To: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702031909.v13J9kGN035880@repo.freebsd.org> <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <27b89dcd-76c2-246b-eaea-01e5816b5551@FreeBSD.org> Date: Fri, 3 Feb 2017 14:41:58 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="naw2m9wKqpvIoUmb4F1uOsSJSe5iqM8Ab" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:42:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --naw2m9wKqpvIoUmb4F1uOsSJSe5iqM8Ab Content-Type: multipart/mixed; boundary="xCj3Uoq4WhdDgj5gXgmWHXOVdN6Ww9peB"; protected-headers="v1" From: Bryan Drewery To: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <27b89dcd-76c2-246b-eaea-01e5816b5551@FreeBSD.org> Subject: Re: svn commit: r313169 - head/tools/build/options References: <201702031909.v13J9kGN035880@repo.freebsd.org> <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> In-Reply-To: <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> --xCj3Uoq4WhdDgj5gXgmWHXOVdN6Ww9peB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/3/2017 2:39 PM, Bryan Drewery wrote: > On 2/3/2017 11:09 AM, Warren Block wrote: >> Modified: head/tools/build/options/makeman >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/tools/build/options/makeman Fri Feb 3 17:02:57 2017 (r313168= ) >> +++ head/tools/build/options/makeman Fri Feb 3 19:09:46 2017 (r313169= ) >> @@ -8,7 +8,7 @@ export LC_ALL=3DC >> ident=3D'$FreeBSD$' >> =20 >> t=3D$(mktemp -d -t makeman) >> -trap 'test -d $t && rm -rf $t' exit >> +# trap 'test -d $t && rm -rf $t' exit >=20 > Woops, you committed a debug change. >=20 Nm, already fixed. --=20 Regards, Bryan Drewery --xCj3Uoq4WhdDgj5gXgmWHXOVdN6Ww9peB-- --naw2m9wKqpvIoUmb4F1uOsSJSe5iqM8Ab Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJYlQc2AAoJEDXXcbtuRpfPl9MH/02aLvmsIIBZXkePIJy81dug +8Ad7jRPL7TtBM9hgsiShiiKVkfYqba5rNpn7nxlEL2O3I84amszkkSm2GMlAqCI ouSn6xZjzt2Nmv24IOOcrU8wCC86YSFITS8dw5CHFkJgXSBtQfG0qDeEcCxuMS/f BTCJz3EhvTMGCPMbP1zam7EkAT9n6T80c6Y0LgisWD25f8qYc/5gEzMUT0oTrT32 ZnyQ5oavwEBYy41eIMbA5XP8zlUa2my/jjNMRt+gRkQUbiFHxbzVkBRqwa6heMIw wkAHcUi1ZFKpFe5/ZMpo4IOivFr/O+Wgd0bGTB/ydXNLZ7D9Ykxg81m2lKdmzOQ= =862R -----END PGP SIGNATURE----- --naw2m9wKqpvIoUmb4F1uOsSJSe5iqM8Ab-- From owner-svn-src-head@freebsd.org Fri Feb 3 22:42:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE241CCF7AE; Fri, 3 Feb 2017 22:42:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A79FD45; Fri, 3 Feb 2017 22:42:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id 19so2379946pfo.3; Fri, 03 Feb 2017 14:42:44 -0800 (PST) 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=p3YazZosGfT4LPqvbtl+jXd3u9vvFFiW2oK5dfVsib4=; b=fmj2R+kqpDh1zcMoswwiVl3Q0vanjqm+bcupnLEoXkbub+61HWRjUlv1UtzMZSXg37 p7Xuffmjyd/kgMNVeQ7BMOolRTOCp8eTxkDUDFPK8yUZACkAhP2dB2waXBhto9RLUPuw YiHo0271Udt2XTmLaRUsckZMFrMvDCEvzmYbeRT5e1AGyZF8uKkoywgqqc0HGw6rLpWY JlY7YKDadUkYvhf88QYXtkMZlUpgDirsyBJgeSPcmkFVCPAr35Imv6vLb8dS17qLod6e Ce7ZdYuz528AefxEdQJ8RJdFQcysmI4HkRMBPLDW06HjRIQF2AE/eoFxF21Imt3SpZ8q 79iA== 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=p3YazZosGfT4LPqvbtl+jXd3u9vvFFiW2oK5dfVsib4=; b=TsehhKG2tnCHdkN6KnapooI/YkFjRCqaAt96R6wJlm97gT94vzbPHTE54p3CLoVhUk 3KxSh9YnlRIwNfiHvBl1FI5RxRaaX4dxzgd2YvDkvpGF3/PRPes3Yxv4iK+jH+AmF6Tc sr6O42oopkxbQlSmvJbkCf/saY5hqxoJAK0dKA1plnB9r0xOpYvmWsK8H7fu0O3A1aV7 Whd17PKMEh3UsnJR8EkZFL6Bzkj0S52AvTGhB8Iox45saYjBWCE8mkl186BC3e4s/3X4 nyu9oVm7eoGkxhCe+zx2ngafb4UA94c11cCsZoPQ0TuEO6IDP7FN8Nr4URVibVPOFXJ6 DsmA== X-Gm-Message-State: AIkVDXKvhezi+723VaWqh3L1acQFZvfseKElGaLLEqlZmY3rZVaGVKaoOFltnohVR0vjDg== X-Received: by 10.98.25.21 with SMTP id 21mr21171958pfz.46.1486161763988; Fri, 03 Feb 2017 14:42:43 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 19sm69595840pft.46.2017.02.03.14.42.43 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 14:42:43 -0800 (PST) Subject: Re: svn commit: r313169 - head/tools/build/options Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_31E5BB45-2493-42CE-A594-0B7A4AF5F57F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> Date: Fri, 3 Feb 2017 14:42:44 -0800 Cc: Warren Block , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2726EE89-5708-4745-B391-31F8E4477641@gmail.com> References: <201702031909.v13J9kGN035880@repo.freebsd.org> <99761ce8-5851-6e78-af1d-3fc89f9d6494@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:42:44 -0000 --Apple-Mail=_31E5BB45-2493-42CE-A594-0B7A4AF5F57F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Feb 3, 2017, at 14:39, Bryan Drewery wrote: >=20 > On 2/3/2017 11:09 AM, Warren Block wrote: >> Modified: head/tools/build/options/makeman >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/tools/build/options/makeman Fri Feb 3 17:02:57 2017 = (r313168) >> +++ head/tools/build/options/makeman Fri Feb 3 19:09:46 2017 = (r313169) >> @@ -8,7 +8,7 @@ export LC_ALL=3DC >> ident=3D'$FreeBSD$' >>=20 >> t=3D$(mktemp -d -t makeman) >> -trap 'test -d $t && rm -rf $t' exit >> +# trap 'test -d $t && rm -rf $t' exit >=20 > Woops, you committed a debug change. wblock fixed it in r313173. -Ngie --Apple-Mail=_31E5BB45-2493-42CE-A594-0B7A4AF5F57F 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 iQIcBAEBCgAGBQJYlQdkAAoJEPWDqSZpMIYVfsIQALth4uZRl20FQ44Vowjl6uYR F313nX5WqfM+g2rELGPjuPsx13RnN36QAHVk8WJQzZAqy2TM4+wtIWyEh7utrjPx Td5tizMA3h/BPEgqUv36prqijp9/cPK6QPOP+dTqP4K5+4blPXt7CkdcjSXHj6pI N8VblpNyTWjTbsf4KWdPnNBCaNjErPvn1bZ/UFMnUARvs5EhCyqxzDumUmsZK+7q JXyhHnvoFqLgm+N8jlOwKZ3E6wToeDT73Fa3iu2Gy1V7wJLsIMjr3meCUcAo1jxo /0XlBpjU4RAwdq9J3Fnr8u6Umzz7/dHmqi03xVbkHSx4Hjlk4Aa5O5X3q0exhcok hn0Q5KVGlumglb24m7o9DoRYXP/jcoQLbsBBPu1ipJm+qinyqfImSDY53o9XeuNW CA0iKsNJay1Ng0M17/I2bceRH0lLp21Lk6zqMTcGWZMdzW9RlcANsvwAe7RTKGSY mTR2/gPIZD/mqaWfa0yuyBjhFpo2uTS+ACDZSclX/+zt6ZiN0l0QofOR6TKvQJx1 8zLuYS58Zw8NcN8W6df9QSU+GlNgR/uNvMzShGZhTu8+QbDUztg2VjKgkzIMl0ZO rZ2+aowQq5abQIrhNv3VsHQFcy6qFNQqjLiIX62kattXgKVjoTZ/yQOtor2qEczc +xcI4qeUaBVSpAr2vd4M =5pBQ -----END PGP SIGNATURE----- --Apple-Mail=_31E5BB45-2493-42CE-A594-0B7A4AF5F57F-- From owner-svn-src-head@freebsd.org Fri Feb 3 22:46:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D22CCF85F; Fri, 3 Feb 2017 22:46:57 +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 7AA2EEC9; Fri, 3 Feb 2017 22:46:57 +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 v13MkqTC001609 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Feb 2017 00:46:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v13MkqTC001609 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v13Mkq6g001608; Sat, 4 Feb 2017 00:46:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 4 Feb 2017 00:46:52 +0200 From: Konstantin Belousov To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313177 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace Message-ID: <20170203224652.GC2092@kib.kiev.ua> References: <201702032240.v13MeDg1022196@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702032240.v13MeDg1022196@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 22:46:58 -0000 On Fri, Feb 03, 2017 at 10:40:13PM +0000, George V. Neville-Neil wrote: > + > +#ifndef _DTRACE_XOROSHIRO128_PLUS_H > +#define _DTRACE_XOROSHIRO128_PLUS_H > +#endif This protective define is useless unless #endif is placed properly. > + > +#include > + > +extern void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const); extern keywords there are useless as well. > +extern uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const); From owner-svn-src-head@freebsd.org Sat Feb 4 00:34:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB84CCF560; Sat, 4 Feb 2017 00:34:02 +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 2D44418EB; Sat, 4 Feb 2017 00:34:02 +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 v140Y1AQ071002; Sat, 4 Feb 2017 00:34:01 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v140Y1ME070999; Sat, 4 Feb 2017 00:34:01 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702040034.v140Y1ME070999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 4 Feb 2017 00:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313180 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 00:34:02 -0000 Author: vangyzen Date: Sat Feb 4 00:34:00 2017 New Revision: 313180 URL: https://svnweb.freebsd.org/changeset/base/313180 Log: PCIe HotPlug: remove tests for DL active link capability As of r313097, the HotPlug code requires the link to support reporting of the data-link status. Remove tests for this capability from code that can now assume its presence. Suggested by: jhb Reviewed by: jhb MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9431 Modified: head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Fri Feb 3 23:48:56 2017 (r313179) +++ head/sys/dev/pci/pci_pci.c Sat Feb 4 00:34:00 2017 (r313180) @@ -918,6 +918,7 @@ static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + uint32_t link_cap; uint16_t link_sta, slot_sta; if (!pci_enable_pcie_hp) @@ -930,12 +931,12 @@ pcib_probe_hotplug(struct pcib_softc *sc if (!(pcie_read_config(dev, PCIER_FLAGS, 2) & PCIEM_FLAGS_SLOT)) return; - sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) return; - if ((sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) == 0) + link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); + if ((link_cap & PCIEM_LINK_CAP_DL_ACTIVE) == 0) return; /* @@ -947,8 +948,7 @@ pcib_probe_hotplug(struct pcib_softc *sc * If there is an open MRL but the Data Link Layer is active, * the MRL is not real. */ - if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 && - (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) { + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0) { link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 && @@ -1061,10 +1061,8 @@ pcib_hotplug_present(struct pcib_softc * return (0); /* Require the Data Link Layer to be active. */ - if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { - if (!(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE)) - return (0); - } + if (!(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE)) + return (0); return (-1); } @@ -1121,20 +1119,18 @@ pcib_pcie_hotplug_update(struct pcib_sof * changed on this interrupt. Stop any scheduled timer if * the Data Link Layer is active. */ - if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { - if (card_inserted && - !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && - sc->pcie_slot_sta & - (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { - if (cold) - device_printf(sc->dev, - "Data Link Layer inactive\n"); - else - callout_reset(&sc->pcie_dll_timer, hz, - pcib_pcie_dll_timeout, sc); - } else if (sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) - callout_stop(&sc->pcie_dll_timer); - } + if (card_inserted && + !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && + sc->pcie_slot_sta & + (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { + if (cold) + device_printf(sc->dev, + "Data Link Layer inactive\n"); + else + callout_reset(&sc->pcie_dll_timer, hz, + pcib_pcie_dll_timeout, sc); + } else if (sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) + callout_stop(&sc->pcie_dll_timer); pcib_pcie_hotplug_command(sc, val, mask); @@ -1384,7 +1380,7 @@ pcib_setup_hotplug(struct pcib_softc *sc mask = PCIEM_SLOT_CTL_DLLSCE | PCIEM_SLOT_CTL_HPIE | PCIEM_SLOT_CTL_CCIE | PCIEM_SLOT_CTL_PDCE | PCIEM_SLOT_CTL_MRLSCE | PCIEM_SLOT_CTL_PFDE | PCIEM_SLOT_CTL_ABPE; - val = PCIEM_SLOT_CTL_PDCE | PCIEM_SLOT_CTL_HPIE; + val = PCIEM_SLOT_CTL_DLLSCE | PCIEM_SLOT_CTL_HPIE | PCIEM_SLOT_CTL_PDCE; if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_APB) val |= PCIEM_SLOT_CTL_ABPE; if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) @@ -1393,8 +1389,6 @@ pcib_setup_hotplug(struct pcib_softc *sc val |= PCIEM_SLOT_CTL_MRLSCE; if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS)) val |= PCIEM_SLOT_CTL_CCIE; - if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) - val |= PCIEM_SLOT_CTL_DLLSCE; /* Turn the attention indicator off. */ if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_AIP) { Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Fri Feb 3 23:48:56 2017 (r313179) +++ head/sys/dev/pci/pcib_private.h Sat Feb 4 00:34:00 2017 (r313180) @@ -132,7 +132,6 @@ struct pcib_softc uint16_t bridgectl; /* bridge control register */ uint16_t pcie_link_sta; uint16_t pcie_slot_sta; - uint32_t pcie_link_cap; uint32_t pcie_slot_cap; struct resource *pcie_irq; void *pcie_ihand; From owner-svn-src-head@freebsd.org Sat Feb 4 00:37:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D85CCF5FD; Sat, 4 Feb 2017 00:37:27 +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 D4AED1A9C; Sat, 4 Feb 2017 00:37:26 +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 v140bPmG071203; Sat, 4 Feb 2017 00:37:25 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v140bPri071202; Sat, 4 Feb 2017 00:37:25 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702040037.v140bPri071202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 4 Feb 2017 00:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313181 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 00:37:27 -0000 Author: vangyzen Date: Sat Feb 4 00:37:25 2017 New Revision: 313181 URL: https://svnweb.freebsd.org/changeset/base/313181 Log: Fix grammar in getpeereid(3) Modified: head/lib/libc/gen/getpeereid.3 Modified: head/lib/libc/gen/getpeereid.3 ============================================================================== --- head/lib/libc/gen/getpeereid.3 Sat Feb 4 00:34:00 2017 (r313180) +++ head/lib/libc/gen/getpeereid.3 Sat Feb 4 00:37:25 2017 (r313181) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2001 +.Dd February 3, 2017 .Dt GETPEEREID 3 .Os .Sh NAME @@ -57,8 +57,8 @@ on which either .Xr connect 2 or .Xr listen 2 -have been called. -The effective used ID is placed in +has been called. +The effective user ID is placed in .Fa euid , and the effective group ID in .Fa egid . From owner-svn-src-head@freebsd.org Sat Feb 4 01:21:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66943CCF3D0; Sat, 4 Feb 2017 01:21:49 +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 36773112B; Sat, 4 Feb 2017 01:21:49 +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 v141LmEo090560; Sat, 4 Feb 2017 01:21:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v141Lmhf090559; Sat, 4 Feb 2017 01:21:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702040121.v141Lmhf090559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 01:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313182 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 01:21:49 -0000 Author: ngie Date: Sat Feb 4 01:21:48 2017 New Revision: 313182 URL: https://svnweb.freebsd.org/changeset/base/313182 Log: Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS) MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 4 00:37:25 2017 (r313181) +++ head/Makefile.inc1 Sat Feb 4 01:21:48 2017 (r313182) @@ -242,10 +242,10 @@ SUBDIR+= ${_DIR} # of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and # LOCAL_LIB_DIRS=foo/lib to behave as expected. .for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} -_REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} +_REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} .endfor .for _DIR in ${LOCAL_LIB_DIRS} -.if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) +.if empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} .else .warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121. From owner-svn-src-head@freebsd.org Sat Feb 4 02:15:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C6BCCF4A9; Sat, 4 Feb 2017 02:15:51 +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 F3A65127A; Sat, 4 Feb 2017 02:15:50 +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 v142FoZH011871; Sat, 4 Feb 2017 02:15:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v142Fobx011870; Sat, 4 Feb 2017 02:15:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702040215.v142Fobx011870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Feb 2017 02:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313184 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 02:15:51 -0000 Author: bdrewery Date: Sat Feb 4 02:15:49 2017 New Revision: 313184 URL: https://svnweb.freebsd.org/changeset/base/313184 Log: Remove LOCAL_LIB_DIRS warning added in r275839. The case for which this was added, r274807, causes this warning to always show. LOCAL_DIRS=foo LOCAL_LIB_DIRS=foo/lib. The only case in which r274807 is a problem is if foo/Makefile does not contain SUBDIR+=lib, which is a normal convention. LOCAL_LIB_DIRS is a special hack only to get a library into the _generic_libs list for the 'make libraries' bootstrapping phase. The old behavior changed in r274807 was only in head during the 10.0 cycle, so the warning was only ever needed until release anyhow. Reported by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 4 01:24:21 2017 (r313183) +++ head/Makefile.inc1 Sat Feb 4 02:15:49 2017 (r313184) @@ -247,8 +247,6 @@ _REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIR .for _DIR in ${LOCAL_LIB_DIRS} .if empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} -.else -.warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121. .endif .endfor From owner-svn-src-head@freebsd.org Sat Feb 4 04:12:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B196CD0B22; Sat, 4 Feb 2017 04:12:48 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::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 EDD2C1486; Sat, 4 Feb 2017 04:12:47 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id h53so8314146qth.3; Fri, 03 Feb 2017 20:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=bCbWnuAKfVf+lM7mvTpa5afRC47dyNjKFfA40qMLk3Y=; b=A8KQ18ySSa2oLfGkN7thNXnppErCAYWdSatcTS4kvnmxMwaYdSeWvKzCKgkBQgevCf ggEndMpGSZ5PDwz3FsGLjXVvwp/ff/0XckmE3z9dOqaaBvPfPG5XbRponSbEUJ2xn0R6 PDdBu+WPiKwHPXKXiF97dx400d7NUJ2MLn974ENL4ceCXiKmLxd6HZZ56uEqjbJ0RcV8 Qw7Vh9Mn45rs8DxVYjCcfZLucWZITZByiNojpiTfAHtSkeXWYEgaS6qSBMR/oPd8JlFT kManySAp6a+63wzlOLVajQpjzI5p2WZdPCKiZKwX5UEG7v7u5dwPfRVtys8i/PLDWHK0 O8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=bCbWnuAKfVf+lM7mvTpa5afRC47dyNjKFfA40qMLk3Y=; b=F/SlbXQFgJAosKoP9erzxMTQTJimtlglg4PfmESk7eOXdW1MJ+jOviSCnNqgM7pQ7H /jTAm9Z5t+zGkVTgeGytncCVZ8XHARqRdHKLzgRSxWE1BIvUEkYtUTWtxBjDUwkZfIOa xURvzwsGeLxwJmq6luf8mKYErfKLU3O2VdAa1xiqmYiiPaxgAQI0cWDb9mANbq6yBnGC 4HWPajjT1h9F/0xGtgm3GRI9L317UB84+K64XHz1/F0r+Za5UgPM62YqDisVAbvLpst0 rJheoyhraPFPxFDPqPRxOBag5Drw34E4j+K8ibFPyU3mjFopypaacSSs/h3crtlJ48Iz yEEQ== X-Gm-Message-State: AMke39mO6oxRZuxdDO57DiSN5ejRd+Fz8pQljW1+YtOUWE+t12+mgnPFEhzpH569DvtwZQ== X-Received: by 10.200.43.115 with SMTP id 48mr372168qtv.157.1486181566715; Fri, 03 Feb 2017 20:12:46 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id d52sm26422460qtc.2.2017.02.03.20.12.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2017 20:12:43 -0800 (PST) Date: Fri, 3 Feb 2017 23:12:38 -0500 From: Alexander Kabaev To: "Jason A. Harmening" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include Message-ID: <20170203231238.0675c289@kan> In-Reply-To: <201702010332.v113WnYf041362@repo.freebsd.org> References: <201702010332.v113WnYf041362@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/qc8uWeVfq6fCjBto+huGfjq"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 04:12:48 -0000 --Sig_/qc8uWeVfq6fCjBto+huGfjq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) "Jason A. Harmening" wrote: > Author: jah > Date: Wed Feb 1 03:32:49 2017 > New Revision: 313037 > URL: https://svnweb.freebsd.org/changeset/base/313037 >=20 > Log: > Implement get_pcpu() for the remaining architectures and use it to > replace pcpu_find(curcpu) in MI code. >=20 > Modified: > head/sys/amd64/include/pcpu.h > head/sys/kern/kern_rmlock.c > head/sys/mips/include/pcpu.h > head/sys/net/netisr.c > head/sys/powerpc/include/cpufunc.h > head/sys/powerpc/include/pcpu.h > head/sys/sparc64/include/pcpu.h >=20 Hi, this change was not reviewed nor testing was thought for all architectures it touches. The change happens to break MIPS quite thoroughly, since MIPS is using different pointers when accessing PCPU area locally and when doing iterations using cpu_to_cpuid array. I therefore officially am requesting this change to be reverted until reasonable solution is found to unbreak architectures that use wired TLBs to access local per-CPU data. --=20 Alexander Kabaev --Sig_/qc8uWeVfq6fCjBto+huGfjq Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAliVVLZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln5C5BAAi+BeKHGRfGjrUvBD1Bkx6bRcIoFJMgrZ1bLrRtH+ibGeMeGnwnLwZ6Th lmkWFj1hDJ0UEem6KXtyM+8LQm0BKkJr+5Vc6Fdt9QDIAmagsct6jpQFgmh4Q+/5 Gh0hBWMlHUJW4MsMW6bT8v8qw3jmDxf7UE6lrivrW/ul7zn4x8WCIW9NXB3DG70G Cf/JVHM7lcYj9S+7kxdU4v5Ct+xkOT4AUWiumVUKbO+DPdh973QoMgr1fsVGU7Nv O/ykcvJwdscGwp8eDgIWuwsFEEl1gZzBNQGZyRIBt9qt06AJmpvQ9rq0/bMA2I1L HulsIWq9QU5+ghTBuz8xcwL9Jc7NcykFWJhnBopxR+2Yr6rTjsNPv4WqzyigwakO 6+qYvCWCC+lTyZV9BkczUu9uXFHIgMxxfRKogNxRQ1ukUH/pPbJSY15f82MAmCQi MxvjnTwF8j6QSjsmwM1tfZOTEuGmVBXTTZCI2H5EFow/9FwZhSXNxa0JgqfuyXCq VClSqSS6tEdnCZS+kHVYgmzj1886iDzYJ4v+qSb0/18l677xSdVnpriFLKfLiKMH ObEUzRQlLcELOeRSjFIoS9h/Mi/1ylrlWtela95QDeXxfOiLHNCs5WWuJysWj77H oNUjkrDqoNfmpRReqKstEi3ojbsr9h7PlNwp1SR9cwLa0f8ZlLo= =4S6O -----END PGP SIGNATURE----- --Sig_/qc8uWeVfq6fCjBto+huGfjq-- From owner-svn-src-head@freebsd.org Sat Feb 4 05:09:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6568CD0087; Sat, 4 Feb 2017 05:09:48 +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 7387D1563; Sat, 4 Feb 2017 05:09:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1459lex081997; Sat, 4 Feb 2017 05:09:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1459llj081996; Sat, 4 Feb 2017 05:09:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201702040509.v1459llj081996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 4 Feb 2017 05:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313185 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:09:48 -0000 Author: ae Date: Sat Feb 4 05:09:47 2017 New Revision: 313185 URL: https://svnweb.freebsd.org/changeset/base/313185 Log: Check that primary GPT header is valid before wiping partitioning. This allows safely destroy corrupted GPT when primary header was rewritten by some data, that do not want to destroy. MFC after: 1 week Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sat Feb 4 02:15:49 2017 (r313184) +++ head/sys/geom/part/g_part_gpt.c Sat Feb 4 05:09:47 2017 (r313185) @@ -687,10 +687,11 @@ g_part_gpt_destroy(struct g_part_table * table->hdr = NULL; /* - * Wipe the first 2 sectors to clear the partitioning. Wipe the last - * sector only if it has valid secondary header. + * Wipe the first 2 sectors and last one to clear the partitioning. + * Wipe sectors only if they have valid metadata. */ - basetable->gpt_smhead |= 3; + if (table->state[GPT_ELT_PRIHDR] == GPT_STATE_OK) + basetable->gpt_smhead |= 3; if (table->state[GPT_ELT_SECHDR] == GPT_STATE_OK && table->lba[GPT_ELT_SECHDR] == pp->mediasize / pp->sectorsize - 1) basetable->gpt_smtail |= 1; From owner-svn-src-head@freebsd.org Sat Feb 4 05:23:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CA4BCD0598; Sat, 4 Feb 2017 05:23:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC87D1EFE; Sat, 4 Feb 2017 05:23:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v145NA7A090102; Sat, 4 Feb 2017 05:23:10 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v145NAHd090101; Sat, 4 Feb 2017 05:23:10 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201702040523.v145NAHd090101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 4 Feb 2017 05:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313186 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:23:13 -0000 Author: alc Date: Sat Feb 4 05:23:10 2017 New Revision: 313186 URL: https://svnweb.freebsd.org/changeset/base/313186 Log: Over the years, the code and comments in vm_page_startup() have diverged in one respect. When determining how many page structures to allocate, contrary to what the comments say, the code does not account for the overhead of a page structure per page of physical memory. This revision changes the code to match the comments. Reviewed by: kib, markj MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D9081 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Feb 4 05:09:47 2017 (r313185) +++ head/sys/vm/vm_page.c Sat Feb 4 05:23:10 2017 (r313186) @@ -421,17 +421,16 @@ vm_page_domain_init(struct vm_domain *vm /* * vm_page_startup: * - * Initializes the resident memory module. - * - * Allocates memory for the page cells, and - * for the object/offset-to-page hash table headers. - * Each page cell is initialized and placed on the free list. + * Initializes the resident memory module. Allocates physical memory for + * bootstrapping UMA and some data structures that are used to manage + * physical pages. Initializes these structures, and populates the free + * page queues. */ vm_offset_t vm_page_startup(vm_offset_t vaddr) { vm_offset_t mapped; - vm_paddr_t page_range; + vm_paddr_t high_avail, low_avail, page_range, size; vm_paddr_t new_end; int i; vm_paddr_t pa; @@ -439,7 +438,6 @@ vm_page_startup(vm_offset_t vaddr) char *list, *listend; vm_paddr_t end; vm_paddr_t biggestsize; - vm_paddr_t low_water, high_water; int biggestone; int pages_per_zone; @@ -451,27 +449,12 @@ vm_page_startup(vm_offset_t vaddr) phys_avail[i] = round_page(phys_avail[i]); phys_avail[i + 1] = trunc_page(phys_avail[i + 1]); } - - low_water = phys_avail[0]; - high_water = phys_avail[1]; - - for (i = 0; i < vm_phys_nsegs; i++) { - if (vm_phys_segs[i].start < low_water) - low_water = vm_phys_segs[i].start; - if (vm_phys_segs[i].end > high_water) - high_water = vm_phys_segs[i].end; - } for (i = 0; phys_avail[i + 1]; i += 2) { - vm_paddr_t size = phys_avail[i + 1] - phys_avail[i]; - + size = phys_avail[i + 1] - phys_avail[i]; if (size > biggestsize) { biggestone = i; biggestsize = size; } - if (phys_avail[i] < low_water) - low_water = phys_avail[i]; - if (phys_avail[i + 1] > high_water) - high_water = phys_avail[i + 1]; } end = phys_avail[biggestone+1]; @@ -486,7 +469,7 @@ vm_page_startup(vm_offset_t vaddr) vm_page_domain_init(&vm_dom[i]); /* - * Almost all of the pages needed for boot strapping UMA are used + * Almost all of the pages needed for bootstrapping UMA are used * for zone structures, so if the number of CPUs results in those * structures taking more than one page each, we set aside more pages * in proportion to the zone structure size. @@ -537,6 +520,16 @@ vm_page_startup(vm_offset_t vaddr) new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE); bzero((void *)vm_page_dump, vm_page_dump_size); #endif +#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) + /* + * Include the UMA bootstrap pages and vm_page_dump in a crash dump. + * When pmap_map() uses the direct map, they are not automatically + * included. + */ + for (pa = new_end; pa < end; pa += PAGE_SIZE) + dump_add_page(pa); +#endif + phys_avail[biggestone + 1] = new_end; #ifdef __amd64__ /* * Request that the physical pages underlying the message buffer be @@ -552,20 +545,48 @@ vm_page_startup(vm_offset_t vaddr) #endif /* * Compute the number of pages of memory that will be available for - * use (taking into account the overhead of a page structure per - * page). + * use, taking into account the overhead of a page structure per page. + * In other words, solve + * "available physical memory" - round_page(page_range * + * sizeof(struct vm_page)) = page_range * PAGE_SIZE + * for page_range. */ - first_page = low_water / PAGE_SIZE; -#ifdef VM_PHYSSEG_SPARSE - page_range = 0; + low_avail = phys_avail[0]; + high_avail = phys_avail[1]; for (i = 0; i < vm_phys_nsegs; i++) { - page_range += atop(vm_phys_segs[i].end - - vm_phys_segs[i].start); + if (vm_phys_segs[i].start < low_avail) + low_avail = vm_phys_segs[i].start; + if (vm_phys_segs[i].end > high_avail) + high_avail = vm_phys_segs[i].end; + } + /* Skip the first chunk. It is already accounted for. */ + for (i = 2; phys_avail[i + 1] != 0; i += 2) { + if (phys_avail[i] < low_avail) + low_avail = phys_avail[i]; + if (phys_avail[i + 1] > high_avail) + high_avail = phys_avail[i + 1]; } + first_page = low_avail / PAGE_SIZE; +#ifdef VM_PHYSSEG_SPARSE + size = 0; + for (i = 0; i < vm_phys_nsegs; i++) + size += vm_phys_segs[i].end - vm_phys_segs[i].start; for (i = 0; phys_avail[i + 1] != 0; i += 2) - page_range += atop(phys_avail[i + 1] - phys_avail[i]); + size += phys_avail[i + 1] - phys_avail[i]; + page_range = size / (PAGE_SIZE + sizeof(struct vm_page)); #elif defined(VM_PHYSSEG_DENSE) - page_range = high_water / PAGE_SIZE - first_page; + /* + * In the VM_PHYSSEG_DENSE case, the number of pages can account for + * the overhead of a page structure per page only if vm_page_array is + * allocated from the last physical memory chunk. Otherwise, we must + * allocate page structures representing the physical memory + * underlying vm_page_array, even though they will not be used. + */ + if (new_end == high_avail) + page_range = (high_avail - low_avail) / (PAGE_SIZE + + sizeof(struct vm_page)); + else + page_range = high_avail / PAGE_SIZE - first_page; #else #error "Either VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE must be defined." #endif @@ -573,12 +594,13 @@ vm_page_startup(vm_offset_t vaddr) /* * Reserve an unmapped guard page to trap access to vm_page_array[-1]. + * However, because this page is allocated from KVM, out-of-bounds + * accesses using the direct map will not be trapped. */ vaddr += PAGE_SIZE; /* - * Initialize the mem entry structures now, and put them in the free - * queue. + * Allocate physical memory for the page structures, and map it. */ new_end = trunc_page(end - page_range * sizeof(struct vm_page)); mapped = pmap_map(&vaddr, new_end, end, @@ -586,19 +608,18 @@ vm_page_startup(vm_offset_t vaddr) vm_page_array = (vm_page_t) mapped; #if VM_NRESERVLEVEL > 0 /* - * Allocate memory for the reservation management system's data - * structures. + * Allocate physical memory for the reservation management system's + * data structures, and map it. */ - new_end = vm_reserv_startup(&vaddr, new_end, high_water); + if (high_avail == end) + high_avail = new_end; + new_end = vm_reserv_startup(&vaddr, new_end, high_avail); #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) /* - * pmap_map on arm64, amd64, and mips can come out of the direct-map, - * not kvm like i386, so the pages must be tracked for a crashdump to - * include this data. This includes the vm_page_array and the early - * UMA bootstrap pages. + * Include vm_page_array and vm_reserv_array in a crash dump. */ - for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) + for (pa = new_end; pa < end; pa += PAGE_SIZE) dump_add_page(pa); #endif phys_avail[biggestone + 1] = new_end; From owner-svn-src-head@freebsd.org Sat Feb 4 05:29:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D38CD071B; Sat, 4 Feb 2017 05:29:34 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-ot0-x244.google.com (mail-ot0-x244.google.com [IPv6:2607:f8b0:4003:c0f::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 6A7181F8; Sat, 4 Feb 2017 05:29:34 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-ot0-x244.google.com with SMTP id 73so4565164otj.1; Fri, 03 Feb 2017 21:29:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gk010vl6EJwcICvv1ayMUmErJYVyyoHdo5+VvUMsgkA=; b=NYuTg9tmm1DA6H1XExg5S7tvUAwYGzkSS9fNq4j0sW4QRBkYW3mta1A8z59n0X8NHt 2fZNlFhr0VkGDSFVQqCR1Jt+hJnZA0mFMwLP16QGnxbC0hrJvPCi3rElNHhnX6uH3ari Fjkal9s7JpP4LuSaFxyaft9pldgLLO4UseoVPebkIFpBtGV7569+kACxxcyRQrTZDaVI v6Upv5SM5cCRA0lY8UqgAVUwnnbDGgB8d/mmW7k2hatOqKsahJOj8uZ1N30lEzq0IAh+ VA9UZDGdyag1GtITStCEtZ0Ky7Da5oy0RJk0iYCQpglWvyMF2dR+mMJsJg+oAXUBrDsC OKXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gk010vl6EJwcICvv1ayMUmErJYVyyoHdo5+VvUMsgkA=; b=QOGO7RTr1sGZ7oLy57MenjaK/cvx/0XyH/PliTxqBBg7kC9jh6/sJB7V7gy0RXR8Gw URpBhE5OPTvZ9OfIelmWZoUl6d1z4fdGsGmvILH+Hfen/UoYwmtJmd6/b91tnYXxnnDT d2TBdcTK1CcId01lyvA9LvkTU5BcToc5+YaqrULr5gC/E9WPvEs9I5OKjXHTCi3+Nl7+ GAqUeKNcyDOwZ6qky/EsjuVaX/Khr4x7w7pZKA3WnwTysnfuFKQAA0ia7Hg0jc785vIq VBODaJuNAK3wO4SMtlJkPrYXsx7GCORwPiiToO77Id1jXOJ8ekf9NmpQaerkH+3BhyCc Pv3A== X-Gm-Message-State: AIkVDXIEdVu3ErZRz8bM8UHW2uL068uPzi732c1GDgz2AqX3JmpkRrNpHYPUMyy3TYPyZqznVf8Jh//iQOYsvQ== X-Received: by 10.157.7.53 with SMTP id 50mr239549ote.91.1486186173526; Fri, 03 Feb 2017 21:29:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.51.7 with HTTP; Fri, 3 Feb 2017 21:29:33 -0800 (PST) In-Reply-To: <20170203231238.0675c289@kan> References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> From: Jason Harmening Date: Fri, 3 Feb 2017 21:29:33 -0800 Message-ID: Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Alexander Kabaev Cc: "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:29:34 -0000 Hi, I'm a bit confused as to how this change breaks MIPS. The new function, get_pcpu() is intended to be used only to access the per-cpu data pointer locally. It returns pcpup, which is the per-cpu pointer wired into the local TLB to translate to the local CPU's physical data region, correct? This is the same value used by the per-CPU accessors such as PCPU_ADD and PCPU_GET. The MI portions of this change only use get_pcpu() to access the local CPU's data, e.g. under a critical section in the rmlock. It is not intended to be used for iterating all CPUs. If I've missed something and MIPS is truly broken by this, then I'll gladly revert, but (maybe because it's late) I'm not seeing where this goes wrong on MIPS. Thanks, Jason On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev wrote: > On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) > "Jason A. Harmening" wrote: > > > Author: jah > > Date: Wed Feb 1 03:32:49 2017 > > New Revision: 313037 > > URL: https://svnweb.freebsd.org/changeset/base/313037 > > > > Log: > > Implement get_pcpu() for the remaining architectures and use it to > > replace pcpu_find(curcpu) in MI code. > > > > Modified: > > head/sys/amd64/include/pcpu.h > > head/sys/kern/kern_rmlock.c > > head/sys/mips/include/pcpu.h > > head/sys/net/netisr.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/pcpu.h > > head/sys/sparc64/include/pcpu.h > > > > Hi, > > this change was not reviewed nor testing was thought for all > architectures it touches. The change happens to break MIPS quite > thoroughly, since MIPS is using different pointers when accessing PCPU > area locally and when doing iterations using cpu_to_cpuid array. I > therefore officially am requesting this change to be reverted until > reasonable solution is found to unbreak architectures that use wired > TLBs to access local per-CPU data. > > -- > Alexander Kabaev > From owner-svn-src-head@freebsd.org Sat Feb 4 05:52:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 433C5CD0E69; Sat, 4 Feb 2017 05:52:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 130AC10A8; Sat, 4 Feb 2017 05:52:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v145qqa7002667; Sat, 4 Feb 2017 05:52:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v145qqaO002666; Sat, 4 Feb 2017 05:52:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702040552.v145qqaO002666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 05:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313189 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:52:53 -0000 Author: imp Date: Sat Feb 4 05:52:51 2017 New Revision: 313189 URL: https://svnweb.freebsd.org/changeset/base/313189 Log: Back off using CPUTYPE for the moment. There's still some issues with that. Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Sat Feb 4 05:52:50 2017 (r313188) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg Sat Feb 4 05:52:51 2017 (r313189) @@ -31,6 +31,5 @@ NANO_KERNEL=RPI2 NANO_DRIVE=mmcsd0 NANO_NAME=rpi2 NANO_BOOT_PKG=u-boot-rpi2 -NANO_CPUTYPE=cortex-a7 . common # Pull in common definitions, keep last From owner-svn-src-head@freebsd.org Sat Feb 4 05:52:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB251CD0E5D; Sat, 4 Feb 2017 05:52:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAF6810A6; Sat, 4 Feb 2017 05:52:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v145qoZH002622; Sat, 4 Feb 2017 05:52:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v145qouO002621; Sat, 4 Feb 2017 05:52:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702040552.v145qouO002621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 05:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313188 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:52:52 -0000 Author: imp Date: Sat Feb 4 05:52:50 2017 New Revision: 313188 URL: https://svnweb.freebsd.org/changeset/base/313188 Log: Put the arguments to aligned_alloc in the right order. Modified: head/sbin/nvmecontrol/firmware.c Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Sat Feb 4 05:52:14 2017 (r313187) +++ head/sbin/nvmecontrol/firmware.c Sat Feb 4 05:52:50 2017 (r313188) @@ -114,7 +114,7 @@ update_firmware(int fd, uint8_t *payload off = 0; resid = payload_size; - if ((chunk = aligned_alloc(NVME_MAX_XFER_SIZE, PAGE_SIZE)) == NULL) + if ((chunk = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE)) == NULL) errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE); while (resid > 0) { From owner-svn-src-head@freebsd.org Sat Feb 4 05:52:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC45CCD0E7E; Sat, 4 Feb 2017 05:52:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDE010B9; Sat, 4 Feb 2017 05:52:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v145qrT9002712; Sat, 4 Feb 2017 05:52:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v145qrAH002710; Sat, 4 Feb 2017 05:52:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702040552.v145qrAH002710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 05:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313190 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:52:54 -0000 Author: imp Date: Sat Feb 4 05:52:53 2017 New Revision: 313190 URL: https://svnweb.freebsd.org/changeset/base/313190 Log: Move the usage and command name lookup into functions. Modified: head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Feb 4 05:52:51 2017 (r313189) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Feb 4 05:52:53 2017 (r313190) @@ -45,13 +45,8 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" -typedef void (*nvme_fn_t)(int argc, char *argv[]); -static struct nvme_function { - const char *name; - nvme_fn_t fn; - const char *usage; -} funcs[] = { +static struct nvme_function funcs[] = { {"devlist", devlist, DEVLIST_USAGE}, {"identify", identify, IDENTIFY_USAGE}, {"perftest", perftest, PERFTEST_USAGE}, @@ -62,12 +57,10 @@ static struct nvme_function { {NULL, NULL, NULL}, }; -static void -usage(void) +void +gen_usage(struct nvme_function *f) { - struct nvme_function *f; - f = funcs; fprintf(stderr, "usage:\n"); while (f->name != NULL) { fprintf(stderr, "%s", f->usage); @@ -76,6 +69,21 @@ usage(void) exit(1); } +void +dispatch(int argc, char *argv[], struct nvme_function *tbl) +{ + struct nvme_function *f = tbl; + + while (f->name != NULL) { + if (strcmp(argv[1], f->name) == 0) + f->fn(argc-1, &argv[1]); + f++; + } + + fprintf(stderr, "Unknown command: %s\n", argv[1]); + gen_usage(tbl); +} + static void print_bytes(void *data, uint32_t length) { @@ -217,19 +225,11 @@ parse_ns_str(const char *ns_str, char *c int main(int argc, char *argv[]) { - struct nvme_function *f; if (argc < 2) - usage(); - - f = funcs; - while (f->name != NULL) { - if (strcmp(argv[1], f->name) == 0) - f->fn(argc-1, &argv[1]); - f++; - } + gen_usage(funcs); - usage(); + dispatch(argc, argv, funcs); return (0); } Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sat Feb 4 05:52:51 2017 (r313189) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Feb 4 05:52:53 2017 (r313190) @@ -31,6 +31,14 @@ #include +typedef void (*nvme_fn_t)(int argc, char *argv[]); + +struct nvme_function { + const char *name; + nvme_fn_t fn; + const char *usage; +}; + #define NVME_CTRLR_PREFIX "nvme" #define NVME_NS_PREFIX "ns" @@ -73,6 +81,8 @@ void read_namespace_data(int fd, int nsi void print_hex(void *data, uint32_t length); void read_logpage(int fd, uint8_t log_page, int nsid, void *payload, uint32_t payload_size); +void gen_usage(struct nvme_function *); +void dispatch(int argc, char *argv[], struct nvme_function *f); #endif From owner-svn-src-head@freebsd.org Sat Feb 4 05:53:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6610CD0ECD; Sat, 4 Feb 2017 05:53:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7340611AC; Sat, 4 Feb 2017 05:53:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v145r1ZU002781; Sat, 4 Feb 2017 05:53:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v145r1wB002775; Sat, 4 Feb 2017 05:53:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702040553.v145r1wB002775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 05:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313191 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:53:02 -0000 Author: imp Date: Sat Feb 4 05:53:00 2017 New Revision: 313191 URL: https://svnweb.freebsd.org/changeset/base/313191 Log: Implement 5 wdc-specific nvme control options for their HGST drives: wdc cap-diag Capture diagnostic data from drive wdc drive-log Capture drive history data from drive wdc get-crash-dump Retrieve firmware crash dump from drive Added: head/sbin/nvmecontrol/wdc.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Sat Feb 4 05:52:53 2017 (r313190) +++ head/sbin/nvmecontrol/Makefile Sat Feb 4 05:53:00 2017 (r313191) @@ -3,7 +3,7 @@ PACKAGE=runtime PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c nvme_util.c power.c + perftest.c reset.c nvme_util.c power.c wdc.c MAN= nvmecontrol.8 .PATH: ${.CURDIR}/../../sys/dev/nvme Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Sat Feb 4 05:52:53 2017 (r313190) +++ head/sbin/nvmecontrol/nvmecontrol.8 Sat Feb 4 05:53:00 2017 (r313191) @@ -75,6 +75,24 @@ .Op Fl l .Op Fl p power_state .Op fl w workload_hint +.Nm +.Ic wdc cap-diag +.Op Fl o path_template +.Aq device id +.Nm +.Ic wdc drive-log +.Op Fl o path_template +.Aq device id +.Nm +.Ic wdc get-crash-dump +.Op Fl o path_template +.Aq device id +.\" .Nm +.\" .Ic wdc purge +.\" .Aq device id +.\" .Nm +.\" .Ic wdc purge-monitor +.\" .Aq device id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Feb 4 05:52:53 2017 (r313190) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Feb 4 05:53:00 2017 (r313191) @@ -54,6 +54,7 @@ static struct nvme_function funcs[] = { {"logpage", logpage, LOGPAGE_USAGE}, {"firmware", firmware, FIRMWARE_USAGE}, {"power", power, POWER_USAGE}, + {"wdc", wdc, WDC_USAGE}, {NULL, NULL, NULL}, }; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sat Feb 4 05:52:53 2017 (r313190) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Feb 4 05:53:00 2017 (r313191) @@ -66,6 +66,9 @@ struct nvme_function { #define POWER_USAGE \ " nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" +#define WDC_USAGE \ +" nvmecontrol wdc (cap-diag|drive-log|get-crash-dump|purge|purge-montior)\n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); @@ -73,6 +76,7 @@ void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); void power(int argc, char *argv[]); +void wdc(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); Added: head/sbin/nvmecontrol/wdc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/wdc.c Sat Feb 4 05:53:00 2017 (r313191) @@ -0,0 +1,341 @@ +/*- + * Copyright (c) 2017 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +#define WDC_NVME_TOC_SIZE 8 + +#define WDC_NVME_CAP_DIAG_OPCODE 0xe6 +#define WDC_NVME_CAP_DIAG_CMD 0x0000 + +#define WDC_NVME_DIAG_OPCODE 0xc6 +#define WDC_NVME_DRIVE_LOG_SIZE_CMD 0x0120 +#define WDC_NVME_DRIVE_LOG_CMD 0x0020 +#define WDC_NVME_CRASH_DUMP_SIZE_CMD 0x0320 +#define WDC_NVME_CRASH_DUMP_CMD 0x0420 +#define WDC_NVME_PFAIL_DUMP_SIZE_CMD 0x0520 +#define WDC_NVME_PFAIL_DUMP_CMD 0x0620 + +#define WDC_NVME_CLEAR_DUMP_OPCODE 0xff +#define WDC_NVME_CLEAR_CRASH_DUMP_CMD 0x0503 +#define WDC_NVME_CLEAR_PFAIL_DUMP_CMD 0x0603 + +static void wdc_cap_diag(int argc, char *argv[]); +static void wdc_drive_log(int argc, char *argv[]); +static void wdc_get_crash_dump(int argc, char *argv[]); +static void wdc_purge(int argc, char *argv[]); +static void wdc_purge_monitor(int argc, char *argv[]); + +#define WDC_CAP_DIAG_USAGE "\tnvmecontrol wdc cap-diag [-o path-template]\n" +#define WDC_DRIVE_LOG_USAGE "\tnvmecontrol wdc drive-log [-o path-template]\n" +#define WDC_GET_CRASH_DUMP_USAGE "\tnvmecontrol wdc get-crash-dump [-o path-template]\n" +#define WDC_PURGE_USAGE "\tnvmecontrol wdc purge [-o path-template]\n" +#define WDC_PURGE_MONITOR_USAGE "\tnvmecontrol wdc purge-montor\n" + +static struct nvme_function wdc_funcs[] = { + {"cap-diag", wdc_cap_diag, WDC_CAP_DIAG_USAGE}, + {"drive-log", wdc_drive_log, WDC_DRIVE_LOG_USAGE}, + {"get-crash-dump", wdc_get_crash_dump, WDC_GET_CRASH_DUMP_USAGE}, + {"purge", wdc_purge, WDC_PURGE_USAGE}, + {"purge_monitor", wdc_purge_monitor, WDC_PURGE_MONITOR_USAGE}, + {NULL, NULL, NULL}, +}; + +static void +wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix) +{ + struct nvme_controller_data cdata; + char sn[NVME_SERIAL_NUMBER_LENGTH + 1]; + char *walker; + + len -= strlen(buf); + buf += strlen(buf); + read_controller_data(fd, &cdata); + memcpy(sn, cdata.sn, NVME_SERIAL_NUMBER_LENGTH); + walker = sn + NVME_SERIAL_NUMBER_LENGTH - 1; + while (walker > sn && *walker == ' ') + walker--; + *walker = '\0'; + snprintf(buf, len, "%s%s.bin", sn, suffix); +} + +static void +wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, + uint8_t *buffer, size_t buflen) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = opcode; + pt.cmd.cdw10 = len / sizeof(uint32_t); /* - 1 like all the others ??? */ + pt.cmd.cdw11 = off / sizeof(uint32_t); + pt.cmd.cdw12 = cmd; + pt.buf = buffer; + pt.len = buflen; + pt.is_read = 1; +// printf("opcode %#x cdw10(len) %#x cdw11(offset?) %#x cdw12(cmd/sub) %#x buflen %zd\n", +// (int)opcode, (int)cdw10, (int)cdw11, (int)cdw12, buflen); + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "wdc_get_data request failed"); + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "wdc_get_data request returned error"); +} + +static void +wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode, + uint32_t size_cmd, uint32_t cmd, int len_off) +{ + int fd2; + uint8_t *buf; + uint32_t len, resid, offset; + + wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); + + buf = aligned_alloc(PAGE_SIZE, WDC_NVME_TOC_SIZE); + if (buf == NULL) + errx(1, "Can't get buffer to get size"); + wdc_get_data(fd, opcode, WDC_NVME_TOC_SIZE, + 0, size_cmd, buf, WDC_NVME_TOC_SIZE); + len = be32dec(buf + len_off); + + if (len == 0) + errx(1, "No data for %s", suffix); + + printf("Dumping %d bytes to %s\n", len, tmpl); + /* XXX overwrite protection? */ + fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC); + if (fd2 < 0) + err(1, "open %s", tmpl); + offset = 0; + buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE); + if (buf == NULL) + errx(1, "Can't get buffer to read dump"); + while (len > 0) { + resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len; + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid); + if (write(fd2, buf, resid) != resid) + err(1, "write"); + offset += resid; + len -= resid; + } + free(buf); + close(fd2); +} + +static void +wdc_do_clear_dump(int fd, uint32_t opcode, uint32_t cmd) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = opcode; + pt.cmd.cdw12 = cmd; + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "wdc_do_clear_dump request failed"); + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "wdc_do_clear_dump request returned error"); +} + +static void +wdc_cap_diag_usage() +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, WDC_CAP_DIAG_USAGE); + exit(1); +} + +static void +wdc_cap_diag(int argc, char *argv[]) +{ + char path_tmpl[MAXPATHLEN]; + int ch, fd; + + path_tmpl[0] = '\0'; + while ((ch = getopt(argc, argv, "o:")) != -1) { + switch ((char)ch) { + case 'o': + strlcpy(path_tmpl, optarg, MAXPATHLEN); + break; + default: + wdc_cap_diag_usage(); + } + } + /* Check that a controller was specified. */ + if (optind >= argc) + wdc_cap_diag_usage(); + open_dev(argv[optind], &fd, 1, 1); + + wdc_do_dump(fd, path_tmpl, "cap_diag", WDC_NVME_CAP_DIAG_OPCODE, + WDC_NVME_CAP_DIAG_CMD, WDC_NVME_CAP_DIAG_CMD, 4); + + close(fd); + + exit(1); +} + +static void +wdc_drive_log_usage() +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, WDC_DRIVE_LOG_USAGE); + exit(1); +} + +static void +wdc_drive_log(int argc, char *argv[]) +{ + char path_tmpl[MAXPATHLEN]; + int ch, fd; + + path_tmpl[0] = '\0'; + while ((ch = getopt(argc, argv, "o:")) != -1) { + switch ((char)ch) { + case 'o': + strlcpy(path_tmpl, optarg, MAXPATHLEN); + break; + default: + wdc_drive_log_usage(); + } + } + /* Check that a controller was specified. */ + if (optind >= argc) + wdc_drive_log_usage(); + open_dev(argv[optind], &fd, 1, 1); + + wdc_do_dump(fd, path_tmpl, "drive_log", WDC_NVME_DIAG_OPCODE, + WDC_NVME_DRIVE_LOG_SIZE_CMD, WDC_NVME_DRIVE_LOG_CMD, 0); + + close(fd); + + exit(1); +} + +static void +wdc_get_crash_dump_usage() +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, WDC_CAP_DIAG_USAGE); + exit(1); +} + +static void +wdc_get_crash_dump(int argc, char *argv[]) +{ + char path_tmpl[MAXPATHLEN]; + int ch, fd; + + while ((ch = getopt(argc, argv, "o:")) != -1) { + switch ((char)ch) { + case 'o': + strlcpy(path_tmpl, optarg, MAXPATHLEN); + break; + default: + wdc_get_crash_dump_usage(); + } + } + /* Check that a controller was specified. */ + if (optind >= argc) + wdc_get_crash_dump_usage(); + open_dev(argv[optind], &fd, 1, 1); + + wdc_do_dump(fd, path_tmpl, "crash_dump", WDC_NVME_DIAG_OPCODE, + WDC_NVME_CRASH_DUMP_SIZE_CMD, WDC_NVME_CRASH_DUMP_CMD, 0); + wdc_do_clear_dump(fd, WDC_NVME_CLEAR_DUMP_OPCODE, + WDC_NVME_CLEAR_CRASH_DUMP_CMD); +// wdc_led_beacon_disable(fd); + wdc_do_dump(fd, path_tmpl, "pfail_dump", WDC_NVME_DIAG_OPCODE, + WDC_NVME_PFAIL_DUMP_SIZE_CMD, WDC_NVME_PFAIL_DUMP_CMD, 0); + wdc_do_clear_dump(fd, WDC_NVME_CLEAR_DUMP_OPCODE, + WDC_NVME_CLEAR_PFAIL_DUMP_CMD); + + close(fd); + + exit(1); +} + +static void +wdc_purge(int argc, char *argv[]) +{ + char path_tmpl[MAXPATHLEN]; + int ch; + + while ((ch = getopt(argc, argv, "o:")) != -1) { + switch ((char)ch) { + case 'o': + strlcpy(path_tmpl, optarg, MAXPATHLEN); + break; + default: + wdc_cap_diag_usage(); + } + } + + printf("purge has not been implemented.\n"); + exit(1); +} + +static void +wdc_purge_monitor(int argc, char *argv[]) +{ + char path_tmpl[MAXPATHLEN]; + int ch; + + while ((ch = getopt(argc, argv, "o:")) != -1) { + switch ((char)ch) { + case 'o': + strlcpy(path_tmpl, optarg, MAXPATHLEN); + break; + default: + wdc_cap_diag_usage(); + } + } + + printf("purge has not been implemented.\n"); + exit(1); +} + +void +wdc(int argc, char *argv[]) +{ + + dispatch(argc, argv, wdc_funcs); +} From owner-svn-src-head@freebsd.org Sat Feb 4 05:54:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6ABBCD0FAC; Sat, 4 Feb 2017 05:54:17 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C511654; Sat, 4 Feb 2017 05:54:17 +0000 (UTC) (envelope-from lidl@pix.net) Received: from torb.pix.net (torb.pix.net [IPv6:2001:470:e254:10:1042:6a31:1deb:9f8a]) (authenticated bits=0) by hydra.pix.net (8.16.0.19/8.15.2) with ESMTPA id v145sF9k051864; Sat, 4 Feb 2017 00:54:16 -0500 (EST) (envelope-from lidl@pix.net) Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Jason Harmening , Alexander Kabaev References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> Cc: "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste From: Kurt Lidl Message-ID: <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> Date: Sat, 4 Feb 2017 00:54:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 05:54:18 -0000 Having just spent a couple of hours bisecting what broke the kernel on my mips64 machine, I can definitively state it was this commit. With this commit in place, the kernel hangs early in the autoconfiguration: gcc version 4.2.1 20070831 patched [FreeBSD] Preloaded elf kernel "kernel" at 0xffffffff80aa96a0. real memory = 523239424 (510976K bytes) Physical memory chunk(s): 0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages) 0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages) 0x410000000 - 0x41f196fff, 253325312 bytes (61847 pages) avail memory = 504360960 (480MB) Create COP2 context zone AP #1 started! FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs ---- hangs here ---- -Kurt On 2/4/17 12:29 AM, Jason Harmening wrote: > Hi, > > I'm a bit confused as to how this change breaks MIPS. The new function, > get_pcpu() is intended to be used only to access the per-cpu data > pointer locally. It returns pcpup, which is the per-cpu pointer wired > into the local TLB to translate to the local CPU's physical data region, > correct? > > This is the same value used by the per-CPU accessors such as PCPU_ADD > and PCPU_GET. The MI portions of this change only use get_pcpu() to > access the local CPU's data, e.g. under a critical section in the > rmlock. It is not intended to be used for iterating all CPUs. > > If I've missed something and MIPS is truly broken by this, then I'll > gladly revert, but (maybe because it's late) I'm not seeing where this > goes wrong on MIPS. > > Thanks, > Jason > > On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev > wrote: > > On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) > "Jason A. Harmening" wrote: > > > Author: jah > > Date: Wed Feb 1 03:32:49 2017 > > New Revision: 313037 > > URL: https://svnweb.freebsd.org/changeset/base/313037 > > > > > Log: > > Implement get_pcpu() for the remaining architectures and use it to > > replace pcpu_find(curcpu) in MI code. > > > > Modified: > > head/sys/amd64/include/pcpu.h > > head/sys/kern/kern_rmlock.c > > head/sys/mips/include/pcpu.h > > head/sys/net/netisr.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/pcpu.h > > head/sys/sparc64/include/pcpu.h > > > > Hi, > > this change was not reviewed nor testing was thought for all > architectures it touches. The change happens to break MIPS quite > thoroughly, since MIPS is using different pointers when accessing PCPU > area locally and when doing iterations using cpu_to_cpuid array. I > therefore officially am requesting this change to be reverted until > reasonable solution is found to unbreak architectures that use wired > TLBs to access local per-CPU data. > > -- > Alexander Kabaev > > From owner-svn-src-head@freebsd.org Sat Feb 4 06:12:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE669CD046B; Sat, 4 Feb 2017 06:12:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9655C67; Sat, 4 Feb 2017 06:12:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v146Cm2E010779; Sat, 4 Feb 2017 06:12:48 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v146CmwT010775; Sat, 4 Feb 2017 06:12:48 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201702040612.v146CmwT010775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 4 Feb 2017 06:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313192 - in head/sbin: hastctl hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 06:12:49 -0000 Author: allanjude Date: Sat Feb 4 06:12:48 2017 New Revision: 313192 URL: https://svnweb.freebsd.org/changeset/base/313192 Log: Switch hastctl and hastd to libmd instead of openssl for sha256 Reviewed by: bapt, brnrd, pjd Approved by: pjd (maintainer) Sponsored by: ScaleEngine Inc., FOSDEM DevSummit Differential Revision: https://reviews.freebsd.org/D9423 Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/hast_checksum.c head/sbin/hastd/hast_proto.c Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Sat Feb 4 05:53:00 2017 (r313191) +++ head/sbin/hastctl/Makefile Sat Feb 4 06:12:48 2017 (r313192) @@ -33,11 +33,7 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -LIBADD= util -.if ${MK_OPENSSL} != "no" -LIBADD+= crypto -CFLAGS+=-DHAVE_CRYPTO -.endif +LIBADD= md util YFLAGS+=-v Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Sat Feb 4 05:53:00 2017 (r313191) +++ head/sbin/hastd/Makefile Sat Feb 4 06:12:48 2017 (r313192) @@ -31,11 +31,7 @@ CFLAGS+=-DINET CFLAGS+=-DINET6 .endif -LIBADD= geom pthread util -.if ${MK_OPENSSL} != "no" -LIBADD+= crypto -CFLAGS+=-DHAVE_CRYPTO -.endif +LIBADD= geom md pthread util YFLAGS+=-v Modified: head/sbin/hastd/hast_checksum.c ============================================================================== --- head/sbin/hastd/hast_checksum.c Sat Feb 4 05:53:00 2017 (r313191) +++ head/sbin/hastd/hast_checksum.c Sat Feb 4 06:12:48 2017 (r313192) @@ -31,22 +31,15 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef HAVE_CRYPTO -#include -#endif - #include #include #include +#include #include #include "hast_checksum.h" -#ifdef HAVE_CRYPTO #define MAX_HASH_SIZE SHA256_DIGEST_LENGTH -#else -#define MAX_HASH_SIZE 4 -#endif static void hast_crc32_checksum(const unsigned char *data, size_t size, @@ -60,7 +53,6 @@ hast_crc32_checksum(const unsigned char *hsizep = sizeof(crc); } -#ifdef HAVE_CRYPTO static void hast_sha256_checksum(const unsigned char *data, size_t size, unsigned char *hash, size_t *hsizep) @@ -72,7 +64,6 @@ hast_sha256_checksum(const unsigned char SHA256_Final(hash, &ctx); *hsizep = SHA256_DIGEST_LENGTH; } -#endif /* HAVE_CRYPTO */ const char * checksum_name(int num) @@ -102,11 +93,9 @@ checksum_send(const struct hast_resource case HAST_CHECKSUM_CRC32: hast_crc32_checksum(*datap, *sizep, hash, &hsize); break; -#ifdef HAVE_CRYPTO case HAST_CHECKSUM_SHA256: hast_sha256_checksum(*datap, *sizep, hash, &hsize); break; -#endif default: PJDLOG_ABORT("Invalid checksum: %d.", res->hr_checksum); } @@ -138,10 +127,8 @@ checksum_recv(const struct hast_resource } if (strcmp(algo, "crc32") == 0) hast_crc32_checksum(*datap, *sizep, chash, &chsize); -#ifdef HAVE_CRYPTO else if (strcmp(algo, "sha256") == 0) hast_sha256_checksum(*datap, *sizep, chash, &chsize); -#endif else { pjdlog_error("Unknown checksum algorithm '%s'.", algo); return (-1); /* Unknown checksum algorithm. */ Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Sat Feb 4 05:53:00 2017 (r313191) +++ head/sbin/hastd/hast_proto.c Sat Feb 4 06:12:48 2017 (r313192) @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef HAVE_CRYPTO #include "hast_checksum.h" -#endif #include "hast_compression.h" #include "hast_proto.h" @@ -68,9 +66,7 @@ struct hast_pipe_stage { static struct hast_pipe_stage pipeline[] = { { "compression", compression_send, compression_recv }, -#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } -#endif }; /* From owner-svn-src-head@freebsd.org Sat Feb 4 06:24:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D500ECD06E0; Sat, 4 Feb 2017 06:24:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD07B7BA; Sat, 4 Feb 2017 06:24:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v146OoAY015122; Sat, 4 Feb 2017 06:24:50 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v146Oo5s015115; Sat, 4 Feb 2017 06:24:50 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201702040624.v146Oo5s015115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 4 Feb 2017 06:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313193 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 06:24:51 -0000 Author: jah Date: Sat Feb 4 06:24:49 2017 New Revision: 313193 URL: https://svnweb.freebsd.org/changeset/base/313193 Log: Revert r313037 The switch to get_pcpu() in MI code seems to cause hangs on MIPS. Back out until we can get a better idea of what's happening there. Reported by: kan, lidl Modified: head/sys/amd64/include/pcpu.h head/sys/kern/kern_rmlock.c head/sys/mips/include/pcpu.h head/sys/net/netisr.c head/sys/powerpc/include/cpufunc.h head/sys/powerpc/include/pcpu.h head/sys/sparc64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/amd64/include/pcpu.h Sat Feb 4 06:24:49 2017 (r313193) @@ -78,7 +78,6 @@ extern struct pcpu *pcpup; -#define get_pcpu() (pcpup) #define PCPU_GET(member) (pcpup->pc_ ## member) #define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) #define PCPU_INC(member) PCPU_ADD(member, 1) @@ -204,15 +203,6 @@ extern struct pcpu *pcpup; } \ } -#define get_pcpu() __extension__ ({ \ - struct pcpu *__pc; \ - \ - __asm __volatile("movq %%gs:%1,%0" \ - : "=r" (__pc) \ - : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \ - __pc; \ -}) - #define PCPU_GET(member) __PCPU_GET(pc_ ## member) #define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val) #define PCPU_INC(member) __PCPU_INC(pc_ ## member) Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/kern/kern_rmlock.c Sat Feb 4 06:24:49 2017 (r313193) @@ -156,7 +156,7 @@ unlock_rm(struct lock_object *lock) */ critical_enter(); td = curthread; - pc = get_pcpu(); + pc = pcpu_find(curcpu); for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { tracker = (struct rm_priotracker *)queue; @@ -258,7 +258,7 @@ rm_cleanIPI(void *arg) struct rmlock *rm = arg; struct rm_priotracker *tracker; struct rm_queue *queue; - pc = get_pcpu(); + pc = pcpu_find(curcpu); for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { @@ -355,7 +355,7 @@ _rm_rlock_hard(struct rmlock *rm, struct struct pcpu *pc; critical_enter(); - pc = get_pcpu(); + pc = pcpu_find(curcpu); /* Check if we just need to do a proper critical_exit. */ if (!CPU_ISSET(pc->pc_cpuid, &rm->rm_writecpus)) { @@ -416,7 +416,7 @@ _rm_rlock_hard(struct rmlock *rm, struct } critical_enter(); - pc = get_pcpu(); + pc = pcpu_find(curcpu); CPU_CLR(pc->pc_cpuid, &rm->rm_writecpus); rm_tracker_add(pc, tracker); sched_pin(); @@ -641,7 +641,7 @@ _rm_rlock_debug(struct rmlock *rm, struc #ifdef INVARIANTS if (!(rm->lock_object.lo_flags & LO_RECURSABLE) && !trylock) { critical_enter(); - KASSERT(rm_trackers_present(get_pcpu(), rm, + KASSERT(rm_trackers_present(pcpu_find(curcpu), rm, curthread) == 0, ("rm_rlock: recursed on non-recursive rmlock %s @ %s:%d\n", rm->lock_object.lo_name, file, line)); @@ -771,7 +771,7 @@ _rm_assert(const struct rmlock *rm, int } critical_enter(); - count = rm_trackers_present(get_pcpu(), rm, curthread); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); critical_exit(); if (count == 0) @@ -797,7 +797,7 @@ _rm_assert(const struct rmlock *rm, int rm->lock_object.lo_name, file, line); critical_enter(); - count = rm_trackers_present(get_pcpu(), rm, curthread); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); critical_exit(); if (count != 0) Modified: head/sys/mips/include/pcpu.h ============================================================================== --- head/sys/mips/include/pcpu.h Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/mips/include/pcpu.h Sat Feb 4 06:24:49 2017 (r313193) @@ -65,7 +65,6 @@ extern char pcpu_space[MAXCPU][PAGE_SIZE extern struct pcpu *pcpup; #define PCPUP pcpup -#define get_pcpu() (pcpup) #define PCPU_ADD(member, value) (PCPUP->pc_ ## member += (value)) #define PCPU_GET(member) (PCPUP->pc_ ## member) #define PCPU_INC(member) PCPU_ADD(member, 1) Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/net/netisr.c Sat Feb 4 06:24:49 2017 (r313193) @@ -1268,7 +1268,9 @@ netisr_start_swi(u_int cpuid, struct pcp static void netisr_init(void *arg) { +#ifdef EARLY_AP_STARTUP struct pcpu *pc; +#endif NETISR_LOCK_INIT(); if (netisr_maxthreads == 0 || netisr_maxthreads < -1 ) @@ -1306,8 +1308,7 @@ netisr_init(void *arg) netisr_start_swi(pc->pc_cpuid, pc); } #else - pc = get_pcpu(); - netisr_start_swi(pc->pc_cpuid, pc); + netisr_start_swi(curcpu, pcpu_find(curcpu)); #endif } SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL); Modified: head/sys/powerpc/include/cpufunc.h ============================================================================== --- head/sys/powerpc/include/cpufunc.h Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/powerpc/include/cpufunc.h Sat Feb 4 06:24:49 2017 (r313193) @@ -201,7 +201,7 @@ intr_restore(register_t msr) } static __inline struct pcpu * -get_pcpu(void) +powerpc_get_pcpup(void) { struct pcpu *ret; Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/powerpc/include/pcpu.h Sat Feb 4 06:24:49 2017 (r313193) @@ -142,7 +142,7 @@ struct pvo_entry; #ifdef _KERNEL -#define pcpup (get_pcpu()) +#define pcpup ((struct pcpu *) powerpc_get_pcpup()) static __inline __pure2 struct thread * __curthread(void) Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Sat Feb 4 06:12:48 2017 (r313192) +++ head/sys/sparc64/include/pcpu.h Sat Feb 4 06:24:49 2017 (r313193) @@ -74,7 +74,6 @@ struct pcpu; register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); -#define get_pcpu() (pcpup) #define PCPU_GET(member) (pcpup->pc_ ## member) static __inline __pure2 struct thread * From owner-svn-src-head@freebsd.org Sat Feb 4 06:27:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69228CD075F; Sat, 4 Feb 2017 06:27:32 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-ot0-x241.google.com (mail-ot0-x241.google.com [IPv6:2607:f8b0:4003:c0f::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B964934; Sat, 4 Feb 2017 06:27:32 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-ot0-x241.google.com with SMTP id 65so4643214otq.2; Fri, 03 Feb 2017 22:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=V6Y8LXo1sFhYnQ++2JlnTTuJbbpmt7WD9BhqEOVvjhA=; b=kvv4kckN9Vdpzi1EIsuM4UO8oLaL/Rn0YzTi6H5aJqrdO3UqOUmh/076BzBolY3xSL 2YuqxDKMUnuWEO3avyAI6K6SRRhdBDStzLo1ZeRhw1d3K7SETTK6gy4QqQDGUTmoaIQC 0i6eOBJ5RoYAm3+399KNwSPsg7tlcFXAv0QpS5PVZODM9o2gvTOY0mVA787MTjKaDqU+ Br+fJ7MCFNk5DNCx5OCJqNVD5nAaV+Z4EASoEx9wWgmlLPenyhsoU1YXFy0Udgr1Uz0B shUfY07juUx+FWtWk1mbwyKbDwWRUhZDISRFSGWQVrGUmi52V+dqz5DI9V6vgXvfejiz sweQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=V6Y8LXo1sFhYnQ++2JlnTTuJbbpmt7WD9BhqEOVvjhA=; b=P6d/ZGYBUbfqIvgZKYd5Is4p/h3Ae5/+RrwI0etWAekY9wx0JaKPQ2JlCMCfdAn2mK s5M5j8vw42bmbPFeISYnTe4X88vlEFEO9r59V8MhdOlYKcFWov+sOcsDOPvi351jbiNB oTIHlRYBnN1deRK9ldJenekyaTuRqAXbeZXRIUFsQ+zzfea0kqCBycawoA/gG+TlfUMA MYM6JtLP/2j/r9KTKitEJ3QUrti7brdwGySpQ3cDWda+I8cXLHV+ggQgFVUX4fGH5VxR /KmLIHwiRS9N2GhurSwPCeeB/hHaNNVzJTk2DzYtfUfQyA1mLtE4IsJCpsnzV2ptHbsn zsRg== X-Gm-Message-State: AMke39kuum+IIsExMLv1SgK82LRUXzgDSNtsAGATuB9hA1B0zjcswsBSsV+zK9cxWG95ruxp7ebjU/TktK29jQ== X-Received: by 10.157.41.173 with SMTP id n42mr312752otb.158.1486189651370; Fri, 03 Feb 2017 22:27:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.51.7 with HTTP; Fri, 3 Feb 2017 22:27:30 -0800 (PST) In-Reply-To: <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> From: Jason Harmening Date: Fri, 3 Feb 2017 22:27:30 -0800 Message-ID: Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Kurt Lidl Cc: Alexander Kabaev , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 06:27:32 -0000 It's hard to argue with that:) I've backed it out until we can figure out what's going on. Sorry for the breakage. On Fri, Feb 3, 2017 at 9:54 PM, Kurt Lidl wrote: > Having just spent a couple of hours bisecting what broke the kernel on > my mips64 machine, I can definitively state it was this commit. > > With this commit in place, the kernel hangs early in the > autoconfiguration: > > gcc version 4.2.1 20070831 patched [FreeBSD] > Preloaded elf kernel "kernel" at 0xffffffff80aa96a0. > real memory = 523239424 (510976K bytes) > Physical memory chunk(s): > 0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages) > 0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages) > 0x410000000 - 0x41f196fff, 253325312 bytes (61847 pages) > avail memory = 504360960 (480MB) > Create COP2 context zone > AP #1 started! > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > ---- hangs here ---- > > -Kurt > > On 2/4/17 12:29 AM, Jason Harmening wrote: > >> Hi, >> >> I'm a bit confused as to how this change breaks MIPS. The new function, >> get_pcpu() is intended to be used only to access the per-cpu data >> pointer locally. It returns pcpup, which is the per-cpu pointer wired >> into the local TLB to translate to the local CPU's physical data region, >> correct? >> >> This is the same value used by the per-CPU accessors such as PCPU_ADD >> and PCPU_GET. The MI portions of this change only use get_pcpu() to >> access the local CPU's data, e.g. under a critical section in the >> rmlock. It is not intended to be used for iterating all CPUs. >> >> If I've missed something and MIPS is truly broken by this, then I'll >> gladly revert, but (maybe because it's late) I'm not seeing where this >> goes wrong on MIPS. >> >> Thanks, >> Jason >> >> On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev > > wrote: >> >> On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) >> "Jason A. Harmening" wrote: >> >> > Author: jah >> > Date: Wed Feb 1 03:32:49 2017 >> > New Revision: 313037 >> > URL: https://svnweb.freebsd.org/changeset/base/313037 >> >> > >> > Log: >> > Implement get_pcpu() for the remaining architectures and use it to >> > replace pcpu_find(curcpu) in MI code. >> > >> > Modified: >> > head/sys/amd64/include/pcpu.h >> > head/sys/kern/kern_rmlock.c >> > head/sys/mips/include/pcpu.h >> > head/sys/net/netisr.c >> > head/sys/powerpc/include/cpufunc.h >> > head/sys/powerpc/include/pcpu.h >> > head/sys/sparc64/include/pcpu.h >> > >> >> Hi, >> >> this change was not reviewed nor testing was thought for all >> architectures it touches. The change happens to break MIPS quite >> thoroughly, since MIPS is using different pointers when accessing PCPU >> area locally and when doing iterations using cpu_to_cpuid array. I >> therefore officially am requesting this change to be reverted until >> reasonable solution is found to unbreak architectures that use wired >> TLBs to access local per-CPU data. >> >> -- >> Alexander Kabaev >> >> >> > From owner-svn-src-head@freebsd.org Sat Feb 4 09:25:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDAA9CCEC54; Sat, 4 Feb 2017 09:25:34 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2EC1FE0; Sat, 4 Feb 2017 09:25:34 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 28FB2C8393; Sat, 4 Feb 2017 10:25:30 +0100 (CET) Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Jason Harmening , Kurt Lidl References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> Cc: Alexander Kabaev , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste From: Andreas Tobler Message-ID: <6bf86e46-9714-c7e9-8d47-845761e2de24@FreeBSD.org> Date: Sat, 4 Feb 2017 10:25:29 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: Obelix Submit on 127.0.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 09:25:34 -0000 On 04.02.17 07:27, Jason Harmening wrote: > It's hard to argue with that:) I've backed it out until we can figure > out what's going on. > Sorry for the breakage. For the record, powerpc64 was also affected. Andreas > > On Fri, Feb 3, 2017 at 9:54 PM, Kurt Lidl > wrote: > > Having just spent a couple of hours bisecting what broke the kernel on > my mips64 machine, I can definitively state it was this commit. > > With this commit in place, the kernel hangs early in the > autoconfiguration: > > gcc version 4.2.1 20070831 patched [FreeBSD] > Preloaded elf kernel "kernel" at 0xffffffff80aa96a0. > real memory = 523239424 (510976K bytes) > Physical memory chunk(s): > 0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages) > 0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages) > 0x410000000 - 0x41f196fff, 253325312 bytes (61847 pages) > avail memory = 504360960 (480MB) > Create COP2 context zone > AP #1 started! > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > ---- hangs here ---- > > -Kurt > > On 2/4/17 12:29 AM, Jason Harmening wrote: > > Hi, > > I'm a bit confused as to how this change breaks MIPS. The new > function, > get_pcpu() is intended to be used only to access the per-cpu data > pointer locally. It returns pcpup, which is the per-cpu pointer > wired > into the local TLB to translate to the local CPU's physical data > region, > correct? > > This is the same value used by the per-CPU accessors such as > PCPU_ADD > and PCPU_GET. The MI portions of this change only use get_pcpu() to > access the local CPU's data, e.g. under a critical section in the > rmlock. It is not intended to be used for iterating all CPUs. > > If I've missed something and MIPS is truly broken by this, then I'll > gladly revert, but (maybe because it's late) I'm not seeing > where this > goes wrong on MIPS. > > Thanks, > Jason > > On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev > > >> wrote: > > On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) > "Jason A. Harmening" wrote: > > > Author: jah > > Date: Wed Feb 1 03:32:49 2017 > > New Revision: 313037 > > URL: https://svnweb.freebsd.org/changeset/base/313037 > > > > > > > Log: > > Implement get_pcpu() for the remaining architectures and > use it to > > replace pcpu_find(curcpu) in MI code. > > > > Modified: > > head/sys/amd64/include/pcpu.h > > head/sys/kern/kern_rmlock.c > > head/sys/mips/include/pcpu.h > > head/sys/net/netisr.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/pcpu.h > > head/sys/sparc64/include/pcpu.h > > > > Hi, > > this change was not reviewed nor testing was thought for all > architectures it touches. The change happens to break MIPS quite > thoroughly, since MIPS is using different pointers when > accessing PCPU > area locally and when doing iterations using cpu_to_cpuid > array. I > therefore officially am requesting this change to be > reverted until > reasonable solution is found to unbreak architectures that > use wired > TLBs to access local per-CPU data. > > -- > Alexander Kabaev > > > > From owner-svn-src-head@freebsd.org Sat Feb 4 12:26:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA88CCD73F; Sat, 4 Feb 2017 12:26:40 +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 0A0561D64; Sat, 4 Feb 2017 12:26:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14CQdLX066152; Sat, 4 Feb 2017 12:26:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14CQcFw066144; Sat, 4 Feb 2017 12:26:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702041226.v14CQcFw066144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Feb 2017 12:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313194 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 12:26:40 -0000 Author: kib Date: Sat Feb 4 12:26:38 2017 New Revision: 313194 URL: https://svnweb.freebsd.org/changeset/base/313194 Log: Define the vm_ooffset_t and vm_pindex_t types as machine-independend. The types are for the byte offset and page index in vm object. They are similar to off_t, which is defined as 64bit MI integer. Using MI definitions will allow to provide consistent MD values of vm object-related maximum sizes. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/arm/include/_types.h head/sys/arm64/include/_types.h head/sys/mips/include/_types.h head/sys/powerpc/include/_types.h head/sys/riscv/include/_types.h head/sys/sparc64/include/_types.h head/sys/sys/types.h head/sys/x86/include/_types.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/arm/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -100,9 +100,7 @@ typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; typedef __uint32_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; typedef unsigned int ___wchar_t; Modified: head/sys/arm64/include/_types.h ============================================================================== --- head/sys/arm64/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/arm64/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -88,9 +88,7 @@ typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; typedef unsigned int ___wchar_t; Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/mips/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -143,8 +143,6 @@ typedef __uint64_t __vm_paddr_t; typedef __uint32_t __vm_paddr_t; #endif -typedef __int64_t __vm_ooffset_t; -typedef __uint64_t __vm_pindex_t; typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/powerpc/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -135,8 +135,6 @@ typedef __uint32_t __vm_paddr_t; #endif typedef __uint32_t __vm_size_t; #endif -typedef __int64_t __vm_ooffset_t; -typedef __uint64_t __vm_pindex_t; typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ Modified: head/sys/riscv/include/_types.h ============================================================================== --- head/sys/riscv/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/riscv/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -88,9 +88,7 @@ typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; typedef int ___wchar_t; Modified: head/sys/sparc64/include/_types.h ============================================================================== --- head/sys/sparc64/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/sparc64/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -88,9 +88,7 @@ typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; typedef int ___wchar_t; Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/sys/types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -250,9 +250,9 @@ typedef struct cap_rights cap_rights_t; #endif typedef __vm_offset_t vm_offset_t; -typedef __vm_ooffset_t vm_ooffset_t; +typedef __int64_t vm_ooffset_t; typedef __vm_paddr_t vm_paddr_t; -typedef __vm_pindex_t vm_pindex_t; +typedef __uint64_t vm_pindex_t; typedef __vm_size_t vm_size_t; typedef __rman_res_t rman_res_t; Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Sat Feb 4 06:24:49 2017 (r313193) +++ head/sys/x86/include/_types.h Sat Feb 4 12:26:38 2017 (r313194) @@ -142,8 +142,6 @@ typedef __uint32_t __vm_paddr_t; #endif typedef __uint32_t __vm_size_t; #endif -typedef __int64_t __vm_ooffset_t; -typedef __uint64_t __vm_pindex_t; typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ From owner-svn-src-head@freebsd.org Sat Feb 4 14:10:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 376A7CCF466; Sat, 4 Feb 2017 14:10:18 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0181EF78; Sat, 4 Feb 2017 14:10:17 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14EAHBj007172; Sat, 4 Feb 2017 14:10:17 GMT (envelope-from def@FreeBSD.org) Received: (from def@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14EAGAn007170; Sat, 4 Feb 2017 14:10:16 GMT (envelope-from def@FreeBSD.org) Message-Id: <201702041410.v14EAGAn007170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: def set sender to def@FreeBSD.org using -f From: Konrad Witaszczyk Date: Sat, 4 Feb 2017 14:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313195 - in head/sbin: decryptcore savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 14:10:18 -0000 Author: def Date: Sat Feb 4 14:10:16 2017 New Revision: 313195 URL: https://svnweb.freebsd.org/changeset/base/313195 Log: Fix bugs found by Coverity in decryptcore(8) and savecore(8): - Perform final decryption and write decrypted data in case of non-block aligned input data; - Use strlcpy(3) instead of strncpy(3) to verify if paths aren't too long; - Check errno after calling unlink(2) instead of calling stat(2) in order to verify if a decrypted core was created by a child process; - Free dumpkey. Reported by: Coverity, cem, pfg Suggested by: cem CID: 1366936, 1366942, 1366951, 1366952 Approved by: pjd (mentor) Modified: head/sbin/decryptcore/decryptcore.c head/sbin/savecore/savecore.c Modified: head/sbin/decryptcore/decryptcore.c ============================================================================== --- head/sbin/decryptcore/decryptcore.c Sat Feb 4 12:26:38 2017 (r313194) +++ head/sbin/decryptcore/decryptcore.c Sat Feb 4 14:10:16 2017 (r313195) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -232,8 +231,6 @@ decrypt(const char *privkeyfile, const c pjdlog_errno(LOG_ERR, "Unable to read data from %s", input); goto failed; - } else if (bytes == 0) { - break; } if (bytes > 0) { @@ -249,10 +246,7 @@ decrypt(const char *privkeyfile, const c } } - if (olen == 0) - continue; - - if (write(ofd, buf, olen) != olen) { + if (olen > 0 && write(ofd, buf, olen) != olen) { pjdlog_errno(LOG_ERR, "Unable to write data to %s", output); goto failed; @@ -274,7 +268,6 @@ int main(int argc, char **argv) { char core[PATH_MAX], encryptedcore[PATH_MAX], keyfile[PATH_MAX]; - struct stat sb; const char *crashdir, *dumpnr, *privatekey; int ch, debug; size_t ii; @@ -297,16 +290,23 @@ main(int argc, char **argv) usesyslog = true; break; case 'c': - strncpy(core, optarg, sizeof(core)); + if (strlcpy(core, optarg, sizeof(core)) >= sizeof(core)) + pjdlog_exitx(1, "Core file path is too long."); break; case 'd': crashdir = optarg; break; case 'e': - strncpy(encryptedcore, optarg, sizeof(encryptedcore)); + if (strlcpy(encryptedcore, optarg, + sizeof(encryptedcore)) >= sizeof(encryptedcore)) { + pjdlog_exitx(1, "Encrypted core file path is too long."); + } break; case 'k': - strncpy(keyfile, optarg, sizeof(keyfile)); + if (strlcpy(keyfile, optarg, sizeof(keyfile)) >= + sizeof(keyfile)) { + pjdlog_exitx(1, "Key file path is too long."); + } break; case 'n': dumpnr = optarg; @@ -362,7 +362,7 @@ main(int argc, char **argv) pjdlog_debug_set(debug); if (!decrypt(privatekey, keyfile, encryptedcore, core)) { - if (stat(core, &sb) == 0 && unlink(core) != 0) + if (unlink(core) == -1 && errno != ENOENT) pjdlog_exit(1, "Unable to remove core"); exit(1); } Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sat Feb 4 12:26:38 2017 (r313194) +++ head/sbin/savecore/savecore.c Sat Feb 4 14:10:16 2017 (r313195) @@ -478,6 +478,7 @@ DoFile(const char *savedir, const char * bool isencrypted, ret; bounds = getbounds(); + dumpkey = NULL; mediasize = 0; status = STATUS_UNKNOWN; @@ -816,6 +817,7 @@ nuke: } xo_close_container_h(xostdout, "crashdump"); xo_finish_h(xostdout); + free(dumpkey); free(temp); close(fd); return; @@ -824,6 +826,7 @@ closeall: fclose(fp); closefd: + free(dumpkey); free(temp); close(fd); } From owner-svn-src-head@freebsd.org Sat Feb 4 18:25:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4C64CCFD82; Sat, 4 Feb 2017 18:25:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48F71E85; Sat, 4 Feb 2017 18:25:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14IP9Pb017873; Sat, 4 Feb 2017 18:25:09 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14IP95F017872; Sat, 4 Feb 2017 18:25:09 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201702041825.v14IP95F017872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 4 Feb 2017 18:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313248 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 18:25:10 -0000 Author: sbruno Date: Sat Feb 4 18:25:09 2017 New Revision: 313248 URL: https://svnweb.freebsd.org/changeset/base/313248 Log: Delete duplicate break. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Feb 4 18:20:07 2017 (r313247) +++ head/sys/net/iflib.c Sat Feb 4 18:25:09 2017 (r313248) @@ -3422,8 +3422,6 @@ iflib_if_ioctl(if_t ifp, u_long command, ctx->ifc_if_flags = if_getflags(ifp); CTX_UNLOCK(ctx); break; - - break; case SIOCADDMULTI: case SIOCDELMULTI: if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { From owner-svn-src-head@freebsd.org Sat Feb 4 19:16:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1042CD0A85; Sat, 4 Feb 2017 19:16:20 +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 85A8616A9; Sat, 4 Feb 2017 19:16:20 +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 v14JGJ8s037734; Sat, 4 Feb 2017 19:16:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14JGJxp037733; Sat, 4 Feb 2017 19:16:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702041916.v14JGJxp037733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Feb 2017 19:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313249 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 19:16:20 -0000 Author: kib Date: Sat Feb 4 19:16:19 2017 New Revision: 313249 URL: https://svnweb.freebsd.org/changeset/base/313249 Log: Style, use tab after #define. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_object.h Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Feb 4 18:25:09 2017 (r313248) +++ head/sys/vm/vm_object.h Sat Feb 4 19:16:19 2017 (r313249) @@ -183,8 +183,8 @@ struct vm_object { #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ #define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ -#define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) -#define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) +#define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) +#define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) #ifdef _KERNEL From owner-svn-src-head@freebsd.org Sat Feb 4 19:35:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09570CD104C; Sat, 4 Feb 2017 19:35:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4D961F30; Sat, 4 Feb 2017 19:35:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14JZcmK045952; Sat, 4 Feb 2017 19:35:38 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14JZc2U045946; Sat, 4 Feb 2017 19:35:38 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201702041935.v14JZc2U045946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 4 Feb 2017 19:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313250 - in head/sys/dev: mmc sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 19:35:40 -0000 Author: marius Date: Sat Feb 4 19:35:38 2017 New Revision: 313250 URL: https://svnweb.freebsd.org/changeset/base/313250 Log: Fix some more overly long lines, whitespace and other bugs according to style(9) as well as spelling in comments. Modified: head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcreg.h head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Feb 4 19:16:19 2017 (r313249) +++ head/sys/dev/mmc/mmc.c Sat Feb 4 19:35:38 2017 (r313250) @@ -111,14 +111,15 @@ struct mmc_ivars { char card_sn_string[16];/* Formatted serial # for disk->d_ident */ }; -#define CMD_RETRIES 3 +#define CMD_RETRIES 3 #define CARD_ID_FREQUENCY 400000 /* Spec requires 400kHz max during ID phase. */ static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); static int mmc_debug; -SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &mmc_debug, 0, "Debug level"); +SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &mmc_debug, 0, + "Debug level"); /* bus entry points */ static int mmc_acquire_bus(device_t busdev, device_t dev); @@ -137,14 +138,14 @@ static int mmc_wait_for_request(device_t static int mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value); -#define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define MMC_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ +#define MMC_LOCK_INIT(_sc) \ + mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->dev), \ "mmc", MTX_DEF) -#define MMC_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define MMC_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); +#define MMC_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED); +#define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED); static int mmc_all_send_cid(struct mmc_softc *sc, uint32_t *rawcid); static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); @@ -744,9 +745,9 @@ mmc_set_card_bus_width(struct mmc_softc static int mmc_set_timing(struct mmc_softc *sc, int timing) { + u_char switch_res[64]; int err; uint8_t value; - u_char switch_res[64]; switch (timing) { case bus_timing_normal: @@ -1161,9 +1162,9 @@ mmc_app_send_scr(struct mmc_softc *sc, u static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd) { - int err; struct mmc_command cmd; struct mmc_data data; + int err; memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); @@ -1185,9 +1186,9 @@ mmc_send_ext_csd(struct mmc_softc *sc, u static int mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca, uint32_t *rawsdstatus) { - int err, i; struct mmc_command cmd; struct mmc_data data; + int err, i; memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); @@ -1393,7 +1394,7 @@ mmc_discover_cards(struct mmc_softc *sc) * commands, although the state tables / diagrams in the * standard suggest they go back to the transfer state. * Other cards don't become deselected, and if we - * atttempt to blindly re-select them, we get timeout + * attempt to blindly re-select them, we get timeout * errors from some controllers. So we deselect then * reselect to handle all situations. The only thing we * use from the sd_status is the erase sector size, but @@ -1534,7 +1535,7 @@ mmc_discover_cards(struct mmc_softc *sc) static void mmc_rescan_cards(struct mmc_softc *sc) { - struct mmc_ivars *ivar = NULL; + struct mmc_ivars *ivar; device_t *devlist; int err, i, devcount; @@ -1664,14 +1665,13 @@ mmc_go_discovery(struct mmc_softc *sc) static int mmc_calculate_clock(struct mmc_softc *sc) { - int max_dtr, max_hs_dtr, max_timing; - int nkid, i, f_max; device_t *kids; struct mmc_ivars *ivar; + int i, f_max, max_dtr, max_hs_dtr, max_timing, nkid; f_max = mmcbr_get_f_max(sc->dev); max_dtr = max_hs_dtr = f_max; - if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)) + if (mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED) max_timing = bus_timing_hs; else max_timing = bus_timing_normal; Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Sat Feb 4 19:16:19 2017 (r313249) +++ head/sys/dev/mmc/mmcreg.h Sat Feb 4 19:35:38 2017 (r313250) @@ -100,7 +100,7 @@ struct mmc_command { #define MMC_ERR_FAILED 4 #define MMC_ERR_INVALID 5 #define MMC_ERR_NO_MEMORY 6 -#define MMC_ERR_MAX 6 +#define MMC_ERR_MAX 6 struct mmc_data *data; /* Data segment with cmd */ struct mmc_request *mrq; /* backpointer to request */ }; @@ -291,47 +291,47 @@ struct mmc_request { /* * EXT_CSD fields */ -#define EXT_CSD_ERASE_GRP_DEF 175 /* R/W */ -#define EXT_CSD_BUS_WIDTH 183 /* R/W */ -#define EXT_CSD_HS_TIMING 185 /* R/W */ -#define EXT_CSD_CARD_TYPE 196 /* RO */ -#define EXT_CSD_REV 192 /* RO */ -#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ -#define EXT_CSD_ERASE_TO_MULT 223 /* RO */ -#define EXT_CSD_ERASE_GRP_SIZE 224 /* RO */ +#define EXT_CSD_ERASE_GRP_DEF 175 /* R/W */ +#define EXT_CSD_BUS_WIDTH 183 /* R/W */ +#define EXT_CSD_HS_TIMING 185 /* R/W */ +#define EXT_CSD_CARD_TYPE 196 /* RO */ +#define EXT_CSD_REV 192 /* RO */ +#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ +#define EXT_CSD_ERASE_TO_MULT 223 /* RO */ +#define EXT_CSD_ERASE_GRP_SIZE 224 /* RO */ /* * EXT_CSD field definitions */ -#define EXT_CSD_CMD_SET_NORMAL 1 -#define EXT_CSD_CMD_SET_SECURE 2 -#define EXT_CSD_CMD_SET_CPSECURE 4 - -#define EXT_CSD_CARD_TYPE_26 1 -#define EXT_CSD_CARD_TYPE_52 2 - -#define EXT_CSD_BUS_WIDTH_1 0 -#define EXT_CSD_BUS_WIDTH_4 1 -#define EXT_CSD_BUS_WIDTH_8 2 +#define EXT_CSD_CMD_SET_NORMAL 1 +#define EXT_CSD_CMD_SET_SECURE 2 +#define EXT_CSD_CMD_SET_CPSECURE 4 + +#define EXT_CSD_CARD_TYPE_26 1 +#define EXT_CSD_CARD_TYPE_52 2 + +#define EXT_CSD_BUS_WIDTH_1 0 +#define EXT_CSD_BUS_WIDTH_4 1 +#define EXT_CSD_BUS_WIDTH_8 2 -#define MMC_TYPE_26_MAX_HS 26000000 -#define MMC_TYPE_52_MAX_HS 52000000 +#define MMC_TYPE_26_MAX_HS 26000000 +#define MMC_TYPE_52_MAX_HS 52000000 /* * SD bus widths */ -#define SD_BUS_WIDTH_1 0 -#define SD_BUS_WIDTH_4 2 +#define SD_BUS_WIDTH_1 0 +#define SD_BUS_WIDTH_4 2 /* * SD Switch */ -#define SD_SWITCH_MODE_CHECK 0 -#define SD_SWITCH_MODE_SET 1 -#define SD_SWITCH_GROUP1 0 -#define SD_SWITCH_NORMAL_MODE 0 -#define SD_SWITCH_HS_MODE 1 -#define SD_SWITCH_NOCHANGE 0xF +#define SD_SWITCH_MODE_CHECK 0 +#define SD_SWITCH_MODE_SET 1 +#define SD_SWITCH_GROUP1 0 +#define SD_SWITCH_NORMAL_MODE 0 +#define SD_SWITCH_HS_MODE 1 +#define SD_SWITCH_NOCHANGE 0xF #define SD_CLR_CARD_DETECT 0 #define SD_SET_CARD_DETECT 1 @@ -419,8 +419,8 @@ struct mmc_scr { unsigned char sda_vsn; unsigned char bus_widths; -#define SD_SCR_BUS_WIDTH_1 (1<<0) -#define SD_SCR_BUS_WIDTH_4 (1<<2) +#define SD_SCR_BUS_WIDTH_1 (1 << 0) +#define SD_SCR_BUS_WIDTH_4 (1 << 2) }; struct mmc_sd_status @@ -443,6 +443,6 @@ struct mmc_sd_status * byte sector size anywhere, so we assume that such cards are very rare * and only note their existence in passing here... */ -#define MMC_SECTOR_SIZE 512 +#define MMC_SECTOR_SIZE 512 #endif /* DEV_MMCREG_H */ Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Feb 4 19:16:19 2017 (r313249) +++ head/sys/dev/sdhci/sdhci.c Sat Feb 4 19:35:38 2017 (r313250) @@ -55,18 +55,19 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); static int sdhci_debug; -SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, "Debug level"); +SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, + "Debug level"); -#define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) -#define RD2(slot, off) SDHCI_READ_2((slot)->bus, (slot), (off)) -#define RD4(slot, off) SDHCI_READ_4((slot)->bus, (slot), (off)) -#define RD_MULTI_4(slot, off, ptr, count) \ +#define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) +#define RD2(slot, off) SDHCI_READ_2((slot)->bus, (slot), (off)) +#define RD4(slot, off) SDHCI_READ_4((slot)->bus, (slot), (off)) +#define RD_MULTI_4(slot, off, ptr, count) \ SDHCI_READ_MULTI_4((slot)->bus, (slot), (off), (ptr), (count)) -#define WR1(slot, off, val) SDHCI_WRITE_1((slot)->bus, (slot), (off), (val)) -#define WR2(slot, off, val) SDHCI_WRITE_2((slot)->bus, (slot), (off), (val)) -#define WR4(slot, off, val) SDHCI_WRITE_4((slot)->bus, (slot), (off), (val)) -#define WR_MULTI_4(slot, off, ptr, count) \ +#define WR1(slot, off, val) SDHCI_WRITE_1((slot)->bus, (slot), (off), (val)) +#define WR2(slot, off, val) SDHCI_WRITE_2((slot)->bus, (slot), (off), (val)) +#define WR4(slot, off, val) SDHCI_WRITE_4((slot)->bus, (slot), (off), (val)) +#define WR_MULTI_4(slot, off, ptr, count) \ SDHCI_WRITE_MULTI_4((slot)->bus, (slot), (off), (ptr), (count)) static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock); @@ -77,13 +78,13 @@ static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ -#define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) +#define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) #define SDHCI_UNLOCK(_slot) mtx_unlock(&(_slot)->mtx) -#define SDHCI_LOCK_INIT(_slot) \ +#define SDHCI_LOCK_INIT(_slot) \ mtx_init(&_slot->mtx, "SD slot mtx", "sdhci", MTX_DEF) -#define SDHCI_LOCK_DESTROY(_slot) mtx_destroy(&_slot->mtx); -#define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED); -#define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED); +#define SDHCI_LOCK_DESTROY(_slot) mtx_destroy(&_slot->mtx); +#define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED); +#define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED); #define SDHCI_DEFAULT_MAX_FREQ 50 @@ -97,20 +98,20 @@ static void sdhci_card_task(void *, int) * Broadcom BCM577xx Controller Constants */ /* Maximum divider supported by the default clock source. */ -#define BCM577XX_DEFAULT_MAX_DIVIDER 256 +#define BCM577XX_DEFAULT_MAX_DIVIDER 256 /* Alternative clock's base frequency. */ -#define BCM577XX_ALT_CLOCK_BASE 63000000 - -#define BCM577XX_HOST_CONTROL 0x198 -#define BCM577XX_CTRL_CLKSEL_MASK 0xFFFFCFFF -#define BCM577XX_CTRL_CLKSEL_SHIFT 12 -#define BCM577XX_CTRL_CLKSEL_DEFAULT 0x0 -#define BCM577XX_CTRL_CLKSEL_64MHZ 0x3 +#define BCM577XX_ALT_CLOCK_BASE 63000000 +#define BCM577XX_HOST_CONTROL 0x198 +#define BCM577XX_CTRL_CLKSEL_MASK 0xFFFFCFFF +#define BCM577XX_CTRL_CLKSEL_SHIFT 12 +#define BCM577XX_CTRL_CLKSEL_DEFAULT 0x0 +#define BCM577XX_CTRL_CLKSEL_64MHZ 0x3 static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { + if (error != 0) { printf("getaddr: error %d\n", error); return; @@ -136,6 +137,7 @@ slot_printf(struct sdhci_slot *slot, con static void sdhci_dumpregs(struct sdhci_slot *slot) { + slot_printf(slot, "============== REGISTER DUMP ==============\n"); @@ -498,9 +500,10 @@ sdhci_transfer_pio(struct sdhci_slot *sl } static void -sdhci_card_task(void *arg, int pending) +sdhci_card_task(void *arg, int pending __unused) { struct sdhci_slot *slot = arg; + device_t d; SDHCI_LOCK(slot); if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { @@ -519,7 +522,7 @@ sdhci_card_task(void *arg, int pending) /* If no card present - detach mmc bus. */ if (bootverbose || sdhci_debug) slot_printf(slot, "Card removed\n"); - device_t d = slot->dev; + d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); device_delete_child(slot->bus, d); @@ -739,6 +742,7 @@ sdhci_init_slot(device_t dev, struct sdh void sdhci_start_slot(struct sdhci_slot *slot) { + sdhci_card_task(slot, 0); } @@ -774,6 +778,7 @@ sdhci_cleanup_slot(struct sdhci_slot *sl int sdhci_generic_suspend(struct sdhci_slot *slot) { + sdhci_reset(slot, SDHCI_RESET_ALL); return (0); @@ -782,6 +787,7 @@ sdhci_generic_suspend(struct sdhci_slot int sdhci_generic_resume(struct sdhci_slot *slot) { + sdhci_init(slot); return (0); @@ -790,6 +796,7 @@ sdhci_generic_resume(struct sdhci_slot * uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot) { + if (slot->version >= SDHCI_SPEC_300) return (slot->max_clk / SDHCI_300_MAX_DIVIDER); else @@ -869,7 +876,7 @@ sdhci_timeout(void *arg) if (slot->curcmd != NULL) { slot_printf(slot, " Controller timeout\n"); sdhci_dumpregs(slot); - sdhci_reset(slot, SDHCI_RESET_CMD|SDHCI_RESET_DATA); + sdhci_reset(slot, SDHCI_RESET_CMD | SDHCI_RESET_DATA); slot->curcmd->error = MMC_ERR_TIMEOUT; sdhci_req_done(slot); } else { @@ -1122,6 +1129,7 @@ void sdhci_finish_data(struct sdhci_slot *slot) { struct mmc_data *data = slot->curcmd->data; + size_t left; /* Interrupt aggregation: Restore command interrupt. * Auxiliary restore point for the case when data interrupt @@ -1133,7 +1141,7 @@ sdhci_finish_data(struct sdhci_slot *slo /* Unload rest of data from DMA buffer. */ if (!slot->data_done && (slot->flags & SDHCI_USE_DMA)) { if (data->flags & MMC_DATA_READ) { - size_t left = data->len - slot->offset; + left = data->len - slot->offset; bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, @@ -1433,7 +1441,7 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle data interrupts. */ if (intmask & SDHCI_INT_DATA_MASK) { WR4(slot, SDHCI_INT_STATUS, intmask & SDHCI_INT_DATA_MASK); - /* Dont call data_irq in case of errored command */ + /* Don't call data_irq in case of errored command. */ if ((intmask & SDHCI_INT_CMD_ERROR_MASK) == 0) sdhci_data_irq(slot, intmask & SDHCI_INT_DATA_MASK); } Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sat Feb 4 19:16:19 2017 (r313249) +++ head/sys/dev/sdhci/sdhci.h Sat Feb 4 19:35:38 2017 (r313250) @@ -28,246 +28,246 @@ #ifndef __SDHCI_H__ #define __SDHCI_H__ -#define DMA_BLOCK_SIZE 4096 -#define DMA_BOUNDARY 0 /* DMA reload every 4K */ +#define DMA_BLOCK_SIZE 4096 +#define DMA_BOUNDARY 0 /* DMA reload every 4K */ /* Controller doesn't honor resets unless we touch the clock register */ -#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) +#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1 << 0) /* Controller really supports DMA */ -#define SDHCI_QUIRK_FORCE_DMA (1<<1) +#define SDHCI_QUIRK_FORCE_DMA (1 << 1) /* Controller has unusable DMA engine */ -#define SDHCI_QUIRK_BROKEN_DMA (1<<2) +#define SDHCI_QUIRK_BROKEN_DMA (1 << 2) /* Controller doesn't like to be reset when there is no card inserted. */ -#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<3) +#define SDHCI_QUIRK_NO_CARD_NO_RESET (1 << 3) /* Controller has flaky internal state so reset it on each ios change */ -#define SDHCI_QUIRK_RESET_ON_IOS (1<<4) +#define SDHCI_QUIRK_RESET_ON_IOS (1 << 4) /* Controller can only DMA chunk sizes that are a multiple of 32 bits */ -#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<5) +#define SDHCI_QUIRK_32BIT_DMA_SIZE (1 << 5) /* Controller needs to be reset after each request to stay stable */ -#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<6) +#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1 << 6) /* Controller has an off-by-one issue with timeout value */ -#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) +#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1 << 7) /* Controller has broken read timings */ -#define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) +#define SDHCI_QUIRK_BROKEN_TIMINGS (1 << 8) /* Controller needs lowered frequency */ -#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) +#define SDHCI_QUIRK_LOWER_FREQUENCY (1 << 9) /* Data timeout is invalid, should use SD clock */ -#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<10) +#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1 << 10) /* Timeout value is invalid, should be overriden */ -#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<11) +#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1 << 11) /* SDHCI_CAPABILITIES is invalid */ -#define SDHCI_QUIRK_MISSING_CAPS (1<<12) +#define SDHCI_QUIRK_MISSING_CAPS (1 << 12) /* Hardware shifts the 136-bit response, don't do it in software. */ -#define SDHCI_QUIRK_DONT_SHIFT_RESPONSE (1<<13) +#define SDHCI_QUIRK_DONT_SHIFT_RESPONSE (1 << 13) /* Wait to see reset bit asserted before waiting for de-asserted */ -#define SDHCI_QUIRK_WAITFOR_RESET_ASSERTED (1<<14) +#define SDHCI_QUIRK_WAITFOR_RESET_ASSERTED (1 << 14) /* Leave controller in standard mode when putting card in HS mode. */ -#define SDHCI_QUIRK_DONT_SET_HISPD_BIT (1<<15) +#define SDHCI_QUIRK_DONT_SET_HISPD_BIT (1 << 15) /* Alternate clock source is required when supplying a 400 KHz clock. */ -#define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) +#define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1 << 16) /* Card insert/remove interrupts don't work, polling required. */ -#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1 << 17) /* All controller slots are non-removable. */ -#define SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18) +#define SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1 << 18) /* Issue custom Intel controller reset sequence after power-up. */ -#define SDHCI_QUIRK_INTEL_POWER_UP_RESET (1<<19) +#define SDHCI_QUIRK_INTEL_POWER_UP_RESET (1 << 19) /* Data timeout is invalid, use 1 MHz clock instead. */ -#define SDHCI_QUIRK_DATA_TIMEOUT_1MHZ (1<<20) +#define SDHCI_QUIRK_DATA_TIMEOUT_1MHZ (1 << 20) /* * Controller registers */ -#define SDHCI_DMA_ADDRESS 0x00 +#define SDHCI_DMA_ADDRESS 0x00 -#define SDHCI_BLOCK_SIZE 0x04 -#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) +#define SDHCI_BLOCK_SIZE 0x04 +#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) -#define SDHCI_BLOCK_COUNT 0x06 +#define SDHCI_BLOCK_COUNT 0x06 -#define SDHCI_ARGUMENT 0x08 +#define SDHCI_ARGUMENT 0x08 -#define SDHCI_TRANSFER_MODE 0x0C -#define SDHCI_TRNS_DMA 0x01 -#define SDHCI_TRNS_BLK_CNT_EN 0x02 -#define SDHCI_TRNS_ACMD12 0x04 -#define SDHCI_TRNS_READ 0x10 -#define SDHCI_TRNS_MULTI 0x20 - -#define SDHCI_COMMAND_FLAGS 0x0E -#define SDHCI_CMD_RESP_NONE 0x00 -#define SDHCI_CMD_RESP_LONG 0x01 -#define SDHCI_CMD_RESP_SHORT 0x02 -#define SDHCI_CMD_RESP_SHORT_BUSY 0x03 -#define SDHCI_CMD_RESP_MASK 0x03 -#define SDHCI_CMD_CRC 0x08 -#define SDHCI_CMD_INDEX 0x10 -#define SDHCI_CMD_DATA 0x20 -#define SDHCI_CMD_TYPE_NORMAL 0x00 -#define SDHCI_CMD_TYPE_SUSPEND 0x40 -#define SDHCI_CMD_TYPE_RESUME 0x80 -#define SDHCI_CMD_TYPE_ABORT 0xc0 -#define SDHCI_CMD_TYPE_MASK 0xc0 - -#define SDHCI_COMMAND 0x0F - -#define SDHCI_RESPONSE 0x10 - -#define SDHCI_BUFFER 0x20 - -#define SDHCI_PRESENT_STATE 0x24 -#define SDHCI_CMD_INHIBIT 0x00000001 -#define SDHCI_DAT_INHIBIT 0x00000002 -#define SDHCI_DAT_ACTIVE 0x00000004 -#define SDHCI_RETUNE_REQUEST 0x00000008 -#define SDHCI_DOING_WRITE 0x00000100 -#define SDHCI_DOING_READ 0x00000200 -#define SDHCI_SPACE_AVAILABLE 0x00000400 -#define SDHCI_DATA_AVAILABLE 0x00000800 -#define SDHCI_CARD_PRESENT 0x00010000 -#define SDHCI_CARD_STABLE 0x00020000 -#define SDHCI_CARD_PIN 0x00040000 -#define SDHCI_WRITE_PROTECT 0x00080000 -#define SDHCI_STATE_DAT_MASK 0x00f00000 -#define SDHCI_STATE_CMD 0x01000000 - -#define SDHCI_HOST_CONTROL 0x28 -#define SDHCI_CTRL_LED 0x01 -#define SDHCI_CTRL_4BITBUS 0x02 -#define SDHCI_CTRL_HISPD 0x04 -#define SDHCI_CTRL_SDMA 0x08 -#define SDHCI_CTRL_ADMA2 0x10 -#define SDHCI_CTRL_ADMA264 0x18 -#define SDHCI_CTRL_DMA_MASK 0x18 -#define SDHCI_CTRL_8BITBUS 0x20 -#define SDHCI_CTRL_CARD_DET 0x40 -#define SDHCI_CTRL_FORCE_CARD 0x80 - -#define SDHCI_POWER_CONTROL 0x29 -#define SDHCI_POWER_ON 0x01 -#define SDHCI_POWER_180 0x0A -#define SDHCI_POWER_300 0x0C -#define SDHCI_POWER_330 0x0E - -#define SDHCI_BLOCK_GAP_CONTROL 0x2A - -#define SDHCI_WAKE_UP_CONTROL 0x2B - -#define SDHCI_CLOCK_CONTROL 0x2C -#define SDHCI_DIVIDER_MASK 0xff -#define SDHCI_DIVIDER_MASK_LEN 8 -#define SDHCI_DIVIDER_SHIFT 8 -#define SDHCI_DIVIDER_HI_MASK 3 -#define SDHCI_DIVIDER_HI_SHIFT 6 -#define SDHCI_CLOCK_CARD_EN 0x0004 -#define SDHCI_CLOCK_INT_STABLE 0x0002 -#define SDHCI_CLOCK_INT_EN 0x0001 -#define SDHCI_DIVIDERS_MASK \ +#define SDHCI_TRANSFER_MODE 0x0C +#define SDHCI_TRNS_DMA 0x01 +#define SDHCI_TRNS_BLK_CNT_EN 0x02 +#define SDHCI_TRNS_ACMD12 0x04 +#define SDHCI_TRNS_READ 0x10 +#define SDHCI_TRNS_MULTI 0x20 + +#define SDHCI_COMMAND_FLAGS 0x0E +#define SDHCI_CMD_RESP_NONE 0x00 +#define SDHCI_CMD_RESP_LONG 0x01 +#define SDHCI_CMD_RESP_SHORT 0x02 +#define SDHCI_CMD_RESP_SHORT_BUSY 0x03 +#define SDHCI_CMD_RESP_MASK 0x03 +#define SDHCI_CMD_CRC 0x08 +#define SDHCI_CMD_INDEX 0x10 +#define SDHCI_CMD_DATA 0x20 +#define SDHCI_CMD_TYPE_NORMAL 0x00 +#define SDHCI_CMD_TYPE_SUSPEND 0x40 +#define SDHCI_CMD_TYPE_RESUME 0x80 +#define SDHCI_CMD_TYPE_ABORT 0xc0 +#define SDHCI_CMD_TYPE_MASK 0xc0 + +#define SDHCI_COMMAND 0x0F + +#define SDHCI_RESPONSE 0x10 + +#define SDHCI_BUFFER 0x20 + +#define SDHCI_PRESENT_STATE 0x24 +#define SDHCI_CMD_INHIBIT 0x00000001 +#define SDHCI_DAT_INHIBIT 0x00000002 +#define SDHCI_DAT_ACTIVE 0x00000004 +#define SDHCI_RETUNE_REQUEST 0x00000008 +#define SDHCI_DOING_WRITE 0x00000100 +#define SDHCI_DOING_READ 0x00000200 +#define SDHCI_SPACE_AVAILABLE 0x00000400 +#define SDHCI_DATA_AVAILABLE 0x00000800 +#define SDHCI_CARD_PRESENT 0x00010000 +#define SDHCI_CARD_STABLE 0x00020000 +#define SDHCI_CARD_PIN 0x00040000 +#define SDHCI_WRITE_PROTECT 0x00080000 +#define SDHCI_STATE_DAT_MASK 0x00f00000 +#define SDHCI_STATE_CMD 0x01000000 + +#define SDHCI_HOST_CONTROL 0x28 +#define SDHCI_CTRL_LED 0x01 +#define SDHCI_CTRL_4BITBUS 0x02 +#define SDHCI_CTRL_HISPD 0x04 +#define SDHCI_CTRL_SDMA 0x08 +#define SDHCI_CTRL_ADMA2 0x10 +#define SDHCI_CTRL_ADMA264 0x18 +#define SDHCI_CTRL_DMA_MASK 0x18 +#define SDHCI_CTRL_8BITBUS 0x20 +#define SDHCI_CTRL_CARD_DET 0x40 +#define SDHCI_CTRL_FORCE_CARD 0x80 + +#define SDHCI_POWER_CONTROL 0x29 +#define SDHCI_POWER_ON 0x01 +#define SDHCI_POWER_180 0x0A +#define SDHCI_POWER_300 0x0C +#define SDHCI_POWER_330 0x0E + +#define SDHCI_BLOCK_GAP_CONTROL 0x2A + +#define SDHCI_WAKE_UP_CONTROL 0x2B + +#define SDHCI_CLOCK_CONTROL 0x2C +#define SDHCI_DIVIDER_MASK 0xff +#define SDHCI_DIVIDER_MASK_LEN 8 +#define SDHCI_DIVIDER_SHIFT 8 +#define SDHCI_DIVIDER_HI_MASK 3 +#define SDHCI_DIVIDER_HI_SHIFT 6 +#define SDHCI_CLOCK_CARD_EN 0x0004 +#define SDHCI_CLOCK_INT_STABLE 0x0002 +#define SDHCI_CLOCK_INT_EN 0x0001 +#define SDHCI_DIVIDERS_MASK \ ((SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT) | \ (SDHCI_DIVIDER_HI_MASK << SDHCI_DIVIDER_HI_SHIFT)) -#define SDHCI_TIMEOUT_CONTROL 0x2E +#define SDHCI_TIMEOUT_CONTROL 0x2E -#define SDHCI_SOFTWARE_RESET 0x2F -#define SDHCI_RESET_ALL 0x01 -#define SDHCI_RESET_CMD 0x02 -#define SDHCI_RESET_DATA 0x04 - -#define SDHCI_INT_STATUS 0x30 -#define SDHCI_INT_ENABLE 0x34 -#define SDHCI_SIGNAL_ENABLE 0x38 -#define SDHCI_INT_RESPONSE 0x00000001 -#define SDHCI_INT_DATA_END 0x00000002 -#define SDHCI_INT_BLOCK_GAP 0x00000004 -#define SDHCI_INT_DMA_END 0x00000008 -#define SDHCI_INT_SPACE_AVAIL 0x00000010 -#define SDHCI_INT_DATA_AVAIL 0x00000020 -#define SDHCI_INT_CARD_INSERT 0x00000040 -#define SDHCI_INT_CARD_REMOVE 0x00000080 -#define SDHCI_INT_CARD_INT 0x00000100 -#define SDHCI_INT_INT_A 0x00000200 -#define SDHCI_INT_INT_B 0x00000400 -#define SDHCI_INT_INT_C 0x00000800 -#define SDHCI_INT_RETUNE 0x00001000 -#define SDHCI_INT_ERROR 0x00008000 -#define SDHCI_INT_TIMEOUT 0x00010000 -#define SDHCI_INT_CRC 0x00020000 -#define SDHCI_INT_END_BIT 0x00040000 -#define SDHCI_INT_INDEX 0x00080000 -#define SDHCI_INT_DATA_TIMEOUT 0x00100000 -#define SDHCI_INT_DATA_CRC 0x00200000 -#define SDHCI_INT_DATA_END_BIT 0x00400000 -#define SDHCI_INT_BUS_POWER 0x00800000 -#define SDHCI_INT_ACMD12ERR 0x01000000 -#define SDHCI_INT_ADMAERR 0x02000000 -#define SDHCI_INT_TUNEERR 0x04000000 +#define SDHCI_SOFTWARE_RESET 0x2F +#define SDHCI_RESET_ALL 0x01 +#define SDHCI_RESET_CMD 0x02 +#define SDHCI_RESET_DATA 0x04 + +#define SDHCI_INT_STATUS 0x30 +#define SDHCI_INT_ENABLE 0x34 +#define SDHCI_SIGNAL_ENABLE 0x38 +#define SDHCI_INT_RESPONSE 0x00000001 +#define SDHCI_INT_DATA_END 0x00000002 +#define SDHCI_INT_BLOCK_GAP 0x00000004 +#define SDHCI_INT_DMA_END 0x00000008 +#define SDHCI_INT_SPACE_AVAIL 0x00000010 +#define SDHCI_INT_DATA_AVAIL 0x00000020 +#define SDHCI_INT_CARD_INSERT 0x00000040 +#define SDHCI_INT_CARD_REMOVE 0x00000080 +#define SDHCI_INT_CARD_INT 0x00000100 +#define SDHCI_INT_INT_A 0x00000200 +#define SDHCI_INT_INT_B 0x00000400 +#define SDHCI_INT_INT_C 0x00000800 +#define SDHCI_INT_RETUNE 0x00001000 +#define SDHCI_INT_ERROR 0x00008000 +#define SDHCI_INT_TIMEOUT 0x00010000 +#define SDHCI_INT_CRC 0x00020000 +#define SDHCI_INT_END_BIT 0x00040000 +#define SDHCI_INT_INDEX 0x00080000 +#define SDHCI_INT_DATA_TIMEOUT 0x00100000 +#define SDHCI_INT_DATA_CRC 0x00200000 +#define SDHCI_INT_DATA_END_BIT 0x00400000 +#define SDHCI_INT_BUS_POWER 0x00800000 +#define SDHCI_INT_ACMD12ERR 0x01000000 +#define SDHCI_INT_ADMAERR 0x02000000 +#define SDHCI_INT_TUNEERR 0x04000000 -#define SDHCI_INT_NORMAL_MASK 0x00007FFF -#define SDHCI_INT_ERROR_MASK 0xFFFF8000 +#define SDHCI_INT_NORMAL_MASK 0x00007FFF +#define SDHCI_INT_ERROR_MASK 0xFFFF8000 -#define SDHCI_INT_CMD_ERROR_MASK (SDHCI_INT_TIMEOUT | \ +#define SDHCI_INT_CMD_ERROR_MASK (SDHCI_INT_TIMEOUT | \ SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX) -#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_CMD_ERROR_MASK) +#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_CMD_ERROR_MASK) -#define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ +#define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ SDHCI_INT_DATA_END_BIT) -#define SDHCI_ACMD12_ERR 0x3C -#define SDHCI_HOST_CONTROL2 0x3E +#define SDHCI_ACMD12_ERR 0x3C +#define SDHCI_HOST_CONTROL2 0x3E -#define SDHCI_CAPABILITIES 0x40 -#define SDHCI_TIMEOUT_CLK_MASK 0x0000003F -#define SDHCI_TIMEOUT_CLK_SHIFT 0 -#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 -#define SDHCI_CLOCK_BASE_MASK 0x00003F00 -#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00 -#define SDHCI_CLOCK_BASE_SHIFT 8 -#define SDHCI_MAX_BLOCK_MASK 0x00030000 -#define SDHCI_MAX_BLOCK_SHIFT 16 -#define SDHCI_CAN_DO_8BITBUS 0x00040000 -#define SDHCI_CAN_DO_ADMA2 0x00080000 -#define SDHCI_CAN_DO_HISPD 0x00200000 -#define SDHCI_CAN_DO_DMA 0x00400000 -#define SDHCI_CAN_DO_SUSPEND 0x00800000 -#define SDHCI_CAN_VDD_330 0x01000000 -#define SDHCI_CAN_VDD_300 0x02000000 -#define SDHCI_CAN_VDD_180 0x04000000 -#define SDHCI_CAN_DO_64BIT 0x10000000 -#define SDHCI_CAN_ASYNC_INTR 0x20000000 - -#define SDHCI_CAPABILITIES2 0x44 -#define SDHCI_CAN_SDR50 0x00000001 -#define SDHCI_CAN_SDR104 0x00000002 -#define SDHCI_CAN_DDR50 0x00000004 -#define SDHCI_CAN_DRIVE_TYPE_A 0x00000010 -#define SDHCI_CAN_DRIVE_TYPE_B 0x00000020 -#define SDHCI_CAN_DRIVE_TYPE_C 0x00000040 -#define SDHCI_RETUNE_CNT_MASK 0x00000F00 -#define SDHCI_RETUNE_CNT_SHIFT 8 -#define SDHCI_TUNE_SDR50 0x00002000 -#define SDHCI_RETUNE_MODES_MASK 0x0000C000 -#define SDHCI_RETUNE_MODES_SHIFT 14 -#define SDHCI_CLOCK_MULT_MASK 0x00FF0000 -#define SDHCI_CLOCK_MULT_SHIFT 16 - -#define SDHCI_MAX_CURRENT 0x48 -#define SDHCI_FORCE_AUTO_EVENT 0x50 -#define SDHCI_FORCE_INTR_EVENT 0x52 -#define SDHCI_ADMA_ERR 0x54 -#define SDHCI_ADMA_ADDRESS_LOW 0x58 -#define SDHCI_ADMA_ADDRESS_HI 0x5C -#define SDHCI_PRESET_VALUE 0x60 -#define SDHCI_SHARED_BUS_CTRL 0xE0 - -#define SDHCI_SLOT_INT_STATUS 0xFC - -#define SDHCI_HOST_VERSION 0xFE -#define SDHCI_VENDOR_VER_MASK 0xFF00 -#define SDHCI_VENDOR_VER_SHIFT 8 -#define SDHCI_SPEC_VER_MASK 0x00FF -#define SDHCI_SPEC_VER_SHIFT 0 +#define SDHCI_CAPABILITIES 0x40 +#define SDHCI_TIMEOUT_CLK_MASK 0x0000003F +#define SDHCI_TIMEOUT_CLK_SHIFT 0 +#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 +#define SDHCI_CLOCK_BASE_MASK 0x00003F00 +#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00 +#define SDHCI_CLOCK_BASE_SHIFT 8 +#define SDHCI_MAX_BLOCK_MASK 0x00030000 +#define SDHCI_MAX_BLOCK_SHIFT 16 +#define SDHCI_CAN_DO_8BITBUS 0x00040000 +#define SDHCI_CAN_DO_ADMA2 0x00080000 +#define SDHCI_CAN_DO_HISPD 0x00200000 +#define SDHCI_CAN_DO_DMA 0x00400000 +#define SDHCI_CAN_DO_SUSPEND 0x00800000 +#define SDHCI_CAN_VDD_330 0x01000000 +#define SDHCI_CAN_VDD_300 0x02000000 +#define SDHCI_CAN_VDD_180 0x04000000 +#define SDHCI_CAN_DO_64BIT 0x10000000 +#define SDHCI_CAN_ASYNC_INTR 0x20000000 + +#define SDHCI_CAPABILITIES2 0x44 +#define SDHCI_CAN_SDR50 0x00000001 +#define SDHCI_CAN_SDR104 0x00000002 +#define SDHCI_CAN_DDR50 0x00000004 +#define SDHCI_CAN_DRIVE_TYPE_A 0x00000010 +#define SDHCI_CAN_DRIVE_TYPE_B 0x00000020 +#define SDHCI_CAN_DRIVE_TYPE_C 0x00000040 +#define SDHCI_RETUNE_CNT_MASK 0x00000F00 +#define SDHCI_RETUNE_CNT_SHIFT 8 +#define SDHCI_TUNE_SDR50 0x00002000 +#define SDHCI_RETUNE_MODES_MASK 0x0000C000 +#define SDHCI_RETUNE_MODES_SHIFT 14 +#define SDHCI_CLOCK_MULT_MASK 0x00FF0000 +#define SDHCI_CLOCK_MULT_SHIFT 16 + +#define SDHCI_MAX_CURRENT 0x48 +#define SDHCI_FORCE_AUTO_EVENT 0x50 +#define SDHCI_FORCE_INTR_EVENT 0x52 +#define SDHCI_ADMA_ERR 0x54 +#define SDHCI_ADMA_ADDRESS_LOW 0x58 +#define SDHCI_ADMA_ADDRESS_HI 0x5C +#define SDHCI_PRESET_VALUE 0x60 +#define SDHCI_SHARED_BUS_CTRL 0xE0 + +#define SDHCI_SLOT_INT_STATUS 0xFC + +#define SDHCI_HOST_VERSION 0xFE +#define SDHCI_VENDOR_VER_MASK 0xFF00 +#define SDHCI_VENDOR_VER_SHIFT 8 +#define SDHCI_SPEC_VER_MASK 0x00FF +#define SDHCI_SPEC_VER_SHIFT 0 #define SDHCI_SPEC_100 0 #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 @@ -310,10 +310,10 @@ struct sdhci_slot { u_char cmd_done; /* CMD command part done flag */ u_char data_done; /* DAT command part done flag */ u_char flags; /* Request execution flags */ -#define CMD_STARTED 1 -#define STOP_STARTED 2 -#define SDHCI_USE_DMA 4 /* Use DMA for this req. */ -#define PLATFORM_DATA_STARTED 8 /* Data xfer is handled by platform */ +#define CMD_STARTED 1 +#define STOP_STARTED 2 +#define SDHCI_USE_DMA 4 /* Use DMA for this req. */ +#define PLATFORM_DATA_STARTED 8 /* Data xfer is handled by platform */ struct mtx mtx; /* Slot mutex */ }; Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Sat Feb 4 19:16:19 2017 (r313249) +++ head/sys/dev/sdhci/sdhci_fdt.c Sat Feb 4 19:35:38 2017 (r313250) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include "mmcbr_if.h" #include "sdhci_if.h" -#define MAX_SLOTS 6 +#define MAX_SLOTS 6 struct sdhci_fdt_softc { device_t dev; /* Controller device */ @@ -68,7 +68,7 @@ struct sdhci_fdt_softc { u_int caps; /* If we override SDHCI_CAPABILITIES */ uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ + void *intrhand; /* Interrupt handle */ int num_slots; /* Number of slots on this controller*/ struct sdhci_slot slots[MAX_SLOTS]; @@ -79,14 +79,16 @@ static uint8_t sdhci_fdt_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + return (bus_read_1(sc->mem_res[slot->num], off)); } static void sdhci_fdt_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, - uint8_t val) + uint8_t val) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + bus_write_1(sc->mem_res[slot->num], off, val); } @@ -94,14 +96,16 @@ static uint16_t sdhci_fdt_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + return (bus_read_2(sc->mem_res[slot->num], off)); } static void sdhci_fdt_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, - uint16_t val) + uint16_t val) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + bus_write_2(sc->mem_res[slot->num], off, val); } @@ -109,14 +113,16 @@ static uint32_t sdhci_fdt_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + return (bus_read_4(sc->mem_res[slot->num], off)); } static void sdhci_fdt_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, - uint32_t val) + uint32_t val) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + bus_write_4(sc->mem_res[slot->num], off, val); } @@ -125,6 +131,7 @@ sdhci_fdt_read_multi_4(device_t dev, str bus_size_t off, uint32_t *data, bus_size_t count) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + bus_read_multi_4(sc->mem_res[slot->num], off, data, count); } @@ -133,6 +140,7 @@ sdhci_fdt_write_multi_4(device_t dev, st bus_size_t off, uint32_t *data, bus_size_t count) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + bus_write_multi_4(sc->mem_res[slot->num], off, data, count); } @@ -142,10 +150,8 @@ sdhci_fdt_intr(void *arg) struct sdhci_fdt_softc *sc = (struct sdhci_fdt_softc *)arg; int i; - for (i = 0; i < sc->num_slots; i++) { - struct sdhci_slot *slot = &sc->slots[i]; - sdhci_generic_intr(slot); - } + for (i = 0; i < sc->num_slots; i++) + sdhci_generic_intr(&sc->slots[i]); } static int @@ -187,6 +193,7 @@ static int sdhci_fdt_attach(device_t dev) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + struct sdhci_slot *slot; int err, slots, rid, i; sc->dev = dev; @@ -194,7 +201,7 @@ sdhci_fdt_attach(device_t dev) /* Allocate IRQ. */ rid = 0; sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(dev, "Can't allocate IRQ\n"); return (ENOMEM); @@ -204,15 +211,15 @@ sdhci_fdt_attach(device_t dev) slots = sc->num_slots; /* number of slots determined in probe(). */ sc->num_slots = 0; for (i = 0; i < slots; i++) { - struct sdhci_slot *slot = &sc->slots[sc->num_slots]; + slot = &sc->slots[sc->num_slots]; /* Allocate memory. */ rid = 0; sc->mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res[i] == NULL) { - device_printf(dev, "Can't allocate memory for " - "slot %d\n", i); + device_printf(dev, + "Can't allocate memory for slot %d\n", i); continue; } @@ -236,10 +243,8 @@ sdhci_fdt_attach(device_t dev) } /* Process cards detection. */ - for (i = 0; i < sc->num_slots; i++) { - struct sdhci_slot *slot = &sc->slots[i]; - sdhci_start_slot(slot); - } + for (i = 0; i < sc->num_slots; i++) + sdhci_start_slot(&sc->slots[i]); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Feb 4 19:54:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23FEECD14E0; Sat, 4 Feb 2017 19:54:55 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D300CADD; Sat, 4 Feb 2017 19:54:54 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id s203so28930263oie.1; Sat, 04 Feb 2017 11:54:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=18RR8Gc0wtR4qq87ghFluNik2juWBFQQO57H36KkeMw=; b=fbzRJq4wxBPb8ZvQBY3c6LcQbd2s2EUWLo2Q0NS50484wV64OcK7VEDB81nAxdwtz7 Ebv6FXPQHbExvhYMmu6BE+TuEWfRz/WM8E1UJmLIIq2Tc0YI4/b3I2huuNcaL0zmnxPa vd5+8Hf52lZJq3zy8cOX8QB9IOIPjbQeH7J3ekBon1BQjOi/WwvWrPDjAivWz7Gg7+9R Z3w3o5AQy+NVc1SYP+W+Fo9SvC8+dT3bDzJHaCWEnP02e1jlWWCMStjJ9CjtQu7Br/7G l3l4mG6x1Qc5Glmhzfwzc4TF8zMEibgPJUT5ooK/jnHhd/ZTLWJHvVWEumGzuLrKY8xg Z5jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=18RR8Gc0wtR4qq87ghFluNik2juWBFQQO57H36KkeMw=; b=jpYUh9/k5C/zRj/h1hWHPP+Rh52d3BfGg/HlCqse81S6yPSCZ6EWF8ptozU46AdrZH HAZkQ0NI06MaotNVCSzOo3ssYJu1hMR4ujX3TBMfVJnSygkTANc77ac36y0lqKzLMkfU xKhQmwC8vvgG+MWExEgX+5csenUTu9mRujuKlSUXpShonPsTAAvaJCpRsFZtCvCOnfZ1 QyxjaE3AZ5U04o4+NDOJITtk/WoOE1k/unb2jcjIcxfP8NomiMkrwAyNmneFKuO39bNi GYYldpGLe/XPJuLY9DlPRx5YT2KmIIDkX4vpIxLI97lk67U1zW1uUl/6KFWaQFM2ATFO es0g== X-Gm-Message-State: AMke39lmpypCiNd/DIaT4YD7uskj0cMsxJ+N9h5S/HLBVBP7Ev3tSaV+l7K7KT31X69Gg5HAAmK/Mg4yhChtFA== X-Received: by 10.202.105.70 with SMTP id e67mr1864187oic.26.1486238094117; Sat, 04 Feb 2017 11:54:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.51.7 with HTTP; Sat, 4 Feb 2017 11:54:53 -0800 (PST) In-Reply-To: <6bf86e46-9714-c7e9-8d47-845761e2de24@FreeBSD.org> References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> <6bf86e46-9714-c7e9-8d47-845761e2de24@FreeBSD.org> From: Jason Harmening Date: Sat, 4 Feb 2017 11:54:53 -0800 Message-ID: Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Andreas Tobler Cc: Kurt Lidl , Alexander Kabaev , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 19:54:55 -0000 I suspect this broke rmlocks for mips because the rmlock implementation takes the address of the per-CPU pc_rm_queue when building tracker lists. That address may be later accessed from another CPU and will then translate to the wrong physical region if the address was taken relative to the globally-constant pcpup VA used on mips. Regardless, for mips get_pcpup() should be implemented as pcpu_find(curcpu) since returning an address that may mean something different depending on the CPU seems like a big POLA violation if nothing else. I'm more concerned about the report of powerpc breakage. For powerpc we simply take each pcpu pointer from the pc_allcpu list (which is the same value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu global to each AP's startup code, which then stores it in sprg0. It should be globally unique and won't have the variable-translation issues seen on mips. Andreas, are you certain this change was responsible the breakage you saw, and was it the same sort of hang observed on mips? On Sat, Feb 4, 2017 at 1:25 AM, Andreas Tobler wrote: > On 04.02.17 07:27, Jason Harmening wrote: > >> It's hard to argue with that:) I've backed it out until we can figure >> out what's going on. >> Sorry for the breakage. >> > > > For the record, powerpc64 was also affected. > > Andreas > >> >> On Fri, Feb 3, 2017 at 9:54 PM, Kurt Lidl > > wrote: >> >> Having just spent a couple of hours bisecting what broke the kernel on >> my mips64 machine, I can definitively state it was this commit. >> >> With this commit in place, the kernel hangs early in the >> autoconfiguration: >> >> gcc version 4.2.1 20070831 patched [FreeBSD] >> Preloaded elf kernel "kernel" at 0xffffffff80aa96a0. >> real memory = 523239424 (510976K bytes) >> Physical memory chunk(s): >> 0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages) >> 0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages) >> 0x410000000 - 0x41f196fff, 253325312 bytes (61847 pages) >> avail memory = 504360960 (480MB) >> Create COP2 context zone >> AP #1 started! >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> ---- hangs here ---- >> >> -Kurt >> >> On 2/4/17 12:29 AM, Jason Harmening wrote: >> >> Hi, >> >> I'm a bit confused as to how this change breaks MIPS. The new >> function, >> get_pcpu() is intended to be used only to access the per-cpu data >> pointer locally. It returns pcpup, which is the per-cpu pointer >> wired >> into the local TLB to translate to the local CPU's physical data >> region, >> correct? >> >> This is the same value used by the per-CPU accessors such as >> PCPU_ADD >> and PCPU_GET. The MI portions of this change only use get_pcpu() >> to >> access the local CPU's data, e.g. under a critical section in the >> rmlock. It is not intended to be used for iterating all CPUs. >> >> If I've missed something and MIPS is truly broken by this, then >> I'll >> gladly revert, but (maybe because it's late) I'm not seeing >> where this >> goes wrong on MIPS. >> >> Thanks, >> Jason >> >> On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev >> >> >> wrote: >> >> On Wed, 1 Feb 2017 03:32:49 +0000 (UTC) >> "Jason A. Harmening" wrote: >> >> > Author: jah >> > Date: Wed Feb 1 03:32:49 2017 >> > New Revision: 313037 >> > URL: https://svnweb.freebsd.org/changeset/base/313037 >> >> > > >> > >> > Log: >> > Implement get_pcpu() for the remaining architectures and >> use it to >> > replace pcpu_find(curcpu) in MI code. >> > >> > Modified: >> > head/sys/amd64/include/pcpu.h >> > head/sys/kern/kern_rmlock.c >> > head/sys/mips/include/pcpu.h >> > head/sys/net/netisr.c >> > head/sys/powerpc/include/cpufunc.h >> > head/sys/powerpc/include/pcpu.h >> > head/sys/sparc64/include/pcpu.h >> > >> >> Hi, >> >> this change was not reviewed nor testing was thought for all >> architectures it touches. The change happens to break MIPS >> quite >> thoroughly, since MIPS is using different pointers when >> accessing PCPU >> area locally and when doing iterations using cpu_to_cpuid >> array. I >> therefore officially am requesting this change to be >> reverted until >> reasonable solution is found to unbreak architectures that >> use wired >> TLBs to access local per-CPU data. >> >> -- >> Alexander Kabaev >> >> >> >> >> > From owner-svn-src-head@freebsd.org Sat Feb 4 19:56:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C743DCD155E; Sat, 4 Feb 2017 19:56:44 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::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 7C846C53; Sat, 4 Feb 2017 19:56:44 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id w20so10041538qtb.1; Sat, 04 Feb 2017 11:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=5y8bwiMsyQEfw48sVCUuCpy5bi/F/El656V/XsUAbYc=; b=B3pwtjYmNGsmnYcOxoVpVt4dGXKlnwW9hn50qT6KLB5/HS3JEd+67xLuvJ2/QRwlL/ YfFxir7PaVLQyOXr/yI7YrCQzTRO7gh5cxbQpaCkKZz9Q0t0/gHBkoGyk7mfhh+6L2LX OAsy08XideK/jDV4Vfw/gF9GgAMDAFdB5sY+OfnJzDCrhrDxJd5eWRHiBJpE0FcGzwZt ny+nE67orPxSttZvLBZvh4YWc5JmRbZ8BAjSO3cl5Wxa4DbrC+zb2t5Sqyab43THZdhe tynT0pu4B0A+Q4Dzrw+fXTe88vr4MQYAWFiyZm5mPZrKiyJMzHlNNqMBtNkI+1BBd2QD Nb/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=5y8bwiMsyQEfw48sVCUuCpy5bi/F/El656V/XsUAbYc=; b=L60QGhuyuCtwjlTplnIvDzpImbYBffIizhnmiLIIriXvYLKV0R9qJ51ymetRcrkqen gT+PxoLsnTZ91RTLPqCx85uAK5ydVnvDlb6mpI8F7AEXgUXkQC2D6XBfGR4YH5wiIkuc 2BGgCG+uXaG0t6dzinPc7vSAv25vSu5aJlMS7QGuhsMepEx1SEMl1HLKnwjX4D1NUtSN WvO1fGS8t9B7taFzqLA0MJ1ZxG1ZsxHWkytpycnh1eAGqVL/WbVVZExMhbwqjkjwbMUA Upahlql8n7PePi0oRXxbE+41SgJQ8fw1mgpUjqkWh831rZnMcVJMJQj1TN8G6JCjb8ZO GNaQ== X-Gm-Message-State: AMke39lZ3wZSZ0nZT2xz+8bODp5IiW0NiEdOpN22Fi/mQ7TaR7hXHa0Kk4EnS63miRkugw== X-Received: by 10.237.33.209 with SMTP id m17mr3289440qtc.59.1486238203435; Sat, 04 Feb 2017 11:56:43 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id h124sm28386818qke.40.2017.02.04.11.56.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Feb 2017 11:56:42 -0800 (PST) Date: Sat, 4 Feb 2017 14:56:37 -0500 From: Alexander Kabaev To: "Jason A. Harmening" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Andreas Tobler , Kurt Lidl Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include Message-ID: <20170204145637.0324f015@kan> In-Reply-To: References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/tT+G97w/.cXn85LaPanxYVX"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 19:56:44 -0000 --Sig_/tT+G97w/.cXn85LaPanxYVX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 3 Feb 2017 21:29:33 -0800 Jason Harmening wrote: > Hi, >=20 > I'm a bit confused as to how this change breaks MIPS. The new > function, get_pcpu() is intended to be used only to access the > per-cpu data pointer locally. It returns pcpup, which is the per-cpu > pointer wired into the local TLB to translate to the local CPU's > physical data region, correct? >=20 > This is the same value used by the per-CPU accessors such as PCPU_ADD > and PCPU_GET. The MI portions of this change only use get_pcpu() to > access the local CPU's data, e.g. under a critical section in the > rmlock. It is not intended to be used for iterating all CPUs. >=20 > If I've missed something and MIPS is truly broken by this, then I'll > gladly revert, but (maybe because it's late) I'm not seeing where > this goes wrong on MIPS. >=20 > Thanks, > Jason The hang is actually due to _rmlock_assert spinning in rm_trackers_present with interrupts disabled, due to this constructs: for (queue =3D pc->pc_rm_queue.rmq_next; queue !=3D &pc->pc_rm_queue; queue =3D queue->rmq_next) { You changed the code to pass get_pcpu() results instead of direct pointer to the corresponding pcpu storage and that is NOT the pointer that was being used in pcpu_init. On architectures that rig TLB to make local PCPU available at constant address from each CPU, these two are generally not same, so while empty pc_rm_queue is a cyclic list consisting of just one element pc_rm_queue, the loop terminating condition will never be met, as &pc->pc_rm_qeue value will be very different from the one that pc->pc_rm_queue.rmq_next was set at initialisation time. This affects MIPS in SMP configuration only, UP configs do not bother with TLB hackery. --=20 Alexander Kabaev --Sig_/tT+G97w/.cXn85LaPanxYVX Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAliWMfVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln7gZg/+OrJ/rUQ+gm0P5DzMAf7aZ4rSOVNe244TWr+3Vu69zCEY9290HzxvKGd1 IhNY2P+4s5OFzbtYm/3ppjSrIziYr/hhIR0ZglunBEzsKtMwMGM2/mmi0n8fkMJW Ls0ndnQLgpNvInf6hKgvumqoxW/ak+WIet4AgqRfETPl5NfEHmaPKtrXT6qapP4c 8lGD1Lg4Sv/nOI7/VkeULMWXxGY9opFTZ08x68jOJKtxgNO/7g9D9LKg2JlO0FED GPA50APGetUuzkxLAItOYx1zr6SDeZqkwOokBr8gAbL4OI2oTND7lIFdqn+gkJM0 UCGul7AtgwOOSHsDp31rVok5OEs12S4AGb8RY5aRkG03g6NsCTY06JpvmbLI9S3e WvC/18ZSqVPjq7HkZnK2bSBwF3pwq2uIAXuKy8+0WCRn8d7OrW0+w4d5HaT58ACh XfadjjgCf8nBe7cde7AmckORU7cCGqV0ik8RVDUoqVgEGbqbOBHn8xXhCFoON00T nRUpHgzhYqWRX0MJ8Br800MXbNx/Dv/uljI6tfhF75+39TOOdQItdB7jpllvf+ox NmFbvQxVAJ5ShYEDprj4yEZuJKmxVZn7v4zaHCIJLAr+KQEl0OQAH2LiXSdPtPa7 eWZ87NIFjHmvIRTa8m7y8JWqXe1Rbvk7Ckq3h28/hUul+q0fALA= =kIAL -----END PGP SIGNATURE----- --Sig_/tT+G97w/.cXn85LaPanxYVX-- From owner-svn-src-head@freebsd.org Sat Feb 4 20:22:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD7D2CD1B85; Sat, 4 Feb 2017 20:22:32 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9EA185F; Sat, 4 Feb 2017 20:22:32 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 49CB4C53F9; Sat, 4 Feb 2017 21:22:27 +0100 (CET) Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Jason Harmening References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> <6bf86e46-9714-c7e9-8d47-845761e2de24@FreeBSD.org> Cc: Kurt Lidl , Alexander Kabaev , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , Justin Hibbits From: Andreas Tobler Message-ID: <8a2f7f7d-14c3-8e75-e060-fc41213ce389@FreeBSD.org> Date: Sat, 4 Feb 2017 21:22:27 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: Idefix Submit on 127.0.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 20:22:33 -0000 On 04.02.17 20:54, Jason Harmening wrote: > I suspect this broke rmlocks for mips because the rmlock implementation > takes the address of the per-CPU pc_rm_queue when building tracker > lists. That address may be later accessed from another CPU and will > then translate to the wrong physical region if the address was taken > relative to the globally-constant pcpup VA used on mips. > > Regardless, for mips get_pcpup() should be implemented as > pcpu_find(curcpu) since returning an address that may mean something > different depending on the CPU seems like a big POLA violation if > nothing else. > > I'm more concerned about the report of powerpc breakage. For powerpc we > simply take each pcpu pointer from the pc_allcpu list (which is the same > value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu > global to each AP's startup code, which then stores it in sprg0. It > should be globally unique and won't have the variable-translation issues > seen on mips. Andreas, are you certain this change was responsible the > breakage you saw, and was it the same sort of hang observed on mips? I'm really sure. 313036 booted fine, allowed me to execute heavy compilation jobs, np. 313037 on the other side gave me various patterns of panics. During startup, but I also succeeded to get into multiuser and then the panic happend during port building. I have no deeper inside where pcpu data is used. Justin mentioned netisr? Andreas From owner-svn-src-head@freebsd.org Sat Feb 4 20:39:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2EDCD1F4F; Sat, 4 Feb 2017 20:39:31 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-ot0-x243.google.com (mail-ot0-x243.google.com [IPv6:2607:f8b0:4003:c0f::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 CB9931E8A; Sat, 4 Feb 2017 20:39:30 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-ot0-x243.google.com with SMTP id 65so6166015otq.2; Sat, 04 Feb 2017 12:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=W7AQFNRW6Pso0h2MUXQhud6LmcjyZuHP2BvW5JOP/7g=; b=c+rcJQWGoT4PtXGUUGzRjHC42j9Fc1M5Oygy+rVNMFgLpqcG0dOz8YGGsETAMaNbSa 2apIYs/BfdkK0HuuBZjBsp52nK7aWBeHUdieHLwvx5bqJZ783Ga/FDPn8HLU66X9HIRd vle7jqlloK9YId7quPc18TalQFO7XyxpFp3tWKTScFByle2u8gQ9hTh59f7Gez1Ebnr8 dhZHV0FLgwe+sKo8MpLZiX9BX3J9N21m4gqP77I5PvSWiPRoD2brXqe0Vp5xbI3/sw5S 7Iae6BOHUNYWNsMTFZGYVP1Kfc5xSyN2qf6chiuiIqLw5x+OFds2AsRPxTE6t1zs5aXG SCug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=W7AQFNRW6Pso0h2MUXQhud6LmcjyZuHP2BvW5JOP/7g=; b=k4JXt81L2s9vNHJfwRUe5nZvV4EtUB8dBQ4rqTCMggcAAQtrrln0y5rrepurwq+enB 7O0OGQKKM2WApnxfTooltX8XO60LQwp3Ri1LEiMadoApXJm6IrH+bkEWUkOiN9yhL6wO wuiZzS//jLVQIsN6tctFCO3SPigPv4iLGxzrjzEKiK4Bi0zeKQ/qv7unCDtltOVLl/d9 QUZKIGjSLeI3ePgfaBzNu6o79glulu7+ovS+aYshl+7g76D75FMNjUNVc3vSXp5cyWso 1yQLAAprLsvjyGjf+Obwjxp0YYNCeyHSCKKJLzidvrj44/Rdocy4VJwNFQB+i2yBhABL 9zrg== X-Gm-Message-State: AIkVDXKERdFrwiqsHy0M1/oj0LHH1Mya2jUOwfHeef5m/TP9tIiS5VxksaFzzieFw5dvnchBB1HaUI1GdFuFkg== X-Received: by 10.157.27.208 with SMTP id v16mr1577762otv.200.1486240770032; Sat, 04 Feb 2017 12:39:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.51.7 with HTTP; Sat, 4 Feb 2017 12:39:29 -0800 (PST) In-Reply-To: <8a2f7f7d-14c3-8e75-e060-fc41213ce389@FreeBSD.org> References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> <8523aaa5-6c30-9f9f-40f0-fdf82cdf1669@pix.net> <6bf86e46-9714-c7e9-8d47-845761e2de24@FreeBSD.org> <8a2f7f7d-14c3-8e75-e060-fc41213ce389@FreeBSD.org> From: Jason Harmening Date: Sat, 4 Feb 2017 12:39:29 -0800 Message-ID: Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include To: Andreas Tobler Cc: Kurt Lidl , Alexander Kabaev , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , Justin Hibbits Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 20:39:31 -0000 Can you post an example of such panic? Only 2 MI pieces were changed, netisr and rmlock. I haven't seen problems on my own amd64/i386/arm testing of this, so a backtrace might help to narrow down the cause. On Sat, Feb 4, 2017 at 12:22 PM, Andreas Tobler wrote: > On 04.02.17 20:54, Jason Harmening wrote: > >> I suspect this broke rmlocks for mips because the rmlock implementation >> takes the address of the per-CPU pc_rm_queue when building tracker >> lists. That address may be later accessed from another CPU and will >> then translate to the wrong physical region if the address was taken >> relative to the globally-constant pcpup VA used on mips. >> >> Regardless, for mips get_pcpup() should be implemented as >> pcpu_find(curcpu) since returning an address that may mean something >> different depending on the CPU seems like a big POLA violation if >> nothing else. >> >> I'm more concerned about the report of powerpc breakage. For powerpc we >> simply take each pcpu pointer from the pc_allcpu list (which is the same >> value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu >> global to each AP's startup code, which then stores it in sprg0. It >> should be globally unique and won't have the variable-translation issues >> seen on mips. Andreas, are you certain this change was responsible the >> breakage you saw, and was it the same sort of hang observed on mips? >> > > I'm really sure. 313036 booted fine, allowed me to execute heavy > compilation jobs, np. 313037 on the other side gave me various patterns of > panics. During startup, but I also succeeded to get into multiuser and then > the panic happend during port building. > > I have no deeper inside where pcpu data is used. Justin mentioned netisr? > > Andreas > > From owner-svn-src-head@freebsd.org Sat Feb 4 20:43:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73673CCE151; Sat, 4 Feb 2017 20:43:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433EF352; Sat, 4 Feb 2017 20:43:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Khjai073762; Sat, 4 Feb 2017 20:43:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14KhjUM073761; Sat, 4 Feb 2017 20:43:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702042043.v14KhjUM073761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 20:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313251 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 20:43:46 -0000 Author: imp Date: Sat Feb 4 20:43:45 2017 New Revision: 313251 URL: https://svnweb.freebsd.org/changeset/base/313251 Log: Fix a typo in usage string for unimplemented command. Modified: head/sbin/nvmecontrol/wdc.c Modified: head/sbin/nvmecontrol/wdc.c ============================================================================== --- head/sbin/nvmecontrol/wdc.c Sat Feb 4 19:35:38 2017 (r313250) +++ head/sbin/nvmecontrol/wdc.c Sat Feb 4 20:43:45 2017 (r313251) @@ -69,7 +69,7 @@ static void wdc_purge_monitor(int argc, #define WDC_DRIVE_LOG_USAGE "\tnvmecontrol wdc drive-log [-o path-template]\n" #define WDC_GET_CRASH_DUMP_USAGE "\tnvmecontrol wdc get-crash-dump [-o path-template]\n" #define WDC_PURGE_USAGE "\tnvmecontrol wdc purge [-o path-template]\n" -#define WDC_PURGE_MONITOR_USAGE "\tnvmecontrol wdc purge-montor\n" +#define WDC_PURGE_MONITOR_USAGE "\tnvmecontrol wdc purge-monitor\n" static struct nvme_function wdc_funcs[] = { {"cap-diag", wdc_cap_diag, WDC_CAP_DIAG_USAGE}, From owner-svn-src-head@freebsd.org Sat Feb 4 20:43:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDC23CCE186; Sat, 4 Feb 2017 20:43:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73833E5; Sat, 4 Feb 2017 20:43:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14KhsJc073808; Sat, 4 Feb 2017 20:43:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14Khs2A073807; Sat, 4 Feb 2017 20:43:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702042043.v14Khs2A073807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 4 Feb 2017 20:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313252 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 20:43:56 -0000 Author: imp Date: Sat Feb 4 20:43:54 2017 New Revision: 313252 URL: https://svnweb.freebsd.org/changeset/base/313252 Log: Fix off by one error that truncated the serial number for filenames. Modified: head/sbin/nvmecontrol/wdc.c Modified: head/sbin/nvmecontrol/wdc.c ============================================================================== --- head/sbin/nvmecontrol/wdc.c Sat Feb 4 20:43:45 2017 (r313251) +++ head/sbin/nvmecontrol/wdc.c Sat Feb 4 20:43:54 2017 (r313252) @@ -94,7 +94,7 @@ wdc_append_serial_name(int fd, char *buf walker = sn + NVME_SERIAL_NUMBER_LENGTH - 1; while (walker > sn && *walker == ' ') walker--; - *walker = '\0'; + *++walker = '\0'; snprintf(buf, len, "%s%s.bin", sn, suffix); } From owner-svn-src-head@freebsd.org Sat Feb 4 20:57:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DAF1CCE72F; Sat, 4 Feb 2017 20:57:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAEEDC8; Sat, 4 Feb 2017 20:57:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Kv9bW078145; Sat, 4 Feb 2017 20:57:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14Kv99A078144; Sat, 4 Feb 2017 20:57:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702042057.v14Kv99A078144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Feb 2017 20:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313253 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 20:57:10 -0000 Author: adrian Date: Sat Feb 4 20:57:09 2017 New Revision: 313253 URL: https://svnweb.freebsd.org/changeset/base/313253 Log: [net80211] fix quiet_duration parameter to match what is provided in the manpage. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Feb 4 20:43:54 2017 (r313252) +++ head/sbin/ifconfig/ifieee80211.c Sat Feb 4 20:57:09 2017 (r313253) @@ -5594,12 +5594,12 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD_ARG("bgscanidle", set80211bgscanidle), DEF_CMD_ARG("bgscanintvl", set80211bgscanintvl), DEF_CMD_ARG("scanvalid", set80211scanvalid), - DEF_CMD("quiet", 1, set80211quiet), - DEF_CMD("-quiet", 0, set80211quiet), - DEF_CMD_ARG("quiet_count", set80211quietcount), - DEF_CMD_ARG("quiet_period", set80211quietperiod), - DEF_CMD_ARG("quiet_dur", set80211quietduration), - DEF_CMD_ARG("quiet_offset", set80211quietoffset), + DEF_CMD("quiet", 1, set80211quiet), + DEF_CMD("-quiet", 0, set80211quiet), + DEF_CMD_ARG("quiet_count", set80211quietcount), + DEF_CMD_ARG("quiet_period", set80211quietperiod), + DEF_CMD_ARG("quiet_duration", set80211quietduration), + DEF_CMD_ARG("quiet_offset", set80211quietoffset), DEF_CMD_ARG("roam:rssi", set80211roamrssi), DEF_CMD_ARG("roam:rate", set80211roamrate), DEF_CMD_ARG("mcastrate", set80211mcastrate),