From owner-svn-src-stable-11@freebsd.org Sun Jan 15 04:23:22 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044F3CB03F0; Sun, 15 Jan 2017 04:23:22 +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 C7D3E192D; Sun, 15 Jan 2017 04:23:21 +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 v0F4NKdx049101; Sun, 15 Jan 2017 04:23:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F4NKvg049100; Sun, 15 Jan 2017 04:23:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701150423.v0F4NKvg049100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Jan 2017 04:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312210 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2017 04:23:22 -0000 Author: pfg Date: Sun Jan 15 04:23:20 2017 New Revision: 312210 URL: https://svnweb.freebsd.org/changeset/base/312210 Log: MFC r311896 Remove unused __gnu_inline() attribute. This was meant to be used by a future FORTIFY_SOURCE implementation. Probably for good, FORTIFY_SOURCE and this particular GCCism were never well supported by clang or other compilers. Furthermore, the technology has long since been replaced by either static checkers, sanitizers, or even just the strong stack protector that was enabled by default. Drop __gnu_inline to avoid cluttering the headers. Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Sun Jan 15 03:53:20 2017 (r312209) +++ stable/11/sys/sys/cdefs.h Sun Jan 15 04:23:20 2017 (r312210) @@ -543,22 +543,6 @@ __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) #endif -/* - * FORTIFY_SOURCE, and perhaps other compiler-specific features, require - * the use of non-standard inlining. In general we should try to avoid - * using these but GCC-compatible compilers tend to support the extensions - * well enough to use them in limited cases. - */ -#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__) -#define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) -#else -#define __gnu_inline __attribute__((__gnu_inline__)) -#endif /* artificial */ -#else -#define __gnu_inline -#endif - /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ defined(__GNUC__) && !defined(__INTEL_COMPILER) From owner-svn-src-stable-11@freebsd.org Sun Jan 15 15:43:20 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1ABFCB145E; Sun, 15 Jan 2017 15:43:20 +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 8258E1E30; Sun, 15 Jan 2017 15:43:20 +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 v0FFhJnf029548; Sun, 15 Jan 2017 15:43:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FFhJh5029547; Sun, 15 Jan 2017 15:43:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701151543.v0FFhJh5029547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 15 Jan 2017 15:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312233 - stable/11/sys/netipsec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2017 15:43:20 -0000 Author: ae Date: Sun Jan 15 15:43:19 2017 New Revision: 312233 URL: https://svnweb.freebsd.org/changeset/base/312233 Log: MFC r311679: Add direction argument to ipsec_setspidx_inpcb() function. This function is used only by ipsec_getpolicybysock() to fill security policy index selector for locally generated packets (that have INPCB). The function incorrectly assumes that spidx is the same for both directions. Fix this by using new direction argument to specify correct INPCB security policy - sp_in or sp_out. There is no need to fill both policy indeces, because they are overwritten for each packet. This fixes security policy matching for outbound packets when user has specified TCP/UDP ports in the security policy upperspec. PR: 213869 Modified: stable/11/sys/netipsec/ipsec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec.c ============================================================================== --- stable/11/sys/netipsec/ipsec.c Sun Jan 15 13:57:42 2017 (r312232) +++ stable/11/sys/netipsec/ipsec.c Sun Jan 15 15:43:19 2017 (r312233) @@ -241,7 +241,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, #endif /* INET6 */ static int ipsec_in_reject(struct secpolicy *, const struct mbuf *); -static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *); +static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *, u_int); static int ipsec_setspidx(const struct mbuf *, struct secpolicyindex *, int); static void ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); static int ipsec4_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); @@ -344,7 +344,7 @@ ipsec_getpolicybysock(const struct mbuf } /* Set spidx in pcb. */ - *error = ipsec_setspidx_inpcb(m, inp); + *error = ipsec_setspidx_inpcb(m, inp, dir); if (*error) return (NULL); @@ -501,8 +501,9 @@ ipsec4_checkpolicy(const struct mbuf *m, } static int -ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp, u_int dir) { + struct secpolicyindex *spidx; int error; IPSEC_ASSERT(inp != NULL, ("null inp")); @@ -510,11 +511,13 @@ ipsec_setspidx_inpcb(const struct mbuf * IPSEC_ASSERT(inp->inp_sp->sp_out != NULL && inp->inp_sp->sp_in != NULL, ("null sp_in || sp_out")); - error = ipsec_setspidx(m, &inp->inp_sp->sp_in->spidx, 1); + if (dir == IPSEC_DIR_INBOUND) + spidx = &inp->inp_sp->sp_in->spidx; + else + spidx = &inp->inp_sp->sp_out->spidx; + error = ipsec_setspidx(m, spidx, 1); if (error == 0) { - inp->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND; - inp->inp_sp->sp_out->spidx = inp->inp_sp->sp_in->spidx; - inp->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND; + spidx->dir = dir; } else { bzero(&inp->inp_sp->sp_in->spidx, sizeof (inp->inp_sp->sp_in->spidx)); From owner-svn-src-stable-11@freebsd.org Sun Jan 15 22:10:33 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC05CB1C49; Sun, 15 Jan 2017 22:10:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C79DB1583; Sun, 15 Jan 2017 22:10:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FMAWom084567; Sun, 15 Jan 2017 22:10:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FMAWad084564; Sun, 15 Jan 2017 22:10:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701152210.v0FMAWad084564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Jan 2017 22:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312244 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2017 22:10:34 -0000 Author: ian Date: Sun Jan 15 22:10:32 2017 New Revision: 312244 URL: https://svnweb.freebsd.org/changeset/base/312244 Log: MFC r308187, r311660, r311693, r311727, r311797: Toggle card insert/remove interrupt enable bits on events. Add a new sdhci interface method, get_card_present(). Now that the PRESENT_STATE register is only used for the inhibit bits loop in this function, sdhci_start_command(), eliminate the state variable and restructure the loop to read the register just once at the top of the loop. Add support for non-removable media, and a quirk to use polling to detect card insert/remove events on controllers that don't implement the insert and remove interrupts. Add sdhci_handle_card_present_locked() that can be called from the interrupt handler which already holds the mutex, and have sdhci_handle_card_present() be just a tiny wrapper that does the locking for external callers. Modified: stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_if.m Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci.c Sun Jan 15 22:10:32 2017 (r312244) @@ -73,6 +73,7 @@ static void sdhci_set_clock(struct sdhci static void sdhci_start(struct sdhci_slot *slot); static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ @@ -89,6 +90,9 @@ static void sdhci_card_task(void *, int) #define SDHCI_200_MAX_DIVIDER 256 #define SDHCI_300_MAX_DIVIDER 2046 +#define SDHCI_CARD_PRESENT_TICKS (hz / 5) +#define SDHCI_INSERT_DELAY_TICKS (hz / 2) + /* * Broadcom BCM577xx Controller Constants */ @@ -164,8 +168,7 @@ sdhci_reset(struct sdhci_slot *slot, uin int timeout; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { - if (!(RD4(slot, SDHCI_PRESENT_STATE) & - SDHCI_CARD_PRESENT)) + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot)) return; } @@ -230,10 +233,15 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | SDHCI_INT_ACMD12ERR; + + if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; + } + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -475,23 +483,17 @@ sdhci_transfer_pio(struct sdhci_slot *sl } } -static void -sdhci_card_delay(void *arg) -{ - struct sdhci_slot *slot = arg; - - taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); -} - static void sdhci_card_task(void *arg, int pending) { struct sdhci_slot *slot = arg; SDHCI_LOCK(slot); - if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { + if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card inserted\n"); slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); @@ -501,6 +503,8 @@ sdhci_card_task(void *arg, int pending) } else { if (slot->dev != NULL) { /* If no card present - detach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); @@ -510,6 +514,51 @@ sdhci_card_task(void *arg, int pending) } } +static void +sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present) +{ + bool was_present; + + /* + * If there was no card and now there is one, schedule the task to + * create the child device after a short delay. The delay is to + * debounce the card insert (sometimes the card detect pin stabilizes + * before the other pins have made good contact). + * + * If there was a card present and now it's gone, immediately schedule + * the task to delete the child device. No debouncing -- gone is gone, + * because once power is removed, a full card re-init is needed, and + * that happens by deleting and recreating the child device. + */ + was_present = slot->dev != NULL; + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &slot->card_delayed_task, -SDHCI_INSERT_DELAY_TICKS); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); + } +} + +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + + SDHCI_LOCK(slot); + sdhci_handle_card_present_locked(slot, is_present); + SDHCI_UNLOCK(slot); +} + +static void +sdhci_card_poll(void *arg) +{ + struct sdhci_slot *slot = arg; + + sdhci_handle_card_present(slot, + SDHCI_GET_CARD_PRESENT(slot->bus, slot)); + 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) { @@ -653,9 +702,17 @@ sdhci_init_slot(device_t dev, struct sdh "timeout", CTLFLAG_RW, &slot->timeout, 0, "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - callout_init(&slot->card_callout, 1); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, + sdhci_card_task, slot); + callout_init(&slot->card_poll_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); + if ((slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + callout_reset(&slot->card_poll_callout, + SDHCI_CARD_PRESENT_TICKS, sdhci_card_poll, slot); + } + return (0); } @@ -671,8 +728,9 @@ sdhci_cleanup_slot(struct sdhci_slot *sl device_t d; callout_drain(&slot->timeout_callout); - callout_drain(&slot->card_callout); + callout_drain(&slot->card_poll_callout); taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &slot->card_delayed_task); SDHCI_LOCK(slot); d = slot->dev; @@ -718,6 +776,16 @@ sdhci_generic_min_freq(device_t brdev, s return (slot->max_clk / SDHCI_200_MAX_DIVIDER); } +bool +sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) +{ + + if (slot->opt & SDHCI_NON_REMOVABLE) + return true; + + return (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); +} + int sdhci_generic_update_ios(device_t brdev, device_t reqdev) { @@ -815,7 +883,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -830,11 +898,9 @@ sdhci_start_command(struct sdhci_slot *s return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ - if ((state & SDHCI_CARD_PRESENT) == 0 || + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || slot->power == 0 || slot->clock == 0) { cmd->error = MMC_ERR_FAILED; @@ -860,7 +926,7 @@ sdhci_start_command(struct sdhci_slot *s * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -871,7 +937,6 @@ sdhci_start_command(struct sdhci_slot *s } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ @@ -1309,7 +1374,7 @@ sdhci_acmd_irq(struct sdhci_slot *slot) void sdhci_generic_intr(struct sdhci_slot *slot) { - uint32_t intmask; + uint32_t intmask, present; SDHCI_LOCK(slot); /* Read slot interrupt status. */ @@ -1323,22 +1388,16 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle card presence interrupts. */ if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { + present = (intmask & SDHCI_INT_CARD_INSERT) != 0; + slot->intmask &= + ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); + slot->intmask |= present ? SDHCI_INT_CARD_REMOVE : + SDHCI_INT_CARD_INSERT; + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); + WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - - if (intmask & SDHCI_INT_CARD_REMOVE) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card removed\n"); - callout_stop(&slot->card_callout); - taskqueue_enqueue(taskqueue_swi_giant, - &slot->card_task); - } - if (intmask & SDHCI_INT_CARD_INSERT) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card inserted\n"); - callout_reset(&slot->card_callout, hz / 2, - sdhci_card_delay, slot); - } + sdhci_handle_card_present_locked(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); } /* Handle command interrupts. */ Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci.h Sun Jan 15 22:10:32 2017 (r312244) @@ -65,6 +65,8 @@ #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) +/* Card insert/remove interrupts don't work, polling required. */ +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) /* * Controller registers @@ -273,8 +275,9 @@ struct sdhci_slot { device_t dev; /* Slot device */ u_char num; /* Slot number */ u_char opt; /* Slot options */ -#define SDHCI_HAVE_DMA 1 -#define SDHCI_PLATFORM_TRANSFER 2 +#define SDHCI_HAVE_DMA 0x01 +#define SDHCI_PLATFORM_TRANSFER 0x02 +#define SDHCI_NON_REMOVABLE 0x04 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ @@ -284,7 +287,9 @@ struct sdhci_slot { u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ - struct callout card_callout; /* Card insert delay callout */ + 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 */ @@ -322,5 +327,7 @@ int sdhci_generic_acquire_host(device_t int sdhci_generic_release_host(device_t brdev, device_t reqdev); void sdhci_generic_intr(struct sdhci_slot *slot); uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot); +bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); +void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); #endif /* __SDHCI_H__ */ Modified: stable/11/sys/dev/sdhci/sdhci_if.m ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:10:32 2017 (r312244) @@ -152,3 +152,9 @@ METHOD uint32_t min_freq { device_t brdev; struct sdhci_slot *slot; } DEFAULT sdhci_generic_min_freq; + +METHOD bool get_card_present { + device_t brdev; + struct sdhci_slot *slot; +} DEFAULT sdhci_generic_get_card_present; + From owner-svn-src-stable-11@freebsd.org Mon Jan 16 00:35:35 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082E8CAF825; Mon, 16 Jan 2017 00:35:35 +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 CDF381A20; Mon, 16 Jan 2017 00:35:34 +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 v0G0ZYFp046020; Mon, 16 Jan 2017 00:35:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0ZYKL046019; Mon, 16 Jan 2017 00:35:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160035.v0G0ZYKL046019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312246 - stable/11/lib/libprocstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 00:35:35 -0000 Author: kib Date: Mon Jan 16 00:35:33 2017 New Revision: 312246 URL: https://svnweb.freebsd.org/changeset/base/312246 Log: MFC r311780: Use tab for indent. Modified: stable/11/lib/libprocstat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/Makefile ============================================================================== --- stable/11/lib/libprocstat/Makefile Sun Jan 15 22:30:59 2017 (r312245) +++ stable/11/lib/libprocstat/Makefile Mon Jan 16 00:35:33 2017 (r312246) @@ -9,7 +9,7 @@ SRCS= cd9660.c \ common_kvm.c \ core.c \ libprocstat.c \ - msdosfs.c \ + msdosfs.c \ smbfs.c \ udf.c From owner-svn-src-stable-11@freebsd.org Mon Jan 16 00:37:27 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B77CAF902; Mon, 16 Jan 2017 00:37:27 +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 568711BC5; Mon, 16 Jan 2017 00:37:27 +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 v0G0bQQm046133; Mon, 16 Jan 2017 00:37:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0bQb7046132; Mon, 16 Jan 2017 00:37:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160037.v0G0bQb7046132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312247 - stable/11/lib/libprocstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 00:37:27 -0000 Author: kib Date: Mon Jan 16 00:37:26 2017 New Revision: 312247 URL: https://svnweb.freebsd.org/changeset/base/312247 Log: MFC r311781: Use standard Versions.def for libprocstat. Deleted: stable/11/lib/libprocstat/Versions.def Modified: stable/11/lib/libprocstat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/Makefile ============================================================================== --- stable/11/lib/libprocstat/Makefile Mon Jan 16 00:35:33 2017 (r312246) +++ stable/11/lib/libprocstat/Makefile Mon Jan 16 00:37:26 2017 (r312247) @@ -13,7 +13,7 @@ SRCS= cd9660.c \ smbfs.c \ udf.c -VERSION_DEF= ${.CURDIR}/Versions.def +VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map INCS= libprocstat.h From owner-svn-src-stable-11@freebsd.org Mon Jan 16 00:43:58 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87D75CAFB84; Mon, 16 Jan 2017 00:43:58 +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 3E1111FF9; Mon, 16 Jan 2017 00:43:58 +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 v0G0hvk8050004; Mon, 16 Jan 2017 00:43:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0hvHT050003; Mon, 16 Jan 2017 00:43:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160043.v0G0hvHT050003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312248 - stable/11/sys/fs/pseudofs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 00:43:58 -0000 Author: kib Date: Mon Jan 16 00:43:57 2017 New Revision: 312248 URL: https://svnweb.freebsd.org/changeset/base/312248 Log: MFC r311815: Forcibly remove the cached items from pseudofs vncache on module unload. Modified: stable/11/sys/fs/pseudofs/pseudofs_vncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 00:37:26 2017 (r312247) +++ stable/11/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 00:43:57 2017 (r312248) @@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex; static struct pfs_vdata *pfs_vncache; static eventhandler_tag pfs_exit_tag; static void pfs_exit(void *arg, struct proc *p); +static void pfs_purge_locked(struct pfs_node *pn, bool force); static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0, "pseudofs vnode cache"); @@ -97,6 +98,9 @@ pfs_vncache_unload(void) { EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(NULL, true); + mtx_unlock(&pfs_vncache_mutex); KASSERT(pfs_vncache_entries == 0, ("%d vncache entries remaining", pfs_vncache_entries)); mtx_destroy(&pfs_vncache_mutex); @@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp) * used to implement the cache. */ static void -pfs_purge_locked(struct pfs_node *pn) +pfs_purge_locked(struct pfs_node *pn, bool force) { struct pfs_vdata *pvd; struct vnode *vnp; @@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn) mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { - if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { + if (force || pvd->pvd_dead || + (pn != NULL && pvd->pvd_pn == pn)) { vnp = pvd->pvd_vnode; vhold(vnp); mtx_unlock(&pfs_vncache_mutex); @@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn) { mtx_lock(&pfs_vncache_mutex); - pfs_purge_locked(pn); + pfs_purge_locked(pn, false); mtx_unlock(&pfs_vncache_mutex); } @@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; if (dead) - pfs_purge_locked(NULL); + pfs_purge_locked(NULL, false); mtx_unlock(&pfs_vncache_mutex); } From owner-svn-src-stable-11@freebsd.org Mon Jan 16 01:38:35 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8554CB1F9E; Mon, 16 Jan 2017 01:38:35 +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 C289E16E4; Mon, 16 Jan 2017 01:38:35 +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 v0G1cYO6070302; Mon, 16 Jan 2017 01:38:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G1cYM5070301; Mon, 16 Jan 2017 01:38:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701160138.v0G1cYM5070301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 16 Jan 2017 01:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312249 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 01:38:36 -0000 Author: emaste Date: Mon Jan 16 01:38:34 2017 New Revision: 312249 URL: https://svnweb.freebsd.org/changeset/base/312249 Log: newvers.sh: add options to eliminate kernel build metadata MFC r310112, r310114, r310273, r310279 r310112: newvers.sh: add option to eliminate kernel build metadata Build metadata (username, hostname, etc.) prevents the FreeBSD kernel from building reproducibly. Add an option to disable inclusion of that metadata but retain the release information and SVN/git VCS details. See https://reproducible-builds.org/ for additional background. r310114: newvers.sh: correct typo in comment r310273: newvers.sh: add -R option to include metadata only for unmodified src tree r310279: newvers.sh: consider as modified SVN mixed revision and other cases The newvers -R option is intended to include build metadata (e.g. user, host, time) if the build is from an unmodified VCS tree. For subversion it considered a trailing 'M' as an indication of a modified tree, and any other version string as modified. Also include mixed revision checkouts (e.g. 123:126), switched (123S) and partial (123P) working copies as modified: the revision number is insufficient to uniquely determine which source was used for the build. Modified: stable/11/sys/conf/newvers.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Mon Jan 16 00:43:57 2017 (r312248) +++ stable/11/sys/conf/newvers.sh Mon Jan 16 01:38:34 2017 (r312249) @@ -30,6 +30,18 @@ # @(#)newvers.sh 8.1 (Berkeley) 4/20/94 # $FreeBSD$ +# Command line options: +# +# -r Reproducible build. Do not embed directory names, user +# names, time stamps or other dynamic information into +# the output file. This is intended to allow two builds +# done at different times and even by different people on +# different hosts to produce identical output. +# +# -R Reproducible build if the tree represents an unmodified +# checkout from a version control system. Metadata is +# included if the tree is modified. + TYPE="FreeBSD" REVISION="11.0" BRANCH="STABLE" @@ -163,8 +175,16 @@ fi if [ -n "$svnversion" ] ; then svn=`cd ${SYSDIR} && $svnversion 2>/dev/null` case "$svn" in - [0-9]*) svn=" r${svn}" ;; - *) unset svn ;; + [0-9]*[MSP]|*:*) + svn=" r${svn}" + modified=true + ;; + [0-9]*) + svn=" r${svn}" + ;; + *) + unset svn + ;; esac fi @@ -196,6 +216,7 @@ if [ -n "$git_cmd" ] ; then if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" + modified=true fi fi @@ -208,7 +229,10 @@ if [ -n "$p4_cmd" ] ; then p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` case "$p4opened" in File*) ;; - //*) p4version="${p4version}+edit" ;; + //*) + p4version="${p4version}+edit" + modified=true + ;; esac ;; *) unset p4version ;; @@ -227,10 +251,32 @@ if [ -n "$hg_cmd" ] ; then fi fi +include_metadata=true +while getopts rR opt; do + case "$opt" in + r) + include_metadata= + ;; + R) + if [ -z "${modified}" ]; then + include_metadata= + fi + esac +done +shift $((OPTIND - 1)) + +if [ -z "${include_metadata}" ]; then + VERINFO="${VERSION} ${svn}${git}${hg}${p4version}" + VERSTR="${VERINFO}\\n" +else + VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" + VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" +fi + cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERINFO}" +#define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-stable-11@freebsd.org Mon Jan 16 03:48:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE91C650FB; Mon, 16 Jan 2017 03:48: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 524771A25; Mon, 16 Jan 2017 03:48: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 v0G3mqfJ023360; Mon, 16 Jan 2017 03:48:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G3mqul023357; Mon, 16 Jan 2017 03:48:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701160348.v0G3mqul023357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Jan 2017 03:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312252 - stable/11/lib/libkvm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 03:48:53 -0000 Author: pfg Date: Mon Jan 16 03:48:52 2017 New Revision: 312252 URL: https://svnweb.freebsd.org/changeset/base/312252 Log: MFC r311101: libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from: DragonflyBSD (ecc2e461) Modified: stable/11/lib/libkvm/kvm.h stable/11/lib/libkvm/kvm_getswapinfo.3 stable/11/lib/libkvm/kvm_getswapinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libkvm/kvm.h ============================================================================== --- stable/11/lib/libkvm/kvm.h Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm.h Mon Jan 16 03:48:52 2017 (r312252) @@ -66,11 +66,11 @@ struct proc; struct kvm_swap { char ksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX 0x0002 Modified: stable/11/lib/libkvm/kvm_getswapinfo.3 ============================================================================== --- stable/11/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:48:52 2017 (r312252) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fi .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El Modified: stable/11/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- stable/11/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:48:52 2017 (r312252) @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -163,7 +164,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; From owner-svn-src-stable-11@freebsd.org Mon Jan 16 06:51:59 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C003CB11E6; Mon, 16 Jan 2017 06:51:59 +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 DC62A1658; Mon, 16 Jan 2017 06:51:58 +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 v0G6pwD6099019; Mon, 16 Jan 2017 06:51:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6pvfn099017; Mon, 16 Jan 2017 06:51:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160651.v0G6pvfn099017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312254 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 06:51:59 -0000 Author: ngie Date: Mon Jan 16 06:51:57 2017 New Revision: 312254 URL: https://svnweb.freebsd.org/changeset/base/312254 Log: MFC r311759,r311760: r311759: Add a REVISION section to track changes for the FOKUS-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311760: Add a REVISION section to track changes for the BEGEMOT-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 03:52:20 2017 (r312253) +++ stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) @@ -54,6 +54,9 @@ begemot MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Begemot subtree of the fokus tree." + REVISION "200201300000Z" + DESCRIPTION + "Initial revision." ::= { fokus 1 } END Modified: stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 03:52:20 2017 (r312253) +++ stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) @@ -52,6 +52,9 @@ fokus MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Fokus enterprises tree." + REVISION "200202050000Z" + DESCRIPTION + "Initial revision." ::= { enterprises 12325 } END From owner-svn-src-stable-11@freebsd.org Mon Jan 16 06:54:00 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A260CB14BD; Mon, 16 Jan 2017 06:54:00 +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 B2F8E1BD9; Mon, 16 Jan 2017 06:53:59 +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 v0G6rw6D099421; Mon, 16 Jan 2017 06:53:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6rwud099419; Mon, 16 Jan 2017 06:53:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160653.v0G6rwud099419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312256 - in stable/11/usr.sbin/bsnmpd/modules: snmp_hostres snmp_netgraph X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 06:54:00 -0000 Author: ngie Date: Mon Jan 16 06:53:58 2017 New Revision: 312256 URL: https://svnweb.freebsd.org/changeset/base/312256 Log: MFC r311741,r311761: r311741: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311761: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:53:02 2017 (r312255) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:53:58 2017 (r312256) @@ -54,6 +54,9 @@ begemotHostres MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for additional HOST-RESOURCES data." + REVISION "200601030000Z" + DESCRIPTION + "Initial revision." ::= { begemot 202 } begemotHostresObjects OBJECT IDENTIFIER ::= { begemotHostres 1 } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:53:02 2017 (r312255) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:53:58 2017 (r312256) @@ -59,6 +59,19 @@ begemotNg MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for the NetGraph access module for SNMP." + REVISION "200311140000Z" + DESCRIPTION + "The maximum width of the following OCTET STRINGs was increased + from 15 to 31: + + - NgTypeName + - NgNodeName + - NgNodeNameOrEmpty + - NgHookName + " + REVISION "200201310000Z" + DESCRIPTION + "Initial revision." ::= { begemot 2 } begemotNgObjects OBJECT IDENTIFIER ::= { begemotNg 1 } From owner-svn-src-stable-11@freebsd.org Mon Jan 16 06:55:12 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9E0CB15C7; Mon, 16 Jan 2017 06:55:12 +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 6C1E01EA0; Mon, 16 Jan 2017 06:55:12 +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 v0G6tBhZ099621; Mon, 16 Jan 2017 06:55:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6tBba099620; Mon, 16 Jan 2017 06:55:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160655.v0G6tBba099620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312258 - stable/11/usr.sbin/bsnmpd/modules/snmp_atm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 06:55:12 -0000 Author: ngie Date: Mon Jan 16 06:55:11 2017 New Revision: 312258 URL: https://svnweb.freebsd.org/changeset/base/312258 Log: MFC r311758: Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:54:07 2017 (r312257) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:55:11 2017 (r312258) @@ -56,7 +56,9 @@ begemotAtmFreeBSDGroup MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The FreeBSD specific Begemot MIB for ATM interfaces." - + REVISION "200408060000Z" + DESCRIPTION + "Initial revision." ::= { begemotAtmSysGroup 1 } -- Netgraph From owner-svn-src-stable-11@freebsd.org Mon Jan 16 06:56:03 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C78CB1709; Mon, 16 Jan 2017 06:56:03 +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 49CCF1161; Mon, 16 Jan 2017 06:56:03 +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 v0G6u2u4099784; Mon, 16 Jan 2017 06:56:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6u2sw099783; Mon, 16 Jan 2017 06:56:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160656.v0G6u2sw099783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312260 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 06:56:03 -0000 Author: ngie Date: Mon Jan 16 06:56:02 2017 New Revision: 312260 URL: https://svnweb.freebsd.org/changeset/base/312260 Log: MFC r311742: Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:55:19 2017 (r312259) +++ stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:56:02 2017 (r312260) @@ -54,6 +54,9 @@ begemotIp MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for IP stuff that is not in the official IP MIBs." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemot 3 } begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 } From owner-svn-src-stable-11@freebsd.org Mon Jan 16 06:57:54 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D735CB1829; Mon, 16 Jan 2017 06:57:54 +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 E66BC14B8; Mon, 16 Jan 2017 06:57:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G6vrc5099969; Mon, 16 Jan 2017 06:57:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6vrIN099967; Mon, 16 Jan 2017 06:57:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160657.v0G6vrIN099967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312262 - in stable/11/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 06:57:54 -0000 Author: ngie Date: Mon Jan 16 06:57:52 2017 New Revision: 312262 URL: https://svnweb.freebsd.org/changeset/base/312262 Log: MFC r311740: Improve the smilint target in the hostres and mibII modules - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:56:12 2017 (r312261) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:57:52 2017 (r312262) @@ -76,6 +76,7 @@ LIBADD= kvm devinfo m geom memstat printcap.pico: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:56:12 2017 (r312261) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:57:52 2017 (r312262) @@ -22,6 +22,7 @@ BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-M .include -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${BMIBS:C/^/${CONTRIB}\/snmp_mibII\//} + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-stable-11@freebsd.org Mon Jan 16 07:03:34 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E16CB1B6F; Mon, 16 Jan 2017 07:03:34 +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 C5C7A1B55; Mon, 16 Jan 2017 07:03:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G73YY0004142; Mon, 16 Jan 2017 07:03:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G73XSk004137; Mon, 16 Jan 2017 07:03:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160703.v0G73XSk004137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312264 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 07:03:35 -0000 Author: ngie Date: Mon Jan 16 07:03:33 2017 New Revision: 312264 URL: https://svnweb.freebsd.org/changeset/base/312264 Log: MFC r310655: Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used as the listening address in snmpd_input(..) Stash the IPv4 address of the receiver via the recv(..) callback and use it in the send(..) callback for the transport by specifying IP_SENDSRCADDR for the control message type. Add sendmsg logic to the UDP transport's send(..) callback and use the respective send(..) callback for the transport instead of calling sendto in snmpd_input(..). Obtained from: Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595) Modified: stable/11/contrib/bsnmp/snmpd/main.c stable/11/contrib/bsnmp/snmpd/snmpd.h stable/11/contrib/bsnmp/snmpd/trans_lsock.c stable/11/contrib/bsnmp/snmpd/trans_udp.c stable/11/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/main.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/main.c Mon Jan 16 07:03:33 2017 (r312264) @@ -1040,10 +1040,8 @@ snmpd_input(struct port_input *pi, struc #ifdef USE_TCPWRAPPERS char client[16]; #endif - struct msghdr msg; - struct iovec iov[1]; - ret = tport->transport->vtab->recv(pi); + ret = tport->transport->vtab->recv(tport, pi); if (ret == -1) return (-1); @@ -1186,21 +1184,15 @@ snmpd_input(struct port_input *pi, struc sndbuf, &sndlen, "SNMP", ierr, vi, NULL); if (ferr == SNMPD_INPUT_OK) { - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_flags = 0; - iov[0].iov_base = sndbuf; - iov[0].iov_len = sndlen; - - slen = sendmsg(pi->fd, &msg, 0); + slen = tport->transport->vtab->send(tport, sndbuf, sndlen, + pi->peer, pi->peerlen); if (slen == -1) - syslog(LOG_ERR, "sendmsg: %m"); + syslog(LOG_ERR, "send*: %m"); else if ((size_t)slen != sndlen) - syslog(LOG_ERR, "sendmsg: short write %zu/%zu", - sndlen, (size_t)slen); + syslog(LOG_ERR, "send*: short write %zu/%zu", sndlen, + (size_t)slen); } + snmp_pdu_free(&pdu); free(sndbuf); snmp_input_consume(pi); Modified: stable/11/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 07:03:33 2017 (r312264) @@ -193,7 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); - ssize_t (*recv)(struct port_input *); + ssize_t (*recv)(struct tport *, struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 07:03:33 2017 (r312264) @@ -59,7 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t lsock_recv(struct port_input *); +static ssize_t lsock_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -439,7 +439,7 @@ check_priv_stream(struct port_input *pi) * Receive something */ static ssize_t -lsock_recv(struct port_input *pi) +lsock_recv(struct tport *tp __unused, struct port_input *pi) { struct msghdr msg; struct iovec iov[1]; Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:03:33 2017 (r312264) @@ -55,7 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t udp_recv(struct port_input *); +static ssize_t udp_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -217,8 +217,30 @@ udp_send(struct tport *tp, const u_char const struct sockaddr *addr, size_t addrlen) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsg; + struct in_addr *src_addr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct iovec iov; - return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); + iov.iov_base = __DECONST(void*, buf); + iov.iov_len = len; + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_name = __DECONST(void *, addr); + msg.msg_namelen = addrlen; + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); + memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + + return (sendmsg(p->input.fd, &msg, 0)); } static void @@ -309,8 +331,9 @@ recv_dgram(struct port_input *pi, struct * Receive something */ static ssize_t -udp_recv(struct port_input *pi) +udp_recv(struct tport *tp, struct port_input *pi) { + struct udp_port *p = (struct udp_port *)tp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; @@ -330,6 +353,8 @@ udp_recv(struct port_input *pi) ret = recv_dgram(pi, laddr); + memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); + if (laddr->s_addr == INADDR_ANY) { msg.msg_control = NULL; msg.msg_controllen = 0; Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 07:03:33 2017 (r312264) @@ -39,6 +39,7 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ + struct in_addr recv_addr; /* the address the request was sent to */ }; /* argument for open call */ From owner-svn-src-stable-11@freebsd.org Mon Jan 16 07:08:07 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FC6CB1D89; Mon, 16 Jan 2017 07:08:07 +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 A63211011; Mon, 16 Jan 2017 07:08: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 v0G786Sj004549; Mon, 16 Jan 2017 07:08:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G786Io004548; Mon, 16 Jan 2017 07:08:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160708.v0G786Io004548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312267 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 07:08:08 -0000 Author: ngie Date: Mon Jan 16 07:08:06 2017 New Revision: 312267 URL: https://svnweb.freebsd.org/changeset/base/312267 Log: MFC r310656,r311221: r310656: style(9): sort alignment in udp_recv(..) r311221: Initialize msg.msg_flags to 0 This mutes a valid coverity warning about it being uninitialized when passed in to sendmsg(2). CID: 1368202 Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:07:45 2017 (r312266) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:08:06 2017 (r312267) @@ -226,6 +226,7 @@ udp_send(struct tport *tp, const u_char iov.iov_base = __DECONST(void*, buf); iov.iov_len = len; + msg.msg_flags = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); @@ -334,10 +335,10 @@ static ssize_t udp_recv(struct tport *tp, struct port_input *pi) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsgp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; ssize_t ret; memset(cbuf, 0, sizeof(cbuf)); From owner-svn-src-stable-11@freebsd.org Mon Jan 16 07:10:43 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FC1CB1E6C; Mon, 16 Jan 2017 07:10:43 +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 8D80C1237; Mon, 16 Jan 2017 07:10:43 +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 v0G7Agvj004734; Mon, 16 Jan 2017 07:10:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7Ag5i004730; Mon, 16 Jan 2017 07:10:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160710.v0G7Ag5i004730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312268 - in stable/11: . secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 07:10:43 -0000 Author: ngie Date: Mon Jan 16 07:10:42 2017 New Revision: 312268 URL: https://svnweb.freebsd.org/changeset/base/312268 Log: MFC r311140: Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and MK_KERBEROS_SUPPORT != no This fixes the odd case where someone specified MK_GSSAPI=no and MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense, but the build system doesn't prevent this case today, and it didn't when I filed the bug back in 2011 either). PR: 159745 Modified: stable/11/Makefile.inc1 stable/11/secure/lib/libssh/Makefile stable/11/secure/usr.bin/ssh/Makefile stable/11/secure/usr.sbin/sshd/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/Makefile.inc1 Mon Jan 16 07:10:42 2017 (r312268) @@ -2099,7 +2099,7 @@ secure/lib/libssh__L: lib/libz__L secure .if ${MK_LDNS} != "no" secure/lib/libssh__L: lib/libldns__L .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ lib/libmd__L kerberos5/lib/libroken__L Modified: stable/11/secure/lib/libssh/Makefile ============================================================================== --- stable/11/secure/lib/libssh/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/lib/libssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -46,7 +46,7 @@ LIBADD+= ldns CFLAGS+= -I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h .endif Modified: stable/11/secure/usr.bin/ssh/Makefile ============================================================================== --- stable/11/secure/usr.bin/ssh/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/usr.bin/ssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -23,7 +23,7 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi Modified: stable/11/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/11/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -47,7 +47,7 @@ LIBADD+= blacklist LDFLAGS+=-L${LIBBLACKLISTDIR} .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 From owner-svn-src-stable-11@freebsd.org Mon Jan 16 07:11:48 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA4FCB1FCE; Mon, 16 Jan 2017 07:11:48 +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 689DC1819; Mon, 16 Jan 2017 07:11:48 +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 v0G7Blsd005724; Mon, 16 Jan 2017 07:11:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7Bli4005723; Mon, 16 Jan 2017 07:11:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160711.v0G7Bli4005723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312271 - stable/11/usr.sbin/fstyp/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 07:11:48 -0000 Author: ngie Date: Mon Jan 16 07:11:47 2017 New Revision: 312271 URL: https://svnweb.freebsd.org/changeset/base/312271 Log: MFC r312009: Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace Modified: stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:11:37 2017 (r312270) +++ stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:11:47 2017 (r312271) @@ -1,3 +1,29 @@ +#!/bin/sh +# +# Copyright (c) 2015 Alan Somers +# 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$ atf_test_case cd9660 @@ -9,7 +35,7 @@ cd9660_body() { atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img atf_check -s exit:0 -o inline:"cd9660\n" fstyp -l cd9660.img -} +} atf_test_case cd9660_label cd9660_label_head() { @@ -21,7 +47,7 @@ cd9660_label_body() { atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img # Note: cd9660 labels are always upper case atf_check -s exit:0 -o inline:"cd9660 FOO\n" fstyp -l cd9660.img -} +} atf_test_case dir dir_head() { @@ -177,7 +203,7 @@ ufs2_label_body() { atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img -} +} atf_test_case ufs_on_device cleanup ufs_on_device_head() { From owner-svn-src-stable-11@freebsd.org Mon Jan 16 07:15:16 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD27CB215D; Mon, 16 Jan 2017 07:15:16 +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 E30ED1AE6; Mon, 16 Jan 2017 07:15:15 +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 v0G7FFGG008852; Mon, 16 Jan 2017 07:15:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7FFLd008851; Mon, 16 Jan 2017 07:15:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160715.v0G7FFLd008851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312272 - stable/11/share/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 07:15:16 -0000 Author: ngie Date: Mon Jan 16 07:15:14 2017 New Revision: 312272 URL: https://svnweb.freebsd.org/changeset/base/312272 Log: MFC r311133: Move the "MK_* options..." section before the "... MK_*_SUPPORT..." section For the case that someone set WITHOUT_GSSAPI=, now WITHOUT_KERBEROS_SUPPORT will be properly set. This will likely fix the issue for the default case noted in the PR I filed back in 2011. I am trying to fix the less obvious case documented in the PR still. PR: 159745 Modified: stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Jan 16 07:11:47 2017 (r312271) +++ stable/11/share/mk/src.opts.mk Mon Jan 16 07:15:14 2017 (r312272) @@ -375,6 +375,21 @@ MK_CLANG_FULL:= no .endif # +# MK_* options whose default value depends on another option. +# +.for vv in \ + GSSAPI/KERBEROS \ + MAN_UTILS/MAN +.if defined(WITH_${vv:H}) +MK_${vv:H}:= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}:= no +.else +MK_${vv:H}:= ${MK_${vv:T}} +.endif +.endfor + +# # Set defaults for the MK_*_SUPPORT variables. # @@ -401,21 +416,6 @@ MK_${var}_SUPPORT:= yes .endif .endfor -# -# MK_* options whose default value depends on another option. -# -.for vv in \ - GSSAPI/KERBEROS \ - MAN_UTILS/MAN -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - .if !${COMPILER_FEATURES:Mc++11} MK_LLDB:= no .endif From owner-svn-src-stable-11@freebsd.org Mon Jan 16 09:16:12 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8878CB25DB; Mon, 16 Jan 2017 09:16:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 97CE41797; Mon, 16 Jan 2017 09:16:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G9GBXB057289; Mon, 16 Jan 2017 09:16:11 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G9GB94057288; Mon, 16 Jan 2017 09:16:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201701160916.v0G9GB94057288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 16 Jan 2017 09:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312279 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 09:16:12 -0000 Author: smh Date: Mon Jan 16 09:16:11 2017 New Revision: 312279 URL: https://svnweb.freebsd.org/changeset/base/312279 Log: MFC r311769: Fix rstat: symbol not in namelist from netstat Sponsored by: Multiplay Modified: stable/11/usr.bin/netstat/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/main.c ============================================================================== --- stable/11/usr.bin/netstat/main.c Mon Jan 16 09:12:40 2017 (r312278) +++ stable/11/usr.bin/netstat/main.c Mon Jan 16 09:16:11 2017 (r312279) @@ -427,6 +427,9 @@ main(int argc, char *argv[]) if (xflag && Tflag) xo_errx(1, "-x and -T are incompatible, pick one."); + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (Bflag) { if (!live) usage(); @@ -507,9 +510,6 @@ main(int argc, char *argv[]) exit(0); } - /* Load all necessary kvm symbols */ - kresolve_list(nl); - if (tp) { xo_open_container("statistics"); printproto(tp, tp->pr_name, &first); From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:29:05 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6260CB2759; Tue, 17 Jan 2017 01:29:05 +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 90A6518DF; Tue, 17 Jan 2017 01:29:05 +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 v0H1T4gZ062900; Tue, 17 Jan 2017 01:29:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1T3oj062885; Tue, 17 Jan 2017 01:29:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701170129.v0H1T3oj062885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Jan 2017 01:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312318 - in stable/11/sys/boot: common efi/loader i386/loader mips/beri/loader ofw/common pc98/loader powerpc/kboot powerpc/ps3 sparc64/loader uboot/common userboot/userboot X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:29:05 -0000 Author: emaste Date: Tue Jan 17 01:29:03 2017 New Revision: 312318 URL: https://svnweb.freebsd.org/changeset/base/312318 Log: MFC r310225: Reduce boot loader version string duplication Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c Modified: stable/11/sys/boot/common/interp_forth.c stable/11/sys/boot/common/newvers.sh stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/i386/loader/main.c stable/11/sys/boot/mips/beri/loader/loader.h stable/11/sys/boot/mips/beri/loader/main.c stable/11/sys/boot/ofw/common/main.c stable/11/sys/boot/pc98/loader/main.c stable/11/sys/boot/powerpc/kboot/main.c stable/11/sys/boot/powerpc/ps3/main.c stable/11/sys/boot/sparc64/loader/main.c stable/11/sys/boot/uboot/common/main.c stable/11/sys/boot/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/interp_forth.c ============================================================================== --- stable/11/sys/boot/common/interp_forth.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/common/interp_forth.c Tue Jan 17 01:29:03 2017 (r312318) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "ficl.h" -extern char bootprog_rev[]; +extern unsigned bootprog_rev; /* #define BFORTH_DEBUG */ @@ -278,8 +278,7 @@ bf_init(const char *rc) /* Export some version numbers so that code can detect the loader/host version */ ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); - ficlSetEnv(bf_sys, "loader_version", - (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0')); + ficlSetEnv(bf_sys, "loader_version", bootprog_rev); pInterp = ficlLookup(bf_sys, "interpret"); Modified: stable/11/sys/boot/common/newvers.sh ============================================================================== --- stable/11/sys/boot/common/newvers.sh Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/common/newvers.sh Tue Jan 17 01:29:03 2017 (r312318) @@ -40,8 +40,6 @@ u=${USER-root} h=${HOSTNAME-`hostname`} #r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` -echo "char bootprog_name[] = \"FreeBSD/${3} ${2}\";" > $tempfile -echo "char bootprog_rev[] = \"${r}\";" >> $tempfile -echo "char bootprog_date[] = \"${t}\";" >> $tempfile -echo "char bootprog_maker[] = \"${u}@${h}\";" >> $tempfile +echo "char bootprog_info[] = \"FreeBSD/${3} ${2}, Revision ${r}\\n(${t} ${u}@${h})\\n\";" > $tempfile +echo "unsigned bootprog_rev = ${r%%.*}${r##*.};" >> $tempfile mv $tempfile vers.c Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/efi/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; struct arch_switch archsw; /* MI/MD interface boundary */ @@ -387,9 +384,7 @@ main(int argc, CHAR16 *argv[]) printf("EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); /* * Disable the watchdog timer. By default the boot manager sets Modified: stable/11/sys/boot/i386/loader/main.c ============================================================================== --- stable/11/sys/boot/i386/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/i386/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -77,7 +77,7 @@ static void i386_zfs_probe(void); #endif /* from vers.c */ -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; /* XXX debugging */ extern char end[]; @@ -215,9 +215,7 @@ main(void) /* detect PCI BIOS for future reference */ biospci_detect(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ Modified: stable/11/sys/boot/mips/beri/loader/loader.h ============================================================================== --- stable/11/sys/boot/mips/beri/loader/loader.h Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/mips/beri/loader/loader.h Tue Jan 17 01:29:03 2017 (r312318) @@ -58,7 +58,6 @@ extern struct bootinfo boot2_bootinfo; int md_load64(char *args, vm_offset_t *modulep); /* vers.c */ -extern char bootprog_name[], bootprog_rev[]; -extern char bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; #endif /* !_BOOT_LOADER_H_ */ Modified: stable/11/sys/boot/mips/beri/loader/main.c ============================================================================== --- stable/11/sys/boot/mips/beri/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/mips/beri/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -144,9 +144,7 @@ main(int argc, char *argv[], char *envv[ } extract_currdev(bootinfop); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); #if 0 printf("bootpath=\"%s\"\n", bootpath); #endif Modified: stable/11/sys/boot/ofw/common/main.c ============================================================================== --- stable/11/sys/boot/ofw/common/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/ofw/common/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -36,10 +36,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; u_int32_t acells, scells; @@ -127,9 +124,7 @@ main(int (*openfirm)(void *)) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("Memory: %lldKB\n", memsize() / 1024); OF_getprop(chosen, "bootpath", bootpath, 64); Modified: stable/11/sys/boot/pc98/loader/main.c ============================================================================== --- stable/11/sys/boot/pc98/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/pc98/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -66,7 +66,7 @@ static void isa_outb(int port, int valu void exit(int code); /* from vers.c */ -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; /* XXX debugging */ extern char end[]; @@ -186,9 +186,7 @@ main(void) initial_bootinfo->bi_extmem = bios_extmem / 1024; } - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ Modified: stable/11/sys/boot/powerpc/kboot/main.c ============================================================================== --- stable/11/sys/boot/powerpc/kboot/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/powerpc/kboot/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -38,10 +38,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; int kboot_getdev(void **vdev, const char *devspec, const char **path); ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -119,9 +116,7 @@ main(int argc, const char **argv) archsw.arch_autoload = kboot_autoload; archsw.arch_loadaddr = kboot_loadaddr; - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); setenv("currdev", bootdev, 1); setenv("loaddev", bootdev, 1); Modified: stable/11/sys/boot/powerpc/ps3/main.c ============================================================================== --- stable/11/sys/boot/powerpc/ps3/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/powerpc/ps3/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -41,10 +41,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; int ps3_getdev(void **vdev, const char *devspec, const char **path); ssize_t ps3_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -133,9 +130,7 @@ main(void) archsw.arch_readin = ps3_readin; archsw.arch_autoload = ps3_autoload; - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("Memory: %lldKB\n", maxmem / 1024); env_setenv("currdev", EV_VOLATILE, ps3_fmtdev(&currdev), Modified: stable/11/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/11/sys/boot/sparc64/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/sparc64/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; enum { HEAPVA = 0x800000, @@ -891,9 +891,7 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("bootpath=\"%s\"\n", bootpath); /* Give control to the machine independent loader code. */ Modified: stable/11/sys/boot/uboot/common/main.c ============================================================================== --- stable/11/sys/boot/uboot/common/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/uboot/common/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -62,10 +62,7 @@ struct device_type { }; extern char end[]; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -431,9 +428,7 @@ main(int argc, char **argv) cons_probe(); printf("Compatible U-Boot API signature found @%p\n", sig); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("\n"); dump_sig(sig); Modified: stable/11/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/11/sys/boot/userboot/userboot/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/userboot/userboot/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -51,10 +51,7 @@ static int userboot_zfs_found; struct loader_callbacks *callbacks; void *callbacks_arg; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */ @@ -101,9 +98,7 @@ loader_main(struct loader_callbacks *cb, */ cons_probe(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); #if 0 printf("Memory: %ld k\n", memsize() / 1024); #endif From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:52:59 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514E3CB392C; Tue, 17 Jan 2017 01:52:59 +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 20A7F19CB; Tue, 17 Jan 2017 01:52:59 +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 v0H1qwMZ074687; Tue, 17 Jan 2017 01:52:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1qwsL074686; Tue, 17 Jan 2017 01:52:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170152.v0H1qwsL074686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312319 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:52:59 -0000 Author: ngie Date: Tue Jan 17 01:52:58 2017 New Revision: 312319 URL: https://svnweb.freebsd.org/changeset/base/312319 Log: MFC r312112: Fix -Wunused on gcc 4.9 (x was set but not used) Modified: stable/11/sys/kern/subr_unit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_unit.c ============================================================================== --- stable/11/sys/kern/subr_unit.c Tue Jan 17 01:29:03 2017 (r312318) +++ stable/11/sys/kern/subr_unit.c Tue Jan 17 01:52:58 2017 (r312319) @@ -986,7 +986,7 @@ main(int argc, char **argv) long count = 10000; /* Number of unrs to test */ long reps = 1, m; int ch; - u_int i, x, j; + u_int i, j; verbose = false; @@ -999,7 +999,7 @@ main(int argc, char **argv) usage(argv); exit(2); } - + break; case 'v': verbose = true; @@ -1026,7 +1026,6 @@ main(int argc, char **argv) printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); printf("NBITS %lu\n", (unsigned long)NBITS); - x = 1; for (m = 0; m < count * reps; m++) { j = random(); i = (j >> 1) % count; From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:55:15 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 657E8CB3AB7; Tue, 17 Jan 2017 01:55:15 +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 372E11D54; Tue, 17 Jan 2017 01:55:15 +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 v0H1tEs5074944; Tue, 17 Jan 2017 01:55:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1tEhb074943; Tue, 17 Jan 2017 01:55:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170155.v0H1tEhb074943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312321 - stable/11/tests/sys/kern/execve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:55:15 -0000 Author: ngie Date: Tue Jan 17 01:55:14 2017 New Revision: 312321 URL: https://svnweb.freebsd.org/changeset/base/312321 Log: MFC r312118,r312121: r312118: Fix -Wformat issue with zero-length format string passed to err(3) Tested with: clang, gcc 4.2.1, gcc 4.9 r312121: Follow up to r312118 State that execve failed instead of just printing out the program name and strerror(errno) via err(3). Modified: stable/11/tests/sys/kern/execve/execve_helper.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/execve/execve_helper.c ============================================================================== --- stable/11/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:55:05 2017 (r312320) +++ stable/11/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:55:14 2017 (r312321) @@ -50,5 +50,5 @@ main(int argc, char **argv) } execve(argv[1], &argv[1], NULL); - err(1, ""); + err(1, "execve failed"); } From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:56:45 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4470CB3C83; Tue, 17 Jan 2017 01:56: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 9131A107A; Tue, 17 Jan 2017 01:56:45 +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 v0H1uiMi075083; Tue, 17 Jan 2017 01:56:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1uiRs075082; Tue, 17 Jan 2017 01:56:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170156.v0H1uiRs075082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312322 - stable/11/tests/sys/file X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:56:45 -0000 Author: ngie Date: Tue Jan 17 01:56:44 2017 New Revision: 312322 URL: https://svnweb.freebsd.org/changeset/base/312322 Log: MFC r312111: Remove unused vars to fix -Wunused issues Modified: stable/11/tests/sys/file/ftruncate_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/file/ftruncate_test.c ============================================================================== --- stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:55:14 2017 (r312321) +++ stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:44 2017 (r312322) @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, static int lengths_count = sizeof(lengths) / sizeof(off_t); int -main(int argc, char *argv[]) +main(void) { int error, fd, fds[2], i, read_only_fd; char path[PATH_MAX]; From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:59:00 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0C6FCB3E60; Tue, 17 Jan 2017 01:59:00 +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 685A815CF; Tue, 17 Jan 2017 01:59:00 +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 v0H1wxBg075406; Tue, 17 Jan 2017 01:58:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1wxlc075405; Tue, 17 Jan 2017 01:58:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170158.v0H1wxlc075405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312326 - stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:59:00 -0000 Author: ngie Date: Tue Jan 17 01:58:59 2017 New Revision: 312326 URL: https://svnweb.freebsd.org/changeset/base/312326 Log: MFC r312122: Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind This should have been pruned in r305358 Deleted: stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-11@freebsd.org Tue Jan 17 01:59:43 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D0EDCB3F25; Tue, 17 Jan 2017 01:59:43 +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 4F7B71848; Tue, 17 Jan 2017 01:59:43 +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 v0H1xgQn075511; Tue, 17 Jan 2017 01:59:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1xgfb075510; Tue, 17 Jan 2017 01:59:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170159.v0H1xgfb075510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312327 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 01:59:43 -0000 Author: ngie Date: Tue Jan 17 01:59:42 2017 New Revision: 312327 URL: https://svnweb.freebsd.org/changeset/base/312327 Log: MFC r312113: Clean up trailing whitespace Modified: stable/11/sys/kern/subr_unit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_unit.c ============================================================================== --- stable/11/sys/kern/subr_unit.c Tue Jan 17 01:58:59 2017 (r312326) +++ stable/11/sys/kern/subr_unit.c Tue Jan 17 01:59:42 2017 (r312327) @@ -216,7 +216,7 @@ ub_full(struct unrb *ub, int len) * Consistency check function. * * Checks the internal consistency as well as we can. - * + * * Called at all boundaries of this API. */ static void @@ -240,7 +240,7 @@ check_unrhdr(struct unrhdr *uh, int line w = 0; bit_count(ub->map, 0, up->len, &w); y += w; - } else if (up->ptr != NULL) + } else if (up->ptr != NULL) y += up->len; } KASSERT (y == uh->busy, @@ -375,7 +375,7 @@ is_bitmap(struct unrhdr *uh, struct unr /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. - * + * * Return (1) if a sequence was found to indicate that another call * might be able to do more. Return (0) if we found no suitable sequence. * @@ -591,7 +591,7 @@ alloc_unrl(struct unrhdr *uh) } /* - * We can always allocate from the first list element, so if we have + * We can always allocate from the first list element, so if we have * nothing on the list, we must have run out of unit numbers. */ if (up == NULL) @@ -803,7 +803,7 @@ free_unrl(struct unrhdr *uh, u_int item, /* Handle bitmap items */ if (is_bitmap(uh, up)) { ub = up->ptr; - + KASSERT(bit_test(ub->map, item) != 0, ("UNR: Freeing free item %d (bitmap)\n", item)); bit_clear(ub->map, item); @@ -909,7 +909,7 @@ print_unr(struct unrhdr *uh, struct unr for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) printf("#"); - else + else printf(" "); } printf("]\n"); From owner-svn-src-stable-11@freebsd.org Tue Jan 17 07:11:48 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D98CB385B; Tue, 17 Jan 2017 07:11:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D511848; Tue, 17 Jan 2017 07:11:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0H7BlVR004610; Tue, 17 Jan 2017 07:11:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H7BlGf004606; Tue, 17 Jan 2017 07:11:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701170711.v0H7BlGf004606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 17 Jan 2017 07:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312336 - in stable/11: share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef tools/tools/locale/etc tools/tools/locale/etc/final-maps X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 07:11:48 -0000 Author: bapt Date: Tue Jan 17 07:11:46 2017 New Revision: 312336 URL: https://svnweb.freebsd.org/changeset/base/312336 Log: MFC r310201: Update locales cldr to v30.0.3 and unicode to 9.0.0 Relnotes: yes Added: stable/11/share/colldef/fr_CA.UTF-8.src - copied unchanged from r310201, head/share/colldef/fr_CA.UTF-8.src stable/11/share/colldef/ja_JP.eucJP.src - copied unchanged from r310201, head/share/colldef/ja_JP.eucJP.src stable/11/share/colldef/nn_NO.ISO8859-1.src - copied unchanged from r310201, head/share/colldef/nn_NO.ISO8859-1.src stable/11/share/colldef/nn_NO.ISO8859-15.src - copied unchanged from r310201, head/share/colldef/nn_NO.ISO8859-15.src stable/11/share/colldef/nn_NO.UTF-8.src - copied unchanged from r310201, head/share/colldef/nn_NO.UTF-8.src stable/11/share/colldef/sr_RS.ISO8859-2.src - copied unchanged from r310201, head/share/colldef/sr_RS.ISO8859-2.src stable/11/share/colldef/sr_RS.ISO8859-5.src - copied unchanged from r310201, head/share/colldef/sr_RS.ISO8859-5.src stable/11/share/colldef/sr_RS.UTF-8.src - copied unchanged from r310201, head/share/colldef/sr_RS.UTF-8.src stable/11/share/colldef/sr_RS.UTF-8@latin.src - copied unchanged from r310201, head/share/colldef/sr_RS.UTF-8@latin.src stable/11/share/colldef/zh_CN.GB18030.src - copied unchanged from r310201, head/share/colldef/zh_CN.GB18030.src stable/11/share/colldef/zh_CN.GBK.src - copied unchanged from r310201, head/share/colldef/zh_CN.GBK.src stable/11/share/colldef/zh_TW.Big5.src - copied unchanged from r310201, head/share/colldef/zh_TW.Big5.src stable/11/share/ctypedef/ja_JP.eucJP.src - copied unchanged from r310201, head/share/ctypedef/ja_JP.eucJP.src stable/11/share/ctypedef/zh_CN.eucCN.src - copied unchanged from r310201, head/share/ctypedef/zh_CN.eucCN.src stable/11/share/monetdef/nl_BE.UTF-8.src - copied unchanged from r310201, head/share/monetdef/nl_BE.UTF-8.src stable/11/tools/tools/locale/etc/final-maps/map.CP949 - copied unchanged from r310201, head/tools/tools/locale/etc/final-maps/map.CP949 Deleted: stable/11/share/colldef/hr_HR.UTF-8.src stable/11/share/colldef/nb_NO.UTF-8.src stable/11/share/ctypedef/ja_JP.SJIS.src stable/11/share/ctypedef/zh_CN.GB18030.src stable/11/share/monetdef/be_BY.CP1251.src stable/11/share/monetdef/lv_LV.ISO8859-13.src stable/11/share/monetdef/lv_LV.UTF-8.src stable/11/share/monetdef/ru_RU.CP1251.src stable/11/share/msgdef/he_IL.UTF-8.src stable/11/share/numericdef/hy_AM.UTF-8.src Modified: stable/11/share/colldef/Makefile stable/11/share/colldef/af_ZA.UTF-8.src stable/11/share/colldef/am_ET.UTF-8.src stable/11/share/colldef/ar_SA.UTF-8.src stable/11/share/colldef/be_BY.UTF-8.src stable/11/share/colldef/ca_AD.UTF-8.src stable/11/share/colldef/cs_CZ.ISO8859-2.src stable/11/share/colldef/cs_CZ.UTF-8.src stable/11/share/colldef/da_DK.ISO8859-1.src stable/11/share/colldef/da_DK.ISO8859-15.src stable/11/share/colldef/da_DK.UTF-8.src stable/11/share/colldef/el_GR.UTF-8.src stable/11/share/colldef/en_US.UTF-8.src stable/11/share/colldef/es_MX.UTF-8.src stable/11/share/colldef/et_EE.UTF-8.src stable/11/share/colldef/fi_FI.UTF-8.src stable/11/share/colldef/he_IL.UTF-8.src stable/11/share/colldef/hi_IN.UTF-8.src stable/11/share/colldef/hr_HR.ISO8859-2.src stable/11/share/colldef/hu_HU.ISO8859-2.src stable/11/share/colldef/hu_HU.UTF-8.src stable/11/share/colldef/hy_AM.UTF-8.src stable/11/share/colldef/is_IS.UTF-8.src stable/11/share/colldef/ja_JP.UTF-8.src stable/11/share/colldef/kk_KZ.UTF-8.src stable/11/share/colldef/ko_KR.UTF-8.src stable/11/share/colldef/lt_LT.UTF-8.src stable/11/share/colldef/lv_LV.UTF-8.src stable/11/share/colldef/nb_NO.ISO8859-1.src stable/11/share/colldef/nb_NO.ISO8859-15.src stable/11/share/colldef/pl_PL.UTF-8.src stable/11/share/colldef/ro_RO.UTF-8.src stable/11/share/colldef/ru_RU.UTF-8.src stable/11/share/colldef/se_NO.UTF-8.src stable/11/share/colldef/sk_SK.ISO8859-2.src stable/11/share/colldef/sk_SK.UTF-8.src stable/11/share/colldef/sl_SI.UTF-8.src stable/11/share/colldef/sv_SE.UTF-8.src stable/11/share/colldef/tr_TR.UTF-8.src stable/11/share/colldef/uk_UA.UTF-8.src stable/11/share/colldef/zh_CN.GB2312.src stable/11/share/colldef/zh_CN.UTF-8.src stable/11/share/colldef/zh_CN.eucCN.src stable/11/share/colldef/zh_TW.UTF-8.src stable/11/share/ctypedef/Makefile stable/11/share/ctypedef/be_BY.CP1131.src stable/11/share/ctypedef/ca_IT.ISO8859-1.src stable/11/share/ctypedef/en_US.ISO8859-1.src stable/11/share/ctypedef/en_US.UTF-8.src stable/11/share/ctypedef/hi_IN.ISCII-DEV.src stable/11/share/ctypedef/uk_UA.CP1251.src stable/11/share/monetdef/Makefile stable/11/share/monetdef/ar_AE.UTF-8.src stable/11/share/monetdef/ar_EG.UTF-8.src stable/11/share/monetdef/ar_JO.UTF-8.src stable/11/share/monetdef/ar_QA.UTF-8.src stable/11/share/monetdef/ar_SA.UTF-8.src stable/11/share/monetdef/be_BY.CP1131.src stable/11/share/monetdef/be_BY.ISO8859-5.src stable/11/share/monetdef/be_BY.UTF-8.src stable/11/share/monetdef/bg_BG.CP1251.src stable/11/share/monetdef/bg_BG.UTF-8.src stable/11/share/monetdef/es_AR.UTF-8.src stable/11/share/monetdef/es_CR.UTF-8.src stable/11/share/monetdef/hu_HU.ISO8859-2.src stable/11/share/monetdef/hu_HU.UTF-8.src stable/11/share/monetdef/hy_AM.ARMSCII-8.src stable/11/share/monetdef/hy_AM.UTF-8.src stable/11/share/monetdef/ru_RU.CP866.src stable/11/share/monetdef/ru_RU.ISO8859-5.src stable/11/share/monetdef/ru_RU.KOI8-R.src stable/11/share/monetdef/ru_RU.UTF-8.src stable/11/share/monetdef/sl_SI.UTF-8.src stable/11/share/monetdef/tr_TR.ISO8859-9.src stable/11/share/monetdef/tr_TR.UTF-8.src stable/11/share/monetdef/zh_CN.GB2312.src stable/11/share/monetdef/zh_CN.GBK.src stable/11/share/monetdef/zh_CN.UTF-8.src stable/11/share/monetdef/zh_CN.eucCN.src stable/11/share/monetdef/zh_TW.Big5.src stable/11/share/monetdef/zh_TW.UTF-8.src stable/11/share/msgdef/Makefile stable/11/share/msgdef/ja_JP.SJIS.src stable/11/share/msgdef/ja_JP.UTF-8.src stable/11/share/msgdef/ja_JP.eucJP.src stable/11/share/msgdef/tr_TR.ISO8859-9.src stable/11/share/msgdef/tr_TR.UTF-8.src stable/11/share/numericdef/Makefile stable/11/tools/tools/locale/etc/common.UTF-8.src (contents, props changed) stable/11/tools/tools/locale/etc/final-maps/map.GB2312 stable/11/tools/tools/locale/etc/final-maps/map.UTF-8 (contents, props changed) Directory Properties: stable/11/ (props changed) Modified: stable/11/share/colldef/Makefile ============================================================================== --- stable/11/share/colldef/Makefile Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/Makefile Tue Jan 17 07:11:46 2017 (r312336) @@ -23,9 +23,9 @@ LOCALES+= en_US.UTF-8 LOCALES+= es_MX.UTF-8 LOCALES+= et_EE.UTF-8 LOCALES+= fi_FI.UTF-8 +LOCALES+= fr_CA.UTF-8 LOCALES+= he_IL.UTF-8 LOCALES+= hi_IN.UTF-8 -LOCALES+= hr_HR.UTF-8 LOCALES+= hu_HU.UTF-8 LOCALES+= hy_AM.UTF-8 LOCALES+= is_IS.UTF-8 @@ -34,13 +34,15 @@ LOCALES+= kk_KZ.UTF-8 LOCALES+= ko_KR.UTF-8 LOCALES+= lt_LT.UTF-8 LOCALES+= lv_LV.UTF-8 -LOCALES+= nb_NO.UTF-8 +LOCALES+= nn_NO.UTF-8 LOCALES+= pl_PL.UTF-8 LOCALES+= ro_RO.UTF-8 LOCALES+= ru_RU.UTF-8 LOCALES+= se_NO.UTF-8 LOCALES+= sk_SK.UTF-8 LOCALES+= sl_SI.UTF-8 +LOCALES+= sr_RS.UTF-8 +LOCALES+= sr_RS.UTF-8@latin LOCALES+= sv_SE.UTF-8 LOCALES+= tr_TR.UTF-8 LOCALES+= uk_UA.UTF-8 @@ -52,7 +54,6 @@ LOCALES_MAPPED+= af_ZA.UTF-8 af_ZA.ISO88 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.ISO8859-5 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1251 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1131 -LOCALES_MAPPED+= ru_RU.UTF-8 sr_RS.ISO8859-5 LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.KOI8-R LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.ISO8859-5 LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.CP866 @@ -66,13 +67,9 @@ LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO88 LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO8859-1 LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-15 LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 sr_RS.UTF-8@latin -LOCALES_MAPPED+= en_US.UTF-8 sr_RS.ISO8859-2 LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 pt_BR.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 nn_NO.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 nn_NO.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 nl_BE.ISO8859-15 @@ -85,8 +82,6 @@ LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO88 LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 fr_CA.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 fr_CA.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 eu_ES.ISO8859-15 @@ -128,12 +123,14 @@ LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO88 LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO8859-1 LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-15 LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-1 +LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-15 +LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-1 LOCALES_MAPPED+= hi_IN.UTF-8 hi_IN.ISCII-DEV +LOCALES_MAPPED+= sr_RS.UTF-8@latin hr_HR.UTF-8 LOCALES_MAPPED+= hy_AM.UTF-8 hy_AM.ARMSCII-8 LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-15 LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-1 LOCALES_MAPPED+= ja_JP.UTF-8 ja_JP.SJIS -LOCALES_MAPPED+= ja_JP.UTF-8 ja_JP.eucJP LOCALES_MAPPED+= ko_KR.UTF-8 ko_KR.eucKR LOCALES_MAPPED+= lt_LT.UTF-8 lt_LT.ISO8859-13 LOCALES_MAPPED+= lv_LV.UTF-8 lv_LV.ISO8859-13 @@ -148,9 +145,6 @@ LOCALES_MAPPED+= tr_TR.UTF-8 tr_TR.ISO88 LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.KOI8-U LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.ISO8859-5 LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.CP1251 -LOCALES_MAPPED+= zh_CN.UTF-8 zh_CN.GBK -LOCALES_MAPPED+= zh_CN.UTF-8 zh_CN.GB18030 -LOCALES_MAPPED+= zh_TW.UTF-8 zh_TW.Big5 LOCALES+= cs_CZ.ISO8859-2 LOCALES+= da_DK.ISO8859-1 @@ -160,8 +154,16 @@ LOCALES+= hu_HU.ISO8859-2 LOCALES+= nb_NO.ISO8859-1 LOCALES+= nb_NO.ISO8859-15 LOCALES+= sk_SK.ISO8859-2 +LOCALES+= sr_RS.ISO8859-2 +LOCALES+= sr_RS.ISO8859-5 LOCALES+= zh_CN.GB2312 LOCALES+= zh_CN.eucCN +LOCALES+= zh_TW.Big5 +LOCALES+= zh_CN.GB18030 +LOCALES+= zh_CN.GBK +LOCALES+= ja_JP.eucJP +LOCALES+= nn_NO.ISO8859-15 +LOCALES+= nn_NO.ISO8859-1 SAME+= ar_SA.UTF-8 ar_QA.UTF-8 @@ -169,7 +171,6 @@ SAME+= ar_SA.UTF-8 ar_MA.UTF-8 SAME+= ar_SA.UTF-8 ar_JO.UTF-8 SAME+= ar_SA.UTF-8 ar_EG.UTF-8 SAME+= ar_SA.UTF-8 ar_AE.UTF-8 -SAME+= ru_RU.UTF-8 sr_RS.UTF-8 SAME+= ru_RU.UTF-8 mn_MN.UTF-8 SAME+= ru_RU.UTF-8 bg_BG.UTF-8 SAME+= ca_AD.UTF-8 ca_IT.UTF-8 @@ -177,14 +178,12 @@ SAME+= ca_AD.UTF-8 ca_FR.UTF-8 SAME+= ca_AD.UTF-8 ca_ES.UTF-8 SAME+= en_US.UTF-8 pt_PT.UTF-8 SAME+= en_US.UTF-8 pt_BR.UTF-8 -SAME+= en_US.UTF-8 nn_NO.UTF-8 SAME+= en_US.UTF-8 nl_NL.UTF-8 SAME+= en_US.UTF-8 nl_BE.UTF-8 SAME+= en_US.UTF-8 it_IT.UTF-8 SAME+= en_US.UTF-8 it_CH.UTF-8 SAME+= en_US.UTF-8 fr_FR.UTF-8 SAME+= en_US.UTF-8 fr_CH.UTF-8 -SAME+= en_US.UTF-8 fr_CA.UTF-8 SAME+= en_US.UTF-8 fr_BE.UTF-8 SAME+= en_US.UTF-8 eu_ES.UTF-8 SAME+= en_US.UTF-8 en_ZA.UTF-8 @@ -202,6 +201,7 @@ SAME+= en_US.UTF-8 de_AT.UTF-8 SAME+= es_MX.UTF-8 es_ES.UTF-8 SAME+= es_MX.UTF-8 es_CR.UTF-8 SAME+= es_MX.UTF-8 es_AR.UTF-8 +SAME+= nn_NO.UTF-8 nb_NO.UTF-8 SAME+= se_NO.UTF-8 se_FI.UTF-8 SAME+= sv_SE.UTF-8 sv_FI.UTF-8 SAME+= zh_TW.UTF-8 zh_HK.UTF-8 Modified: stable/11/share/colldef/af_ZA.UTF-8.src ============================================================================== --- stable/11/share/colldef/af_ZA.UTF-8.src Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/af_ZA.UTF-8.src Tue Jan 17 07:11:46 2017 (r312336) @@ -42,7 +42,6 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol collating-symbol collating-symbol @@ -76,36 +75,36 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -139,6 +138,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -312,6 +312,8 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -471,14 +473,14 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol collating-symbol collating-symbol collating-symbol @@ -489,6 +491,10 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol order_start forward;forward;forward;forward @@ -526,7 +532,6 @@ order_start forward;forward;forward;forw - @@ -560,36 +565,36 @@ order_start forward;forward;forward;forw - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -623,6 +628,7 @@ order_start forward;forward;forward;forw + @@ -796,6 +802,8 @@ order_start forward;forward;forward;forw + + @@ -955,14 +963,14 @@ order_start forward;forward;forward;forw - - - + + + + + - - @@ -973,6 +981,10 @@ order_start forward;forward;forward;forw + + + + * assignment of characters to weights @@ -1018,36 +1030,36 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1147,7 +1159,7 @@ order_start forward;forward;forward;forw "";"";""; "";"";""; "";"";""; - "";"";""; + "";"";""; ;;; ;;; ;;; @@ -1193,6 +1205,8 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1528,7 +1542,8 @@ order_start forward;forward;forward;forw "";"";""; ;;; ;;; - ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1558,7 +1573,8 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1621,8 +1637,8 @@ order_start forward;forward;forward;forw ;"";""; ;"";""; ;"";""; - ;"";""; - ;"";""; + ;"";""; + ;"";""; "";"";""; "";"";""; "";"";""; @@ -1846,23 +1862,26 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;;

;;;

;;;

;;;

@@ -2252,6 +2271,7 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; + ;;; ;;; ;;; ;;; @@ -2344,52 +2364,56 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; UNDEFINED IGNORE;IGNORE;IGNORE;... order_end Modified: stable/11/share/colldef/am_ET.UTF-8.src ============================================================================== --- stable/11/share/colldef/am_ET.UTF-8.src Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/am_ET.UTF-8.src Tue Jan 17 07:11:46 2017 (r312336) @@ -13,13 +13,13 @@ LC_COLLATE collating-symbol collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -46,51 +46,51 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -176,20 +176,20 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -351,13 +351,13 @@ order_start forward;forward;forward;forw - - + + + - - + @@ -384,51 +384,51 @@ order_start forward;forward;forward;forw - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - + + + + + + + + + + @@ -514,20 +514,20 @@ order_start forward;forward;forward;forw - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -712,9 +712,9 @@ order_start forward;forward;forward;forw IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; - IGNORE;"";""; - IGNORE;"";""; - IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; ;;; ;;; ;;; @@ -736,23 +736,23 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; "";;""; @@ -765,24 +765,24 @@ order_start forward;forward;forward;forw "";;""; "";;""; "";;""; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Tue Jan 17 09:56:10 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DD5CB0F8B; Tue, 17 Jan 2017 09:56:10 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC6A1558; Tue, 17 Jan 2017 09:56:10 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v0H9u2ku071088; Tue, 17 Jan 2017 01:56:03 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v0H9tvtj071087; Tue, 17 Jan 2017 01:55:57 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201701170955.v0H9tvtj071087@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r312322 - stable/11/tests/sys/file In-Reply-To: <201701170156.v0H1uiRs075082@repo.freebsd.org> To: Ngie Cooper Date: Tue, 17 Jan 2017 01:55:57 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 09:56:11 -0000 > Author: ngie > Date: Tue Jan 17 01:56:44 2017 > New Revision: 312322 > URL: https://svnweb.freebsd.org/changeset/base/312322 > > Log: > MFC r312111: > > Remove unused vars to fix -Wunused issues The actual mistake here is that these are unused, a main() should do at least a check on argc to see if the correct number of args has been passed, and print a usage() if it has not: freebsd-rwg {105}% pwd /A/freebsd-rwg freebsd-rwg {106}% pwd foo usage: pwd [-LP] > Modified: > stable/11/tests/sys/file/ftruncate_test.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/tests/sys/file/ftruncate_test.c > ============================================================================== > --- stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:55:14 2017 (r312321) > +++ stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:44 2017 (r312322) > @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, > static int lengths_count = sizeof(lengths) / sizeof(off_t); > > int > -main(int argc, char *argv[]) > +main(void) > { > int error, fd, fds[2], i, read_only_fd; > char path[PATH_MAX]; > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-11@freebsd.org Tue Jan 17 10:32:28 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71176CB2CE8; Tue, 17 Jan 2017 10:32:28 +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 3E39619FF; Tue, 17 Jan 2017 10:32:28 +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 v0HAWRth087076; Tue, 17 Jan 2017 10:32:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HAWRGm087075; Tue, 17 Jan 2017 10:32:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701171032.v0HAWRGm087075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Jan 2017 10:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312339 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 10:32:28 -0000 Author: kib Date: Tue Jan 17 10:32:27 2017 New Revision: 312339 URL: https://svnweb.freebsd.org/changeset/base/312339 Log: MFC r311879: Use ANSI C definitions, update comment. Modified: stable/11/libexec/rtld-elf/rtld_lock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld_lock.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld_lock.c Tue Jan 17 08:15:10 2017 (r312338) +++ stable/11/libexec/rtld-elf/rtld_lock.c Tue Jan 17 10:32:27 2017 (r312339) @@ -38,8 +38,8 @@ * In this algorithm the lock is a single word. Its low-order bit is * set when a writer holds the lock. The remaining high-order bits * contain a count of readers desiring the lock. The algorithm requires - * atomic "compare_and_store" and "add" operations, which we implement - * using assembly language sequences in "rtld_start.S". + * atomic "compare_and_store" and "add" operations, which we take + * from machine/atomic.h. */ #include @@ -67,7 +67,7 @@ static sigset_t fullsigmask, oldsigmask; static int thread_flag; static void * -def_lock_create() +def_lock_create(void) { void *base; char *p; @@ -269,7 +269,7 @@ lock_restart_for_upgrade(RtldLockState * } void -lockdflt_init() +lockdflt_init(void) { int i; From owner-svn-src-stable-11@freebsd.org Tue Jan 17 19:19:31 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED8ECB3E7D; Tue, 17 Jan 2017 19:19:31 +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 D2A5914E8; Tue, 17 Jan 2017 19:19:30 +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 v0HJJTJc002910; Tue, 17 Jan 2017 19:19:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HJJTe9002907; Tue, 17 Jan 2017 19:19:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701171919.v0HJJTe9002907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 17 Jan 2017 19:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312349 - in stable/11/sys/boot/efi: . loader/arch/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 19:19:31 -0000 Author: gonzo Date: Tue Jan 17 19:19:29 2017 New Revision: 312349 URL: https://svnweb.freebsd.org/changeset/base/312349 Log: MFC r311888, r311890-r311891 r311888: [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start __bss_end should not be included in .bss zeroing code. Otherwise first 4 bytes of the section that follows .bss (in loader's case it's .sdata) are overwritten by zero. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 r311890: [efi] Fix .rel.data.* being erroneously merged into .data on ARM Fix section pattern code to exclude .rel.data.* sections from being merged into .data. Otherwise relocations in those sections are lost in final binary Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 r311891: [efi] Build EFI bits with -fPIC on ARM clang 3.9.0 without -fPIC generates absolute jump table for switch/case statement which trips boot1.efi and loader.efi on ARM platform. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 Modified: stable/11/sys/boot/efi/Makefile.inc stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm stable/11/sys/boot/efi/loader/arch/arm/start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/Makefile.inc ============================================================================== --- stable/11/sys/boot/efi/Makefile.inc Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/Makefile.inc Tue Jan 17 19:19:29 2017 (r312349) @@ -22,4 +22,8 @@ CFLAGS+= -mno-aes CFLAGS+= -fshort-wchar .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif + .include "../Makefile.inc" Modified: stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 17 19:19:29 2017 (r312349) @@ -18,7 +18,7 @@ SECTIONS . = ALIGN(16); .data : { - *(.data *.data.*) + *(.data .data.*) *(.gnu.linkonce.d*) *(.rodata) *(.rodata.*) Modified: stable/11/sys/boot/efi/loader/arch/arm/start.S ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm/start.S Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/loader/arch/arm/start.S Tue Jan 17 19:19:29 2017 (r312349) @@ -161,7 +161,7 @@ _start: mov r2, #0 1: cmp r0, r1 - bgt 2f + bge 2f str r2, [r0], #4 b 1b 2: From owner-svn-src-stable-11@freebsd.org Tue Jan 17 22:01:34 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594A8CB42CC; Tue, 17 Jan 2017 22:01:34 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 286CE1A7E; Tue, 17 Jan 2017 22:01:34 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM1XFc068151; Tue, 17 Jan 2017 22:01:33 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM1XfW068150; Tue, 17 Jan 2017 22:01:33 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201701172201.v0HM1XfW068150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Tue, 17 Jan 2017 22:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312351 - stable/11/sys/dev/kbd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 22:01:34 -0000 Author: lifanov (ports committer) Date: Tue Jan 17 22:01:33 2017 New Revision: 312351 URL: https://svnweb.freebsd.org/changeset/base/312351 Log: MFC r311650 Restore priority value for OGIO_KEYMAP PR: 206678 Submitted by: ecturt@gmail.com Reviewed by: cem Approved by: cem, matthew (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5095 Modified: stable/11/sys/dev/kbd/kbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/kbd/kbd.c ============================================================================== --- stable/11/sys/dev/kbd/kbd.c Tue Jan 17 21:12:21 2017 (r312350) +++ stable/11/sys/dev/kbd/kbd.c Tue Jan 17 22:01:33 2017 (r312351) @@ -884,7 +884,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo omapp->key[i].spcl = mapp->key[i].spcl; omapp->key[i].flgs = mapp->key[i].flgs; } - return (0); + break; case PIO_KEYMAP: /* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD From owner-svn-src-stable-11@freebsd.org Tue Jan 17 23:47:38 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3909CB5406; Tue, 17 Jan 2017 23:47:38 +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 B2C1C1A85; Tue, 17 Jan 2017 23:47:38 +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 v0HNlbQc011650; Tue, 17 Jan 2017 23:47:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HNlbLp011649; Tue, 17 Jan 2017 23:47:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701172347.v0HNlbLp011649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 23:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312356 - stable/11/sys/modules/cam X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 23:47:39 -0000 Author: ngie Date: Tue Jan 17 23:47:37 2017 New Revision: 312356 URL: https://svnweb.freebsd.org/changeset/base/312356 Log: MFC r303166: r303166 (by imp): Add opt_ddb.h. Modified: stable/11/sys/modules/cam/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/cam/Makefile ============================================================================== --- stable/11/sys/modules/cam/Makefile Tue Jan 17 22:05:52 2017 (r312355) +++ stable/11/sys/modules/cam/Makefile Tue Jan 17 23:47:37 2017 (r312356) @@ -14,6 +14,7 @@ SRCS+= opt_cd.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h +SRCS+= opt_ddb.h SRCS+= device_if.h bus_if.h vnode_if.h SRCS+= cam.c SRCS+= cam_compat.c From owner-svn-src-stable-11@freebsd.org Tue Jan 17 23:57:37 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66B9CB5A98; Tue, 17 Jan 2017 23:57:37 +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 A3636147B; Tue, 17 Jan 2017 23:57:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 194so9138874pgd.0; Tue, 17 Jan 2017 15:57:37 -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=PrUvL/T62pNn/HMk/Aua3pnYb8/rBjh+FiFdotY8tNA=; b=Krq0DXBlGIFOjR1zTeBvlbPzb90wTLimN9A6B0xBXFjZ27/Iiq1mKWWHou9mUwuEyJ yOnaEqSt0dpY6JqdfDNhQFwuyUCKlz7cPNSFIgTD0zx+qCwdd3uJ9Dt6wYjr+obtwAUg OEFAHjHkfi+y08up+Tg0/5MpyrdHWVw23ck3y49cd52QkWlq60bcak44SnwY6caKxF4M 8O5azBEew82/A19TWyF369G5jqHyTziUmhxYtpz9xvzAqXHc87RtgIhnOb393b6p2HSk rDSevzVqdM52s4VEXfwiwroo9e6GssWW2HDE97swBiQ1R+rF/0wQ3x+tMp7FUp2niILl shMg== 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=PrUvL/T62pNn/HMk/Aua3pnYb8/rBjh+FiFdotY8tNA=; b=c89au/koGQm6gBMRoRW48ikERC3vHm1qIZRIaTJotQSLS6qimBBFD/TTshIFcobIx2 tvezimd3U9J3SDiQ4AL+YNDzymHC8hgerue+S5JVqtjXF8FjxTPEi1NPtMC//KegOw9F enTyFWTtiM1igAvIfaBsTo12U/B5pNCK2839bXE+4L1ysdG5/uN+iFdLRKS6UMI2gkxq rGYz04YZXFSqc9V8qRfqfkdAtwf/GMxdIPV/LUcg7bzRKPE21Zv5Fz4aAcAmyq3aMYlJ 8jbaxoQC/KFsYn9atfNgHeiulpiUSkjddPP7kkYyLiNtJu+U222owJqhruJxkIBZbYBI CfeA== X-Gm-Message-State: AIkVDXJe2+QuCgeBWcFtX3+cbe7lQJapc0/vOwxhwJb6+dSZ+PIkksJeKivXzFKQ9Tc/vQ== X-Received: by 10.84.130.5 with SMTP id 5mr457432plc.69.1484697456778; Tue, 17 Jan 2017 15:57:36 -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 b1sm8802845pfa.28.2017.01.17.15.57.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 15:57:36 -0800 (PST) Subject: Re: svn commit: r312356 - stable/11/sys/modules/cam Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701172347.v0HNlbLp011649@repo.freebsd.org> Date: Tue, 17 Jan 2017 15:57:34 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, ports@grosbein.net Message-Id: References: <201701172347.v0HNlbLp011649@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 23:57:37 -0000 --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 17, 2017, at 15:47, Ngie Cooper wrote: > > Author: ngie > Date: Tue Jan 17 23:47:37 2017 > New Revision: 312356 > URL: https://svnweb.freebsd.org/changeset/base/312356 > > Log: > MFC r303166: > r303166 (by imp): > > Add opt_ddb.h. This MFC fixes bug 213535 as well. Reported by: Eugene Grosbein -Ngie --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22 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 iQIcBAEBCgAGBQJYfq9vAAoJEPWDqSZpMIYVaukQALXNyjaIllh7tbfg9cOCs8u0 SCwIgplSf0KZEVAisoVz4A5WoO8yj0NqWXVXlpwn33YmLxcQIei3OVzFN0v1lF46 SdGaeEWFp4QfHU8CK6nsXlSOXDjuLz12C55Frw5xX2YD/dgCdkuHWCBbfJU1FTfl oztsLF2C+2yyzZdHrH593FTVA1w3X+qA09F1fBMpIgoSQorEWPVQ26JjCgnt8DWX CPx+VbORFJOKNB7KwEUfninQd8P3fX322khixUOhY0d4tLYXIO8IwSv2zxaQKSSh UJI+5UucCo7mvO3IWmkeybYwj/fegAmY9TYUKbks1Gwu98XUzr4nOvypsq7izKFy 1NhM6zhOfJAQ52GDo4/UyZxb2eASGQp2gMD8rfcZIkKKf/AmV+4t+SoGKzUX5elz KPCypuyq2PM7bxJONR15o6lxedY3EFLt4uqfLgXkrwt4QI6h/+aHBvkqBb94G7Fz XET7x4j1AZGA4ZFRzzQ8mhXFLQZBBqd5EcLbITJ97uBEh7w9V3mk1sK/3DPvkyZm 04BHV9W8cYMDOTBwOEjk9GniyLdYydSCTmNU56w1jHfzujHmZNUxkXzMgkG3CpFE 2ZRmEf53fGsrAGJ2gjecQhhzCspN0D9h30D4j/3HddcRv/4VnJSHVwhoeEhbDXSV /In0aC3PDkYi4UFEuu5C =h+IC -----END PGP SIGNATURE----- --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22-- From owner-svn-src-stable-11@freebsd.org Wed Jan 18 01:52:05 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE37ECB445B; Wed, 18 Jan 2017 01:52:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 88BD01981; Wed, 18 Jan 2017 01:52:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1q4wA061336; Wed, 18 Jan 2017 01:52:04 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1q42a061332; Wed, 18 Jan 2017 01:52:04 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180152.v0I1q42a061332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312358 - in stable/11/sys/dev: alc pci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 01:52:05 -0000 Author: yongari Date: Wed Jan 18 01:52:04 2017 New Revision: 312358 URL: https://svnweb.freebsd.org/changeset/base/312358 Log: MFC r304574-304575,304584: r304574: Correct DMA channel number selection on AR816x family of controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x except L1D controller, use vendor recommended ASPM parameters. While here, increase alc_dma_burst array size. Broken H/W can return bogus value in theory. r304575: Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Force the maximum payload size to 128 bytes in DMA configuration. This change should fix occasional DMA write errors reported on Killer E2200. r304584: Add a missing change in r304575. Modified: stable/11/sys/dev/alc/if_alc.c stable/11/sys/dev/alc/if_alcreg.h stable/11/sys/dev/alc/if_alcvar.h stable/11/sys/dev/pci/pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/alc/if_alc.c ============================================================================== --- stable/11/sys/dev/alc/if_alc.c Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alc.c Wed Jan 18 01:52:04 2017 (r312358) @@ -121,6 +121,8 @@ static struct alc_ident alc_ident_table[ "Atheros AR8172 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, "Killer E2200 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, + "Killer E2400 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -255,7 +257,7 @@ static struct resource_spec alc_irq_spec { -1, 0, 0 } }; -static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 }; +static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0, 0 }; static int alc_miibus_readreg(device_t dev, int phy, int reg) @@ -1080,6 +1082,7 @@ alc_phy_down(struct alc_softc *sc) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1397,12 +1400,15 @@ alc_attach(device_t dev) * shows the same PHY model/revision number of AR8131. */ switch (sc->alc_ident->deviceid) { + case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: + sc->alc_flags |= ALC_FLAG_E2X00; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && pci_get_subdevice(dev) == 0x0091 && sc->alc_rev == 0) sc->alc_flags |= ALC_FLAG_LINK_WAR; /* FALLTHROUGH */ - case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_AR8171: sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; break; @@ -1473,6 +1479,12 @@ alc_attach(device_t dev) sc->alc_dma_rd_burst = 3; if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; + /* + * Force maximum payload size to 128 bytes for E2200/E2400. + * Otherwise it triggers DMA write error. + */ + if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) + sc->alc_dma_wr_burst = 0; alc_init_pcie(sc); } @@ -4184,13 +4196,17 @@ alc_init_locked(struct alc_softc *sc) reg = (RXQ_CFG_RD_BURST_DEFAULT << RXQ_CFG_RD_BURST_SHIFT) & RXQ_CFG_RD_BURST_MASK; reg |= RXQ_CFG_RSS_MODE_DIS; - if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) { reg |= (RXQ_CFG_816X_IDT_TBL_SIZE_DEFAULT << RXQ_CFG_816X_IDT_TBL_SIZE_SHIFT) & RXQ_CFG_816X_IDT_TBL_SIZE_MASK; - if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && - sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) - reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M; + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } else { + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && + sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } CSR_WRITE_4(sc, ALC_RXQ_CFG, reg); /* Configure DMA parameters. */ @@ -4214,12 +4230,12 @@ alc_init_locked(struct alc_softc *sc) switch (AR816X_REV(sc->alc_rev)) { case AR816X_REV_A0: case AR816X_REV_A1: - reg |= DMA_CFG_RD_CHNL_SEL_1; + reg |= DMA_CFG_RD_CHNL_SEL_2; break; case AR816X_REV_B0: /* FALLTHROUGH */ default: - reg |= DMA_CFG_RD_CHNL_SEL_3; + reg |= DMA_CFG_RD_CHNL_SEL_4; break; } } Modified: stable/11/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/11/sys/dev/alc/if_alcreg.h Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alcreg.h Wed Jan 18 01:52:04 2017 (r312358) @@ -45,10 +45,11 @@ #define DEVICEID_ATHEROS_AR8152_B 0x2060 /* L2C V1.1 */ #define DEVICEID_ATHEROS_AR8152_B2 0x2062 /* L2C V2.0 */ #define DEVICEID_ATHEROS_AR8161 0x1091 -#define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_AR8162 0x1090 #define DEVICEID_ATHEROS_AR8171 0x10A1 #define DEVICEID_ATHEROS_AR8172 0x10A0 +#define DEVICEID_ATHEROS_E2200 0xE091 +#define DEVICEID_ATHEROS_E2400 0xE0A1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: stable/11/sys/dev/alc/if_alcvar.h ============================================================================== --- stable/11/sys/dev/alc/if_alcvar.h Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alcvar.h Wed Jan 18 01:52:04 2017 (r312358) @@ -235,7 +235,8 @@ struct alc_softc { #define ALC_FLAG_APS 0x1000 #define ALC_FLAG_AR816X_FAMILY 0x2000 #define ALC_FLAG_LINK_WAR 0x4000 -#define ALC_FLAG_LINK 0x8000 +#define ALC_FLAG_E2X00 0x8000 +#define ALC_FLAG_LINK 0x10000 struct callout alc_tick_ch; struct alc_hw_stats alc_stats; Modified: stable/11/sys/dev/pci/pci.c ============================================================================== --- stable/11/sys/dev/pci/pci.c Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/pci/pci.c Wed Jan 18 01:52:04 2017 (r312358) @@ -281,12 +281,13 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200 Ethernet controllers have a bug that - * MSI interrupt does not assert if PCIM_CMD_INTxDIS bit of the - * command register is set. + * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a + * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-stable-11@freebsd.org Wed Jan 18 01:57:15 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43227CB4653; Wed, 18 Jan 2017 01:57:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 123931E90; Wed, 18 Jan 2017 01:57:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1vECp063725; Wed, 18 Jan 2017 01:57:14 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1vEoJ063724; Wed, 18 Jan 2017 01:57:14 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180157.v0I1vEoJ063724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312360 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 01:57:15 -0000 Author: yongari Date: Wed Jan 18 01:57:13 2017 New Revision: 312360 URL: https://svnweb.freebsd.org/changeset/base/312360 Log: MFC r304576: Add Killer E2400 to the supported hardware list. Modified: stable/11/share/man/man4/alc.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/alc.4 ============================================================================== --- stable/11/share/man/man4/alc.4 Wed Jan 18 01:53:07 2017 (r312359) +++ stable/11/share/man/man4/alc.4 Wed Jan 18 01:57:13 2017 (r312360) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2014 +.Dd August 22, 2016 .Dt ALC 4 .Os .Sh NAME @@ -122,6 +122,8 @@ Atheros AR8171 PCI Express Gigabit Ether Atheros AR8172 PCI Express Fast Ethernet controller .It Killer E2200 Gigabit Ethernet controller +.It +Killer E2400 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the From owner-svn-src-stable-11@freebsd.org Wed Jan 18 02:40:19 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDE6CB5447; Wed, 18 Jan 2017 02:40:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8F00416F6; Wed, 18 Jan 2017 02:40:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2eIQq080507; Wed, 18 Jan 2017 02:40:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2eIGL080506; Wed, 18 Jan 2017 02:40:18 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180240.v0I2eIGL080506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312364 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 02:40:19 -0000 Author: yongari Date: Wed Jan 18 02:40:18 2017 New Revision: 312364 URL: https://svnweb.freebsd.org/changeset/base/312364 Log: MFC r302548: Belatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading capabilities. It was removed in r243624 and r254804/r271006 respectively. This file and mbuf(9) needs updates for other offloading capabilities(i.e. CSUM_SCTP and CSUM_TSO). Modified: stable/11/share/man/man9/ifnet.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/ifnet.9 ============================================================================== --- stable/11/share/man/man9/ifnet.9 Wed Jan 18 02:22:07 2017 (r312363) +++ stable/11/share/man/man9/ifnet.9 Wed Jan 18 02:40:18 2017 (r312364) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2014 +.Dd July 11, 2016 .Dt IFNET 9 .Os .Sh NAME @@ -787,18 +787,6 @@ The interface will compute IP checksums. The interface will compute TCP checksums. .It Dv CSUM_UDP The interface will compute UDP checksums. -.It Dv CSUM_IP_FRAGS -The interface can compute a TCP or UDP checksum for a packet -fragmented by the host CPU. -Makes sense only along with -.Dv CSUM_TCP -or -.Dv CSUM_UDP . -.It Dv CSUM_FRAGMENT -The interface will do the fragmentation of IP packets if necessary. -The host CPU does not need to care about MTU on this interface -as long as a packet to transmit through it is an IP one and it -does not exceed the size of the hardware buffer. .El .Pp An interface notifies the TCP/IP module about the tasks From owner-svn-src-stable-11@freebsd.org Wed Jan 18 02:56:25 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D915CCB57A5; Wed, 18 Jan 2017 02:56:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8F0241015; Wed, 18 Jan 2017 02:56:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2uOLh088447; Wed, 18 Jan 2017 02:56:24 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2uOAi088444; Wed, 18 Jan 2017 02:56:24 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180256.v0I2uOAi088444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312366 - stable/11/sys/dev/sound/pci/hda X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 02:56:26 -0000 Author: yongari Date: Wed Jan 18 02:56:24 2017 New Revision: 312366 URL: https://svnweb.freebsd.org/changeset/base/312366 Log: MFC r309527-309528: r309527: Recognize RealTek ALC1150 7.1 channel HD audio codec. r309528: Fix too low volume on MSI H170 GAMING M3 board by poking vendor specific COEF. Modified: stable/11/sys/dev/sound/pci/hda/hdaa_patches.c stable/11/sys/dev/sound/pci/hda/hdac.h stable/11/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:56:24 2017 (r312366) @@ -739,6 +739,12 @@ hdaa_patch_direct(struct hdaa_devinfo *d hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, 0xf88, 0xc0)); break; + case HDA_CODEC_ALC1150: + if (subid == 0xd9781462) { + /* Too low volume on MSI H170 GAMING M3. */ + hdaa_write_coef(dev, 0x20, 0x07, 0x7cb); + } + break; } if (subid == APPLE_INTEL_MAC) hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, Modified: stable/11/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:56:24 2017 (r312366) @@ -368,6 +368,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) +#define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Motorola */ Modified: stable/11/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:56:24 2017 (r312366) @@ -111,6 +111,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, + { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, 0, "Analog Devices AD1883" }, From owner-svn-src-stable-11@freebsd.org Wed Jan 18 08:11:20 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3501FCB42A0; Wed, 18 Jan 2017 08:11:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 041401FBF; Wed, 18 Jan 2017 08:11:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I8BJtK016068; Wed, 18 Jan 2017 08:11:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I8BIb6016063; Wed, 18 Jan 2017 08:11:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701180811.v0I8BIb6016063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 18 Jan 2017 08:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312373 - in stable/11: lib/libstand lib/libz lib/libz/contrib lib/libz/doc lib/libz/test usr.bin/minigzip X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 08:11:20 -0000 Author: delphij Date: Wed Jan 18 08:11:18 2017 New Revision: 312373 URL: https://svnweb.freebsd.org/changeset/base/312373 Log: MFC r311275: Restructure libz. Added: - copied from r311275, head/contrib/zlib/ Directory Properties: stable/11/contrib/zlib/ (props changed) Deleted: stable/11/lib/libz/ChangeLog stable/11/lib/libz/FAQ stable/11/lib/libz/README stable/11/lib/libz/adler32.c stable/11/lib/libz/compress.c stable/11/lib/libz/contrib/ stable/11/lib/libz/crc32.c stable/11/lib/libz/crc32.h stable/11/lib/libz/deflate.c stable/11/lib/libz/deflate.h stable/11/lib/libz/doc/ stable/11/lib/libz/gzclose.c stable/11/lib/libz/gzguts.h stable/11/lib/libz/gzlib.c stable/11/lib/libz/gzread.c stable/11/lib/libz/gzwrite.c stable/11/lib/libz/infback.c stable/11/lib/libz/inffast.c stable/11/lib/libz/inffast.h stable/11/lib/libz/inffixed.h stable/11/lib/libz/inflate.c stable/11/lib/libz/inflate.h stable/11/lib/libz/inftrees.c stable/11/lib/libz/inftrees.h stable/11/lib/libz/test/ stable/11/lib/libz/trees.c stable/11/lib/libz/trees.h stable/11/lib/libz/uncompr.c stable/11/lib/libz/zconf.h stable/11/lib/libz/zlib.3 stable/11/lib/libz/zlib.h stable/11/lib/libz/zutil.c stable/11/lib/libz/zutil.h Modified: stable/11/lib/libstand/Makefile stable/11/lib/libz/FREEBSD-upgrade stable/11/lib/libz/Makefile stable/11/usr.bin/minigzip/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/Makefile ============================================================================== --- stable/11/lib/libstand/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libstand/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -109,9 +109,9 @@ libstand_bzlib_private.h: bzlib_private. sed -e 's||"stand.h"|' \ ${.ALLSRC} > ${.TARGET} -# decompression functionality from libz -.PATH: ${LIBSTAND_SRC}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz +# decompression functionality from zlib +.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/11/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/11/lib/libz/FREEBSD-upgrade Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libz/FREEBSD-upgrade Wed Jan 18 08:11:18 2017 (r312373) @@ -1,44 +1,16 @@ $FreeBSD$ -ZLib 1.2.2 - -Original distribution from http://www.gzip.org/zlib/ - -Vendor files removed from distribution before import: - INDEX configure qnx/ - Makefile contrib/ win32/ - Makefile.in msdos/ zconf.in.h - amiga/ old/ - as400/ projects/ - -Vendor files imported: - ChangeLog example.c minigzip.c - FAQ gzio.c trees.c - README infback.c trees.h - adler32.c inffast.c uncompr.c - algorithm.txt inffast.h zconf.h - compress.c inffixed.h zlib.3 - crc32.c inflate.c zlib.h - crc32.h inflate.h zutil.c - deflate.c inftrees.c zutil.h - deflate.h inftrees.h - -As of April, 2005, only the following three vendor files -had non-trivial local changes: - gzio.c minigzip.c zconf.h - -Added files (not from vendor): - Makefile zopen.c FREEBSD-upgrade +Original distribution from http://zlib.net/. Currently, only trivial +changes were made to support build of libstand and to suppress certain +compiler warnings, we upstream our local changes whenever they would +benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. - 2) Delete unnecessary files. - 3) Import onto the vendor branch. The 1.2.2 import was done like this: - cvs -d import -ko -m "ZLib 1.2.2" src/lib/libz ZLIB v1_2_2 - 4) In a clean directory, check out a fresh copy of HEAD, - merging in vendor changes since the last import. - cvs -d co -jZLIB:yesterday -jZLIB src/lib/libz - 5) Resolve any conflicts and commit them. - 6) Update this file with any changes to the file list or update procedure. + 2) Import onto the vendor area. + 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + version of upstream source, resolve any conflicts. + 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we + have the required changes. Test universe and commit them. -kientzle@FreeBSD.org +delphij@FreeBSD.org Modified: stable/11/lib/libz/Makefile ============================================================================== --- stable/11/lib/libz/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libz/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -8,6 +8,10 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 +ZLIBSRC= ${SRCTOP}/contrib/zlib + +.PATH: ${ZLIBSRC} + #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ @@ -37,14 +41,14 @@ SRCS+= zopen.c SRCS+= zutil.c #.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} -#.PATH: ${.CURDIR}/contrib/asm686 +#.PATH: ${ZLIBSRC}/contrib/asm686 #SRCS+= match.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack #.endif #.if ${MACHINE_ARCH} == "amd64" -#.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +#.PATH: ${ZLIBSRC}/contrib/gcc_gvmat64 #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack @@ -56,7 +60,7 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h -.PATH: ${.CURDIR}/test +.PATH: ${ZLIBSRC}/test minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz Modified: stable/11/usr.bin/minigzip/Makefile ============================================================================== --- stable/11/usr.bin/minigzip/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/usr.bin/minigzip/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../lib/libz/test +SRCDIR= ${.CURDIR}/../../contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-stable-11@freebsd.org Wed Jan 18 14:13:30 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D6ACB6BBF; Wed, 18 Jan 2017 14:13:30 +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 0F8E81DF1; Wed, 18 Jan 2017 14:13:29 +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 v0IEDTvt067009; Wed, 18 Jan 2017 14:13:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IEDSnZ067006; Wed, 18 Jan 2017 14:13:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701181413.v0IEDSnZ067006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 Jan 2017 14:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312381 - in stable/11: include lib/libkvm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 14:13:30 -0000 Author: avg Date: Wed Jan 18 14:13:28 2017 New Revision: 312381 URL: https://svnweb.freebsd.org/changeset/base/312381 Log: MFC r310630: libkvm: support access to vmm guest memory, allow writes to fwmem and vmm Sponsored by: Panzura Modified: stable/11/include/paths.h stable/11/lib/libkvm/kvm.c stable/11/lib/libkvm/kvm_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/paths.h ============================================================================== --- stable/11/include/paths.h Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/include/paths.h Wed Jan 18 14:13:28 2017 (r312381) @@ -99,6 +99,7 @@ #define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" +#define _PATH_DEVVMM "/dev/vmm/" #define _PATH_YP "/var/yp/" #define _PATH_UUCPLOCK "/var/spool/lock/" Modified: stable/11/lib/libkvm/kvm.c ============================================================================== --- stable/11/lib/libkvm/kvm.c Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/lib/libkvm/kvm.c Wed Jan 18 14:13:28 2017 (r312381) @@ -429,8 +429,10 @@ _kvm_open(kvm_t *kd, const char *uf, con return (kd); } } + /* - * This is a crash dump. + * This is either a crash dump or a remote live system with its physical + * memory fully accessible via a special device. * Open the namelist fd and determine the architecture. */ if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) { @@ -439,8 +441,11 @@ _kvm_open(kvm_t *kd, const char *uf, con } if (_kvm_read_kernel_ehdr(kd) < 0) goto failed; - if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0) + if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0 || + strncmp(mf, _PATH_DEVVMM, strlen(_PATH_DEVVMM)) == 0) { kd->rawdump = 1; + kd->writable = 1; + } SET_FOREACH(parch, kvm_arch) { if ((*parch)->ka_probe(kd)) { kd->arch = *parch; @@ -866,6 +871,15 @@ ssize_t kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; + ssize_t cw; + off_t pa; + const char *cp; + + if (!ISALIVE(kd) && !kd->writable) { + _kvm_err(kd, kd->program, + "kvm_write not implemented for dead kernels"); + return (-1); + } if (ISALIVE(kd)) { /* @@ -883,12 +897,38 @@ kvm_write(kvm_t *kd, u_long kva, const v } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); - } else { - _kvm_err(kd, kd->program, - "kvm_write not implemented for dead kernels"); - return (-1); } - /* NOTREACHED */ + + cp = buf; + while (len > 0) { + cc = kd->arch->ka_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cw = write(kd->pmfd, cp, cc); + if (cw < 0) { + _kvm_syserr(kd, kd->program, "kvm_write"); + break; + } + /* + * If ka_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cw == 0) + break; + cp += cw; + kva += cw; + len -= cw; + } + + return (cp - (char *)buf); } int Modified: stable/11/lib/libkvm/kvm_private.h ============================================================================== --- stable/11/lib/libkvm/kvm_private.h Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/lib/libkvm/kvm_private.h Wed Jan 18 14:13:28 2017 (r312381) @@ -78,6 +78,7 @@ struct __kvm { */ struct vmstate *vmst; int rawdump; /* raw dump format */ + int writable; /* physical memory is writable */ int vnet_initialized; /* vnet fields set up */ kvaddr_t vnet_start; /* start of kernel's vnet region */ From owner-svn-src-stable-11@freebsd.org Wed Jan 18 15:22:55 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C611CB6603; Wed, 18 Jan 2017 15:22: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 51AC41831; Wed, 18 Jan 2017 15:22: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 v0IFMsr4096631; Wed, 18 Jan 2017 15:22:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IFMsaX096629; Wed, 18 Jan 2017 15:22:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701181522.v0IFMsaX096629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 Jan 2017 15:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312385 - stable/11/usr.bin/rpcgen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 15:22:55 -0000 Author: pfg Date: Wed Jan 18 15:22:54 2017 New Revision: 312385 URL: https://svnweb.freebsd.org/changeset/base/312385 Log: MFC r311947, r311981: rpcgen(1): Avoid unused variable warning on generated code. Avoid "unused variable 'i'" warnings in generated .c files by only emitting the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Obtained from: OpenBSD (CVS rev 1.28) rpcgen(1): Check getrlimit() return for generated code. Obtained from: NetBSD (CVS rev 1.27, 1.28) Modified: stable/11/usr.bin/rpcgen/rpc_cout.c stable/11/usr.bin/rpcgen/rpc_svcout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/rpcgen/rpc_cout.c ============================================================================== --- stable/11/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 14:41:59 2017 (r312384) +++ stable/11/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 15:22:54 2017 (r312385) @@ -551,7 +551,8 @@ emit_struct(definition *def) } for (dl = def->def.st.decls; dl != NULL; dl = dl->next) - if (dl->decl.rel == REL_VECTOR){ + if (dl->decl.rel == REL_VECTOR && + strcmp(dl->decl.type, "opaque") != 0){ f_print(fout, "\tint i;\n"); break; } Modified: stable/11/usr.bin/rpcgen/rpc_svcout.c ============================================================================== --- stable/11/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 14:41:59 2017 (r312384) +++ stable/11/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 15:22:54 2017 (r312385) @@ -728,7 +728,8 @@ write_timeout_func(void) if (tirpcflag) { f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); f_print(fout, "\t\t\trl.rlim_max = 0;\n"); - f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); + f_print(fout, "\t\t\tif (getrlimit(RLIMIT_NOFILE, &rl) == -1)\n"); + f_print(fout, "\t\t\t\treturn;\n"); f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0) {\n"); if (mtflag) @@ -902,7 +903,11 @@ write_rpc_svc_fg(const char *infile, con /* get number of file descriptors */ if (tirpcflag) { f_print(fout, "%srl.rlim_max = 0;\n", sp); - f_print(fout, "%sgetrlimit(RLIMIT_NOFILE, &rl);\n", sp); + f_print(fout, "%sif (getrlimit(RLIMIT_NOFILE, &rl) == -1) {\n", + sp); + f_print(fout, "%s\tperror(\"getrlimit\");\n", sp); + f_print(fout, "%s\texit(1);\n", sp); + f_print(fout, "%s}\n", sp); f_print(fout, "%sif ((size = rl.rlim_max) == 0)\n", sp); f_print(fout, "%s\texit(1);\n", sp); } else { From owner-svn-src-stable-11@freebsd.org Wed Jan 18 19:38:55 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF551CB6F6C; Wed, 18 Jan 2017 19:38:55 +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 8FF281BDD; Wed, 18 Jan 2017 19:38:55 +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 v0IJcsaU001275; Wed, 18 Jan 2017 19:38:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IJcs4f001268; Wed, 18 Jan 2017 19:38:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701181938.v0IJcs4f001268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Jan 2017 19:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312394 - in stable/11/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc sparc64/sparc64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 19:38:55 -0000 Author: jhb Date: Wed Jan 18 19:38:53 2017 New Revision: 312394 URL: https://svnweb.freebsd.org/changeset/base/312394 Log: MFC 307332,312086: Drop support for using mmap() with /dev/kmem. 307332: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. 312086: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique. Modified: stable/11/sys/amd64/amd64/mem.c stable/11/sys/arm/arm/mem.c stable/11/sys/arm64/arm64/mem.c stable/11/sys/i386/i386/mem.c stable/11/sys/mips/mips/mem.c stable/11/sys/powerpc/powerpc/mem.c stable/11/sys/sparc64/sparc64/mem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/mem.c ============================================================================== --- stable/11/sys/amd64/amd64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/amd64/amd64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -172,10 +172,9 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (offset > cpu_getmaxphyaddr()) return (-1); *paddr = offset; - } else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: stable/11/sys/arm/arm/mem.c ============================================================================== --- stable/11/sys/arm/arm/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/arm/arm/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -161,10 +161,9 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: stable/11/sys/arm64/arm64/mem.c ============================================================================== --- stable/11/sys/arm64/arm64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/arm64/arm64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -123,10 +123,9 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: stable/11/sys/i386/i386/mem.c ============================================================================== --- stable/11/sys/i386/i386/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/i386/i386/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -168,10 +168,9 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (offset > cpu_getmaxphyaddr()) return (-1); *paddr = offset; - } else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: stable/11/sys/mips/mips/mem.c ============================================================================== --- stable/11/sys/mips/mips/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/mips/mips/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -151,12 +151,6 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { - /* - * /dev/mem is the only one that makes sense through this - * interface. For /dev/kmem any physaddr we return here - * could be transient and hence incorrect or invalid at - * a later time. - */ if (dev2unit(dev) != CDEV_MINOR_MEM) return (-1); Modified: stable/11/sys/powerpc/powerpc/mem.c ============================================================================== --- stable/11/sys/powerpc/powerpc/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/powerpc/powerpc/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -179,8 +179,6 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); else return (EFAULT); Modified: stable/11/sys/sparc64/sparc64/mem.c ============================================================================== --- stable/11/sys/sparc64/sparc64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/sparc64/sparc64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); /* * Memory special file * - * NOTE: other architectures support mmap()'ing the mem and kmem devices; this + * NOTE: other architectures support mmap()'ing the mem device; this * might cause illegal aliases to be created for the locked kernel page(s), so * it is not implemented. */ From owner-svn-src-stable-11@freebsd.org Wed Jan 18 22:40:24 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03915CB6DAF; Wed, 18 Jan 2017 22:40:24 +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 C70421AF7; Wed, 18 Jan 2017 22:40:23 +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 v0IMeMMr075251; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IMeMo3075250; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701182240.v0IMeMo3075250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Jan 2017 22:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312397 - in stable: 10/sys/vm 11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 22:40:24 -0000 Author: jhb Date: Wed Jan 18 22:40:22 2017 New Revision: 312397 URL: https://svnweb.freebsd.org/changeset/base/312397 Log: MFC 310028: Use db_lookup_proc() in the DDB 'show procvm' command. This allows processes to be identified by PID as well as a pointer address. Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Jan 18 22:10:18 2017 (r312396) +++ stable/11/sys/vm/vm_map.c Wed Jan 18 22:40:22 2017 (r312397) @@ -4313,7 +4313,7 @@ DB_SHOW_COMMAND(procvm, procvm) struct proc *p; if (have_addr) { - p = (struct proc *) addr; + p = db_lookup_proc(addr); } else { p = curproc; } From owner-svn-src-stable-11@freebsd.org Wed Jan 18 23:25:48 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B51DCB6D98; Wed, 18 Jan 2017 23:25:48 +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 49B4914C3; Wed, 18 Jan 2017 23:25:48 +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 v0INPlOK095502; Wed, 18 Jan 2017 23:25:47 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0INPk9V095494; Wed, 18 Jan 2017 23:25:46 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701182325.v0INPk9V095494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 18 Jan 2017 23:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312399 - in stable/11/sys/dev: ichiic mmc sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 23:25:48 -0000 Author: marius Date: Wed Jan 18 23:25:46 2017 New Revision: 312399 URL: https://svnweb.freebsd.org/changeset/base/312399 Log: MFC: r310309, r310340-310341, r311664, r311793-r311794 o sdhci/mmc: Minor whitespace cleanups o Add Braswell PCI IDs for Intel Cherryview o mmc: Accept even lower voltage for Cherryview And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698. o In mmcsd_task(), bio_resid was not being set to 0 on a successful read or write, resulting in random short-read and short-write returns for requests. Fixing this fixes nominal block I/O via mmcsd(4). Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0) o Add support for Intel Apollo Lake and Bay Trail eMMC PCI controllers. o Flesh out the support for Intel Braswell eMMC controllers further. o In sdhci_init_slot(), use the right capability field for determining the announced bus width based on MMC_CAP_*_BIT_DATA. Modified: stable/11/sys/dev/ichiic/ig4_pci.c stable/11/sys/dev/mmc/mmc.c stable/11/sys/dev/mmc/mmcreg.h stable/11/sys/dev/mmc/mmcsd.c stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ichiic/ig4_pci.c ============================================================================== --- stable/11/sys/dev/ichiic/ig4_pci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/ichiic/ig4_pci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -68,6 +68,12 @@ static int ig4iic_pci_detach(device_t de #define PCI_CHIP_LYNXPT_LP_I2C_1 0x9c618086 #define PCI_CHIP_LYNXPT_LP_I2C_2 0x9c628086 +#define PCI_CHIP_BRASWELL_I2C_1 0x22c18086 +#define PCI_CHIP_BRASWELL_I2C_2 0x22c28086 +#define PCI_CHIP_BRASWELL_I2C_3 0x22c38086 +#define PCI_CHIP_BRASWELL_I2C_5 0x22c58086 +#define PCI_CHIP_BRASWELL_I2C_6 0x22c68086 +#define PCI_CHIP_BRASWELL_I2C_7 0x22c78086 static int ig4iic_pci_probe(device_t dev) @@ -79,6 +85,24 @@ ig4iic_pci_probe(device_t dev) case PCI_CHIP_LYNXPT_LP_I2C_2: device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-2"); break; + case PCI_CHIP_BRASWELL_I2C_1: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 1"); + break; + case PCI_CHIP_BRASWELL_I2C_2: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 2"); + break; + case PCI_CHIP_BRASWELL_I2C_3: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 3"); + break; + case PCI_CHIP_BRASWELL_I2C_5: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 5"); + break; + case PCI_CHIP_BRASWELL_I2C_6: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 6"); + break; + case PCI_CHIP_BRASWELL_I2C_7: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 7"); + break; default: return (ENXIO); } Modified: stable/11/sys/dev/mmc/mmc.c ============================================================================== --- stable/11/sys/dev/mmc/mmc.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmc.c Wed Jan 18 23:25:46 2017 (r312399) @@ -401,7 +401,7 @@ mmc_wait_for_req(struct mmc_softc *sc, s msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) - device_printf(sc->dev, "CMD%d RESULT: %d\n", + device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } @@ -511,7 +511,7 @@ mmc_idle_cards(struct mmc_softc *sc) { device_t dev; struct mmc_command cmd; - + dev = sc->dev; mmcbr_set_chip_select(dev, cs_high); mmcbr_update_ios(dev); @@ -795,7 +795,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 8; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -808,7 +808,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.flags = MMC_DATA_READ; err = mmc_wait_for_cmd(sc, &cmd, 0); sc->squelched--; - + mmcbr_set_bus_width(sc->dev, bus_width_1); mmcbr_update_ios(sc->dev); @@ -832,7 +832,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 4; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -1017,7 +1017,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else + } else panic("unknown SD CSD version"); } @@ -1349,9 +1349,9 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; - + err = mmc_send_status(sc, ivar->rca, &status); if (err != MMC_ERR_NONE) { device_printf(sc->dev, @@ -1446,7 +1446,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_decode_csd_mmc(ivar->raw_csd, &ivar->csd); ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; err = mmc_send_status(sc, ivar->rca, &status); @@ -1655,7 +1655,7 @@ mmc_calculate_clock(struct mmc_softc *sc int nkid, i, f_max; device_t *kids; struct mmc_ivars *ivar; - + f_max = mmcbr_get_f_max(sc->dev); max_dtr = max_hs_dtr = f_max; if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)) @@ -1770,7 +1770,7 @@ static void mmc_delayed_attach(void *xsc) { struct mmc_softc *sc = xsc; - + mmc_scan(sc); config_intrhook_disestablish(&sc->config_intrhook); } Modified: stable/11/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/11/sys/dev/mmc/mmcreg.h Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmcreg.h Wed Jan 18 23:25:46 2017 (r312399) @@ -355,8 +355,8 @@ struct mmc_request { */ #define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ #define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ +#define MMC_OCR_MIN_VOLTAGE_SHIFT 7 #define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ -#define MMC_OCR_MIN_VOLTAGE_SHIFT 8 #define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ #define MMC_OCR_220_230 (1U << 10) /* Vdd voltage 2.20 ~ 2.30 */ #define MMC_OCR_230_240 (1U << 11) /* Vdd voltage 2.30 ~ 2.40 */ Modified: stable/11/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/11/sys/dev/mmc/mmcsd.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmcsd.c Wed Jan 18 23:25:46 2017 (r312399) @@ -545,6 +545,8 @@ mmcsd_task(void *arg) bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; } biodone(bp); } Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -376,6 +376,13 @@ sdhci_set_power(struct sdhci_slot *slot, /* Turn on the power. */ pwr |= SDHCI_POWER_ON; WR1(slot, SDHCI_POWER_CONTROL, pwr); + + if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { + WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); + DELAY(10); + WR1(slot, SDHCI_POWER_CONTROL, pwr); + DELAY(300); + } } static void @@ -629,9 +636,11 @@ sdhci_init_slot(device_t dev, struct sdh device_printf(dev, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } - /* Calculate timeout clock frequency. */ + /* Calculate/set timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { slot->timeout_clk = slot->max_clk / 1000; + } 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; @@ -675,6 +684,8 @@ sdhci_init_slot(device_t dev, struct sdh slot->opt &= ~SDHCI_HAVE_DMA; if (slot->quirks & SDHCI_QUIRK_FORCE_DMA) slot->opt |= SDHCI_HAVE_DMA; + if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE) + slot->opt |= SDHCI_NON_REMOVABLE; /* * Use platform-provided transfer backend @@ -687,8 +698,9 @@ sdhci_init_slot(device_t dev, struct sdh slot_printf(slot, "%uMHz%s %s%s%s%s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (caps & MMC_CAP_8_BIT_DATA) ? "8bits" : - ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), + (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" : + ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" : + "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci.h Wed Jan 18 23:25:46 2017 (r312399) @@ -66,7 +66,13 @@ /* Alternate clock source is required when supplying a 400 KHz clock. */ #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) +/* Issue custom Intel controller reset sequence after power-up. */ +#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) /* * Controller registers Modified: stable/11/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -63,15 +63,15 @@ __FBSDID("$FreeBSD$"); #define PCI_SDHCI_IFVENDOR 0x02 #define PCI_SLOT_INFO 0x40 /* 8 bits */ -#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) -#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) +#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) +#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* * RICOH specific PCI registers */ #define SDHC_PCI_MODE_KEY 0xf9 #define SDHC_PCI_MODE 0x150 -#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_MODE_SD20 0x10 #define SDHC_PCI_BASE_FREQ_KEY 0xfc #define SDHC_PCI_BASE_FREQ 0xe1 @@ -107,6 +107,19 @@ static const struct sdhci_device { SDHCI_QUIRK_RESET_AFTER_REQUEST }, { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, + { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { 0, 0xffff, NULL, 0 } }; @@ -119,8 +132,8 @@ struct sdhci_pci_softc { int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; struct resource *mem_res[6]; /* Memory resource */ - uint8_t cfg_freq; /* Saved mode */ - uint8_t cfg_mode; /* Saved frequency */ + uint8_t cfg_freq; /* Saved frequency */ + uint8_t cfg_mode; /* Saved mode */ }; static int sdhci_enable_msi = 1; @@ -450,11 +463,11 @@ 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_acquire_host, sdhci_generic_acquire_host), - DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + 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), /* SDHCI registers accessors */ DEVMETHOD(sdhci_read_1, sdhci_pci_read_1), From owner-svn-src-stable-11@freebsd.org Thu Jan 19 06:44:29 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A070CB7DC3; Thu, 19 Jan 2017 06:44:29 +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 0F5601E99; Thu, 19 Jan 2017 06:44:28 +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 v0J6iSx0077256; Thu, 19 Jan 2017 06:44:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0J6iSLa077255; Thu, 19 Jan 2017 06:44:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701190644.v0J6iSLa077255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 06:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312401 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 06:44:29 -0000 Author: kib Date: Thu Jan 19 06:44:27 2017 New Revision: 312401 URL: https://svnweb.freebsd.org/changeset/base/312401 Log: MFC r311984: For the main binary, postpone enforcing relro read-only protection until copy relocations are done. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Wed Jan 18 23:26:10 2017 (r312400) +++ stable/11/libexec/rtld-elf/rtld.c Thu Jan 19 06:44:27 2017 (r312401) @@ -100,6 +100,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); +static int obj_enforce_relro(Obj_Entry *); static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); static void objlist_call_init(Objlist *, RtldLockState *); @@ -613,6 +614,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (do_copy_relocations(obj_main) == -1) rtld_die(); + dbg("enforcing main obj relro"); + if (obj_enforce_relro(obj_main) == -1) + rtld_die(); + if (getenv(_LD("DUMP_REL_POST")) != NULL) { dump_relocations(obj_main); exit (0); @@ -2711,14 +2716,8 @@ relocate_object(Obj_Entry *obj, bool bin reloc_non_plt(obj, rtldobj, flags | SYMLOOK_IFUNC, lockstate)) return (-1); - if (obj->relro_size > 0) { - if (mprotect(obj->relro_page, obj->relro_size, - PROT_READ) == -1) { - _rtld_error("%s: Cannot enforce relro protection: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + if (!obj->mainprog && obj_enforce_relro(obj) == -1) + return (-1); /* * Set up the magic number and version in the Obj_Entry. These @@ -5061,6 +5060,19 @@ _rtld_is_dlopened(void *arg) return (res); } +int +obj_enforce_relro(Obj_Entry *obj) +{ + + if (obj->relro_size > 0 && mprotect(obj->relro_page, obj->relro_size, + PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } + return (0); +} + static void map_stacks_exec(RtldLockState *lockstate) { From owner-svn-src-stable-11@freebsd.org Thu Jan 19 11:16:27 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B49CB850A; Thu, 19 Jan 2017 11:16:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 914151C6A; Thu, 19 Jan 2017 11:16:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JBGQM9086331; Thu, 19 Jan 2017 11:16:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JBGQ1n086325; Thu, 19 Jan 2017 11:16:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701191116.v0JBGQ1n086325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Jan 2017 11:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312405 - in stable/11/sys: cam/nvme dev/mmc dev/nand dev/nvd geom X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 11:16:27 -0000 Author: mav Date: Thu Jan 19 11:16:25 2017 New Revision: 312405 URL: https://svnweb.freebsd.org/changeset/base/312405 Log: MFC r311971: Report random flash storage as non-rotating to GEOM_DISK. While doing it, introduce respective constants in geom_disk.h. Modified: stable/11/sys/cam/nvme/nvme_da.c stable/11/sys/dev/mmc/mmcsd.c stable/11/sys/dev/nand/nand_geom.c stable/11/sys/dev/nvd/nvd.c stable/11/sys/geom/geom_disk.c stable/11/sys/geom/geom_disk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_da.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/cam/nvme/nvme_da.c Thu Jan 19 11:16:25 2017 (r312405) @@ -761,7 +761,7 @@ ndaregister(struct cam_periph *periph, v MIN(sizeof(softc->disk->d_descr), sizeof(cd->mn))); strlcpy(softc->disk->d_ident, cd->sn, MIN(sizeof(softc->disk->d_ident), sizeof(cd->sn))); - disk->d_rotation_rate = 0; /* Spinning rust need not apply */ + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk->d_open = ndaopen; disk->d_close = ndaclose; disk->d_strategy = ndastrategy; Modified: stable/11/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/11/sys/dev/mmc/mmcsd.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/mmc/mmcsd.c Thu Jan 19 11:16:25 2017 (r312405) @@ -170,6 +170,7 @@ mmcsd_attach(device_t dev) d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); + d->d_rotation_rate = DISK_RR_NON_ROTATING; /* * Display in most natural units. There's no cards < 1MB. The SD Modified: stable/11/sys/dev/nand/nand_geom.c ============================================================================== --- stable/11/sys/dev/nand/nand_geom.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/nand/nand_geom.c Thu Jan 19 11:16:25 2017 (r312405) @@ -394,6 +394,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(ndisk->d_ident, sizeof(ndisk->d_ident), "nand: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + ndisk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(ndisk, DISK_VERSION); @@ -415,6 +416,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(rdisk->d_ident, sizeof(rdisk->d_ident), "nand_raw: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(rdisk, DISK_VERSION); Modified: stable/11/sys/dev/nvd/nvd.c ============================================================================== --- stable/11/sys/dev/nvd/nvd.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/nvd/nvd.c Thu Jan 19 11:16:25 2017 (r312405) @@ -338,13 +338,11 @@ nvd_new_disk(struct nvme_namespace *ns, */ nvme_strvis(disk->d_ident, nvme_ns_get_serial_number(ns), sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); - nvme_strvis(descr, nvme_ns_get_model_number(ns), sizeof(descr), NVME_MODEL_NUMBER_LENGTH); - -#if __FreeBSD_version >= 900034 strlcpy(disk->d_descr, descr, sizeof(descr)); -#endif + + disk->d_rotation_rate = DISK_RR_NON_ROTATING; ndisk->ns = ns; ndisk->disk = disk; Modified: stable/11/sys/geom/geom_disk.c ============================================================================== --- stable/11/sys/geom/geom_disk.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/geom/geom_disk.c Thu Jan 19 11:16:25 2017 (r312405) @@ -586,12 +586,12 @@ g_disk_dumpconf(struct sbuf *sb, const c * special cases, and there's also a valid range. */ sbuf_printf(sb, "%s", indent); - if (dp->d_rotation_rate == 0) /* Old drives don't */ - sbuf_printf(sb, "unknown"); /* report RPM. */ - else if (dp->d_rotation_rate == 1) /* Since 0 is used */ - sbuf_printf(sb, "0"); /* above, SSDs use 1. */ - else if ((dp->d_rotation_rate >= 0x041) && - (dp->d_rotation_rate <= 0xfffe)) + if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */ + sbuf_printf(sb, "unknown"); /* don't report RPM. */ + else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING) + sbuf_printf(sb, "0"); + else if ((dp->d_rotation_rate >= DISK_RR_MIN) && + (dp->d_rotation_rate <= DISK_RR_MAX)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else sbuf_printf(sb, "invalid"); Modified: stable/11/sys/geom/geom_disk.h ============================================================================== --- stable/11/sys/geom/geom_disk.h Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/geom/geom_disk.h Thu Jan 19 11:16:25 2017 (r312405) @@ -119,6 +119,11 @@ struct disk { #define DISKFLAG_DIRECT_COMPLETION 0x20 #define DISKFLAG_CANZONE 0x80 +#define DISK_RR_UNKNOWN 0 +#define DISK_RR_NON_ROTATING 1 +#define DISK_RR_MIN 0x0401 +#define DISK_RR_MAX 0xfffe + struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); void disk_destroy(struct disk *disk); From owner-svn-src-stable-11@freebsd.org Thu Jan 19 15:27:54 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7635DCB8DA6; Thu, 19 Jan 2017 15:27:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3BF121F71; Thu, 19 Jan 2017 15:27:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JFRr5b091015; Thu, 19 Jan 2017 15:27:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JFRrqr091014; Thu, 19 Jan 2017 15:27:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201701191527.v0JFRrqr091014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 19 Jan 2017 15:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312413 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 15:27:54 -0000 Author: bz Date: Thu Jan 19 15:27:53 2017 New Revision: 312413 URL: https://svnweb.freebsd.org/changeset/base/312413 Log: MFC r311950: Get rid of a compiler warning which I saw too often. Include netinet/in.h before ip_compat.t which will then check if IPPROTO_IPIP is defined or not. Doing it the other way round, ip_compat.h would not find it defined and netinet/in.h then redefine it. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 19 15:06:18 2017 (r312412) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 19 15:27:53 2017 (r312413) @@ -11,6 +11,10 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ +#if !defined(linux) || !defined(_KERNEL) +# include +#endif + #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" #if NETBSD_GE_REV(104040000) @@ -24,10 +28,6 @@ # endif #endif -#if !defined(linux) || !defined(_KERNEL) -# include -#endif - #ifndef SOLARIS # if defined(sun) && (defined(__svr4__) || defined(__SVR4)) # define SOLARIS 1 From owner-svn-src-stable-11@freebsd.org Thu Jan 19 16:07:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99FFCB8821; Thu, 19 Jan 2017 16:07:53 +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 B30C117C9; Thu, 19 Jan 2017 16:07:53 +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 v0JG7qn2012270; Thu, 19 Jan 2017 16:07:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JG7q3R012269; Thu, 19 Jan 2017 16:07:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701191607.v0JG7q3R012269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 19 Jan 2017 16:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312415 - stable/11/sys/boot/forth X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 16:07:54 -0000 Author: asomers Date: Thu Jan 19 16:07:52 2017 New Revision: 312415 URL: https://svnweb.freebsd.org/changeset/base/312415 Log: MFC r310417 Add a dumpdev example to /boot/defaults/loader.conf Modified: stable/11/sys/boot/forth/loader.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/forth/loader.conf ============================================================================== --- stable/11/sys/boot/forth/loader.conf Thu Jan 19 16:01:36 2017 (r312414) +++ stable/11/sys/boot/forth/loader.conf Thu Jan 19 16:07:52 2017 (r312415) @@ -101,6 +101,7 @@ module_path="/boot/modules" # Set the mo #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem +#dumpdev="disk1s1b" # Set a dump device early in the boot process #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, # the block size is set to 512. If the value From owner-svn-src-stable-11@freebsd.org Thu Jan 19 17:49:48 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2272CB5F7C; Thu, 19 Jan 2017 17:49:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A70ED1251; Thu, 19 Jan 2017 17:49:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JHnlos053239; Thu, 19 Jan 2017 17:49:47 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JHnl2Z053238; Thu, 19 Jan 2017 17:49:47 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701191749.v0JHnl2Z053238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 17:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312420 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 17:49:49 -0000 Author: jpaetzel Date: Thu Jan 19 17:49:47 2017 New Revision: 312420 URL: https://svnweb.freebsd.org/changeset/base/312420 Log: MFC 311122 Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem. Reviewed by: kib Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:09:11 2017 (r312419) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:49:47 2017 (r312420) @@ -2018,25 +2018,17 @@ again: } /* - * Check to see if entries in this directory can be safely acquired - * via VFS_VGET() or if a switch to VOP_LOOKUP() is required. - * ZFS snapshot directories need VOP_LOOKUP(), so that any - * automount of the snapshot directory that is required will - * be done. - * This needs to be done here for NFSv4, since NFSv4 never does - * a VFS_VGET() for "." or "..". + * For now ZFS requires VOP_LOOKUP as a workaround. Until ino_t is changed + * to 64 bit type a ZFS filesystem with over 1 billion files in it + * will suffer from 64bit -> 32bit truncation. */ - if (is_zfs == 1) { - r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); - if (r == EOPNOTSUPP) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = LK_SHARED | LK_RETRY; - cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; - } else if (r == 0) - vput(nvp); - } + if (is_zfs == 1) + usevget = 0; + + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = nd->nd_cred; + cn.cn_thread = p; /* * Save this position, in case there is an error before one entry @@ -2105,16 +2097,7 @@ again: else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { - if (usevget) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = - LK_SHARED | - LK_RETRY; - cn.cn_cred = - nd->nd_cred; - cn.cn_thread = p; - } + usevget = 0; cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; cn.cn_flags = ISLASTCN | From owner-svn-src-stable-11@freebsd.org Thu Jan 19 23:38:32 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF735CB8B7C; Thu, 19 Jan 2017 23:38:32 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98B0915F9; Thu, 19 Jan 2017 23:38:32 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JNcVDx099733; Thu, 19 Jan 2017 23:38:31 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNcVM5099732; Thu, 19 Jan 2017 23:38:31 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701192338.v0JNcVM5099732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 23:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312439 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 23:38:32 -0000 Author: jpaetzel Date: Thu Jan 19 23:38:31 2017 New Revision: 312439 URL: https://svnweb.freebsd.org/changeset/base/312439 Log: MFC 310847 310864 Harden CARP against network loops. If there is a loop in the network a CARP that is in MASTER state will see it's own broadcasts, which will then cause it to assume BACKUP state. When it assumes BACKUP it will stop sending advertisements. In that state it will no longer see advertisements and will assume MASTER... We can't catch all the cases where we are seeing our own CARP broadcast, but we can catch the obvious case. Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 structs under the INET6 #ifdef. Similarly (even though it doesn't seem to affect the build), conditionalize all IPv4 structs under the INET #ifdef This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not verified other MACHINE/TARGET pairs (e.g. armv6/arm). Submitted by: torek Obtained from: FreeNAS Pointyhat fix: ngie Modified: stable/11/sys/netinet/ip_carp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Thu Jan 19 22:07:21 2017 (r312438) +++ stable/11/sys/netinet/ip_carp.c Thu Jan 19 23:38:31 2017 (r312439) @@ -581,27 +581,96 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ +/* + * This routine should not be necessary at all, but some switches + * (VMWare ESX vswitches) can echo our own packets back at us, + * and we must ignore them or they will cause us to drop out of + * MASTER mode. + * + * We cannot catch all cases of network loops. Instead, what we + * do here is catch any packet that arrives with a carp header + * with a VHID of 0, that comes from an address that is our own. + * These packets are by definition "from us" (even if they are from + * a misconfigured host that is pretending to be us). + * + * The VHID test is outside this mini-function. + */ +static int +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) +{ +#ifdef INET + struct ip *ip4; + struct in_addr in4; +#endif +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; +#endif + + switch (af) { +#ifdef INET + case AF_INET: + ip4 = mtod(m, struct ip *); + in4 = ifatoia(ifa)->ia_addr.sin_addr; + return (in4.s_addr == ip4->ip_src.s_addr); +#endif +#ifdef INET6 + case AF_INET6: + ip6 = mtod(m, struct ip6_hdr *); + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); +#endif + default: + break; + } + return (0); +} + static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa; + struct ifaddr *ifa, *match; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; + int error; - /* verify that the VHID is valid on the receiving interface */ + /* + * Verify that the VHID is valid on the receiving interface. + * + * There should be just one match. If there are none + * the VHID is not valid and we drop the packet. If + * there are multiple VHID matches, take just the first + * one, for compatibility with previous code. While we're + * scanning, check for obvious loops in the network topology + * (these should never happen, and as noted above, we may + * miss real loops; this is just a double-check). + */ IF_ADDR_RLOCK(ifp); - IFNET_FOREACH_IFA(ifp, ifa) - if (ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { - ifa_ref(ifa); - break; - } + error = 0; + match = NULL; + IFNET_FOREACH_IFA(ifp, ifa) { + if (match == NULL && ifa->ifa_carp != NULL && + ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) + match = ifa; + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) + error = ELOOP; + } + ifa = error ? NULL : match; + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - CARPSTATS_INC(carps_badvhid); + if (error == ELOOP) { + CARP_DEBUG("dropping looped packet on interface %s\n", + ifp->if_xname); + CARPSTATS_INC(carps_badif); /* ??? */ + } else { + CARPSTATS_INC(carps_badvhid); + } m_freem(m); return; } @@ -787,12 +856,41 @@ carp_send_ad_error(struct carp_softc *sc } } +/* + * Pick the best ifaddr on the given ifp for sending CARP + * advertisements. + * + * "Best" here is defined by ifa_preferred(). This function is much + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). + * + * (This could be simplified to return the actual address, except that + * it has a different format in AF_INET and AF_INET6.) + */ +static struct ifaddr * +carp_best_ifa(int af, struct ifnet *ifp) +{ + struct ifaddr *ifa, *best; + + if (af >= AF_MAX) + return (NULL); + best = NULL; + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == af && + (best == NULL || ifa_preferred(best, ifa))) + best = ifa; + } + IF_ADDR_RUNLOCK(ifp); + if (best != NULL) + ifa_ref(best); + return (best); +} + static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; - struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -841,9 +939,7 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_sum = 0; ip_fillid(ip); - bzero(&sa, sizeof(sa)); - sa.sa_family = AF_INET; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -887,11 +983,9 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; - bzero(&sa, sizeof(sa)); /* set the source address */ - sa.sa_family = AF_INET6; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-stable-11@freebsd.org Thu Jan 19 23:42:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30335CB8DD3; Thu, 19 Jan 2017 23:42:53 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F3A411BDE; Thu, 19 Jan 2017 23:42:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JNgquw003697; Thu, 19 Jan 2017 23:42:52 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNgq7d003696; Thu, 19 Jan 2017 23:42:52 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201701192342.v0JNgq7d003696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 19 Jan 2017 23:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312441 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 23:42:53 -0000 Author: rpokala Date: Thu Jan 19 23:42:51 2017 New Revision: 312441 URL: https://svnweb.freebsd.org/changeset/base/312441 Log: MFC r311963: Remove writability requirement for single-mbuf, contiguous- range m_pulldown() m_pulldown() only needs to determine if a mbuf is writable if it is going to copy data into the data region of an existing mbuf. It does this to create a contiguous data region in a single mbuf from multiple mbufs in the chain. If the requested memory region is already contiguous and nothing needs to change, the mbuf does not need to be writeable. Modified: stable/11/sys/kern/uipc_mbuf2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mbuf2.c ============================================================================== --- stable/11/sys/kern/uipc_mbuf2.c Thu Jan 19 23:42:26 2017 (r312440) +++ stable/11/sys/kern/uipc_mbuf2.c Thu Jan 19 23:42:51 2017 (r312441) @@ -159,7 +159,7 @@ m_pulldown(struct mbuf *m, int off, int * the target data is on . * if we got enough data on the mbuf "n", we're done. */ - if ((off == 0 || offp) && len <= n->m_len - off && writable) + if ((off == 0 || offp) && len <= n->m_len - off) goto ok; /* From owner-svn-src-stable-11@freebsd.org Thu Jan 19 23:57:03 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404B4CB887E; Thu, 19 Jan 2017 23:57:03 +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 2B41316A6; Thu, 19 Jan 2017 23:57:02 +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 v0JNv1Dr070739 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jan 2017 15:57:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0JNv1BI070738; Thu, 19 Jan 2017 15:57:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jan 2017 15:57:00 -0800 From: Gleb Smirnoff To: Josh Paetzel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r312439 - stable/11/sys/netinet Message-ID: <20170119235700.GM2611@FreeBSD.org> References: <201701192338.v0JNcVM5099732@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701192338.v0JNcVM5099732@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 23:57:03 -0000 Josh, did you notice my reply to the original commit?! On Thu, Jan 19, 2017 at 11:38:31PM +0000, Josh Paetzel wrote: J> Author: jpaetzel J> Date: Thu Jan 19 23:38:31 2017 J> New Revision: 312439 J> URL: https://svnweb.freebsd.org/changeset/base/312439 J> J> Log: J> MFC 310847 310864 J> J> Harden CARP against network loops. J> J> If there is a loop in the network a CARP that is in MASTER state will see it's J> own broadcasts, which will then cause it to assume BACKUP state. When it J> assumes BACKUP it will stop sending advertisements. In that state it will no J> longer see advertisements and will assume MASTER... J> J> We can't catch all the cases where we are seeing our own CARP broadcast, but J> we can catch the obvious case. J> J> Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 J> structs under the INET6 #ifdef. Similarly (even though it doesn't seem J> to affect the build), conditionalize all IPv4 structs under the INET J> #ifdef J> J> This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not J> verified other MACHINE/TARGET pairs (e.g. armv6/arm). J> J> Submitted by: torek J> Obtained from: FreeNAS J> Pointyhat fix: ngie J> J> Modified: J> stable/11/sys/netinet/ip_carp.c J> Directory Properties: J> stable/11/ (props changed) J> J> Modified: stable/11/sys/netinet/ip_carp.c J> ============================================================================== J> --- stable/11/sys/netinet/ip_carp.c Thu Jan 19 22:07:21 2017 (r312438) J> +++ stable/11/sys/netinet/ip_carp.c Thu Jan 19 23:38:31 2017 (r312439) J> @@ -581,27 +581,96 @@ carp6_input(struct mbuf **mp, int *offp, J> } J> #endif /* INET6 */ J> J> +/* J> + * This routine should not be necessary at all, but some switches J> + * (VMWare ESX vswitches) can echo our own packets back at us, J> + * and we must ignore them or they will cause us to drop out of J> + * MASTER mode. J> + * J> + * We cannot catch all cases of network loops. Instead, what we J> + * do here is catch any packet that arrives with a carp header J> + * with a VHID of 0, that comes from an address that is our own. J> + * These packets are by definition "from us" (even if they are from J> + * a misconfigured host that is pretending to be us). J> + * J> + * The VHID test is outside this mini-function. J> + */ J> +static int J> +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) J> +{ J> +#ifdef INET J> + struct ip *ip4; J> + struct in_addr in4; J> +#endif J> +#ifdef INET6 J> + struct ip6_hdr *ip6; J> + struct in6_addr in6; J> +#endif J> + J> + switch (af) { J> +#ifdef INET J> + case AF_INET: J> + ip4 = mtod(m, struct ip *); J> + in4 = ifatoia(ifa)->ia_addr.sin_addr; J> + return (in4.s_addr == ip4->ip_src.s_addr); J> +#endif J> +#ifdef INET6 J> + case AF_INET6: J> + ip6 = mtod(m, struct ip6_hdr *); J> + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; J> + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); J> +#endif J> + default: J> + break; J> + } J> + return (0); J> +} J> + J> static void J> carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) J> { J> struct ifnet *ifp = m->m_pkthdr.rcvif; J> - struct ifaddr *ifa; J> + struct ifaddr *ifa, *match; J> struct carp_softc *sc; J> uint64_t tmp_counter; J> struct timeval sc_tv, ch_tv; J> + int error; J> J> - /* verify that the VHID is valid on the receiving interface */ J> + /* J> + * Verify that the VHID is valid on the receiving interface. J> + * J> + * There should be just one match. If there are none J> + * the VHID is not valid and we drop the packet. If J> + * there are multiple VHID matches, take just the first J> + * one, for compatibility with previous code. While we're J> + * scanning, check for obvious loops in the network topology J> + * (these should never happen, and as noted above, we may J> + * miss real loops; this is just a double-check). J> + */ J> IF_ADDR_RLOCK(ifp); J> - IFNET_FOREACH_IFA(ifp, ifa) J> - if (ifa->ifa_addr->sa_family == af && J> - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { J> - ifa_ref(ifa); J> - break; J> - } J> + error = 0; J> + match = NULL; J> + IFNET_FOREACH_IFA(ifp, ifa) { J> + if (match == NULL && ifa->ifa_carp != NULL && J> + ifa->ifa_addr->sa_family == af && J> + ifa->ifa_carp->sc_vhid == ch->carp_vhid) J> + match = ifa; J> + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) J> + error = ELOOP; J> + } J> + ifa = error ? NULL : match; J> + if (ifa != NULL) J> + ifa_ref(ifa); J> IF_ADDR_RUNLOCK(ifp); J> J> if (ifa == NULL) { J> - CARPSTATS_INC(carps_badvhid); J> + if (error == ELOOP) { J> + CARP_DEBUG("dropping looped packet on interface %s\n", J> + ifp->if_xname); J> + CARPSTATS_INC(carps_badif); /* ??? */ J> + } else { J> + CARPSTATS_INC(carps_badvhid); J> + } J> m_freem(m); J> return; J> } J> @@ -787,12 +856,41 @@ carp_send_ad_error(struct carp_softc *sc J> } J> } J> J> +/* J> + * Pick the best ifaddr on the given ifp for sending CARP J> + * advertisements. J> + * J> + * "Best" here is defined by ifa_preferred(). This function is much J> + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). J> + * J> + * (This could be simplified to return the actual address, except that J> + * it has a different format in AF_INET and AF_INET6.) J> + */ J> +static struct ifaddr * J> +carp_best_ifa(int af, struct ifnet *ifp) J> +{ J> + struct ifaddr *ifa, *best; J> + J> + if (af >= AF_MAX) J> + return (NULL); J> + best = NULL; J> + IF_ADDR_RLOCK(ifp); J> + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { J> + if (ifa->ifa_addr->sa_family == af && J> + (best == NULL || ifa_preferred(best, ifa))) J> + best = ifa; J> + } J> + IF_ADDR_RUNLOCK(ifp); J> + if (best != NULL) J> + ifa_ref(best); J> + return (best); J> +} J> + J> static void J> carp_send_ad_locked(struct carp_softc *sc) J> { J> struct carp_header ch; J> struct timeval tv; J> - struct sockaddr sa; J> struct ifaddr *ifa; J> struct carp_header *ch_ptr; J> struct mbuf *m; J> @@ -841,9 +939,7 @@ carp_send_ad_locked(struct carp_softc *s J> ip->ip_sum = 0; J> ip_fillid(ip); J> J> - bzero(&sa, sizeof(sa)); J> - sa.sa_family = AF_INET; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); J> if (ifa != NULL) { J> ip->ip_src.s_addr = J> ifatoia(ifa)->ia_addr.sin_addr.s_addr; J> @@ -887,11 +983,9 @@ carp_send_ad_locked(struct carp_softc *s J> ip6->ip6_vfc |= IPV6_VERSION; J> ip6->ip6_hlim = CARP_DFLTTL; J> ip6->ip6_nxt = IPPROTO_CARP; J> - bzero(&sa, sizeof(sa)); J> J> /* set the source address */ J> - sa.sa_family = AF_INET6; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); J> if (ifa != NULL) { J> bcopy(IFA_IN6(ifa), &ip6->ip6_src, J> sizeof(struct in6_addr)); J> _______________________________________________ J> svn-src-all@freebsd.org mailing list J> https://lists.freebsd.org/mailman/listinfo/svn-src-all J> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-stable-11@freebsd.org Fri Jan 20 00:17:55 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB94CB57BF; Fri, 20 Jan 2017 00:17:55 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85BB1AF4; Fri, 20 Jan 2017 00:17:54 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0K0Hrgk016685; Fri, 20 Jan 2017 00:17:53 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K0Hr4t016684; Fri, 20 Jan 2017 00:17:53 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701200017.v0K0Hr4t016684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 20 Jan 2017 00:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312445 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 00:17:55 -0000 Author: jpaetzel Date: Fri Jan 20 00:17:53 2017 New Revision: 312445 URL: https://svnweb.freebsd.org/changeset/base/312445 Log: Revert MFC of 310847 and 310864 Requested by glebius who had questions about the original head commit that I didn't see. Modified: stable/11/sys/netinet/ip_carp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Fri Jan 20 00:15:11 2017 (r312444) +++ stable/11/sys/netinet/ip_carp.c Fri Jan 20 00:17:53 2017 (r312445) @@ -581,96 +581,27 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ -/* - * This routine should not be necessary at all, but some switches - * (VMWare ESX vswitches) can echo our own packets back at us, - * and we must ignore them or they will cause us to drop out of - * MASTER mode. - * - * We cannot catch all cases of network loops. Instead, what we - * do here is catch any packet that arrives with a carp header - * with a VHID of 0, that comes from an address that is our own. - * These packets are by definition "from us" (even if they are from - * a misconfigured host that is pretending to be us). - * - * The VHID test is outside this mini-function. - */ -static int -carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) -{ -#ifdef INET - struct ip *ip4; - struct in_addr in4; -#endif -#ifdef INET6 - struct ip6_hdr *ip6; - struct in6_addr in6; -#endif - - switch (af) { -#ifdef INET - case AF_INET: - ip4 = mtod(m, struct ip *); - in4 = ifatoia(ifa)->ia_addr.sin_addr; - return (in4.s_addr == ip4->ip_src.s_addr); -#endif -#ifdef INET6 - case AF_INET6: - ip6 = mtod(m, struct ip6_hdr *); - in6 = ifatoia6(ifa)->ia_addr.sin6_addr; - return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); -#endif - default: - break; - } - return (0); -} - static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa, *match; + struct ifaddr *ifa; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; - int error; - /* - * Verify that the VHID is valid on the receiving interface. - * - * There should be just one match. If there are none - * the VHID is not valid and we drop the packet. If - * there are multiple VHID matches, take just the first - * one, for compatibility with previous code. While we're - * scanning, check for obvious loops in the network topology - * (these should never happen, and as noted above, we may - * miss real loops; this is just a double-check). - */ + /* verify that the VHID is valid on the receiving interface */ IF_ADDR_RLOCK(ifp); - error = 0; - match = NULL; - IFNET_FOREACH_IFA(ifp, ifa) { - if (match == NULL && ifa->ifa_carp != NULL && - ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) - match = ifa; - if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) - error = ELOOP; - } - ifa = error ? NULL : match; - if (ifa != NULL) - ifa_ref(ifa); + IFNET_FOREACH_IFA(ifp, ifa) + if (ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) { + ifa_ref(ifa); + break; + } IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - if (error == ELOOP) { - CARP_DEBUG("dropping looped packet on interface %s\n", - ifp->if_xname); - CARPSTATS_INC(carps_badif); /* ??? */ - } else { - CARPSTATS_INC(carps_badvhid); - } + CARPSTATS_INC(carps_badvhid); m_freem(m); return; } @@ -856,41 +787,12 @@ carp_send_ad_error(struct carp_softc *sc } } -/* - * Pick the best ifaddr on the given ifp for sending CARP - * advertisements. - * - * "Best" here is defined by ifa_preferred(). This function is much - * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). - * - * (This could be simplified to return the actual address, except that - * it has a different format in AF_INET and AF_INET6.) - */ -static struct ifaddr * -carp_best_ifa(int af, struct ifnet *ifp) -{ - struct ifaddr *ifa, *best; - - if (af >= AF_MAX) - return (NULL); - best = NULL; - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family == af && - (best == NULL || ifa_preferred(best, ifa))) - best = ifa; - } - IF_ADDR_RUNLOCK(ifp); - if (best != NULL) - ifa_ref(best); - return (best); -} - static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; + struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -939,7 +841,9 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_sum = 0; ip_fillid(ip); - ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); + bzero(&sa, sizeof(sa)); + sa.sa_family = AF_INET; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -983,9 +887,11 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; + bzero(&sa, sizeof(sa)); /* set the source address */ - ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); + sa.sa_family = AF_INET6; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-stable-11@freebsd.org Fri Jan 20 02:46:16 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983B4CB7F2C; Fri, 20 Jan 2017 02:46:16 +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 364A21EB7; Fri, 20 Jan 2017 02:46:16 +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 v0K2kF7M077001; Fri, 20 Jan 2017 02:46:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2kEa2076991; Fri, 20 Jan 2017 02:46:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200246.v0K2kEa2076991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312447 - in stable/11/contrib/llvm/projects/libunwind: include src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 02:46:16 -0000 Author: emaste Date: Fri Jan 20 02:46:14 2017 New Revision: 312447 URL: https://svnweb.freebsd.org/changeset/base/312447 Log: MFC r308006: libunwind: consistently add \n to log and trace messages Previously most messages included a newline in the string, but a few of them were missing. Fix these and simplify by just adding the newline in the _LIBUNWIND_LOG macro itself. While here correct 'libuwind' typo (missing 'n'). Upstream LLVM libunwind commits r280086 and r280103. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/include/libunwind.h stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c stable/11/contrib/llvm/projects/libunwind/src/config.h stable/11/contrib/llvm/projects/libunwind/src/libunwind.cpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/include/libunwind.h ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/include/libunwind.h Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/include/libunwind.h Fri Jan 20 02:46:14 2017 (r312447) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// Compatible with libuwind API documented at: +// Compatible with libunwind API documented at: // http://www.nongnu.org/libunwind/man/libunwind(3).html // //===----------------------------------------------------------------------===// @@ -120,7 +120,7 @@ extern int unw_init_remote_thread(unw_cu #endif /* UNW_REMOTE */ /* - * traditional libuwind "remote" API + * traditional libunwind "remote" API * NOT IMPLEMENTED on Mac OS X * * extern int unw_init_remote(unw_cursor_t*, unw_addr_space_t, Modified: stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -374,7 +374,7 @@ inline bool LocalAddressSpace::findUnwin (_Unwind_Ptr) targetAddr, &length); info.arm_section_length = (uintptr_t)length; #endif - _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x\n", + _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x", info.arm_section, info.arm_section_length); if (info.arm_section && info.arm_section_length) return true; Modified: stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -105,7 +105,7 @@ int CompactUnwinder_x86::stepWithComp default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for EBP frame, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -224,7 +224,7 @@ int CompactUnwinder_x86::stepWithComp break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -336,7 +336,7 @@ int CompactUnwinder_x86_64::stepWithC default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -455,7 +455,7 @@ int CompactUnwinder_x86_64::stepWithC break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } Modified: stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -85,7 +85,7 @@ bool EHHeaderParser::decodeTableEntry const char *message = CFI_Parser::decodeFDE(addressSpace, fde, fdeInfo, cieInfo); if (message != NULL) { - _LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s\n", + _LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s", message); return false; } Modified: stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jan 20 02:46:14 2017 (r312447) @@ -454,7 +454,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_proc_info_t frameInfo; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -472,7 +472,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX, func=%s, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast(exception_object), (long long)pc, (long long)frameInfo.start_ip, functionName, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -484,7 +484,7 @@ unwind_phase1(unw_context_t *uc, unw_cur __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): calling personality function %p\n", + "unwind_phase1(ex_ojb=%p): calling personality function %p", static_cast(exception_object), reinterpret_cast(reinterpret_cast(p))); struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); @@ -496,7 +496,7 @@ unwind_phase1(unw_context_t *uc, unw_cur (*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p " - "additional %x\n", + "additional %x", static_cast(exception_object), personalityResult, exception_object->pr_cache.fnstart, static_cast(exception_object->pr_cache.ehtp), @@ -508,13 +508,13 @@ unwind_phase1(unw_context_t *uc, unw_cur handlerNotFound = false; // p should have initialized barrier_cache. EHABI #7.3.5 _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n", + "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", static_cast(exception_object)); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast(exception_object)); // continue unwinding break; @@ -526,7 +526,7 @@ unwind_phase1(unw_context_t *uc, unw_cur default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -541,13 +541,13 @@ static _Unwind_Reason_Code unwind_phase2 // See comment at the start of unwind_phase1 regarding VRS integrity. unw_init_local(cursor, uc); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", static_cast(exception_object)); int frame_count = 0; // Walk each frame until we reach where search phase said to stop. while (true) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException or _Unwind_Resume). // // Resume only ever makes sense for 1 frame. @@ -572,7 +572,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE2_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE2_ERROR; } @@ -588,7 +588,7 @@ static _Unwind_Reason_Code unwind_phase2 functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s, sp=0x%llX, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast(exception_object), (long long)frameInfo.start_ip, functionName, (long long)sp, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -610,7 +610,7 @@ static _Unwind_Reason_Code unwind_phase2 case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast(exception_object)); // EHABI #7.2 if (sp == exception_object->barrier_cache.sp) { @@ -621,7 +621,7 @@ static _Unwind_Reason_Code unwind_phase2 break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n", + "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", static_cast(exception_object)); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). @@ -630,7 +630,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_IP, &pc); unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " - "user code with ip=0x%llX, sp=0x%llX\n", + "user code with ip=0x%llX, sp=0x%llX", static_cast(exception_object), (long long)pc, (long long)sp); } @@ -668,7 +668,7 @@ static _Unwind_Reason_Code unwind_phase2 /// Called by __cxa_throw. Only returns if there is a fatal error. _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)", static_cast(exception_object)); unw_context_t uc; unw_cursor_t cursor; @@ -706,7 +706,7 @@ _LIBUNWIND_EXPORT void _Unwind_Complete( /// in turn calls _Unwind_Resume_or_Rethrow(). _LIBUNWIND_EXPORT void _Unwind_Resume(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", static_cast(exception_object)); unw_context_t uc; unw_cursor_t cursor; @@ -730,7 +730,7 @@ _Unwind_GetLanguageSpecificData(struct _ if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.lsda; _LIBUNWIND_TRACE_API( - "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx\n", + "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx", static_cast(context), (long long)result); return result; } @@ -758,7 +758,7 @@ _Unwind_VRS_Set(_Unwind_Context *context uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX)\n", + "rep=%d, value=0x%llX)", static_cast(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep)); @@ -863,7 +863,7 @@ _Unwind_VRS_Result _Unwind_VRS_Get( _Unwind_VRS_Get_Internal(context, regclass, regno, representation, valuep); _LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX, result = %d)\n", + "rep=%d, value=0x%llX, result = %d)", static_cast(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep), result); @@ -875,7 +875,7 @@ _Unwind_VRS_Pop(_Unwind_Context *context uint32_t discriminator, _Unwind_VRS_DataRepresentation representation) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, " - "discriminator=%d, representation=%d)\n", + "discriminator=%d, representation=%d)", static_cast(context), regclass, discriminator, representation); switch (regclass) { @@ -948,7 +948,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co uintptr_t result = 0; if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.start_ip; - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX\n", + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX", static_cast(context), (long long)result); return result; } @@ -958,7 +958,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co // is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", static_cast(exception_object)); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, Modified: stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c Fri Jan 20 02:46:14 2017 (r312447) @@ -72,7 +72,7 @@ _Unwind_SjLj_Unregister(struct _Unwind_F static _Unwind_Reason_Code unwind_phase1(struct _Unwind_Exception *exception_object) { _Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack(); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p\n", c); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p", c); // walk each frame looking for a place to stop for (bool handlerNotFound = true; handlerNotFound; c = c->prev) { @@ -80,17 +80,17 @@ unwind_phase1(struct _Unwind_Exception * // check for no more frames if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p\n", c); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p", c); // if there is a personality routine, ask it if it will want to stop at this // frame if (c->personality != NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): calling " - "personality function %p\n", + "personality function %p", exception_object, c->personality); _Unwind_Reason_Code personalityResult = (*c->personality)( 1, _UA_SEARCH_PHASE, exception_object->exception_class, @@ -102,19 +102,19 @@ unwind_phase1(struct _Unwind_Exception * handlerNotFound = false; exception_object->private_2 = (uintptr_t) c; _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): " - "_URC_HANDLER_FOUND\n", exception_object); + "_URC_HANDLER_FOUND", exception_object); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): " - "_URC_CONTINUE_UNWIND\n", exception_object); + "_URC_CONTINUE_UNWIND", exception_object); // continue unwinding break; default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -126,18 +126,18 @@ unwind_phase1(struct _Unwind_Exception * static _Unwind_Reason_Code unwind_phase2(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", exception_object); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", exception_object); // walk each frame until we reach where search phase said to stop _Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack(); while (true) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p", exception_object, c); // check for no more frames if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } @@ -157,7 +157,7 @@ unwind_phase2(struct _Unwind_Exception * case _URC_CONTINUE_UNWIND: // continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", exception_object); if ((uintptr_t) c == exception_object->private_2) { // phase 1 said we would stop at this frame, but we did not... @@ -168,7 +168,7 @@ unwind_phase2(struct _Unwind_Exception * case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): " "_URC_INSTALL_CONTEXT, will resume at " - "landing pad %p\n", + "landing pad %p", exception_object, c->jbuf[1]); // personality routine says to transfer control to landing pad // we may get control back if landing pad calls _Unwind_Resume() @@ -202,7 +202,7 @@ unwind_phase2_forced(struct _Unwind_Exce // get next frame (skip over first which is _Unwind_RaiseException) if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } @@ -214,11 +214,11 @@ unwind_phase2_forced(struct _Unwind_Exce (*stop)(1, action, exception_object->exception_class, exception_object, (struct _Unwind_Context *)c, stop_parameter); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "stop function returned %d\n", + "stop function returned %d", exception_object, stopResult); if (stopResult != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "stopped by stop function\n", + "stopped by stop function", exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -227,7 +227,7 @@ unwind_phase2_forced(struct _Unwind_Exce if (c->personality != NULL) { __personality_routine p = (__personality_routine) c->personality; _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "calling personality function %p\n", + "calling personality function %p", exception_object, p); _Unwind_Reason_Code personalityResult = (*p)(1, action, exception_object->exception_class, exception_object, @@ -235,13 +235,13 @@ unwind_phase2_forced(struct _Unwind_Exce switch (personalityResult) { case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "personality returned _URC_CONTINUE_UNWIND\n", + "personality returned _URC_CONTINUE_UNWIND", exception_object); // destructors called, continue unwinding break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "personality returned _URC_INSTALL_CONTEXT\n", + "personality returned _URC_INSTALL_CONTEXT", exception_object); // we may get control back if landing pad calls _Unwind_Resume() __Unwind_SjLj_SetTopOfFunctionStack(c); @@ -251,7 +251,7 @@ unwind_phase2_forced(struct _Unwind_Exce // something went wrong _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " "personality returned %d, " - "_URC_FATAL_PHASE2_ERROR\n", + "_URC_FATAL_PHASE2_ERROR", exception_object, personalityResult); return _URC_FATAL_PHASE2_ERROR; } @@ -262,7 +262,7 @@ unwind_phase2_forced(struct _Unwind_Exce // call stop function one last time and tell it we've reached the end of the // stack _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop " - "function with _UA_END_OF_STACK\n", + "function with _UA_END_OF_STACK", exception_object); _Unwind_Action lastAction = (_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK); @@ -278,7 +278,7 @@ unwind_phase2_forced(struct _Unwind_Exce /// Called by __cxa_throw. Only returns if there is a fatal error _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_SjLj_RaiseException(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)\n", exception_object); + _LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)", exception_object); // mark that this is a non-forced unwind, so _Unwind_Resume() can do the right // thing @@ -308,7 +308,7 @@ _Unwind_SjLj_RaiseException(struct _Unwi /// __cxa_rethrow() which in turn calls _Unwind_Resume_or_Rethrow() _LIBUNWIND_EXPORT void _Unwind_SjLj_Resume(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)\n", exception_object); + _LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)", exception_object); if (exception_object->private_1 != 0) unwind_phase2_forced(exception_object, @@ -326,7 +326,7 @@ _Unwind_SjLj_Resume(struct _Unwind_Excep _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *exception_object) { _LIBUNWIND_TRACE_API("__Unwind_SjLj_Resume_or_Rethrow(ex_obj=%p), " - "private_1=%ld\n", + "private_1=%ld", exception_object, exception_object->private_1); // If this is non-forced and a stopping place was found, then this is a // re-throw. @@ -350,7 +350,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; _LIBUNWIND_TRACE_API("_Unwind_GetLanguageSpecificData(context=%p) " - "=> 0x%0lX\n", context, ufc->lsda); + "=> 0x%0lX", context, ufc->lsda); return ufc->lsda; } @@ -358,7 +358,7 @@ _Unwind_GetLanguageSpecificData(struct _ /// Called by personality handler during phase 2 to get register values. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) { - _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)\n", + _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)", context, index); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; return ufc->resumeParameters[index]; @@ -368,7 +368,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetG /// Called by personality handler during phase 2 to alter register values. _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index, uintptr_t new_value) { - _LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)\n" + _LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)" , context, index, new_value); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; ufc->resumeParameters[index] = new_value; @@ -378,7 +378,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(str /// Called by personality handler during phase 2 to get instruction pointer. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; - _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX\n", context, + _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX", context, ufc->resumeLocation + 1); return ufc->resumeLocation + 1; } @@ -391,7 +391,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI int *ipBefore) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; *ipBefore = 0; - _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX\n", + _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX", context, ipBefore, ufc->resumeLocation + 1); return ufc->resumeLocation + 1; } @@ -400,7 +400,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI /// Called by personality handler during phase 2 to alter instruction pointer. _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t new_value) { - _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)\n", + _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)", context, new_value); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; ufc->resumeLocation = new_value - 1; @@ -413,7 +413,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)", context); return 0; } @@ -422,7 +422,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co /// is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", exception_object); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, @@ -437,7 +437,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", context); _LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented"); } @@ -448,14 +448,14 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", context); _LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented"); } /// Called by personality handler to get "Call Frame Area" for current frame. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) { - _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)", context); if (context != NULL) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; // Setjmp/longjmp based exceptions don't have a true CFA. Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// C++ interface to lower levels of libuwind +// C++ interface to lower levels of libunwind //===----------------------------------------------------------------------===// #ifndef __UNWINDCURSOR_HPP__ @@ -935,7 +935,7 @@ bool UnwindCursor::getInfoFromDwar return true; } } - //_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX\n", (uint64_t)pc); + //_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX", (uint64_t)pc); return false; } #endif // _LIBUNWIND_SUPPORT_DWARF_UNWIND @@ -1092,13 +1092,13 @@ bool UnwindCursor::getInfoFromComp funcEnd = firstLevelNextPageFunctionOffset + sects.dso_base; if (pc < funcStart) { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second " - "level compressed unwind table. funcStart=0x%llX\n", + "level compressed unwind table. funcStart=0x%llX", (uint64_t) pc, (uint64_t) funcStart); return false; } if (pc > funcEnd) { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second " - "level compressed unwind table. funcEnd=0x%llX\n", + "level compressed unwind table. funcEnd=0x%llX", (uint64_t) pc, (uint64_t) funcEnd); return false; } @@ -1119,7 +1119,7 @@ bool UnwindCursor::getInfoFromComp } } else { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info at 0x%0llX bad second " - "level page\n", + "level page", (uint64_t) sects.compact_unwind_section); return false; } @@ -1149,7 +1149,7 @@ bool UnwindCursor::getInfoFromComp } if (lsda == 0) { _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with HAS_LSDA bit set for " - "pc=0x%0llX, but lsda table has no entry\n", + "pc=0x%0llX, but lsda table has no entry", encoding, (uint64_t) pc); return false; } @@ -1162,7 +1162,7 @@ bool UnwindCursor::getInfoFromComp --personalityIndex; // change 1-based to zero-based index if (personalityIndex > sectionHeader.personalityArrayCount()) { _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, " - "but personality table has only %d entires\n", + "but personality table has only %d entires", encoding, personalityIndex, sectionHeader.personalityArrayCount()); return false; Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:46:14 2017 (r312447) @@ -29,11 +29,11 @@ _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { #if _LIBUNWIND_ARM_EHABI - _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld", (void *)exception_object, (long)exception_object->unwinder_cache.reserved1); #else - _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld", (void *)exception_object, (long)exception_object->private_1); #endif @@ -66,7 +66,7 @@ _Unwind_Resume_or_Rethrow(_Unwind_Except _LIBUNWIND_EXPORT uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) { (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", (void *)context); _LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented"); } @@ -76,7 +76,7 @@ _Unwind_GetDataRelBase(struct _Unwind_Co _LIBUNWIND_EXPORT uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) { (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", (void *)context); _LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented"); } @@ -84,7 +84,7 @@ _Unwind_GetTextRelBase(struct _Unwind_Co /// Scans unwind information to find the function that contains the /// specified code address "pc". _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { - _LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)\n", pc); + _LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)", pc); // This is slow, but works. // We create an unwind cursor then alter the IP to be pc unw_cursor_t cursor; @@ -108,7 +108,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb unw_getcontext(&uc); unw_init_local(&cursor, &uc); - _LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)", (void *)(uintptr_t)callback); #if _LIBUNWIND_ARM_EHABI @@ -123,11 +123,11 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb _Unwind_Reason_Code result; #if !_LIBUNWIND_ARM_EHABI - // ask libuwind to get next frame (skip over first frame which is + // ask libunwind to get next frame (skip over first frame which is // _Unwind_Backtrace()) if (unw_step(&cursor) <= 0) { _LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached " - "bottom of stack, returning %d\n", + "bottom of stack, returning %d", _URC_END_OF_STACK); return _URC_END_OF_STACK; } @@ -164,7 +164,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb unw_get_proc_name(&cursor, functionName, 512, &offset); unw_get_proc_info(&cursor, &frame); _LIBUNWIND_TRACE_UNWINDING( - " _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p\n", + " _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p", (long long)frame.start_ip, functionName, (long long)frame.lsda, (void *)&cursor); } @@ -173,7 +173,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb result = (*callback)((struct _Unwind_Context *)(&cursor), ref); if (result != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING( - " _backtrace: ended because callback returned %d\n", result); + " _backtrace: ended because callback returned %d", result); return result; } } @@ -195,7 +195,7 @@ _LIBUNWIND_EXPORT const void *_Unwind_Fi bases->tbase = (uintptr_t)info.extra; bases->dbase = 0; // dbase not used on Mac OS X bases->func = (uintptr_t)info.start_ip; - _LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p\n", pc, + _LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p", pc, (void *)(long) info.unwind_info); return (void *)(long) info.unwind_info; } @@ -206,7 +206,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetC unw_cursor_t *cursor = (unw_cursor_t *)context; unw_word_t result; unw_get_reg(cursor, UNW_REG_SP, &result); - _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64 "\n", + _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64, (void *)context, (uint64_t)result); return (uintptr_t)result; } @@ -217,7 +217,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetC /// site address. Normally IP is the return address. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, int *ipBefore) { - _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)", (void *)context); *ipBefore = 0; return _Unwind_GetIP(context); } @@ -229,7 +229,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI /// This function has existed on Mac OS X since 10.4, but /// was broken until 10.6. _LIBUNWIND_EXPORT void __register_frame(const void *fde) { - _LIBUNWIND_TRACE_API("__register_frame(%p)\n", fde); + _LIBUNWIND_TRACE_API("__register_frame(%p)", fde); _unw_add_dynamic_fde((unw_word_t)(uintptr_t) fde); } @@ -239,7 +239,7 @@ _LIBUNWIND_EXPORT void __register_frame( /// This function has existed on Mac OS X since 10.4, but /// was broken until 10.6. _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { - _LIBUNWIND_TRACE_API("__deregister_frame(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame(%p)", fde); _unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde); } @@ -259,7 +259,7 @@ _LIBUNWIND_EXPORT void __register_frame_ (void)ob; (void)tb; (void)db; - _LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)\n", + _LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)", fde, ob, tb, db); // do nothing, this function never worked in Mac OS X } @@ -267,7 +267,7 @@ _LIBUNWIND_EXPORT void __register_frame_ _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { (void)fde; (void)ob; - _LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)\n", fde, ob); + _LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)", fde, ob); // do nothing, this function never worked in Mac OS X } @@ -279,33 +279,33 @@ _LIBUNWIND_EXPORT void __register_frame_ (void)tb; (void)db; _LIBUNWIND_TRACE_API("__register_frame_info_table_bases" - "(%p,%p, %p, %p)\n", fde, ob, tb, db); + "(%p,%p, %p, %p)", fde, ob, tb, db); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) { (void)fde; (void)ob; - _LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)\n", fde, ob); + _LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)", fde, ob); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__register_frame_table(%p)\n", fde); + _LIBUNWIND_TRACE_API("__register_frame_table(%p)", fde); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__deregister_frame_info(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame_info(%p)", fde); // do nothing, this function never worked in Mac OS X return NULL; } _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)", fde); // do nothing, this function never worked in Mac OS X return NULL; } Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c Fri Jan 20 02:46:14 2017 (r312447) @@ -39,17 +39,17 @@ unwind_phase1(unw_context_t *uc, unw_cur // Walk each frame looking for a place to stop. bool handlerNotFound = true; while (handlerNotFound) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", (void *)exception_object); return _URC_END_OF_STACK; } else if (stepResult < 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", + "_URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -59,7 +59,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_word_t sp; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -77,7 +77,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%" PRIx64 - ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n", + ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "", (void *)exception_object, pc, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } @@ -88,7 +88,7 @@ unwind_phase1(unw_context_t *uc, unw_cur __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): calling personality function %p\n", + "unwind_phase1(ex_ojb=%p): calling personality function %p", (void *)exception_object, (void *)(uintptr_t)p); _Unwind_Reason_Code personalityResult = (*p)(1, _UA_SEARCH_PHASE, exception_object->exception_class, @@ -101,13 +101,13 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); exception_object->private_2 = (uintptr_t)sp; _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n", + "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", (void *)exception_object); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", (void *)exception_object); // continue unwinding break; @@ -115,7 +115,7 @@ unwind_phase1(unw_context_t *uc, unw_cur default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -129,23 +129,23 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { unw_init_local(cursor, uc); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", (void *)exception_object); // Walk each frame until we reach where search phase said to stop. while (true) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", (void *)exception_object); return _URC_END_OF_STACK; } else if (stepResult < 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", + "_URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -156,7 +156,7 @@ unwind_phase2(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -172,7 +172,7 @@ unwind_phase2(unw_context_t *uc, unw_cur functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIx64 ", func=%s, sp=0x%" PRIx64 ", lsda=0x%" PRIx64 - ", personality=0x%" PRIx64 "\n", + ", personality=0x%" PRIx64, (void *)exception_object, frameInfo.start_ip, functionName, sp, frameInfo.lsda, frameInfo.handler); @@ -194,7 +194,7 @@ unwind_phase2(unw_context_t *uc, unw_cur case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", (void *)exception_object); if (sp == exception_object->private_2) { // Phase 1 said we would stop at this frame, but we did not... @@ -204,7 +204,7 @@ unwind_phase2(unw_context_t *uc, unw_cur break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n", + "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", (void *)exception_object); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). @@ -214,7 +214,7 @@ unwind_phase2(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " "user code with ip=0x%" PRIx64 - ", sp=0x%" PRIx64 "\n", + ", sp=0x%" PRIx64, (void *)exception_object, pc, sp); } unw_resume(cursor); @@ -247,7 +247,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_proc_info_t frameInfo; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): unw_step " - "failed => _URC_END_OF_STACK\n", + "failed => _URC_END_OF_STACK", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -263,7 +263,7 @@ unwind_phase2_forced(unw_context_t *uc, functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIx64 - ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n", + ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64, (void *)exception_object, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } @@ -275,11 +275,11 @@ unwind_phase2_forced(unw_context_t *uc, (*stop)(1, action, exception_object->exception_class, exception_object, (struct _Unwind_Context *)(cursor), stop_parameter); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): stop function returned %d\n", + "unwind_phase2_forced(ex_ojb=%p): stop function returned %d", (void *)exception_object, stopResult); if (stopResult != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): stopped by stop function\n", + "unwind_phase2_forced(ex_ojb=%p): stopped by stop function", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -289,7 +289,7 @@ unwind_phase2_forced(unw_context_t *uc, __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): calling personality function %p\n", + "unwind_phase2_forced(ex_ojb=%p): calling personality function %p", (void *)exception_object, (void *)(uintptr_t)p); _Unwind_Reason_Code personalityResult = (*p)(1, action, exception_object->exception_class, exception_object, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Jan 20 02:48:54 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246B1CB705D; Fri, 20 Jan 2017 02:48:54 +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 D98361152; Fri, 20 Jan 2017 02:48:53 +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 v0K2mq6f077268; Fri, 20 Jan 2017 02:48:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2mqS4077267; Fri, 20 Jan 2017 02:48:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200248.v0K2mqS4077267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312448 - stable/11/contrib/llvm/projects/libunwind/src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 02:48:54 -0000 Author: emaste Date: Fri Jan 20 02:48:52 2017 New Revision: 312448 URL: https://svnweb.freebsd.org/changeset/base/312448 Log: MFC r310365: libunwind: make __{de,}register_frame compatible with libgcc API The libgcc __register_frame and __deregister_frame functions take a pointer to a set of FDE/CIEs, terminated by an entry where length is 0. In Apple's libunwind implementation the pointer is taken to be to a single FDE. I suspect this was just an Apple bug, compensated by Apple- specific code in LLVM. See lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp and http://lists.llvm.org/pipermail/llvm-dev/2013-April/061737.html for more detail. This change is based on the LLVM RTDyldMemoryManager.cpp. It should later be changed to be alignment-safe. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:46:14 2017 (r312447) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:48:52 2017 (r312448) @@ -224,6 +224,47 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI #if _LIBUNWIND_SUPPORT_DWARF_UNWIND +#ifdef __FreeBSD__ + +// Based on LLVM's lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +// and XXX should be fixed to be alignment-safe. +static void processFDE(const char *addr, bool isDeregister) { + uint64_t length; + while ((length = *((const uint32_t *)addr)) != 0) { + const char *p = addr + 4; + if (length == 0xffffffff) { + length = *((const uint64_t *)p); + p += 8; + } + uint32_t offset = *((const uint32_t *)p); + if (offset != 0) { + if (isDeregister) + _unw_remove_dynamic_fde((unw_word_t)(uintptr_t)addr); + else + _unw_add_dynamic_fde((unw_word_t)(uintptr_t)addr); + } + addr = p + length; + } +} + +/// Called by programs with dynamic code generators that want to register +/// dynamically generated FDEs, with a libgcc-compatible API. + +_LIBUNWIND_EXPORT void __register_frame(const void *addr) { + _LIBUNWIND_TRACE_API("__register_frame(%p)", addr); + processFDE(addr, false); +} + +/// Called by programs with dynamic code generators that want to unregister +/// dynamically generated FDEs, with a libgcc-compatible API. +_LIBUNWIND_EXPORT void __deregister_frame(const void *addr) { + _LIBUNWIND_TRACE_API("__deregister_frame(%p)", addr); + processFDE(addr, true); +} + + +#else + /// Called by programs with dynamic code generators that want /// to register a dynamically generated FDE. /// This function has existed on Mac OS X since 10.4, but @@ -243,6 +284,7 @@ _LIBUNWIND_EXPORT void __deregister_fram _unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde); } +#endif // The following register/deregister functions are gcc extensions. // They have existed on Mac OS X, but have never worked because Mac OS X From owner-svn-src-stable-11@freebsd.org Fri Jan 20 02:50:25 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848FFCB711A; Fri, 20 Jan 2017 02:50:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52A3012D9; Fri, 20 Jan 2017 02:50:25 +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 v0K2oOq4077395; Fri, 20 Jan 2017 02:50:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2oOhs077393; Fri, 20 Jan 2017 02:50:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200250.v0K2oOhs077393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312449 - stable/11/contrib/llvm/projects/libunwind/src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 02:50:25 -0000 Author: emaste Date: Fri Jan 20 02:50:24 2017 New Revision: 312449 URL: https://svnweb.freebsd.org/changeset/base/312449 Log: MFC r311647: libunwind: add noexec stack annotation Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Fri Jan 20 02:48:52 2017 (r312448) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Fri Jan 20 02:50:24 2017 (r312449) @@ -483,3 +483,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li /* RISCVTODO */ #endif + + .section .note.GNU-stack,"",@progbits Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Fri Jan 20 02:48:52 2017 (r312448) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Fri Jan 20 02:50:24 2017 (r312449) @@ -469,3 +469,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext /* RISCVTODO */ #endif + + .section .note.GNU-stack,"",@progbits From owner-svn-src-stable-11@freebsd.org Fri Jan 20 06:22:43 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8392ACB9CC7; Fri, 20 Jan 2017 06:22:43 +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 4197A1302; Fri, 20 Jan 2017 06:22:43 +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 v0K6Mg5u070434; Fri, 20 Jan 2017 06:22:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6Mg1A070432; Fri, 20 Jan 2017 06:22:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200622.v0K6Mg1A070432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 06:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312515 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 06:22:43 -0000 Author: ngie Date: Fri Jan 20 06:22:42 2017 New Revision: 312515 URL: https://svnweb.freebsd.org/changeset/base/312515 Log: MFC r312331: r312331 (by glebius): Fix regression from r310655, which broke operation of bsnmpd if it is bound to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with IP_SENDSRCADDR on a socket that is bound to non-wildcard address is completely different to using this control message on a wildcard one. A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR) on the socket, and use IP_SENDSRCADDR control message only if we did. While here, garbage collect absolutely useless udp_recv() function that establishes some structures on stack to never use them later. Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c stable/11/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 05:51:25 2017 (r312514) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 06:22:42 2017 (r312515) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -119,13 +120,15 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); - if (addr.sin_addr.s_addr == INADDR_ANY && - setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); + if (addr.sin_addr.s_addr == INADDR_ANY) { + if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } + p->recvdstaddr = true; } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { @@ -218,7 +221,6 @@ udp_send(struct tport *tp, const u_char { struct udp_port *p = (struct udp_port *)tp; struct cmsghdr *cmsg; - struct in_addr *src_addr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; struct iovec iov; @@ -231,15 +233,20 @@ udp_send(struct tport *tp, const u_char msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); msg.msg_namelen = addrlen; - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_level = IPPROTO_IP; - cmsg->cmsg_type = IP_SENDSRCADDR; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); - memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + if (p->recvdstaddr) { + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &p->dstaddr, sizeof(struct in_addr)); + } else { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } return (sendmsg(p->input.fd, &msg, 0)); } @@ -260,11 +267,12 @@ check_priv_dgram(struct port_input *pi, * Each receive should return one datagram. */ static ssize_t -recv_dgram(struct port_input *pi, struct in_addr *laddr) +udp_recv(struct tport *tp, struct port_input *pi) { u_char embuf[1000]; char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(struct in_addr))]; + struct udp_port *p = (struct udp_port *)tp; struct msghdr msg; struct iovec iov[1]; ssize_t len; @@ -316,7 +324,8 @@ recv_dgram(struct port_input *pi, struct cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + memcpy(&p->dstaddr, CMSG_DATA(cmsg), + sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) cred = (struct sockcred *)CMSG_DATA(cmsg); @@ -329,42 +338,6 @@ recv_dgram(struct port_input *pi, struct } /* - * Receive something - */ -static ssize_t -udp_recv(struct tport *tp, struct port_input *pi) -{ - struct udp_port *p = (struct udp_port *)tp; - struct cmsghdr *cmsgp; - struct in_addr *laddr; - struct msghdr msg; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - ssize_t ret; - - memset(cbuf, 0, sizeof(cbuf)); - - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); - - if (laddr->s_addr == INADDR_ANY) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - - return (ret); -} - -/* * Port table */ int Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 05:51:25 2017 (r312514) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 06:22:42 2017 (r312515) @@ -39,7 +39,9 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ - struct in_addr recv_addr; /* the address the request was sent to */ + + bool recvdstaddr; /* IP_RECVDSTADDR is on */ + struct in_addr dstaddr; /* address the request was sent to */ }; /* argument for open call */ From owner-svn-src-stable-11@freebsd.org Fri Jan 20 06:38:57 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614E7CB9084; Fri, 20 Jan 2017 06:38:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 116851D06; Fri, 20 Jan 2017 06:38:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0K6cuJi074852; Fri, 20 Jan 2017 06:38:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6cuu5074850; Fri, 20 Jan 2017 06:38:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701200638.v0K6cuu5074850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Jan 2017 06:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312517 - in stable/11: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblzma/common contrib/xz/src/liblzma/delta contrib/... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 06:38:57 -0000 Author: delphij Date: Fri Jan 20 06:38:56 2017 New Revision: 312517 URL: https://svnweb.freebsd.org/changeset/base/312517 Log: MFC r311504: MFV r311477: xz 5.2.3. Modified: stable/11/contrib/xz/ChangeLog stable/11/contrib/xz/THANKS stable/11/contrib/xz/src/common/tuklib_cpucores.c stable/11/contrib/xz/src/common/tuklib_physmem.c stable/11/contrib/xz/src/liblzma/api/lzma/version.h stable/11/contrib/xz/src/liblzma/check/check.h stable/11/contrib/xz/src/liblzma/common/alone_decoder.c stable/11/contrib/xz/src/liblzma/common/alone_encoder.c stable/11/contrib/xz/src/liblzma/common/auto_decoder.c stable/11/contrib/xz/src/liblzma/common/block_decoder.c stable/11/contrib/xz/src/liblzma/common/block_encoder.c stable/11/contrib/xz/src/liblzma/common/common.h stable/11/contrib/xz/src/liblzma/common/index.c stable/11/contrib/xz/src/liblzma/common/index_decoder.c stable/11/contrib/xz/src/liblzma/common/index_encoder.c stable/11/contrib/xz/src/liblzma/common/stream_decoder.c stable/11/contrib/xz/src/liblzma/common/stream_encoder.c stable/11/contrib/xz/src/liblzma/common/stream_encoder_mt.c stable/11/contrib/xz/src/liblzma/delta/delta_common.c stable/11/contrib/xz/src/liblzma/delta/delta_decoder.c stable/11/contrib/xz/src/liblzma/delta/delta_encoder.c stable/11/contrib/xz/src/liblzma/delta/delta_private.h stable/11/contrib/xz/src/liblzma/lz/lz_decoder.c stable/11/contrib/xz/src/liblzma/lz/lz_decoder.h stable/11/contrib/xz/src/liblzma/lz/lz_encoder.c stable/11/contrib/xz/src/liblzma/lz/lz_encoder.h stable/11/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_decoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder.h stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h stable/11/contrib/xz/src/liblzma/simple/arm.c stable/11/contrib/xz/src/liblzma/simple/armthumb.c stable/11/contrib/xz/src/liblzma/simple/ia64.c stable/11/contrib/xz/src/liblzma/simple/powerpc.c stable/11/contrib/xz/src/liblzma/simple/simple_coder.c stable/11/contrib/xz/src/liblzma/simple/simple_private.h stable/11/contrib/xz/src/liblzma/simple/sparc.c stable/11/contrib/xz/src/liblzma/simple/x86.c stable/11/contrib/xz/src/xz/args.c stable/11/contrib/xz/src/xz/coder.c stable/11/contrib/xz/src/xz/file_io.c stable/11/contrib/xz/src/xz/file_io.h stable/11/contrib/xz/src/xz/main.c stable/11/contrib/xz/src/xz/private.h stable/11/lib/liblzma/config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/xz/ChangeLog ============================================================================== --- stable/11/contrib/xz/ChangeLog Fri Jan 20 06:24:31 2017 (r312516) +++ stable/11/contrib/xz/ChangeLog Fri Jan 20 06:38:56 2017 (r312517) @@ -1,3 +1,563 @@ +commit 3d566cd519017eee1a400e7961ff14058dfaf33c +Author: Lasse Collin +Date: 2016-12-30 13:26:36 +0200 + + Bump version and soname for 5.2.3. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 053e624fe33795e779ff736f16ce44a129c829b5 +Author: Lasse Collin +Date: 2016-12-30 13:25:10 +0200 + + Update NEWS for 5.2.3. + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit cae412b2b77d7fd88d187ed7659331709311f80d +Author: Lasse Collin +Date: 2015-04-01 14:45:25 +0300 + + xz: Fix the Capsicum rights on user_abort_pipe. + + src/xz/file_io.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 9ccbae41000572193b9a09e7102f9e84dc6d96de +Author: Lasse Collin +Date: 2016-12-28 21:05:22 +0200 + + Mention potential sandboxing bugs in INSTALL. + + INSTALL | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e013a337d3de77cce24360dffe956ea2339489b6 +Author: Lasse Collin +Date: 2016-11-21 20:24:50 +0200 + + liblzma: Avoid multiple definitions of lzma_coder structures. + + Only one definition was visible in a translation unit. + It avoided a few casts and temp variables but seems that + this hack doesn't work with link-time optimizations in compilers + as it's not C99/C11 compliant. + + Fixes: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html + + src/liblzma/common/alone_decoder.c | 44 +++++---- + src/liblzma/common/alone_encoder.c | 34 ++++--- + src/liblzma/common/auto_decoder.c | 35 ++++--- + src/liblzma/common/block_decoder.c | 41 ++++---- + src/liblzma/common/block_encoder.c | 40 ++++---- + src/liblzma/common/common.h | 18 ++-- + src/liblzma/common/index_decoder.c | 33 ++++--- + src/liblzma/common/index_encoder.c | 16 ++-- + src/liblzma/common/stream_decoder.c | 50 +++++----- + src/liblzma/common/stream_encoder.c | 56 ++++++----- + src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++----------- + src/liblzma/delta/delta_common.c | 25 ++--- + src/liblzma/delta/delta_decoder.c | 6 +- + src/liblzma/delta/delta_encoder.c | 12 ++- + src/liblzma/delta/delta_private.h | 4 +- + src/liblzma/lz/lz_decoder.c | 60 ++++++------ + src/liblzma/lz/lz_decoder.h | 13 ++- + src/liblzma/lz/lz_encoder.c | 57 +++++++----- + src/liblzma/lz/lz_encoder.h | 9 +- + src/liblzma/lzma/lzma2_decoder.c | 32 ++++--- + src/liblzma/lzma/lzma2_encoder.c | 51 +++++----- + src/liblzma/lzma/lzma_decoder.c | 27 +++--- + src/liblzma/lzma/lzma_encoder.c | 29 +++--- + src/liblzma/lzma/lzma_encoder.h | 9 +- + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +- + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++--- + src/liblzma/lzma/lzma_encoder_private.h | 6 +- + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 61 ++++++------ + src/liblzma/simple/simple_private.h | 12 +-- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 15 +-- + 35 files changed, 532 insertions(+), 423 deletions(-) + +commit 8e0f1af3dcaec00a3879cce8ad7441edc6359d1c +Author: Lasse Collin +Date: 2016-12-26 20:50:25 +0200 + + Document --enable-sandbox configure option in INSTALL. + + INSTALL | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit ce2542d220de06acd618fd9f5c0a6683029fb4eb +Author: Lasse Collin +Date: 2015-03-31 22:19:34 +0300 + + xz: Add support for sandboxing with Capsicum (disabled by default). + + In the v5.2 branch this feature is considered experimental + and thus disabled by default. + + The sandboxing is used conditionally as described in main.c. + This isn't optimal but it was much easier to implement than + a full sandboxing solution and it still covers the most common + use cases where xz is writing to standard output. This should + have practically no effect on performance even with small files + as fork() isn't needed. + + C and locale libraries can open files as needed. This has been + fine in the past, but it's a problem with things like Capsicum. + io_sandbox_enter() tries to ensure that various locale-related + files have been loaded before cap_enter() is called, but it's + possible that there are other similar problems which haven't + been seen yet. + + Currently Capsicum is available on FreeBSD 10 and later + and there is a port to Linux too. + + Thanks to Loganaden Velvindron for help. + + configure.ac | 41 +++++++++++++++++++++++++++ + src/xz/Makefile.am | 2 +- + src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/xz/file_io.h | 6 ++++ + src/xz/main.c | 18 ++++++++++++ + src/xz/private.h | 4 +++ + 6 files changed, 151 insertions(+), 1 deletion(-) + +commit 3ca1d5e6320111043e19434da881065fadafa0e4 +Author: Lasse Collin +Date: 2015-03-31 21:12:30 +0300 + + Fix bugs and otherwise improve ax_check_capsicum.m4. + + AU_ALIAS was removed because the new version is incompatible + with the old version. + + It no longer checks for separately. + It's enough to test for it as part of AC_CHECK_DECL. + The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and + HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded. + HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough. + + It no longer does a useless search for the Capsicum library + if the header wasn't found. + + Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying + the argument omitted the default action but the given action + wasn't used instead. + + AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum + support is found. Previously it was part of the default + ACTION-IF-FOUND which a custom action would override. Now + the default action only prepends ${CAPSICUM_LIB} to LIBS. + + The documentation was updated. + + Since there as no serial number, "#serial 2" was added. + + m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 52 deletions(-) + +commit 5f3a742b64197fe8bedb6f05fc6ce5d177d11145 +Author: Lasse Collin +Date: 2015-03-31 19:20:24 +0300 + + Add m4/ax_check_capsicum.m4 for detecting Capsicum support. + + The file was loaded from this web page: + https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4 + + Thanks to Loganaden Velvindron for pointing it out for me. + + m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit d74377e62b4c649e40294dd441de72c0f092e67c +Author: Lasse Collin +Date: 2015-10-12 20:29:09 +0300 + + liblzma: Fix a memory leak in error path of lzma_index_dup(). + + lzma_index_dup() calls index_dup_stream() which, in case of + an error, calls index_stream_end() to free memory allocated + by index_stream_init(). However, it illogically didn't + actually free the memory. To make it logical, the tree + handling code was modified a bit in addition to changing + index_stream_end(). + + Thanks to Evan Nemerson for the bug report. + + src/liblzma/common/index.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit f580732216dcf971f3f006fe8e01cd4979e1d964 +Author: Lasse Collin +Date: 2016-10-24 18:53:25 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 88d7a7fd153bf1355cdf798ffdac7443d0169afc +Author: Lasse Collin +Date: 2016-10-24 18:51:36 +0300 + + tuklib_cpucores: Add support for sched_getaffinity(). + + It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better + than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity() + gives the number of cores available to the process instead of + the total number of cores online. + + As a side effect, this commit fixes a bug on GNU/kFreeBSD where + configure would detect the FreeBSD-specific cpuset_getaffinity() + but it wouldn't actually work because on GNU/kFreeBSD it requires + using -lfreebsd-glue when linking. Now the glibc-specific function + will be used instead. + + Thanks to Sebastian Andrzej Siewior for the original patch + and testing. + + m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 51baf684376903dbeddd840582bfdf9fa91b311b +Author: Lasse Collin +Date: 2016-06-30 20:27:36 +0300 + + xz: Fix copying of timestamps on Windows. + + xz used to call utime() on Windows, but its result gets lost + on close(). Using _futime() seems to work. + + Thanks to Martok for reporting the bug: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html + + configure.ac | 2 +- + src/xz/file_io.c | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 1ddc479851139d6e8202e5835421bfe6578d9e07 +Author: Lasse Collin +Date: 2016-06-16 22:46:02 +0300 + + xz: Silence warnings from -Wlogical-op. + + Thanks to Evan Nemerson. + + src/xz/file_io.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit be647ff5ed5a1c244a65722af6ce250259f3b14a +Author: Lasse Collin +Date: 2016-04-10 20:55:49 +0300 + + Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am. + + Thanks to Christian Kujau. + + src/xz/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb6d50c15343831f35305982cefa82053099191d +Author: Lasse Collin +Date: 2016-04-10 20:54:17 +0300 + + Build: Bump GNU Gettext version requirement to 0.19. + + It silences a few warnings and most people probably have + 0.19 even on stable distributions. + + Thanks to Christian Kujau. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 74f8dad9f912a2993768d93d108ea2b0b2c196e0 +Author: Lasse Collin +Date: 2016-03-13 20:21:49 +0200 + + liblzma: Disable external SHA-256 by default. + + This is the sane thing to do. The conflict with OpenSSL + on some OSes and especially that the OS-provided versions + can be significantly slower makes it clear that it was + a mistake to have the external SHA-256 support enabled by + default. + + Those who want it can now pass --enable-external-sha256 to + configure. INSTALL was updated with notes about OSes where + this can be a bad idea. + + The SHA-256 detection code in configure.ac had some bugs that + could lead to a build failure in some situations. These were + fixed, although it doesn't matter that much now that the + external SHA-256 is disabled by default. + + MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init + in libc instead of libutil. Support for the libutil version + was removed. + + INSTALL | 36 ++++++++++++++++++++++ + configure.ac | 76 +++++++++++++++++++++++------------------------ + src/liblzma/check/check.h | 16 ++++------ + 3 files changed, 79 insertions(+), 49 deletions(-) + +commit ea7f6ff04cb5bb1498088eb09960a4c3f13dfe39 +Author: Lasse Collin +Date: 2016-03-10 20:27:05 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d0e018016b311232e82d9a98dc68f1e3dabce794 +Author: Lasse Collin +Date: 2016-03-10 20:26:49 +0200 + + Build: Avoid SHA256_Init on FreeBSD and MINIX 3. + + On FreeBSD 10 and older, SHA256_Init from libmd conflicts + with libcrypto from OpenSSL. The OpenSSL version has + different sizeof(SHA256_CTX) and it can cause weird + problems if wrong SHA256_Init gets used. + + Looking at the source, MINIX 3 seems to have a similar issue but + I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too. + + NetBSD has SHA256_Init in libc and they had a similar problem, + but they already fixed it in 2009. + + Thanks to Jim Wilcoxson for the bug report that helped + in finding the problem. + + configure.ac | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 5daae123915f32a4ed6dc948b831533c2d1beec3 +Author: Lasse Collin +Date: 2015-11-08 20:16:10 +0200 + + tuklib_physmem: Hopefully silence a warning on Windows. + + src/common/tuklib_physmem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 491acc406e098167ccb7fce0728b94c2f32cff9f +Author: Lasse Collin +Date: 2015-11-04 23:17:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8173ff8790ad3502d04e1c07d014cb84a3b8187b +Author: Lasse Collin +Date: 2015-11-04 23:14:00 +0200 + + liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma. + + When optimizing, GCC can reorder code so that an uninitialized + value gets used in a comparison, which makes Valgrind unhappy. + It doesn't happen when compiled with -O0, which I tend to use + when running Valgrind. + + Thanks to Rich Prohaska. I remember this being mentioned long + ago by someone else but nothing was done back then. + + src/liblzma/lz/lz_encoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 013de2b5ab8094d2c82a2771f3d143eeb656eda9 +Author: Lasse Collin +Date: 2015-11-03 20:55:45 +0200 + + liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c. + + It would be too annoying to update other build systems + just because of this. + + src/liblzma/lzma/Makefile.inc | 2 +- + src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit a322f70ad96de88968c2c36e6a36bc08ae30bd20 +Author: Lasse Collin +Date: 2015-11-03 20:47:07 +0200 + + Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built. + + They all need decoder support and if that isn't available, + there's no point trying to build them. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8ea49606cf6427e32319de7693eca9e43f1c8ad6 +Author: Lasse Collin +Date: 2015-11-03 20:35:19 +0200 + + Build: Simplify $enable_{encoders,decoders} usage a bit. + + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 42131a25e52bfe400acfa7df93469a96bb78bb78 +Author: Lasse Collin +Date: 2015-11-03 20:31:31 +0200 + + Windows/MSVC: Update config.h. + + windows/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e9184e87cc989d14c7413e6adb3eca98f6ae0290 +Author: Lasse Collin +Date: 2015-11-03 20:29:58 +0200 + + DOS: Update config.h. + + dos/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 2296778f3c9a1e3a8699973b09dd3610b8baa402 +Author: Lasse Collin +Date: 2015-11-03 20:29:33 +0200 + + xz: Make xz buildable even when encoders or decoders are disabled. + + The patch is quite long but it's mostly about adding new #ifdefs + to omit code when encoders or decoders have been disabled. + + This adds two new #defines to config.h: HAVE_ENCODERS and + HAVE_DECODERS. + + configure.ac | 4 ++++ + src/xz/Makefile.am | 8 ++++++-- + src/xz/args.c | 16 ++++++++++++++++ + src/xz/coder.c | 33 +++++++++++++++++++++++++-------- + src/xz/main.c | 9 +++++++-- + src/xz/private.h | 5 ++++- + 6 files changed, 62 insertions(+), 13 deletions(-) + +commit 97a3109281e475d9cf1b5095237d672fa0ad25e5 +Author: Lasse Collin +Date: 2015-11-03 18:06:40 +0200 + + Build: Build LZMA1/2 presets also when only decoder is wanted. + + People shouldn't rely on the presets when decoding raw streams, + but xz uses the presets as the starting point for raw decoder + options anyway. + + lzma_encocder_presets.c was renamed to lzma_presets.c to + make it clear it's not used solely by the encoder code. + + src/liblzma/lzma/Makefile.inc | 6 +++++- + src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit dc6b78d7f0f6fe43e9d4215146e8581feb8090e7 +Author: Lasse Collin +Date: 2015-11-03 17:54:48 +0200 + + Build: Fix configure to handle LZMA1 dependency with LZMA2. + + Now it gives an error if LZMA1 encoder/decoder is missing + when LZMA2 encoder/decoder was requested. Even better would + be LZMA2 implicitly enabling LZMA1 but it would need more code. + + configure.ac | 5 ----- + 1 file changed, 5 deletions(-) + +commit 46d76c9cd3cb26a31f5ae6c3a8bbcf38e6da1add +Author: Lasse Collin +Date: 2015-11-03 17:41:54 +0200 + + Build: Don't omit lzma_cputhreads() unless using --disable-threads. + + Previously it was omitted if encoders were disabled + with --disable-encoders. It didn't make sense and + it also broke the build. + + src/liblzma/common/Makefile.inc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 16d68f874d89f1e4a1919786a35bbaef7d71a077 +Author: Lasse Collin +Date: 2015-11-02 18:16:51 +0200 + + liblzma: Fix a build failure related to external SHA-256 support. + + If an appropriate header and structure were found by configure, + but a library with a usable SHA-256 functions wasn't, the build + failed. + + src/liblzma/check/check.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit d9311647fc1ab512a3394596221ab8039c00af6b +Author: Lasse Collin +Date: 2015-11-02 15:19:10 +0200 + + xz: Always close the file before trying to delete it. + + unlink() can return EBUSY in errno for open files on some + operating systems and file systems. + + src/xz/file_io.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit f59c4183f3c9066626ce45dc3db4642fa603fa21 +Author: Lasse Collin +Date: 2015-10-12 21:08:42 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 35f189673e280c12e4c5129f9f97e54eef3bbc04 +Author: Lasse Collin +Date: 2015-10-12 21:07:41 +0300 + + Tests: Add tests for the two bugs fixed in index.c. + + tests/test_index.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit e10bfdb0fcaff12f3a6dadee51e0a022aadccb51 +Author: Lasse Collin +Date: 2015-10-12 20:45:15 +0300 + + liblzma: Fix lzma_index_dup() for empty Streams. + + Stream Flags and Stream Padding weren't copied from + empty Streams. + + src/liblzma/common/index.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 06f434bd8980f25ca23232eb7bb7df7e37dc8448 +Author: Lasse Collin +Date: 2015-10-12 20:31:44 +0300 + + liblzma: Add a note to index.c for those using static analyzers. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a Author: Lasse Collin Date: 2015-09-29 13:59:35 +0300 @@ -129,11 +689,10 @@ Date: 2015-06-19 20:21:30 +0300 Windows: Update the docs. - INSTALL | 29 ++++++---- - windows/INSTALL-MSVC.txt | 47 +++++++++++++++ - windows/INSTALL-MinGW.txt | 138 ++++++++++++++++++++++++++++++++++++++++++++ - windows/INSTALL-Windows.txt | 138 -------------------------------------------- - 4 files changed, 204 insertions(+), 148 deletions(-) + INSTALL | 29 ++++++++----- + windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++ + windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +- + 3 files changed, 67 insertions(+), 11 deletions(-) commit 28195e4c877007cc760ecea1d17f740693d66873 Author: Lasse Collin @@ -1587,11 +2146,10 @@ Date: 2014-05-04 11:07:17 +0300 It can be confusing that two header files have the same name. The public API file is still lzma.h. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/lzma.h | 420 ------------------------------------------ - src/liblzma/api/lzma/lzma12.h | 420 ++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 422 insertions(+), 422 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{lzma.h => lzma12.h} | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) commit 1555a9c5664afc7893a2b75e9970105437f01ef1 Author: Lasse Collin @@ -2650,20 +3208,20 @@ Date: 2012-11-19 00:10:10 -0800 with “|-”. That worked well for a while, but the version string from ‘less’ versions 448 (June, 2012) is misparsed, producing a warning: - $ xzless /tmp/test.xz; echo $? - /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ - integer expression expected - 0 + $ xzless /tmp/test.xz; echo $? + /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ + integer expression expected + 0 More precisely, modern ‘less’ lists the regexp implementation along with its version number, and xzless passes the entire version number with attached parenthetical phrase as a number to "test $a -gt $b", producing the above confusing message. - $ less-444 -V | head -1 - less 444 - $ less -V | head -1 - less 456 (no regular expressions) + $ less-444 -V | head -1 + less 444 + $ less -V | head -1 + less 456 (no regular expressions) So relax the pattern matched --- instead of expecting "less ", look for a line of the form "less [ (extra parenthetical)]". @@ -3058,11 +3616,9 @@ Date: 2012-06-14 10:33:27 +0300 copied the decompressor bug from xz_pipe_decomp.c he has an example how to easily fix it. - doc/examples/xz_pipe_comp.c | 127 -------------------------------------- - doc/examples/xz_pipe_decomp.c | 123 ------------------------------------ - doc/examples_old/xz_pipe_comp.c | 127 ++++++++++++++++++++++++++++++++++++++ - doc/examples_old/xz_pipe_decomp.c | 123 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 250 insertions(+), 250 deletions(-) + doc/{examples => examples_old}/xz_pipe_comp.c | 0 + doc/{examples => examples_old}/xz_pipe_decomp.c | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) commit 905f0ab5b5ce544d4b68a2ed6077df0f3d021292 Author: Lasse Collin @@ -4159,10 +4715,9 @@ Date: 2011-04-10 14:58:10 +0300 DOS: Update the docs and include notes about 8.3 filenames. - dos/INSTALL.txt | 79 ++++++++++++++++++++++++++++++++++++ - dos/README | 88 ---------------------------------------- - dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 202 insertions(+), 88 deletions(-) + dos/{README => INSTALL.txt} | 13 +---- + dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+), 11 deletions(-) commit ebd54dbd6e481d31e80757f900ac8109ad1423c6 Author: Lasse Collin @@ -4279,10 +4834,9 @@ Date: 2011-04-05 17:12:20 +0300 It was renamed to ax_pthread.m4 in Autoconf Archive. - configure.ac | 2 +- - m4/acx_pthread.m4 | 279 ----------------------------------------------------- - m4/ax_pthread.m4 | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 284 insertions(+), 280 deletions(-) + configure.ac | 2 +- + m4/{acx_pthread.m4 => ax_pthread.m4} | 170 ++++++++++++++++++----------------- + 2 files changed, 88 insertions(+), 84 deletions(-) commit 1039bfcfc098b69d56ecb39d198a092552eacf6d Author: Lasse Collin @@ -4664,10 +5218,10 @@ Date: 2010-11-12 15:22:13 -0600 Builds from a separate build directory with - mkdir build - cd build - ../configure - doxygen Doxyfile + mkdir build + cd build + ../configure + doxygen Doxyfile include an even longer prefix /home/someone/src/xz/src; this patch has the nice side-effect of eliminating that prefix, too. @@ -5232,12 +5786,11 @@ Date: 2010-09-28 10:59:53 +0300 Move version.sh to build-aux. - Makefile.am | 4 ++-- - build-aux/version.sh | 24 ++++++++++++++++++++++++ - configure.ac | 2 +- - version.sh | 24 ------------------------ - windows/build.bash | 2 +- - 5 files changed, 28 insertions(+), 28 deletions(-) + Makefile.am | 4 ++-- + version.sh => build-aux/version.sh | 0 + configure.ac | 2 +- + windows/build.bash | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) commit 84af9d8770451339a692e9b70f96cf56156a6069 Author: Lasse Collin @@ -5739,11 +6292,10 @@ Date: 2010-07-27 20:45:03 +0300 Windows: build.sh is a bash script so name it correctly. - INSTALL | 2 +- - windows/INSTALL-Windows.txt | 6 +- - windows/build.bash | 189 ++++++++++++++++++++++++++++++++++++++++++++ - windows/build.sh | 189 -------------------------------------------- - 4 files changed, 193 insertions(+), 193 deletions(-) + INSTALL | 2 +- + windows/INSTALL-Windows.txt | 6 +++--- + windows/{build.sh => build.bash} | 6 +++--- + 3 files changed, 7 insertions(+), 7 deletions(-) commit b1cbfd40f049a646a639eb78a3e41e9e3ef73339 Author: Lasse Collin @@ -7597,48 +8149,44 @@ Date: 2009-09-19 09:47:30 +0300 building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the original patch. - THANKS | 1 + - configure.ac | 12 ++-- - m4/lc_cpucores.m4 | 57 ---------------- - m4/lc_physmem.m4 | 84 ----------------------- - m4/tuklib_common.m4 | 22 ++++++ - m4/tuklib_cpucores.m4 | 72 ++++++++++++++++++++ - m4/tuklib_physmem.m4 | 119 ++++++++++++++++++++++++++++++++ - m4/tuklib_progname.m4 | 25 +++++++ - src/common/cpucores.h | 51 -------------- - src/common/open_stdxxx.h | 49 -------------- - src/common/physmem.h | 144 --------------------------------------- - src/common/sysdefs.h | 4 -- - src/common/tuklib_common.h | 67 ++++++++++++++++++ - src/common/tuklib_config.h | 1 + - src/common/tuklib_cpucores.c | 46 +++++++++++++ - src/common/tuklib_cpucores.h | 23 +++++++ - src/common/tuklib_exit.c | 57 ++++++++++++++++ - src/common/tuklib_exit.h | 25 +++++++ - src/common/tuklib_gettext.h | 44 ++++++++++++ - src/common/tuklib_open_stdxxx.c | 51 ++++++++++++++ - src/common/tuklib_open_stdxxx.h | 23 +++++++ - src/common/tuklib_physmem.c | 146 ++++++++++++++++++++++++++++++++++++++++ - src/common/tuklib_physmem.h | 28 ++++++++ - src/common/tuklib_progname.c | 50 ++++++++++++++ - src/common/tuklib_progname.h | 32 +++++++++ - src/lzmainfo/Makefile.am | 5 +- - src/lzmainfo/lzmainfo.c | 65 ++++++------------ - src/xz/Makefile.am | 7 +- - src/xz/args.c | 8 +-- - src/xz/file_io.c | 43 ++++++------ - src/xz/hardware.c | 8 +-- - src/xz/main.c | 100 ++++++--------------------- - src/xz/main.h | 7 -- - src/xz/message.c | 30 +++++---- - src/xz/message.h | 8 +-- - src/xz/private.h | 11 +-- - src/xz/signals.c | 2 + - src/xz/signals.h | 17 +++-- - src/xz/suffix.c | 2 +- - src/xzdec/Makefile.am | 13 +++- - src/xzdec/xzdec.c | 55 +++++---------- - 41 files changed, 974 insertions(+), 640 deletions(-) + THANKS | 1 + + configure.ac | 12 +-- + m4/lc_physmem.m4 | 84 --------------- + m4/tuklib_common.m4 | 22 ++++ + m4/{lc_cpucores.m4 => tuklib_cpucores.m4} | 83 ++++++++------ + m4/tuklib_physmem.m4 | 119 +++++++++++++++++++++ + m4/tuklib_progname.m4 | 25 +++++ + src/common/sysdefs.h | 4 - + src/common/tuklib_common.h | 67 ++++++++++++ + src/common/tuklib_config.h | 1 + + src/common/{cpucores.h => tuklib_cpucores.c} | 39 +++---- + src/common/tuklib_cpucores.h | 23 ++++ + src/common/tuklib_exit.c | 57 ++++++++++ + src/common/tuklib_exit.h | 25 +++++ + src/common/tuklib_gettext.h | 44 ++++++++ + src/common/{open_stdxxx.h => tuklib_open_stdxxx.c} | 24 +++-- + src/common/tuklib_open_stdxxx.h | 23 ++++ + src/common/{physmem.h => tuklib_physmem.c} | 58 +++++----- + src/common/tuklib_physmem.h | 28 +++++ + src/common/tuklib_progname.c | 50 +++++++++ + src/common/tuklib_progname.h | 32 ++++++ + src/lzmainfo/Makefile.am | 5 +- + src/lzmainfo/lzmainfo.c | 65 ++++------- + src/xz/Makefile.am | 7 +- + src/xz/args.c | 8 +- + src/xz/file_io.c | 43 ++++---- + src/xz/hardware.c | 8 +- + src/xz/main.c | 100 ++++------------- + src/xz/main.h | 7 -- + src/xz/message.c | 30 +++--- + src/xz/message.h | 8 +- + src/xz/private.h | 11 +- + src/xz/signals.c | 2 + + src/xz/signals.h | 17 ++- + src/xz/suffix.c | 2 +- + src/xzdec/Makefile.am | 13 ++- + src/xzdec/xzdec.c | 55 +++------- + 37 files changed, 768 insertions(+), 434 deletions(-) commit 49cfc8d392cf535f8dd10233225b1fc726fec9ef Author: Lasse Collin @@ -8268,11 +8816,11 @@ Date: 2009-08-09 13:22:12 -0500 It can be somewhat confusing that - less < some_file.txt + less < some_file.txt works fine, whereas - xzless < some_file.txt.xz + xzless < some_file.txt.xz does not. Since version 429, ‘less’ allows a filter specified in the LESSOPEN environment variable to preprocess its input even if @@ -8760,18 +9308,13 @@ Date: 2009-06-27 17:28:01 +0300 Moved the Windows resource files outside the windows directory to prepare for building them with Autotools. - src/common/common_w32res.rc | 46 +++++++++++++++++++++++++++++++++++++++++++ - src/liblzma/liblzma_w32res.rc | 5 +++++ - src/xz/xz_w32res.rc | 5 +++++ - src/xzdec/lzmadec_w32res.rc | 5 +++++ - src/xzdec/xzdec_w32res.rc | 5 +++++ - windows/Makefile | 35 +++++++++++++++++--------------- - windows/common.rc | 46 ------------------------------------------- - windows/liblzma.rc | 5 ----- - windows/lzmadec.rc | 5 ----- - windows/xz.rc | 5 ----- - windows/xzdec.rc | 5 ----- - 11 files changed, 85 insertions(+), 82 deletions(-) + windows/common.rc => src/common/common_w32res.rc | 0 + .../liblzma.rc => src/liblzma/liblzma_w32res.rc | 2 +- + windows/xz.rc => src/xz/xz_w32res.rc | 2 +- + windows/lzmadec.rc => src/xzdec/lzmadec_w32res.rc | 2 +- + windows/xzdec.rc => src/xzdec/xzdec_w32res.rc | 2 +- + windows/Makefile | 35 ++++++++++++---------- + 6 files changed, 23 insertions(+), 20 deletions(-) commit 449c634674f35336a4815d398172e447659a135e Author: Lasse Collin @@ -8853,19 +9396,15 @@ Date: 2009-06-26 20:49:54 +0300 to avoid problems on systems with system headers with those names. - dos/Makefile | 4 +- - src/xz/Makefile.am | 8 +- - src/xz/coder.c | 488 ++++++++++++++++++++++++++++++++++++ - src/xz/coder.h | 57 +++++ - src/xz/file_io.c | 716 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/xz/file_io.h | 86 +++++++ - src/xz/io.c | 716 ----------------------------------------------------- - src/xz/io.h | 86 ------- - src/xz/private.h | 4 +- - src/xz/process.c | 488 ------------------------------------ - src/xz/process.h | 57 ----- - windows/Makefile | 4 +- - 12 files changed, 1357 insertions(+), 1357 deletions(-) + dos/Makefile | 4 ++-- + src/xz/Makefile.am | 8 ++++---- + src/xz/{process.c => coder.c} | 0 + src/xz/{process.h => coder.h} | 0 + src/xz/{io.c => file_io.c} | 0 + src/xz/{io.h => file_io.h} | 0 + src/xz/private.h | 4 ++-- + windows/Makefile | 4 ++-- + 8 files changed, 10 insertions(+), 10 deletions(-) commit 5e1257466dcb66f1d7a3f71814a5ad885cba43e8 Author: Lasse Collin @@ -9247,9 +9786,8 @@ Date: 2009-05-01 11:20:23 +0300 Renamed the file format specification to xz-file-format.txt which is the filename used on the WWW. - doc/file-format.txt | 1127 ------------------------------------------------ - doc/xz-file-format.txt | 1127 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 1127 insertions(+), 1127 deletions(-) + doc/{file-format.txt => xz-file-format.txt} | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) commit 21c6b94373d239d7e86bd480fcd558e30391712f Author: Lasse Collin @@ -9318,20 +9856,14 @@ Date: 2009-04-13 14:49:48 +0300 Quick & dirty update to support xz in diff/grep/more scripts. - src/scripts/Makefile.am | 38 +++++++++------ - src/scripts/lzdiff | 67 -------------------------- - src/scripts/lzdiff.1 | 51 -------------------- - src/scripts/lzgrep | 123 ------------------------------------------------ - src/scripts/lzgrep.1 | 61 ------------------------ - src/scripts/lzmore | 74 ----------------------------- - src/scripts/lzmore.1 | 55 ---------------------- - src/scripts/xzdiff | 67 ++++++++++++++++++++++++++ - src/scripts/xzdiff.1 | 58 +++++++++++++++++++++++ - src/scripts/xzgrep | 123 ++++++++++++++++++++++++++++++++++++++++++++++++ - src/scripts/xzgrep.1 | 77 ++++++++++++++++++++++++++++++ - src/scripts/xzmore | 74 +++++++++++++++++++++++++++++ - src/scripts/xzmore.1 | 66 ++++++++++++++++++++++++++ - 13 files changed, 489 insertions(+), 445 deletions(-) + src/scripts/Makefile.am | 38 +++++++++++++++++++----------- + src/scripts/{lzdiff => xzdiff} | 24 +++++++++---------- + src/scripts/{lzdiff.1 => xzdiff.1} | 29 ++++++++++++++--------- + src/scripts/{lzgrep => xzgrep} | 10 ++++---- + src/scripts/{lzgrep.1 => xzgrep.1} | 48 +++++++++++++++++++++++++------------- + src/scripts/{lzmore => xzmore} | 12 +++++----- + src/scripts/{lzmore.1 => xzmore.1} | 33 +++++++++++++++++--------- + 7 files changed, 119 insertions(+), 75 deletions(-) commit 02ddf09bc3079b3e17297729b9e43f14d407b8fc Author: Lasse Collin @@ -9675,16 +10207,15 @@ Date: 2009-02-17 10:43:00 +0200 pieces to avoid unneeded dependencies making statically linked applications bigger than needed. - dos/Makefile | 6 +- - src/liblzma/common/easy.c | 128 ----------------------------- - src/liblzma/common/easy_buffer_encoder.c | 34 ++++++++ - src/liblzma/common/easy_decoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_encoder.c | 87 ++++++++++++++++++++ - src/liblzma/common/easy_encoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_preset.c | 34 ++++++++ - src/liblzma/common/easy_preset.h | 39 +++++++++ - windows/Makefile | 6 +- - 9 files changed, 266 insertions(+), 130 deletions(-) + dos/Makefile | 6 ++- + src/liblzma/common/easy_buffer_encoder.c | 34 +++++++++++++++++ + src/liblzma/common/easy_decoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/{easy.c => easy_encoder.c} | 53 +++------------------------ + src/liblzma/common/easy_encoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/easy_preset.c | 34 +++++++++++++++++ + src/liblzma/common/easy_preset.h | 39 ++++++++++++++++++++ + windows/Makefile | 6 ++- + 8 files changed, 185 insertions(+), 49 deletions(-) commit 7494816ab08d82f4d6409788825930c4e43cfd0d Author: Lasse Collin @@ -10657,15 +11188,14 @@ Date: 2008-12-31 16:29:39 +0200 The internal implementation is still using the name "simple". It may need some cleanups, so I look at it later. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/bcj.h | 94 +++++++++++++++++++++++++++++++++++++ - src/liblzma/api/lzma/simple.h | 94 ------------------------------------- - src/liblzma/simple/simple_coder.c | 2 +- - src/liblzma/simple/simple_decoder.c | 4 +- - src/liblzma/simple/simple_encoder.c | 4 +- - tests/test_filter_flags.c | 8 ++-- - 8 files changed, 105 insertions(+), 105 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{simple.h => bcj.h} | 22 +++++++++++----------- + src/liblzma/simple/simple_coder.c | 2 +- + src/liblzma/simple/simple_decoder.c | 4 ++-- + src/liblzma/simple/simple_encoder.c | 4 ++-- + tests/test_filter_flags.c | 8 ++++---- + 7 files changed, 22 insertions(+), 22 deletions(-) commit 7eea8bec3abfed883efba66264a1452a1c04f6b0 Author: Lasse Collin @@ -10719,47 +11249,44 @@ Date: 2008-12-31 00:30:49 +0200 as the more bloated uint32_t array on x86; hopefully it's not bad on other architectures. - configure.ac | 29 ++++++++-- - src/common/mythread.h | 34 ++++++++++++ - src/liblzma/api/Makefile.am | 1 - - src/liblzma/api/lzma.h | 1 - - src/liblzma/api/lzma/init.h | 85 ----------------------------- - src/liblzma/check/Makefile.am | 29 ++++------ - src/liblzma/check/check.c | 10 ++-- - src/liblzma/check/check.h | 25 ++++----- - src/liblzma/check/check_init.c | 37 ------------- - src/liblzma/check/crc32.c | 88 ------------------------------- - src/liblzma/check/crc32_fast.c | 88 +++++++++++++++++++++++++++++++ - src/liblzma/check/crc32_init.c | 55 ------------------- - src/liblzma/check/crc32_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc32_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/check/crc64.c | 75 -------------------------- - src/liblzma/check/crc64_fast.c | 75 ++++++++++++++++++++++++++ - src/liblzma/check/crc64_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc64_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/common/Makefile.am | 3 -- - src/liblzma/common/common.h | 1 + - src/liblzma/common/init.c | 39 -------------- - src/liblzma/common/init_decoder.c | 31 ----------- - src/liblzma/common/init_encoder.c | 40 -------------- - src/liblzma/liblzma.pc.in | 12 +++++ - src/liblzma/lz/lz_encoder.c | 6 +++ - src/liblzma/lzma.pc.in | 11 ---- - src/liblzma/rangecoder/Makefile.am | 8 +-- - src/liblzma/rangecoder/price.h | 16 +----- - src/liblzma/rangecoder/price_table.c | 2 +- - src/liblzma/rangecoder/price_table_init.c | 55 ------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Jan 20 10:13:41 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339E8CB7FA2; Fri, 20 Jan 2017 10:13:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02FE41433; Fri, 20 Jan 2017 10:13:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KADep1065445; Fri, 20 Jan 2017 10:13:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KADewU065444; Fri, 20 Jan 2017 10:13:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701201013.v0KADewU065444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 20 Jan 2017 10:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312524 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 10:13:41 -0000 Author: np Date: Fri Jan 20 10:13:39 2017 New Revision: 312524 URL: https://svnweb.freebsd.org/changeset/base/312524 Log: MFC r312368: cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring the VNET. Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 08:00:36 2017 (r312523) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 10:13:39 2017 (r312524) @@ -1418,6 +1418,7 @@ found: if (!(synqe->flags & TPF_SYNQE_EXPANDED)) send_reset_synqe(tod, synqe); INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (__LINE__); From owner-svn-src-stable-11@freebsd.org Fri Jan 20 13:00:52 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24676CB769F; Fri, 20 Jan 2017 13:00:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E800A1DC9; Fri, 20 Jan 2017 13:00:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KD0pwN032099; Fri, 20 Jan 2017 13:00:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KD0pKb032098; Fri, 20 Jan 2017 13:00:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201300.v0KD0pKb032098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 13:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312529 - stable/11/share/misc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 13:00:52 -0000 Author: mav Date: Fri Jan 20 13:00:50 2017 New Revision: 312529 URL: https://svnweb.freebsd.org/changeset/base/312529 Log: MFC r311517: Add some more mode page fields. Modified: stable/11/share/misc/scsi_modes Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/scsi_modes ============================================================================== --- stable/11/share/misc/scsi_modes Fri Jan 20 12:02:40 2017 (r312528) +++ stable/11/share/misc/scsi_modes Fri Jan 20 13:00:50 2017 (r312529) @@ -71,7 +71,7 @@ {TAS} t1 {ATMPE} t1 {RWWP} t1 - {Reserved} *t1 + {SBLP (Supported Block Lengths and Protection)} t1 {Autoload Mode} t3 {Ready AEN Holdoff Period} i2 {Busy Timeout Period} i2 @@ -148,6 +148,15 @@ {Minimum Pre-fetch} i2 {Maximum Pre-fetch} i2 {Maximum Pre-fetch Ceiling} i2 + {FSW (Force Sequential Write)} t1 + {LBCSS (Logical Block Cache Segment Size)} t1 + {DRA (Disable Read-Ahead)} t1 + {Vendor Specific} t2 + {SYNC_PROG} t1 + {NV_DIS} t1 + {Number of Cache Segments} i1 + {Cache Segment Size} i2 + {Reserved} *t4 } 0x05 "Flexible Disk Page" { @@ -224,7 +233,8 @@ {Head Offset Count} i1 {Data Strobe Offset Count} i1 {LBPERE (LBP Error Reporting Enabled)} t1 - {Reserved} *t7 + {MWR (Misaligned Write Reporting)} t2 + {Reserved} *t5 {Write Retry Count} i1 {Reserved} *i1 {Recovery Time Limit} i2 From owner-svn-src-stable-11@freebsd.org Fri Jan 20 17:35:32 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAC20CB8327; Fri, 20 Jan 2017 17:35:32 +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 99A7C100A; Fri, 20 Jan 2017 17:35:32 +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 v0KHZV9v047612; Fri, 20 Jan 2017 17:35:31 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHZVFe047611; Fri, 20 Jan 2017 17:35:31 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201735.v0KHZVFe047611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312548 - stable/11/usr.sbin/crunch/crunchgen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 17:35:32 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:35:31 2017 New Revision: 312548 URL: https://svnweb.freebsd.org/changeset/base/312548 Log: MFC 311527: Show that the crunchgen configuration file name is not optional. Sponsored by: iXsystems Modified: stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 ============================================================================== --- stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jan 20 17:29:59 2017 (r312547) +++ stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jan 20 17:35:31 2017 (r312548) @@ -24,7 +24,7 @@ .\" University of Maryland at College Park .\" $FreeBSD$ .\" -.Dd December 23, 2005 +.Dd January 6, 2017 .Dt CRUNCHGEN 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl p Ar obj-prefix .Op Fl c Ar c-file-name .Op Fl e Ar exec-file-name -.Op Ar conf-file +.Ar conf-file .Ek .Sh DESCRIPTION A crunched binary is a program made up of many other programs linked @@ -308,7 +308,7 @@ This is normally but some .Pa Makefile Ns s might like to use other conventions or -prepend the program's name to the variable, e.g.\& +prepend the program's name to the variable, e.g., .Va SSHD_OBJS . .It Ic special Ar progname Ic lib Ar library-name ... Specifies libraries to be linked with object files to produce From owner-svn-src-stable-11@freebsd.org Fri Jan 20 17:38:13 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88118CB84D4; Fri, 20 Jan 2017 17:38:13 +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 4A8D61285; Fri, 20 Jan 2017 17:38:13 +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 v0KHcCE3047772; Fri, 20 Jan 2017 17:38:12 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHcChh047771; Fri, 20 Jan 2017 17:38:12 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201738.v0KHcChh047771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312549 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 17:38:13 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:38:12 2017 New Revision: 312549 URL: https://svnweb.freebsd.org/changeset/base/312549 Log: MFC 312083: Update the shm_open.2 man page to reflect objective reality. Sponsored by: iXsystems Modified: stable/11/lib/libc/sys/shm_open.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/shm_open.2 ============================================================================== --- stable/11/lib/libc/sys/shm_open.2 Fri Jan 20 17:35:31 2017 (r312548) +++ stable/11/lib/libc/sys/shm_open.2 Fri Jan 20 17:38:12 2017 (r312549) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd January 13, 2017 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -171,7 +171,8 @@ and .Dv O_TRUNC flags may be used in portable programs. .Pp -The result of using +.Tn POSIX +specifications state that the result of using .Xr open 2 , .Xr read 2 , or @@ -179,19 +180,43 @@ or on a shared memory object, or on the descriptor returned by .Fn shm_open , is undefined. -It is also undefined whether the shared memory object itself, or its -contents, persist across reboots. -.Pp -In FreeBSD, +However, the +.Fx +kernel implementation explicitly includes support for .Xr read 2 and -.Xr write 2 -on a shared memory object will fail with -.Er EOPNOTSUPP -and neither shared memory objects nor their contents persist across reboots. +.Xr write 2 . +.Pp +Neither shared memory objects nor their contents persist across reboots. +.Pp +Writes do not extend shared memory objects, so +.Xr ftruncate 2 +must be called before any data can be written. +See +.Sx EXAMPLES . +.Sh EXAMPLES +This example fails without the call to +.Xr ftruncate 2 : +.Bd -literal -compact + + uint8_t buffer[getpagesize()]; + ssize_t len; + int fd; + + fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(EX_OSERR, "%s: shm_open", __func__); + if (ftruncate(fd, getpagesize()) < 0) + err(EX_IOERR, "%s: ftruncate", __func__); + len = pwrite(fd, buffer, getpagesize(), 0); + if (len < 0) + err(EX_IOERR, "%s: pwrite", __func__); + if (len != getpagesize()) + errx(EX_IOERR, "%s: pwrite length mismatch", __func__); +.Ed .Sh ERRORS -The following errors are defined for -.Fn shm_open : +.Fn shm_open +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EINVAL A flag other than @@ -235,8 +260,8 @@ are specified and the named shared memor The required permissions (for reading or reading and writing) are denied. .El .Pp -The following errors are defined for -.Fn shm_unlink : +.Fn shm_unlink +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EFAULT The From owner-svn-src-stable-11@freebsd.org Fri Jan 20 17:39:40 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 338CECB8575; Fri, 20 Jan 2017 17:39:40 +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 02B94142A; Fri, 20 Jan 2017 17:39:39 +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 v0KHddhd047874; Fri, 20 Jan 2017 17:39:39 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHddqB047873; Fri, 20 Jan 2017 17:39:39 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201739.v0KHddqB047873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312550 - stable/11/usr.bin/seq X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 17:39:40 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:39:38 2017 New Revision: 312550 URL: https://svnweb.freebsd.org/changeset/base/312550 Log: MFC 305887: Update history. Patch supplied by Sevan Janiyan . Sponsored by: iXsystems Modified: stable/11/usr.bin/seq/seq.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/seq/seq.1 ============================================================================== --- stable/11/usr.bin/seq/seq.1 Fri Jan 20 17:38:12 2017 (r312549) +++ stable/11/usr.bin/seq/seq.1 Fri Jan 20 17:39:38 2017 (r312550) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd August 12, 2016 .Dt SEQ 1 .Os .Sh NAME @@ -156,13 +156,13 @@ the default conversion is changed to .Sh HISTORY The .Nm -command first appeared in -.Tn "Plan 9 from Bell Labs" . +command first appeared in Version\~8 +.At . A .Nm command appeared in .Nx 3.0 , -and ported to +and was ported to .Fx 9.0 . This command was based on the command of the same name in .Tn "Plan 9 from Bell Labs" @@ -180,9 +180,4 @@ option does not handle the transition fr to exponent representation very well. The .Nm -command is not bug for bug compatible with the -.Tn "Plan 9 from Bell Labs" -or -.Tn GNU -versions of -.Nm . +command is not bug for bug compatible with other implementations. From owner-svn-src-stable-11@freebsd.org Fri Jan 20 21:10:39 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D51CB9C63; Fri, 20 Jan 2017 21:10:39 +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 908D11505; Fri, 20 Jan 2017 21:10:39 +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 v0KLAcrF041211; Fri, 20 Jan 2017 21:10:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLAbAL041198; Fri, 20 Jan 2017 21:10:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701202110.v0KLAbAL041198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 21:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312556 - in stable/11/sys/boot: arm/uboot common efi/loader i386/loader mips/beri/loader mips/uboot pc98/loader powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userb... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 21:10:39 -0000 Author: emaste Date: Fri Jan 20 21:10:37 2017 New Revision: 312556 URL: https://svnweb.freebsd.org/changeset/base/312556 Log: MFC r310267: Deduplicate loader vers.c Makefile rules The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/mips/beri/loader/Makefile stable/11/sys/boot/mips/uboot/Makefile stable/11/sys/boot/pc98/loader/Makefile stable/11/sys/boot/powerpc/kboot/Makefile stable/11/sys/boot/powerpc/ofw/Makefile stable/11/sys/boot/powerpc/ps3/Makefile stable/11/sys/boot/powerpc/uboot/Makefile stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/userboot/userboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/arm/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -90,7 +90,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float @@ -117,9 +117,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/common/Makefile.inc Fri Jan 20 21:10:37 2017 (r312556) @@ -70,3 +70,8 @@ CFLAGS+= -DBOOT_PROMPT_123 SRCS+= install.c CFLAGS+=-I${.CURDIR}/../../../../lib/libstand .endif + +CLEANFILES+= vers.c +VERSION_FILE?= ${.CURDIR}/version +vers.c: ${SRCTOP}/sys/boot/common/newvers.sh ${VERSION_FILE} + sh ${SRCTOP}/sys/boot/common/newvers.sh ${VERSION_FILE} ${NEWVERSWHAT} Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/efi/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -110,13 +110,10 @@ FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -CLEANFILES+= vers.c loader.efi +CLEANFILES+= loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - NM?= nm OBJCOPY?= objcopy Modified: stable/11/sys/boot/i386/loader/Makefile ============================================================================== --- stable/11/sys/boot/i386/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/i386/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -8,6 +8,7 @@ PROG= ${LOADER}.sym MAN= INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 +VERSION_FILE= ${.CURDIR}/../loader/version # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -72,7 +73,7 @@ CFLAGS+= -I${.CURDIR}/../../.. -D_STAND CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help +CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -93,10 +94,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ - ${NEWVERSWHAT} - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin Modified: stable/11/sys/boot/mips/beri/loader/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/mips/beri/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -92,7 +92,7 @@ CFLAGS+= -I${.CURDIR}/../common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help # Generate code appropriate for the loader environment CFLAGS+= -G0 \ @@ -114,10 +114,6 @@ LIBSTAND= ${.OBJDIR}/../../../../../lib/ DPADD= ${LIBFICL} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBSTAND} -vers.c: ${.CURDIR}/../../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../../common/newvers.sh ${.CURDIR}/version \ - ${NEWVERSWHAT} - loader.help: help.common help.mips cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/mips/uboot/Makefile ============================================================================== --- stable/11/sys/boot/mips/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/mips/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -99,7 +99,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g @@ -128,9 +128,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/pc98/loader/Makefile ============================================================================== --- stable/11/sys/boot/pc98/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/pc98/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -8,6 +8,7 @@ LOADER?= loader PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 +VERSION_FILE= ${.CURDIR}/../../i386/loader/version # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -48,7 +49,7 @@ CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../i386 CFLAGS+= -I. -CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help +CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -69,9 +70,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin Modified: stable/11/sys/boot/powerpc/kboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/kboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/kboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -76,7 +76,7 @@ CFLAGS+= -mcpu=powerpc64 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -99,9 +99,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ofw/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/ofw/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -73,7 +73,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script @@ -97,9 +97,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/ps3/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ps3/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/ps3/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -76,7 +76,7 @@ CFLAGS+= -mcpu=powerpc64 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -101,9 +101,6 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.ps3 ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -79,7 +79,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c ${PROG}.help +CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding @@ -102,9 +102,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/11/sys/boot/sparc64/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/sparc64/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -6,6 +6,7 @@ MAN= PROG?= loader NEWVERSWHAT?= "bootstrap loader" sparc64 +VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code @@ -70,7 +71,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help LDFLAGS= -static @@ -84,10 +85,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ - ${NEWVERSWHAT} - loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/11/sys/boot/userboot/userboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/userboot/userboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -39,11 +39,6 @@ LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - -CLEANFILES= vers.c - .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 From owner-svn-src-stable-11@freebsd.org Fri Jan 20 21:15:24 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D1CCBA05C; Fri, 20 Jan 2017 21:15:24 +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 D3B171BFC; Fri, 20 Jan 2017 21:15:23 +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 v0KLFMTk045180; Fri, 20 Jan 2017 21:15:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLFMEQ045179; Fri, 20 Jan 2017 21:15:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701202115.v0KLFMEQ045179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 21:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312557 - stable/11/sys/crypto/skein/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 21:15:24 -0000 Author: emaste Date: Fri Jan 20 21:15:22 2017 New Revision: 312557 URL: https://svnweb.freebsd.org/changeset/base/312557 Log: MFC r311655: libmd: add noexec stack annotation in skein_block_asm.s Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/crypto/skein/amd64/skein_block_asm.s (contents, props changed) Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/crypto/skein/amd64/skein_block_asm.s ============================================================================== --- stable/11/sys/crypto/skein/amd64/skein_block_asm.s Fri Jan 20 21:10:37 2017 (r312556) +++ stable/11/sys/crypto/skein/amd64/skein_block_asm.s Fri Jan 20 21:15:22 2017 (r312557) @@ -1325,4 +1325,6 @@ _SP_OFFS_ = _SP_OFFS_-8 ret .endif #---------------------------------------------------------------- + .section .note.GNU-stack,"",@progbits + .end From owner-svn-src-stable-11@freebsd.org Sat Jan 21 06:48:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC16ACBBB5E; Sat, 21 Jan 2017 06:48:53 +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 77AF41C80; Sat, 21 Jan 2017 06:48:53 +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 v0L6mqkw076451; Sat, 21 Jan 2017 06:48:52 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L6mqil076450; Sat, 21 Jan 2017 06:48:52 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201701210648.v0L6mqil076450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 21 Jan 2017 06:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312561 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 06:48:53 -0000 Author: jah Date: Sat Jan 21 06:48:52 2017 New Revision: 312561 URL: https://svnweb.freebsd.org/changeset/base/312561 Log: MFC r312153, r312191 r312153: For i386 temporary mappings, unpin the thread before releasing the cmap lock. Releasing the lock first may result in the thread being immediately rescheduled and bound to the same CPU, only to unpin itself upon resuming execution. Noted by: skra (in review for armv6 equivalent) r312191: Add comment explaining relative order of sched_unpin() and mtx_unlock(). Suggested by: alc Modified: stable/11/sys/i386/i386/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Fri Jan 20 22:41:16 2017 (r312560) +++ stable/11/sys/i386/i386/pmap.c Sat Jan 21 06:48:52 2017 (r312561) @@ -4231,8 +4231,14 @@ pmap_zero_page(vm_page_t m) invlcaddr(pc->pc_cmap_addr2); pagezero(pc->pc_cmap_addr2); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); + + /* + * Unpin the thread before releasing the lock. Otherwise the thread + * could be rescheduled while still bound to the current CPU, only + * to unpin itself immediately upon resuming execution. + */ sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4261,8 +4267,8 @@ pmap_zero_page_area(vm_page_t m, int off else bzero(pc->pc_cmap_addr2 + off, size); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4316,8 +4322,8 @@ pmap_copy_page(vm_page_t src, vm_page_t bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE); *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } int unmapped_buf_allowed = 1; @@ -4364,8 +4370,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -5349,8 +5355,8 @@ pmap_flush_page(vm_page_t m) if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } else pmap_invalidate_cache(); } From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:15:20 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5C1CBB7FA; Sat, 21 Jan 2017 08:15:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFFD16AC; Sat, 21 Jan 2017 08:15:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8FJnL012301; Sat, 21 Jan 2017 08:15:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8FJRj012299; Sat, 21 Jan 2017 08:15:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210815.v0L8FJRj012299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312564 - in stable/11: lib/libcam sbin/camcontrol X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:15:20 -0000 Author: mav Date: Sat Jan 21 08:15:19 2017 New Revision: 312564 URL: https://svnweb.freebsd.org/changeset/base/312564 Log: MFC r311623: Make do_buff_decode() not read past the end of the buffer. Abort format processing as soon as we have no enough data. Modified: stable/11/lib/libcam/scsi_cmdparse.c stable/11/sbin/camcontrol/modeedit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/scsi_cmdparse.c ============================================================================== --- stable/11/lib/libcam/scsi_cmdparse.c Sat Jan 21 07:07:50 2017 (r312563) +++ stable/11/lib/libcam/scsi_cmdparse.c Sat Jan 21 08:15:19 2017 (r312564) @@ -100,10 +100,11 @@ __FBSDID("$FreeBSD$"); */ static int -do_buff_decode(u_int8_t *databuf, size_t len, +do_buff_decode(u_int8_t *buff, size_t len, void (*arg_put)(void *, int , void *, int, char *), void *puthook, const char *fmt, va_list *ap) { + int ind = 0; int assigned = 0; int width; int suppress; @@ -112,21 +113,17 @@ do_buff_decode(u_int8_t *databuf, size_t static u_char mask[] = {0, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; int value; - u_char *base = databuf; char *intendp; char letter; char field_name[80]; -# define ARG_PUT(ARG) \ - do \ - { \ - if (!suppress) \ - { \ +#define ARG_PUT(ARG) \ + do { \ + if (!suppress) { \ if (arg_put) \ - (*arg_put)(puthook, (letter == 't' ? \ - 'b' : letter), \ - (void *)((long)(ARG)), width, \ - field_name); \ + (*arg_put)(puthook, (letter == 't' ? 'b' : \ + letter), (void *)((long)(ARG)), width, \ + field_name); \ else \ *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ @@ -187,7 +184,11 @@ do_buff_decode(u_int8_t *databuf, size_t done = 1; else { if (shift <= 0) { - bits = *databuf++; + if (ind >= len) { + done = 1; + break; + } + bits = buff[ind++]; shift = 8; } value = (bits >> (shift - width)) & @@ -209,29 +210,31 @@ do_buff_decode(u_int8_t *databuf, size_t fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } switch(width) { case 1: - ARG_PUT(*databuf); - databuf++; + ARG_PUT(buff[ind]); + ind++; break; case 2: - ARG_PUT((*databuf) << 8 | *(databuf + 1)); - databuf += 2; + ARG_PUT(buff[ind] << 8 | buff[ind + 1]); + ind += 2; break; case 3: - ARG_PUT((*databuf) << 16 | - (*(databuf + 1)) << 8 | *(databuf + 2)); - databuf += 3; + ARG_PUT(buff[ind] << 16 | + buff[ind + 1] << 8 | buff[ind + 2]); + ind += 3; break; case 4: - ARG_PUT((*databuf) << 24 | - (*(databuf + 1)) << 16 | - (*(databuf + 2)) << 8 | - *(databuf + 3)); - databuf += 4; + ARG_PUT(buff[ind] << 24 | buff[ind + 1] << 16 | + buff[ind + 2] << 8 | buff[ind + 3]); + ind += 4; break; default: @@ -242,32 +245,35 @@ do_buff_decode(u_int8_t *databuf, size_t break; case 'c': /* Characters (i.e., not swapped) */ - case 'z': /* Characters with zeroed trailing - spaces */ + case 'z': /* Characters with zeroed trailing spaces */ shift = 0; fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } if (!suppress) { if (arg_put) (*arg_put)(puthook, - (letter == 't' ? 'b' : letter), - databuf, width, field_name); + (letter == 't' ? 'b' : letter), + &buff[ind], width, field_name); else { char *dest; dest = va_arg(*ap, char *); - bcopy(databuf, dest, width); + bcopy(&buff[ind], dest, width); if (letter == 'z') { char *p; for (p = dest + width - 1; - (p >= (char *)dest) - && (*p == ' '); p--) + p >= dest && *p == ' '; + p--) *p = 0; } } assigned++; } - databuf += width; + ind += width; field_name[0] = 0; suppress = 0; break; @@ -295,9 +301,9 @@ do_buff_decode(u_int8_t *databuf, size_t } if (plus) - databuf += width; /* Relative seek */ + ind += width; /* Relative seek */ else - databuf = base + width; /* Absolute seek */ + ind = width; /* Absolute seek */ break; Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 07:07:50 2017 (r312563) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:19 2017 (r312564) @@ -193,7 +193,14 @@ editentry_save(void *hook __unused, char struct editentry *src; /* Entry value to save. */ src = editentry_lookup(name); - assert(src != NULL); + if (src == 0) { + /* + * This happens if field does not fit into read page size. + * It also means that this field won't be written, so the + * returned value does not really matter. + */ + return (0); + } switch (src->type) { case 'i': /* Byte-sized integral type. */ From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:16:43 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3E2CBB8CB; Sat, 21 Jan 2017 08:16:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6681F1997; Sat, 21 Jan 2017 08:16:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8Gg1T012469; Sat, 21 Jan 2017 08:16:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8Gg5k012462; Sat, 21 Jan 2017 08:16:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210816.v0L8Gg5k012462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312566 - in stable/11: sbin/camcontrol share/misc sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:16:43 -0000 Author: mav Date: Sat Jan 21 08:16:41 2017 New Revision: 312566 URL: https://svnweb.freebsd.org/changeset/base/312566 Log: MFC r311636: Make 'camcontrol modepage' support subpages. Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/camcontrol.h stable/11/sbin/camcontrol/modeedit.c stable/11/share/misc/scsi_modes stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/cam/scsi/scsi_all.h stable/11/sys/cam/scsi/scsi_ch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:16:41 2017 (r312566) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2016 +.Dd January 6, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -121,7 +121,7 @@ .Ic modepage .Op device id .Op generic args -.Aq Fl m Ar page | Fl l +.Aq Fl m Ar page[,subpage] | Fl l .Op Fl P Ar pgctl .Op Fl b | Fl e .Op Fl d @@ -702,9 +702,10 @@ The editor will be invoked if detects that standard input is terminal. .It Fl l Lists all available mode pages. -.It Fl m Ar mode_page -This specifies the number of the mode page the user would like to view -and/or edit. +If specified more then once, also lists subpages. +.It Fl m Ar page[,subpage] +This specifies the number of the mode page and optionally subpage the user +would like to view and/or edit. This argument is mandatory unless .Fl l is specified. Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.c Sat Jan 21 08:16:41 2017 (r312566) @@ -125,12 +125,9 @@ typedef enum { CAM_ARG_GET_STDINQ = 0x00002000, CAM_ARG_GET_XFERRATE = 0x00004000, CAM_ARG_INQ_MASK = 0x00007000, - CAM_ARG_MODE_EDIT = 0x00008000, - CAM_ARG_PAGE_CNTL = 0x00010000, CAM_ARG_TIMEOUT = 0x00020000, CAM_ARG_CMD_IN = 0x00040000, CAM_ARG_CMD_OUT = 0x00080000, - CAM_ARG_DBD = 0x00100000, CAM_ARG_ERR_RECOVER = 0x00200000, CAM_ARG_RETRIES = 0x00400000, CAM_ARG_START_UNIT = 0x00800000, @@ -3987,8 +3984,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC void -mode_sense(struct cam_device *device, int mode_page, int page_control, - int dbd, int retry_count, int timeout, u_int8_t *data, int datalen) +mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -4000,15 +3997,17 @@ mode_sense(struct cam_device *device, in CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - scsi_mode_sense(&ccb->csio, + scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, /* tag_action */ MSG_SIMPLE_Q_TAG, /* dbd */ dbd, - /* page_code */ page_control << 6, - /* page */ mode_page, + /* pc */ pc << 6, + /* page */ page, + /* subpage */ subpage, /* param_buf */ data, /* param_len */ datalen, + /* minimum_cmd_size */ 0, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -4089,8 +4088,9 @@ void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { - int c, mode_page = -1, page_control = 0; - int binary = 0, list = 0; + char *str_subpage; + int c, page = -1, subpage = -1, pc = 0; + int binary = 0, dbd = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4098,40 +4098,44 @@ modepage(struct cam_device *device, int binary = 1; break; case 'd': - arglist |= CAM_ARG_DBD; + dbd = 1; break; case 'e': - arglist |= CAM_ARG_MODE_EDIT; + edit = 1; break; case 'l': - list = 1; + list++; break; case 'm': - mode_page = strtol(optarg, NULL, 0); - if (mode_page < 0) - errx(1, "invalid mode page %d", mode_page); + str_subpage = optarg; + strsep(&str_subpage, ","); + page = strtol(optarg, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + if (page < 0) + errx(1, "invalid mode page %d", page); + if (subpage < 0) + errx(1, "invalid mode subpage %d", subpage); break; case 'P': - page_control = strtol(optarg, NULL, 0); - if ((page_control < 0) || (page_control > 3)) - errx(1, "invalid page control field %d", - page_control); - arglist |= CAM_ARG_PAGE_CNTL; + pc = strtol(optarg, NULL, 0); + if ((pc < 0) || (pc > 3)) + errx(1, "invalid page control field %d", pc); break; default: break; } } - if (mode_page == -1 && list == 0) + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); - if (list) { - mode_list(device, page_control, arglist & CAM_ARG_DBD, - retry_count, timeout); + if (list != 0) { + mode_list(device, dbd, pc, list > 1, retry_count, timeout); } else { - mode_edit(device, mode_page, page_control, - arglist & CAM_ARG_DBD, arglist & CAM_ARG_MODE_EDIT, binary, + mode_edit(device, dbd, pc, page, subpage, edit, binary, retry_count, timeout); } } Modified: stable/11/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.h Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.h Sat Jan 21 08:16:41 2017 (r312566) @@ -84,14 +84,14 @@ int epc(struct cam_device *device, int a int timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbosemode); -void mode_sense(struct cam_device *device, int mode_page, int page_control, - int dbd, int retry_count, int timeout, u_int8_t *data, +void mode_sense(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retry_count, int timeout, uint8_t *data, int datalen); void mode_select(struct cam_device *device, int save_pages, int retry_count, int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int page, int page_control, int dbd, +void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int page_control, int dbd, +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:16:41 2017 (r312566) @@ -66,9 +66,6 @@ __FBSDID("$FreeBSD$"); #define MODE_PAGE_HEADER(mh) \ (struct scsi_mode_page_header *)find_mode_page_6(mh) -#define MODE_PAGE_DATA(mph) \ - (u_int8_t *)(mph) + sizeof(struct scsi_mode_page_header) - struct editentry { STAILQ_ENTRY(editentry) link; @@ -86,7 +83,8 @@ static int editlist_changed = 0; /* Whet struct pagename { SLIST_ENTRY(pagename) link; - int pagenum; + int page; + int subpage; char *name; }; static SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */ @@ -106,21 +104,22 @@ static int editentry_save(void *hook, static struct editentry *editentry_lookup(char *name); static int editentry_set(char *name, char *newvalue, int editonly); -static void editlist_populate(struct cam_device *device, - int modepage, int page_control, - int dbd, int retries, int timeout); -static void editlist_save(struct cam_device *device, int modepage, - int page_control, int dbd, int retries, - int timeout); -static void nameentry_create(int pagenum, char *name); -static struct pagename *nameentry_lookup(int pagenum); -static int load_format(const char *pagedb_path, int page); +static void editlist_populate(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void editlist_save(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void nameentry_create(int page, int subpage, char *name); +static struct pagename *nameentry_lookup(int page, int subpage); +static int load_format(const char *pagedb_path, int lpage, + int lsubpage); static int modepage_write(FILE *file, int editonly); static int modepage_read(FILE *file); static void modepage_edit(void); -static void modepage_dump(struct cam_device *device, int page, - int page_control, int dbd, int retries, - int timeout); +static void modepage_dump(struct cam_device *device, int dbd, + int pc, int page, int subpage, int retries, + int timeout); static void cleanup_editfile(void); @@ -325,10 +324,10 @@ editentry_set(char *name, char *newvalue } static void -nameentry_create(int pagenum, char *name) { +nameentry_create(int page, int subpage, char *name) { struct pagename *newentry; - if (pagenum < 0 || name == NULL || name[0] == '\0') + if (page < 0 || subpage < 0 || name == NULL || name[0] == '\0') return; /* Allocate memory for the new entry and a copy of the entry name. */ @@ -339,16 +338,17 @@ nameentry_create(int pagenum, char *name /* Trim any trailing whitespace for the page name. */ RTRIM(newentry->name); - newentry->pagenum = pagenum; + newentry->page = page; + newentry->subpage = subpage; SLIST_INSERT_HEAD(&namelist, newentry, link); } static struct pagename * -nameentry_lookup(int pagenum) { +nameentry_lookup(int page, int subpage) { struct pagename *scan; SLIST_FOREACH(scan, &namelist, link) { - if (pagenum == scan->pagenum) + if (page == scan->page && subpage == scan->subpage) return (scan); } @@ -357,12 +357,14 @@ nameentry_lookup(int pagenum) { } static int -load_format(const char *pagedb_path, int page) +load_format(const char *pagedb_path, int lpage, int lsubpage) { FILE *pagedb; - char str_pagenum[MAX_PAGENUM_LEN]; + char str_page[MAX_PAGENUM_LEN]; + char *str_subpage; char str_pagename[MAX_PAGENAME_LEN]; - int pagenum; + int page; + int subpage; int depth; /* Quoting depth. */ int found; int lineno; @@ -371,9 +373,10 @@ load_format(const char *pagedb_path, int char c; #define SETSTATE_LOCATE do { \ - str_pagenum[0] = '\0'; \ + str_page[0] = '\0'; \ str_pagename[0] = '\0'; \ - pagenum = -1; \ + page = -1; \ + subpage = -1; \ state = LOCATE; \ } while (0) @@ -450,32 +453,46 @@ load_format(const char *pagedb_path, int * modes without providing a mode definition). */ /* Record the name of this page. */ - pagenum = strtol(str_pagenum, NULL, 0); - nameentry_create(pagenum, str_pagename); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + nameentry_create(page, subpage, str_pagename); SETSTATE_LOCATE; } else if (depth == 0 && c == PAGENAME_START) { SETSTATE_PAGENAME; } else if (c == PAGEDEF_START) { - pagenum = strtol(str_pagenum, NULL, 0); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; if (depth == 1) { /* Record the name of this page. */ - nameentry_create(pagenum, str_pagename); + nameentry_create(page, subpage, + str_pagename); /* * Only record the format if this is * the page we are interested in. */ - if (page == pagenum && !found) + if (lpage == page && + lsubpage == subpage && !found) SETSTATE_PAGEDEF; } } else if (c == PAGEDEF_END) { /* Reset the processor state. */ SETSTATE_LOCATE; - } else if (depth == 0 && ! BUFFERFULL(str_pagenum)) { - strncat(str_pagenum, &c, 1); + } else if (depth == 0 && ! BUFFERFULL(str_page)) { + strncat(str_page, &c, 1); } else if (depth == 0) { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page identifier exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -491,7 +508,7 @@ load_format(const char *pagedb_path, int } else { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page name exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -532,88 +549,95 @@ load_format(const char *pagedb_path, int } static void -editlist_populate(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_populate(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len; STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, modepage, 1, dbd, retries, timeout, data, + mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Decode the value data, creating edit_entries for each value. */ - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_create, 0); + buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_update, 0); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); + buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void -editlist_save(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_save(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) return; - /* - * Preload the CDB buffer with the current mode page data. - * XXX If buff_encode_visit would return the number of bytes encoded - * we *should* use that to build a header from scratch. As it is - * now, we need mode_sense to find out the page length. - */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); + /* Preload the CDB buffer with the current mode page data. */ + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); /* Initial headers & offsets. */ mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + hlen = sizeof(*mph); + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + hlen = sizeof(*mphsp); + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Encode the value data to be passed back to the device. */ - buff_encode_visit(mode_pars, mh->data_length, format, - editentry_save, 0); + buff_encode_visit(mode_pars, len, format, editentry_save, 0); /* Eliminate block descriptors. */ - bcopy(mph, ((u_int8_t *)mh) + sizeof(*mh), - sizeof(*mph) + mph->page_length); + bcopy(mph, mh + 1, hlen + len); /* Recalculate headers & offsets. */ - mh->blk_desc_len = 0; /* No block descriptors. */ + mh->data_length = 0; /* Reserved for MODE SELECT command. */ mh->dev_spec = 0; /* Clear device-specific parameters. */ + mh->blk_desc_len = 0; /* No block descriptors. */ mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); - - mph->page_code &= SMS_PAGE_CODE;/* Isolate just the page code. */ - mh->data_length = 0; /* Reserved for MODE SELECT command. */ + mph->page_code &= ~SMPH_PS; /* Reserved for MODE SELECT command. */ /* * Write the changes back to the device. If the user editted control * page 3 (saved values) then request the changes be permanently * recorded. */ - mode_select(device, - (page_control << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, - sizeof(*mh) + mh->blk_desc_len + sizeof(*mph) + mph->page_length); + mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), + retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); } static int @@ -782,24 +806,32 @@ modepage_edit(void) } static void -modepage_dump(struct cam_device *device, int page, int page_control, int dbd, +modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; - int indx; /* Index for scanning mode params. */ + struct scsi_mode_page_header_sp *mphsp; + int indx, len; - mode_sense(device, page, page_control, dbd, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Print the raw mode page data with newlines each 8 bytes. */ - for (indx = 0; indx < mph->page_length; indx++) { + for (indx = 0; indx < len; indx++) { printf("%02x%c",mode_pars[indx], (((indx + 1) % 8) == 0) ? '\n' : ' '); } @@ -817,7 +849,7 @@ cleanup_editfile(void) } void -mode_edit(struct cam_device *device, int page, int page_control, int dbd, +mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -829,15 +861,17 @@ mode_edit(struct cam_device *device, int if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, page) != 0 && (edit || verbose)) { + if (load_format(pagedb_path, page, subpage) != 0 && + (edit || verbose)) { if (errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } else if (errno == ESRCH) { /* Modepage entry not found in database. */ - warnx("modepage %d not found in database" - "\"%s\"", page, pagedb_path); + warnx("modepage 0x%02x,0x%02x not found in " + "database \"%s\"", page, subpage, + pagedb_path); } /* We can recover in display mode, otherwise we exit. */ if (!edit) { @@ -847,22 +881,20 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, page, page_control, dbd, retry_count, + editlist_populate(device, dbd, pc, page, subpage, retry_count, timeout); } if (edit) { - if (page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && - page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) + if (pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && + pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, page, page_control, dbd, retry_count, - timeout); + editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, page, page_control, dbd, retry_count, - timeout); + modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); @@ -870,44 +902,55 @@ mode_edit(struct cam_device *device, int } void -mode_list(struct cam_device *device, int page_control, int dbd, +mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; struct pagename *nameentry; const char *pagedb_path; - int len; + int len, page, subpage; if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, 0) != 0 && verbose && errno == ENOENT) { + if (load_format(pagedb_path, 0, 0) != 0 && verbose && errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } /* Build the list of all mode pages by querying the "all pages" page. */ - mode_sense(device, SMS_ALL_PAGES_PAGE, page_control, dbd, retry_count, - timeout, data, sizeof(data)); + mode_sense(device, dbd, pc, SMS_ALL_PAGES_PAGE, + subpages ? SMS_SUBPAGE_ALL : 0, + retry_count, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ - mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + len); + mph = (struct scsi_mode_page_header *)((intptr_t)mh + len); - mph->page_code &= SMS_PAGE_CODE; - nameentry = nameentry_lookup(mph->page_code); + if ((mph->page_code & SMPH_SPF) == 0) { + page = mph->page_code & SMS_PAGE_CODE; + subpage = 0; + len += sizeof(*mph) + mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + page = mphsp->page_code & SMS_PAGE_CODE; + subpage = mphsp->subpage; + len += sizeof(*mphsp) + scsi_2btoul(mphsp->page_length); + } - if (nameentry == NULL || nameentry->name == NULL) - printf("0x%02x\n", mph->page_code); - else - printf("0x%02x\t%s\n", mph->page_code, - nameentry->name); - len += mph->page_length + sizeof(*mph); + nameentry = nameentry_lookup(page, subpage); + if (subpage == 0) { + printf("0x%02x\t%s\n", page, + nameentry ? nameentry->name : ""); + } else { + printf("0x%02x,0x%02x\t%s\n", page, subpage, + nameentry ? nameentry->name : ""); + } } } Modified: stable/11/share/misc/scsi_modes ============================================================================== --- stable/11/share/misc/scsi_modes Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/share/misc/scsi_modes Sat Jan 21 08:16:41 2017 (r312566) @@ -49,7 +49,11 @@ # ALL DEVICE TYPES -0x0a "Control Mode Page" { +0x0a,0x03 "Command Duration Limit A"; + +0x0a,0x04 "Command Duration Limit B"; + +0x0a "Control" { {TST} t3 {TMF_ONLY} t1 {DPICZ} t1 @@ -78,7 +82,18 @@ {Extended Self-Test Completion Time} i2 } -0x02 "Disconnect-Reconnect Page" { +0x0a,0x01 "Control Extension" { + {Reserved} *t4 + {DLC} t1 + {TCMOS} t1 + {SCSIP} t1 + {IALUAE} t1 + {Reserved} *t4 + {Initial Command Priority} t4 + {Maximum Sense Data Length} i1 +} + +0x02 "Disconnect-Reconnect" { {Buffer Full Ratio} i1 {Buffer Empty Ratio} i1 {Bus Inactivity Limit} i2 @@ -92,26 +107,11 @@ {Reserved} *i1 } -0x15 "Extended Page"; +0x15 "Extended"; -0x16 "Extended Device-Type Specific Page"; +0x16 "Extended Device-Type Specific"; -0x1c "Informational Exceptions Control Page" { - {PERF} t1 - {Reserved} *t1 - {EBF} t1 - {EWasc} t1 - {DExcpt} t1 - {TEST} t1 - {EBACKERR} t1 - {LogErr} t1 - {Reserved} *t4 - {MRIE} t4 - {Interval Timer} i4 - {Report Count} i4 -} - -0x09 "Peripheral Device Page" { +0x09 "Peripheral Device" { {Interface Identifier} i2 {Reserved} *i1 {Reserved} *i1 @@ -119,21 +119,69 @@ {Reserved} *i1 } -0x1a "Power Condition Page" { - {Reserved} *i1 +0x1a "Power Condition" { + {PM_BG_PRECEDENCE} t1 + {Reserved} *t6 + {STANDBY_Y} t1 + {Reserved} *t4 + {IDLE_C} t1 + {IDLE_B} t1 + {IDLE_A} t1 + {STANDBY_Z} t1 + {IDLE_A Condition Timer} i4 + {STANDBY_Z Condition Timer} i4 + {IDLE_B Condition Timer} i4 + {IDLE_C Condition Timer} i4 + {STANDBY_Y Condition Timer} i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i3 + {CCF Idle} t2 + {CCF Standby} t2 + {CCF Stopped} t2 + {Reserved} *t2 +} + +0x1a,0x01 "Power Consumption" { + {Reserved} *i2 {Reserved} *t6 - {Idle} t1 - {Standby} t1 - {Idle Condition Timer} i4 - {Standby Condition Timer} i4 + {Active Level} t2 + {Power Consumption Identifier} i1 + {Reserved} *i4 + {Reserved} *i4 } -0x18 "Protocol-Specific LUN Page"; +0x18 "Protocol-Specific Logical Unit"; -0x19 "Protocol-Specific Port Page"; +0x19 "Protocol-Specific Port"; # DIRECT ACCESS DEVICES -0x08 "Caching Page" { + +0x0a,0x02 "Application Tag"; + +0x1a,0xf1 "ATA Power Condition"; + +0x1c,0x01 "Background Control" { + {Reserved} *t5 + {S_L_FULL} *t1 + {LOWIR} *t1 + {EN_BMS} *t1 + {Reserved} *t7 + {EN_PS} *t1 + {Background Medium Scan Interval Time} i2 + {Background Pre-Scan Time Limit} i2 + {Minimum Idle Time Before Background Scan} i2 + {Maximum Time To Suspend Background Scan} i2 + {Reserved} *i2 +} + +0x0a,0x06 "Background Operation Control" { + {BO_MODE} t2 + {Reserved} *t6 +} + +0x08 "Caching" { {IC} t1 {ABPF} t1 {CAP} t1 @@ -159,7 +207,7 @@ {Reserved} *t4 } -0x05 "Flexible Disk Page" { +0x05 "Flexible Disk" { {Transfer rate} i2 {Number of heads} i1 {Sectors per track} i1 @@ -190,7 +238,7 @@ {Reserved} *i1 } -0x03 "Format Device Page" { +0x03 "Format Device" { {Tracks per Zone} i2 {Alternate Sectors per Zone} i2 {Alternate Tracks per Zone} i2 @@ -207,7 +255,34 @@ {Reserved} *t4 } -0x0b "Medium Types Supported Page" { +0x0a,0x05 "I/O Advice Hints Grouping"; + +0x1c "Informational Exceptions Control" { + {PERF} t1 + {Reserved} *t1 + {EBF} t1 + {EWasc} t1 + {DExcpt} t1 + {TEST} t1 + {EBACKERR} t1 + {LogErr} t1 + {Reserved} *t4 + {MRIE} t4 + {Interval Timer} i4 + {Report Count} i4 +} + +0x1c,0x02 "Logical Block Provisioning" { + {Reserved} *t7 + {SITUA} t1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i4 + {Reserved} *i4 +} + +0x0b "Medium Types Supported" { {Reserved} *i1 {Reserved} *i1 {Medium type one supported} i1 @@ -216,10 +291,11 @@ {Medium type four supported} i1 } -# Notch page (0x0c) -0x0c "Notch and Partition Page"; +0x0c "Notch and Partition"; + +0x0a,0xf1 "PATA Control"; -0x01 "Read-Write Error Recovery Page" { +0x01 "Read-Write Error Recovery" { {AWRE (Auto Write Reallocation Enbld)} t1 {ARRE (Auto Read Reallocation Enbld)} t1 {TB (Transfer Block)} t1 @@ -240,7 +316,7 @@ {Recovery Time Limit} i2 } -0x04 "Rigid Disk Drive Geometry Page" { +0x04 "Rigid Disk Drive Geometry" { {Number of Cylinders} i3 {Number of Heads} i1 {Starting Cylinder-Write Precompensation} i3 @@ -256,7 +332,7 @@ {Reserved} *i1 } -0x07 "Verify Error Recovery Page" { +0x07 "Verify Error Recovery" { {Reserved} *t4 {EER} t1 {PER} t1 @@ -272,7 +348,7 @@ {Verify Recovery Time Limit} i2 } -0x0E "CD-ROM Audio Control Parameters Page" { +0x0E "CD-ROM Audio Control Parameters" { {Reserved} *t5 {Immed} t1 {SOTC} t1 @@ -297,7 +373,7 @@ } # SEQUENTIAL ACCESS DEVICES -0x10 "Device Configuration Page" { +0x10 "Device Configuration" { {Reserved} *t1 {Change Active Partition} t1 {Change Active Format} t1 @@ -326,7 +402,7 @@ {SCSI-3 Permanent Write Protect} t1 } -0x0f "Data Compression Page" { +0x0f "Data Compression" { {Data Compression Enabled} t1 {Date Compression Capable} t1 {Reserved} *t6 @@ -339,7 +415,7 @@ } # Removable devices -0x1b "Removable Block Access Capacities Page" { +0x1b "Removable Block Access Capacities" { {System Floppy Type Device} t1 {Supports Reporting Format Progress} t1 {Reserved} *t6 @@ -351,7 +427,7 @@ } # CD-ROM (and CD-R[W]) devices -0x2a "CD capabilities and mechanical status page" { +0x2a "CD capabilities and mechanical status" { {Reserved} *t4 {Method 2} t1 {CD-RW Read} t1 Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sys/cam/scsi/scsi_all.c Sat Jan 21 08:16:41 2017 (r312566) @@ -7622,24 +7622,34 @@ scsi_inquiry(struct ccb_scsiio *csio, u_ } void -scsi_mode_sense(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + uint8_t sense_len, uint32_t timeout) { - scsi_mode_sense_len(csio, retries, cbfcnp, tag_action, dbd, - page_code, page, param_buf, param_len, 0, - sense_len, timeout); + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, 0, sense_len, timeout); } void -scsi_mode_sense_len(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense_len(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + int minimum_cmd_size, uint8_t sense_len, uint32_t timeout) +{ + + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, minimum_cmd_size, + sense_len, timeout); +} + +void +scsi_mode_sense_subpage(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t *param_buf, + uint32_t param_len, int minimum_cmd_size, uint8_t sense_len, + uint32_t timeout) { u_int8_t cdb_len; @@ -7658,7 +7668,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_6; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; - scsi_cmd->page = page_code | page; + scsi_cmd->page = pc | page; + scsi_cmd->subpage = subpage; scsi_cmd->length = param_len; cdb_len = sizeof(*scsi_cmd); } else { @@ -7672,7 +7683,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_10; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:19:15 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3BA7CBB9C7; Sat, 21 Jan 2017 08:19:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA85E1CAB; Sat, 21 Jan 2017 08:19:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8JDMd012681; Sat, 21 Jan 2017 08:19:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8JDfc012680; Sat, 21 Jan 2017 08:19:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210819.v0L8JDfc012680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312568 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:19:15 -0000 Author: mav Date: Sat Jan 21 08:19:13 2017 New Revision: 312568 URL: https://svnweb.freebsd.org/changeset/base/312568 Log: MFC r311897: Add checks for received mode page length. If our buffer is too small, we may receive part of the page, and should not try read/write past the end of the buffer. Reported by: Coverity CID: 1368374, 1368375 Modified: stable/11/sbin/camcontrol/modeedit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:17:30 2017 (r312567) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:19:13 2017 (r312568) @@ -557,7 +557,7 @@ editlist_populate(struct cam_device *dev struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len; + size_t len; STAILQ_INIT(&editlist); @@ -575,6 +575,7 @@ editlist_populate(struct cam_device *dev mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Decode the value data, creating edit_entries for each value. */ buff_decode_visit(mode_pars, len, format, editentry_create, 0); @@ -594,7 +595,7 @@ editlist_save(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len, hlen; + size_t len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) @@ -617,6 +618,7 @@ editlist_save(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Encode the value data to be passed back to the device. */ buff_encode_visit(mode_pars, len, format, editentry_save, 0); @@ -814,7 +816,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int indx, len; + size_t indx, len; mode_sense(device, dbd, pc, page, subpage, retries, timeout, data, sizeof(data)); @@ -829,6 +831,7 @@ modepage_dump(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Print the raw mode page data with newlines each 8 bytes. */ for (indx = 0; indx < len; indx++) { From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:29:42 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D079CBBC2A; Sat, 21 Jan 2017 08:29:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5D8128F; Sat, 21 Jan 2017 08:29:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8Tf8U016813; Sat, 21 Jan 2017 08:29:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8TfDL016809; Sat, 21 Jan 2017 08:29:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210829.v0L8TfDL016809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312570 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:29:42 -0000 Author: mav Date: Sat Jan 21 08:29:40 2017 New Revision: 312570 URL: https://svnweb.freebsd.org/changeset/base/312570 Log: MFC r310539: Remove CTL_MAX_LUNS from places where it is not required. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_frontend.c stable/11/sys/cam/ctl/ctl_tpc.c stable/11/sys/cam/ctl/ctl_tpc_local.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:29:40 2017 (r312570) @@ -1218,7 +1218,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -2906,18 +2906,18 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k; + int j, k; struct ctl_port *port; struct ctl_frontend *fe; mtx_lock(&softc->ctl_lock); printf("CTL Persistent Reservation information start:\n"); - for (i = 0; i < CTL_MAX_LUNS; i++) { - lun = softc->ctl_luns[i]; - - if ((lun == NULL) - || ((lun->flags & CTL_LUN_DISABLED) != 0)) + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + if ((lun->flags & CTL_LUN_DISABLED) != 0) { + mtx_unlock(&lun->lun_lock); continue; + } for (j = 0; j < CTL_MAX_PORTS; j++) { if (lun->pr_keys[j] == NULL) @@ -2925,11 +2925,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ if (lun->pr_keys[j][k] == 0) continue; - printf(" LUN %d port %d iid %d key " - "%#jx\n", i, j, k, + printf(" LUN %ju port %d iid %d key " + "%#jx\n", lun->lun, j, k, (uintmax_t)lun->pr_keys[j][k]); } } + mtx_unlock(&lun->lun_lock); } printf("CTL Persistent Reservation information end\n"); printf("CTL Ports:\n"); @@ -3312,7 +3313,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_printf(sb, "\ton\n"); for (j = 0; j < CTL_MAX_LUNS; j++) { plun = ctl_lun_map_from_port(port, j); - if (plun >= CTL_MAX_LUNS) + if (plun == UINT32_MAX) continue; sbuf_printf(sb, "\t%u\n", @@ -3380,8 +3381,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } if (port->status & CTL_PORT_STATUS_ONLINE) { STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == + UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_port(lun, lm->port, -1, @@ -3509,7 +3510,7 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { if (port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3526,7 +3527,7 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old != UINT32_MAX) { if (port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3540,7 +3541,7 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id >= CTL_MAX_LUNS) + if (port->lun_map == NULL || lun_id == UINT32_MAX) return (lun_id); return (port->lun_map[lun_id]); } @@ -7142,7 +7143,7 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->status & CTL_PORT_STATUS_HA_SHARED) @@ -7234,7 +7235,7 @@ ctl_report_tagret_port_groups(struct ctl if (!softc->is_single && (port->status & CTL_PORT_STATUS_HA_SHARED) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -7259,7 +7260,7 @@ ctl_report_tagret_port_groups(struct ctl continue; if (port->status & CTL_PORT_STATUS_HA_SHARED) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -9078,7 +9079,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); num_luns = 0; for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { - if (ctl_lun_map_from_port(port, targ_lun_id) < CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } mtx_unlock(&softc->ctl_lock); @@ -9138,7 +9139,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); - if (lun_id >= CTL_MAX_LUNS) + if (lun_id == UINT32_MAX) continue; lun = softc->ctl_luns[lun_id]; if (lun == NULL) @@ -9774,7 +9775,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->init_devid) @@ -9825,7 +9826,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, pd->relative_port_id); if (port->init_devid) { @@ -11882,7 +11883,7 @@ ctl_target_reset(struct ctl_softc *softc port = ctl_io_port(&io->io_hdr); STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; retval += ctl_do_lun_reset(lun, io, ua_type); } Modified: stable/11/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:29:40 2017 (r312570) @@ -316,8 +316,8 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_enable(port->targ_lun_arg, l); } @@ -338,7 +338,7 @@ ctl_port_online(struct ctl_port *port) } port->status |= CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -360,8 +360,8 @@ ctl_port_offline(struct ctl_port *port) if (port->lun_disable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_disable(port->targ_lun_arg, l); } @@ -373,7 +373,7 @@ ctl_port_offline(struct ctl_port *port) mtx_lock(&softc->ctl_lock); port->status &= ~CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); Modified: stable/11/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:29:40 2017 (r312570) @@ -894,7 +894,7 @@ tpc_process_b2b(struct tpc_list *list) dcscd = scsi_2btoul(seg->dst_cscd); sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); - if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX || dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1042,7 +1042,7 @@ tpc_process_verify(struct tpc_list *list seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->src_cscd); sl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (sl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1106,7 +1106,7 @@ tpc_process_register_key(struct tpc_list seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->dst_cscd); dl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (dl >= CTL_MAX_LUNS) { + if (dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, Modified: stable/11/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:29:40 2017 (r312570) @@ -290,7 +290,7 @@ tpcl_resolve(struct ctl_softc *softc, in port = NULL; STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; if (lun->lun_devid == NULL) continue; From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:31:21 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B72DCBBD27; Sat, 21 Jan 2017 08:31:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5891759; Sat, 21 Jan 2017 08:31:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8VK9R017680; Sat, 21 Jan 2017 08:31:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8VK6K017679; Sat, 21 Jan 2017 08:31:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210831.v0L8VK6K017679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312572 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:31:21 -0000 Author: mav Date: Sat Jan 21 08:31:20 2017 New Revision: 312572 URL: https://svnweb.freebsd.org/changeset/base/312572 Log: MFC r310555: Some random code cleaning. - Reduce indentation. - Remove extra braces. - Add few missing savety checks. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:30:10 2017 (r312571) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:31:20 2017 (r312572) @@ -424,7 +424,7 @@ static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); -static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, struct ctl_ooa *ooa_hdr, struct ctl_ooa_entry *kern_entries); @@ -1024,27 +1024,27 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun < CTL_MAX_LUNS && - (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) != NULL) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && - msg->ua.ua_set) - memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); - if (msg->ua.ua_all) { - if (msg->ua.ua_set) - ctl_est_ua_all(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua_all(lun, iid, msg->ua.ua_type); - } else { - if (msg->ua.ua_set) - ctl_est_ua(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua(lun, iid, msg->ua.ua_type); - } - mtx_unlock(&lun->lun_lock); - } else + if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); + return; + } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && msg->ua.ua_set) + memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); + if (msg->ua.ua_all) { + if (msg->ua.ua_set) + ctl_est_ua_all(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua_all(lun, iid, msg->ua.ua_type); + } else { + if (msg->ua.ua_set) + ctl_est_ua(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua(lun, iid, msg->ua.ua_type); + } + mtx_unlock(&lun->lun_lock); } static void @@ -1058,8 +1058,8 @@ ctl_isc_lun_sync(struct ctl_softc *softc targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -1289,8 +1289,8 @@ ctl_isc_mode_sync(struct ctl_softc *soft targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -2193,7 +2193,7 @@ ctl_create_iid(struct ctl_port *port, in * command on this side (XFER mode) or tell the other side to execute it * (SER_ONLY mode). */ -static int +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = control_softc; @@ -2201,7 +2201,6 @@ ctl_serialize_other_sc_cmd(struct ctl_sc struct ctl_port *port; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; - int retval = 0; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; @@ -2216,24 +2215,10 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } /* Make sure that we know about this LUN. */ - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - /* - * If the LUN is invalid, pretend that it doesn't exist. - * It will go away as soon as all pending I/O has been - * completed. - */ - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - lun = NULL; - } - } else { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); - lun = NULL; - } - if (lun == NULL) { + /* * The other node would not send this request to us unless * received announce that we are primary node for this LUN. @@ -2243,6 +2228,18 @@ ctl_serialize_other_sc_cmd(struct ctl_sc ctl_set_busy(ctsio); goto badjuju; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + + /* + * If the LUN is invalid, pretend that it doesn't exist. + * It will go away as soon as all pending I/Os completed. + */ + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + ctl_set_busy(ctsio); + goto badjuju; + } entry = ctl_get_cmd_entry(ctsio, NULL); if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { @@ -2314,10 +2311,9 @@ badjuju: msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.scsi), M_WAITOK); - retval = 1; + ctl_free_io((union ctl_io *)ctsio); break; } - return (retval); } /* @@ -2685,9 +2681,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } mtx_lock(&softc->ctl_lock); - if (((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0) - && ((ooa_hdr->lun_num >= CTL_MAX_LUNS) - || (softc->ctl_luns[ooa_hdr->lun_num] == NULL))) { + if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && + (ooa_hdr->lun_num >= CTL_MAX_LUNS || + softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); printf("%s: CTL_GET_OOA: invalid LUN %ju\n", @@ -2739,49 +2735,37 @@ ctl_ioctl(struct cdev *dev, u_long cmd, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - - if ((delay_info->lun_id >= CTL_MAX_LUNS) - || (softc->ctl_luns[delay_info->lun_id] == NULL)) { + if (delay_info->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { + mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; - } else { - lun = softc->ctl_luns[delay_info->lun_id]; - mtx_lock(&lun->lun_lock); - - delay_info->status = CTL_DELAY_STATUS_OK; - - switch (delay_info->delay_type) { - case CTL_DELAY_TYPE_CONT: - break; - case CTL_DELAY_TYPE_ONESHOT: - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_TYPE; - break; - } - - switch (delay_info->delay_loc) { - case CTL_DELAY_LOC_DATAMOVE: - lun->delay_info.datamove_type = - delay_info->delay_type; - lun->delay_info.datamove_delay = - delay_info->delay_secs; - break; - case CTL_DELAY_LOC_DONE: - lun->delay_info.done_type = - delay_info->delay_type; - lun->delay_info.done_delay = - delay_info->delay_secs; - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_LOC; - break; - } - mtx_unlock(&lun->lun_lock); + break; } - + mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); + delay_info->status = CTL_DELAY_STATUS_OK; + switch (delay_info->delay_type) { + case CTL_DELAY_TYPE_CONT: + case CTL_DELAY_TYPE_ONESHOT: + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_TYPE; + break; + } + switch (delay_info->delay_loc) { + case CTL_DELAY_LOC_DATAMOVE: + lun->delay_info.datamove_type = delay_info->delay_type; + lun->delay_info.datamove_delay = delay_info->delay_secs; + break; + case CTL_DELAY_LOC_DONE: + lun->delay_info.done_type = delay_info->delay_type; + lun->delay_info.done_delay = delay_info->delay_secs; + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_LOC; + break; + } + mtx_unlock(&lun->lun_lock); #else delay_info->status = CTL_DELAY_STATUS_NOT_IMPLEMENTED; #endif /* CTL_IO_DELAY */ @@ -2832,8 +2816,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[err_desc->lun_id]; - if (lun == NULL) { + if (err_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n", @@ -2876,8 +2860,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, delete_done = 0; mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[delete_desc->lun_id]; - if (lun == NULL) { + if (delete_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", __func__, (uintmax_t)delete_desc->lun_id); @@ -8540,8 +8524,8 @@ ctl_hndl_per_res_out_on_other_sc(union c targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -11436,18 +11420,17 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - return; - } - } else { + if (targ_lun > CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + return; + } if (softc->ha_mode == CTL_HA_MODE_XFER) { TAILQ_FOREACH_SAFE(io, &lun->ooa_queue, ooa_links, next_io) { @@ -11515,15 +11498,13 @@ ctl_scsiio_precheck(struct ctl_softc *so struct ctl_lun *lun; const struct ctl_cmd_entry *entry; uint32_t initidx, targ_lun; - int retval; - - retval = 0; + int retval = 0; lun = NULL; - targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if ((targ_lun < CTL_MAX_LUNS) - && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { + if (targ_lun < CTL_MAX_LUNS) + lun = softc->ctl_luns[targ_lun]; + if (lun) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11533,29 +11514,22 @@ ctl_scsiio_precheck(struct ctl_softc *so if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); lun = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = - lun->be_lun; + } + } + ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; + if (lun) { + ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = + lun->be_lun; - /* - * Every I/O goes into the OOA queue for a - * particular LUN, and stays there until completion. - */ + /* + * Every I/O goes into the OOA queue for a particular LUN, + * and stays there until completion. + */ #ifdef CTL_TIME_IO - if (TAILQ_EMPTY(&lun->ooa_queue)) { - lun->idle_time += getsbinuptime() - - lun->last_busy; - } + if (TAILQ_EMPTY(&lun->ooa_queue)) + lun->idle_time += getsbinuptime() - lun->last_busy; #endif - TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, - ooa_links); - } - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; + TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } /* Get command entry and return error if it is unsuppotyed. */ @@ -11972,7 +11946,7 @@ ctl_lun_reset(struct ctl_softc *softc, u targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12051,7 +12025,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12136,7 +12110,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12261,7 +12235,7 @@ ctl_query_task(union ctl_io *io, int tas softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12301,7 +12275,7 @@ ctl_query_async_event(union ctl_io *io) softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12384,29 +12358,25 @@ ctl_run_task(union ctl_io *io) static void ctl_handle_isc(union ctl_io *io) { - int free_io; - struct ctl_lun *lun; struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + const struct ctl_cmd_entry *entry; uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - lun = softc->ctl_luns[targ_lun]; - switch (io->io_hdr.msg_type) { case CTL_MSG_SERIALIZE: - free_io = ctl_serialize_other_sc_cmd(&io->scsiio); + ctl_serialize_other_sc_cmd(&io->scsiio); break; - case CTL_MSG_R2R: { - const struct ctl_cmd_entry *entry; - - /* - * This is only used in SER_ONLY mode. - */ - free_io = 0; + case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_done(io); + break; + } mtx_lock(&lun->lun_lock); - if (ctl_scsiio_lun_check(lun, - entry, (struct ctl_scsiio *)io) != 0) { + if (ctl_scsiio_lun_check(lun, entry, &io->scsiio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done(io); break; @@ -12415,51 +12385,46 @@ ctl_handle_isc(union ctl_io *io) mtx_unlock(&lun->lun_lock); ctl_enqueue_rtr(io); break; - } case CTL_MSG_FINISH_IO: if (softc->ha_mode == CTL_HA_MODE_XFER) { - free_io = 0; ctl_done(io); - } else { - free_io = 1; - mtx_lock(&lun->lun_lock); - TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, - ooa_links); - ctl_check_blocked(lun); - mtx_unlock(&lun->lun_lock); + break; } + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_free_io(io); + break; + } + mtx_lock(&lun->lun_lock); + TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); + ctl_check_blocked(lun); + mtx_unlock(&lun->lun_lock); + ctl_free_io(io); break; case CTL_MSG_PERS_ACTION: ctl_hndl_per_res_out_on_other_sc( (union ctl_ha_msg *)&io->presio.pr_msg); - free_io = 1; + ctl_free_io(io); break; case CTL_MSG_BAD_JUJU: - free_io = 0; ctl_done(io); break; - case CTL_MSG_DATAMOVE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE: /* Only used in XFER mode */ ctl_datamove_remote(io); break; - case CTL_MSG_DATAMOVE_DONE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE_DONE: /* Only used in XFER mode */ io->scsiio.be_move_done(io); break; case CTL_MSG_FAILOVER: ctl_failover_lun(io); - free_io = 1; + ctl_free_io(io); break; default: - free_io = 1; printf("%s: Invalid message type %d\n", __func__, io->io_hdr.msg_type); + ctl_free_io(io); break; } - if (free_io) - ctl_free_io(io); } @@ -13360,37 +13325,33 @@ ctl_queue_sense(union ctl_io *io) struct ctl_softc *softc; uint32_t initidx, targ_lun; - softc = control_softc; - CTL_DEBUG_PRINT(("ctl_queue_sense\n")); + softc = control_softc; + port = ctl_io_port(&ctsio->io_hdr); + targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); + /* * LUN lookup will likely move to the ctl_work_thread() once we * have our new queueing infrastructure (that doesn't put things on * a per-LUN queue initially). That is so that we can handle * things like an INQUIRY to a LUN that we don't have enabled. We * can't deal with that right now. + * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - - /* - * If we don't have a LUN for this, just toss the sense - * information. - */ - port = ctl_io_port(&ctsio->io_hdr); - targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); - if ((targ_lun < CTL_MAX_LUNS) - && (softc->ctl_luns[targ_lun] != NULL)) - lun = softc->ctl_luns[targ_lun]; - else + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + mtx_unlock(&softc->ctl_lock); goto bailout; - - initidx = ctl_get_initindex(&io->io_hdr.nexus); - + } mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + /* * Already have CA set for this LUN...toss the sense information. */ + initidx = ctl_get_initindex(&io->io_hdr.nexus); if (ctl_is_set(lun->have_ca, initidx)) { mtx_unlock(&lun->lun_lock); goto bailout; @@ -13403,10 +13364,7 @@ ctl_queue_sense(union ctl_io *io) mtx_unlock(&lun->lun_lock); bailout: - mtx_unlock(&softc->ctl_lock); - ctl_free_io(io); - return (CTL_RETVAL_COMPLETE); } #endif From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:32:28 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60BF0CBBEFF; Sat, 21 Jan 2017 08:32:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3AD1B1F; Sat, 21 Jan 2017 08:32:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8WRSH020646; Sat, 21 Jan 2017 08:32:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8WRAa020645; Sat, 21 Jan 2017 08:32:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210832.v0L8WRAa020645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312574 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:32:28 -0000 Author: mav Date: Sat Jan 21 08:32:27 2017 New Revision: 312574 URL: https://svnweb.freebsd.org/changeset/base/312574 Log: MFC r310575: Fix improperly used nexus.targ_lun. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:31:49 2017 (r312573) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:32:27 2017 (r312574) @@ -1024,7 +1024,7 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1074,7 +1074,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc memcmp(&msg->lun.data[0], lun->lun_devid->data, i) != 0)) { mtx_unlock(&lun->lun_lock); printf("%s: Received conflicting HA LUN %d\n", - __func__, msg->hdr.nexus.targ_lun); + __func__, targ_lun); return; } else { /* Record whether peer is primary. */ @@ -1108,7 +1108,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc mtx_unlock(&lun->lun_lock); CTL_DEBUG_PRINT(("%s: Known LUN %d, peer is %s\n", - __func__, msg->hdr.nexus.targ_lun, + __func__, targ_lun, (msg->lun.flags & CTL_LUN_PRIMARY_SC) ? "primary" : "secondary")); From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:33:46 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78BF9CBBFD1; Sat, 21 Jan 2017 08:33:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A9451E0C; Sat, 21 Jan 2017 08:33:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8Xj71020819; Sat, 21 Jan 2017 08:33:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8XjFN020815; Sat, 21 Jan 2017 08:33:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210833.v0L8XjFN020815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312576 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:33:46 -0000 Author: mav Date: Sat Jan 21 08:33:44 2017 New Revision: 312576 URL: https://svnweb.freebsd.org/changeset/base/312576 Log: MFC r310635: Decouple limits on number of LUNs per port and LUs per CTL. Those two values are not directly related, so make them independent. This does not change any limits immediately, but makes number of LUNs per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size. After this change increasing CTL_MAX_LUNS should be pretty cheap, and even making it tunable should be easy. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_frontend.c stable/11/sys/cam/ctl/ctl_frontend.h stable/11/sys/cam/ctl/ctl_io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:33:44 2017 (r312576) @@ -407,6 +407,9 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, work static int ctl_debug = CTL_DEBUG_NONE; SYSCTL_INT(_kern_cam_ctl, OID_AUTO, debug, CTLFLAG_RWTUN, &ctl_debug, 0, "Enabled debug flags"); +static int ctl_lun_map_size = 1024; +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, lun_map_size, CTLFLAG_RWTUN, + &ctl_lun_map_size, 0, "Size of per-port LUN map (max LUN + 1)"); /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), @@ -826,7 +829,7 @@ ctl_isc_announce_port(struct ctl_port *p return; i = sizeof(msg->port) + strlen(port->port_name) + 1; if (port->lun_map) - i += sizeof(uint32_t) * CTL_MAX_LUNS; + i += port->lun_map_size * sizeof(uint32_t); if (port->port_devid) i += port->port_devid->len; if (port->target_devid) @@ -846,7 +849,7 @@ ctl_isc_announce_port(struct ctl_port *p "%d:%s", softc->ha_id, port->port_name) + 1; i += msg->port.name_len; if (port->lun_map) { - msg->port.lun_map_len = sizeof(uint32_t) * CTL_MAX_LUNS; + msg->port.lun_map_len = port->lun_map_size * sizeof(uint32_t); memcpy(&msg->port.data[i], port->lun_map, msg->port.lun_map_len); i += msg->port.lun_map_len; @@ -1155,19 +1158,25 @@ ctl_isc_port_sync(struct ctl_softc *soft M_CTL); i += msg->port.name_len; if (msg->port.lun_map_len != 0) { - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || + port->lun_map_size * sizeof(uint32_t) < + msg->port.lun_map_len) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(msg->port.lun_map_len, M_CTL, M_WAITOK); - memcpy(port->lun_map, &msg->port.data[i], - sizeof(uint32_t) * CTL_MAX_LUNS); + } + memcpy(port->lun_map, &msg->port.data[i], msg->port.lun_map_len); + port->lun_map_size = msg->port.lun_map_len / sizeof(uint32_t); i += msg->port.lun_map_len; } else { + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; } if (msg->port.port_devid_len != 0) { if (port->port_devid == NULL || - port->port_devid->len != msg->port.port_devid_len) { + port->port_devid->len < msg->port.port_devid_len) { free(port->port_devid, M_CTL); port->port_devid = malloc(sizeof(struct ctl_devid) + msg->port.port_devid_len, M_CTL, M_WAITOK); @@ -1182,7 +1191,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.target_devid_len != 0) { if (port->target_devid == NULL || - port->target_devid->len != msg->port.target_devid_len) { + port->target_devid->len < msg->port.target_devid_len) { free(port->target_devid, M_CTL); port->target_devid = malloc(sizeof(struct ctl_devid) + msg->port.target_devid_len, M_CTL, M_WAITOK); @@ -1197,7 +1206,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.init_devid_len != 0) { if (port->init_devid == NULL || - port->init_devid->len != msg->port.init_devid_len) { + port->init_devid->len < msg->port.init_devid_len) { free(port->init_devid, M_CTL); port->init_devid = malloc(sizeof(struct ctl_devid) + msg->port.init_devid_len, M_CTL, M_WAITOK); @@ -3295,7 +3304,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (port->lun_map != NULL) { sbuf_printf(sb, "\ton\n"); - for (j = 0; j < CTL_MAX_LUNS; j++) { + for (j = 0; j < port->lun_map_size; j++) { plun = ctl_lun_map_from_port(port, j); if (plun == UINT32_MAX) continue; @@ -3375,7 +3384,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } } mtx_unlock(&softc->ctl_lock); // XXX: port_enable sleeps - if (lm->plun < CTL_MAX_LUNS) { + if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); else if (lm->lun < CTL_MAX_LUNS && @@ -3383,13 +3392,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = ctl_lun_map_set(port, lm->plun, lm->lun); else return (ENXIO); - } else if (lm->plun == UINT32_MAX) { + } else { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_deinit(port); else retval = ctl_lun_map_init(port); - } else - return (ENXIO); + } if (port->status & CTL_PORT_STATUS_ONLINE) ctl_isc_announce_port(port); break; @@ -3442,15 +3450,20 @@ ctl_lun_map_init(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; struct ctl_lun *lun; + int size = ctl_lun_map_size; uint32_t i; - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || port->lun_map_size < size) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(size * sizeof(uint32_t), M_CTL, M_NOWAIT); + } if (port->lun_map == NULL) return (ENOMEM); - for (i = 0; i < CTL_MAX_LUNS; i++) + for (i = 0; i < size; i++) port->lun_map[i] = UINT32_MAX; + port->lun_map_size = size; if (port->status & CTL_PORT_STATUS_ONLINE) { if (port->lun_disable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) @@ -3469,6 +3482,7 @@ ctl_lun_map_deinit(struct ctl_port *port if (port->lun_map == NULL) return (0); + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; if (port->status & CTL_PORT_STATUS_ONLINE) { @@ -3492,6 +3506,8 @@ ctl_lun_map_set(struct ctl_port *port, u if (status != 0) return (status); } + if (plun >= port->lun_map_size) + return (EINVAL); old = port->lun_map[plun]; port->lun_map[plun] = glun; if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { @@ -3507,7 +3523,7 @@ ctl_lun_map_unset(struct ctl_port *port, { uint32_t old; - if (port->lun_map == NULL) + if (port->lun_map == NULL || plun >= port->lun_map_size) return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; @@ -3525,8 +3541,10 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id == UINT32_MAX) + if (port->lun_map == NULL) return (lun_id); + if (lun_id > port->lun_map_size) + return (UINT32_MAX); return (port->lun_map[lun_id]); } @@ -3539,7 +3557,7 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); if (port->lun_map == NULL) return (lun_id); - for (i = 0; i < CTL_MAX_LUNS; i++) { + for (i = 0; i < port->lun_map_size; i++) { if (port->lun_map[i] == lun_id) return (i); } @@ -9048,9 +9066,8 @@ ctl_report_luns(struct ctl_scsiio *ctsio struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; struct ctl_port *port; - int num_luns, retval; + int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; - int num_filled; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; @@ -9060,9 +9077,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&softc->ctl_lock); num_luns = 0; - for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { + num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + mtx_lock(&softc->ctl_lock); + for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } @@ -9121,7 +9139,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { + for (targ_lun_id = 0, num_filled = 0; + targ_lun_id < num_port_luns && num_filled < num_luns; + targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); if (lun_id == UINT32_MAX) continue; Modified: stable/11/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:33:44 2017 (r312576) @@ -315,7 +315,7 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; @@ -359,7 +359,7 @@ ctl_port_offline(struct ctl_port *port) port->port_offline(port->onoff_arg); if (port->lun_disable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; Modified: stable/11/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:33:44 2017 (r312576) @@ -225,6 +225,7 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + int lun_map_size; /* passed to CTL */ uint32_t *lun_map; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ Modified: stable/11/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:33:44 2017 (r312576) @@ -365,7 +365,7 @@ struct ctl_taskio { /* * HA link messages. */ -#define CTL_HA_VERSION 1 +#define CTL_HA_VERSION 2 /* * Used for CTL_MSG_LOGIN. From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:35:30 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7C8ACB70E8; Sat, 21 Jan 2017 08:35:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6852810D1; Sat, 21 Jan 2017 08:35:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8ZTmA021002; Sat, 21 Jan 2017 08:35:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8ZTFj020997; Sat, 21 Jan 2017 08:35:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210835.v0L8ZTFj020997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312578 - in stable/11/sys/cam: ctl scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:35:30 -0000 Author: mav Date: Sat Jan 21 08:35:28 2017 New Revision: 312578 URL: https://svnweb.freebsd.org/changeset/base/312578 Log: MFC r310640, r310643: Add support for revert to defaults (RTD) bit in MODE SELECT. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl.h stable/11/sys/cam/ctl/ctl_cmd_table.c stable/11/sys/cam/scsi/scsi_all.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:35:28 2017 (r312578) @@ -6158,10 +6158,13 @@ bailout_no_done: int ctl_mode_select(struct ctl_scsiio *ctsio) { - int param_len, pf, sp; - int header_size, bd_len; + struct ctl_lun *lun; union ctl_modepage_info *modepage_info; + int bd_len, i, header_size, param_len, pf, rtd, sp; + uint32_t initidx; + lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); switch (ctsio->cdb[0]) { case MODE_SELECT_6: { struct scsi_mode_select_6 *cdb; @@ -6169,6 +6172,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_6 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = cdb->length; header_size = sizeof(struct scsi_mode_header_6); @@ -6180,6 +6184,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_10 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = scsi_2btoul(cdb->length); header_size = sizeof(struct scsi_mode_header_10); @@ -6191,6 +6196,30 @@ ctl_mode_select(struct ctl_scsiio *ctsio return (CTL_RETVAL_COMPLETE); } + if (rtd) { + if (param_len != 0) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 1, /*field*/ 0, + /*bit_valid*/ 0, /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Revert to defaults. */ + ctl_init_page_index(lun); + mtx_lock(&lun->lun_lock); + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); + mtx_unlock(&lun->lun_lock); + for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { + ctl_isc_announce_mode(lun, -1, + lun->mode_pages.index[i].page_code & SMPH_PC_MASK, + lun->mode_pages.index[i].subpage); + } + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + /* * From SPC-3: * "A parameter list length of zero indicates that the Data-Out Buffer @@ -9563,6 +9592,11 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags4 = SVPD_EID_LUICLR; /* + * We support revert to defaults (RTD) bit in MODE SELECT. + */ + eid_ptr->flags5 = SVPD_EID_RTD_SUP; + + /* * XXX KDM in order to correctly answer this, we would need * information from the SIM to determine how much sense data it * can send. So this would really be a path inquiry field, most Modified: stable/11/sys/cam/ctl/ctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:35:28 2017 (r312578) @@ -78,14 +78,8 @@ struct ctl_modepage_header { int32_t len_left; }; -struct ctl_modepage_aps { - struct ctl_modepage_header header; - uint8_t lock_active; -}; - union ctl_modepage_info { struct ctl_modepage_header header; - struct ctl_modepage_aps aps; }; /* Modified: stable/11/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:35:28 2017 (r312578) @@ -990,7 +990,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}}, + CTL_LUN_PAT_NONE, 6, {0x13, 0, 0, 0xff, 0x07}}, /* 16 RESERVE(6) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | @@ -1260,7 +1260,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, + CTL_LUN_PAT_NONE, 10, {0x13, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 56 RESERVE(10) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | Modified: stable/11/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.h Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/scsi/scsi_all.h Sat Jan 21 08:35:28 2017 (r312578) @@ -228,6 +228,7 @@ struct scsi_mode_select_6 u_int8_t opcode; u_int8_t byte2; #define SMS_SP 0x01 +#define SMS_RTD 0x02 #define SMS_PF 0x10 u_int8_t unused[2]; u_int8_t length; From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:37:00 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C10A0CB7214; Sat, 21 Jan 2017 08:37:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9044F13B3; Sat, 21 Jan 2017 08:37:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8ax5h021164; Sat, 21 Jan 2017 08:36:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8axg5021162; Sat, 21 Jan 2017 08:36:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210836.v0L8axg5021162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312580 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:37:00 -0000 Author: mav Date: Sat Jan 21 08:36:59 2017 New Revision: 312580 URL: https://svnweb.freebsd.org/changeset/base/312580 Log: MFC r310644: Fix/synchronize field types in struct ctl_modepage_header. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:36:05 2017 (r312579) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:36:59 2017 (r312580) @@ -5939,7 +5939,7 @@ ctl_do_mode_select(union ctl_io *io) int page_len, page_len_offset, page_len_size; union ctl_modepage_info *modepage_info; struct ctl_lun *lun; - int *len_left, *len_used; + uint16_t *len_left, *len_used; int retval, i; ctsio = &io->scsiio; Modified: stable/11/sys/cam/ctl/ctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:36:05 2017 (r312579) +++ stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:36:59 2017 (r312580) @@ -74,8 +74,8 @@ struct ctl_port_entry { struct ctl_modepage_header { uint8_t page_code; uint8_t subpage; - int32_t len_used; - int32_t len_left; + uint16_t len_used; + uint16_t len_left; }; union ctl_modepage_info { From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:39:02 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE37BCB7328; Sat, 21 Jan 2017 08:39:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8311705; Sat, 21 Jan 2017 08:39:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8d1k6021346; Sat, 21 Jan 2017 08:39:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8d18g021345; Sat, 21 Jan 2017 08:39:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210839.v0L8d18g021345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312582 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:39:02 -0000 Author: mav Date: Sat Jan 21 08:39:01 2017 New Revision: 312582 URL: https://svnweb.freebsd.org/changeset/base/312582 Log: MFC r310646: Do not update "saved" mode page on every MODE SELECT. We do not have non-volatile memory to really save those values, so we neither report nor support this capability. Also saved mode pages are not replicated between HA peers now. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:37:53 2017 (r312581) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:39:01 2017 (r312582) @@ -5833,7 +5833,7 @@ ctl_default_page_handler(struct ctl_scsi struct ctl_page_index *page_index, uint8_t *page_ptr) { struct ctl_lun *lun; - uint8_t *current_cp, *saved_cp; + uint8_t *current_cp; int set_ua; uint32_t initidx; @@ -5843,13 +5843,10 @@ ctl_default_page_handler(struct ctl_scsi current_cp = (page_index->page_data + (page_index->page_len * CTL_PAGE_CURRENT)); - saved_cp = (page_index->page_data + (page_index->page_len * - CTL_PAGE_SAVED)); mtx_lock(&lun->lun_lock); if (memcmp(current_cp, page_ptr, page_index->page_len)) { memcpy(current_cp, page_ptr, page_index->page_len); - memcpy(saved_cp, page_ptr, page_index->page_len); set_ua = 1; } if (set_ua != 0) From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:40:31 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8740FCB7441; Sat, 21 Jan 2017 08:40:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CF619F5; Sat, 21 Jan 2017 08:40:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8eUFB021526; Sat, 21 Jan 2017 08:40:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8eUt5021524; Sat, 21 Jan 2017 08:40:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210840.v0L8eUt5021524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312584 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:40:31 -0000 Author: mav Date: Sat Jan 21 08:40:30 2017 New Revision: 312584 URL: https://svnweb.freebsd.org/changeset/base/312584 Log: MFC r310649: Allow more efficient use of private area. There are 16 bytes of space, so we may store two pointers in one. Modified: stable/11/sys/cam/ctl/ctl_io.h stable/11/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:39:39 2017 (r312583) +++ stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:40:30 2017 (r312584) @@ -145,7 +145,9 @@ struct ctl_ptr_len_flags { union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; + uint64_t integers[2]; void *ptr; + void *ptrs[2]; }; /* Modified: stable/11/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/11/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:39:39 2017 (r312583) +++ stable/11/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:40:30 2017 (r312584) @@ -185,6 +185,9 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 +#define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0]) +#define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1]) + int ctlfeinitialize(void); void ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; @@ -554,7 +557,7 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } - new_io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_INFO(new_io) = cmd_info; softc->atios_alloced++; new_ccb->ccb_h.io_ptr = new_io; @@ -702,7 +705,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, size_t off; int i, idx; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); bus_softc = softc->parent_softc; /* @@ -806,7 +809,7 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); cmd_info->cur_transfer_index = 0; cmd_info->cur_transfer_off = 0; cmd_info->flags = 0; @@ -987,7 +990,7 @@ ctlfe_free_ccb(struct cam_periph *periph switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: softc->atios_freed++; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); free(cmd_info, M_CTLFE); break; case XPT_IMMEDIATE_NOTIFY: @@ -1154,12 +1157,12 @@ ctlfedone(struct cam_periph *periph, uni */ mtx_unlock(mtx); io = done_ccb->ccb_h.io_ptr; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); ctl_zero_io(io); /* Save pointers on both sides */ - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = done_ccb; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_CCB(io) = done_ccb; + PRIV_INFO(io) = cmd_info; done_ccb->ccb_h.io_ptr = io; /* @@ -1315,7 +1318,7 @@ ctlfedone(struct cam_periph *periph, uni struct ccb_scsiio *csio; csio = &done_ccb->csio; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; @@ -1444,7 +1447,7 @@ ctlfedone(struct cam_periph *periph, uni send_ctl_io = 1; io->io_hdr.io_type = CTL_IO_TASK; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr =done_ccb; + PRIV_CCB(io) = done_ccb; inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; @@ -2002,7 +2005,7 @@ ctlfe_datamove(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; @@ -2022,7 +2025,7 @@ ctlfe_done(union ctl_io *io) struct cam_periph *periph; struct ctlfe_lun_softc *softc; - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; From owner-svn-src-stable-11@freebsd.org Sat Jan 21 08:43:12 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C29CB76AC; Sat, 21 Jan 2017 08:43:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5741E1F4E; Sat, 21 Jan 2017 08:43:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L8hBdI025702; Sat, 21 Jan 2017 08:43:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8hBFk025701; Sat, 21 Jan 2017 08:43:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210843.v0L8hBFk025701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312586 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:43:12 -0000 Author: mav Date: Sat Jan 21 08:43:11 2017 New Revision: 312586 URL: https://svnweb.freebsd.org/changeset/base/312586 Log: MFC r311892: Do not wait for HA thread shutdown if scheduler is stopped. This wait loop made system hang on panic instead of reboot. Modified: stable/11/sys/cam/ctl/ctl_ha.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:41:00 2017 (r312585) +++ stable/11/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:43:11 2017 (r312586) @@ -1001,7 +1001,7 @@ ctl_ha_msg_shutdown(struct ctl_softc *ct softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2) { + while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); } From owner-svn-src-stable-11@freebsd.org Sat Jan 21 11:47:32 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E3ACBA2B9; Sat, 21 Jan 2017 11:47:32 +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 7285B106C; Sat, 21 Jan 2017 11:47:32 +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 v0LBlVfL098738; Sat, 21 Jan 2017 11:47:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LBlVEt098732; Sat, 21 Jan 2017 11:47:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701211147.v0LBlVEt098732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Jan 2017 11:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312589 - in stable/11/lib/libc: include stdlib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 11:47:32 -0000 Author: kib Date: Sat Jan 21 11:47:30 2017 New Revision: 312589 URL: https://svnweb.freebsd.org/changeset/base/312589 Log: MFC r311651: Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit. Added: stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c - copied unchanged from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c Modified: stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/stdlib/Makefile.inc stable/11/lib/libc/stdlib/Symbol.map stable/11/lib/libc/stdlib/cxa_thread_atexit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/include/libc_private.h Sat Jan 21 11:47:30 2017 (r312589) @@ -272,6 +272,8 @@ void _malloc_thread_cleanup(void); * thread is exiting, so its thread-local dtors should be called. */ void __cxa_thread_call_dtors(void); +int __cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) __hidden; /* * These functions are used by the threading libraries in order to protect Modified: stable/11/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/Makefile.inc Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/Makefile.inc Sat Jan 21 11:47:30 2017 (r312589) @@ -5,7 +5,9 @@ .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ - bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ + bsearch.c \ + cxa_thread_atexit.c cxa_thread_atexit_impl.c \ + div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ Modified: stable/11/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/11/lib/libc/stdlib/Symbol.map Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/Symbol.map Sat Jan 21 11:47:30 2017 (r312589) @@ -118,6 +118,7 @@ FBSD_1.4 { FBSD_1.5 { __cxa_thread_atexit; + __cxa_thread_atexit_impl; }; FBSDprivate_1.0 { Modified: stable/11/lib/libc/stdlib/cxa_thread_atexit.c ============================================================================== --- stable/11/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 11:47:30 2017 (r312589) @@ -1,7 +1,10 @@ /*- - * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,114 +30,11 @@ #include __FBSDID("$FreeBSD$"); -#include -#include "namespace.h" -#include -#include -#include -#include -#include -#include -#include "un-namespace.h" #include "libc_private.h" -/* - * C++11 introduces the thread_local scope (like __thread with some - * additions). As a key-feature it should support non-trivial - * destructors, registered with __cxa_thread_atexit() to be executed - * at the thread termination. - * - * The implemention keeps a _Thread_local list of destructors per each - * thread, and calls __cxa_thread_call_dtors() on each thread's exit - * to do cleanup. For a thread calling exit(3), in particular, for - * the initial thread returning from main(), we call - * __cxa_thread_call_dtors() inside exit(). - * - * It could be possible that a dynamically loaded library, use - * thread_local variable but is dlclose()'d before thread exit. The - * destructor of this variable will then try to access the address, - * for calling it but it's unloaded, so it'll crash. We're using - * __elf_phdr_match_addr() to detect and prevent such cases and so - * prevent the crash. - */ - -#define CXA_DTORS_ITERATIONS 4 - -struct cxa_thread_dtor { - void *obj; - void (*func)(void *); - void *dso; - LIST_ENTRY(cxa_thread_dtor) entry; -}; -static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = - LIST_HEAD_INITIALIZER(dtors); - int __cxa_thread_atexit(void (*dtor_func)(void *), void *obj, void *dso_symbol) { - struct cxa_thread_dtor *new_dtor; - - new_dtor = malloc(sizeof(*new_dtor)); - if (new_dtor == NULL) { - errno = ENOMEM; /* forcibly override malloc(3) error */ - return (-1); - } - - new_dtor->obj = obj; - new_dtor->func = dtor_func; - new_dtor->dso = dso_symbol; - LIST_INSERT_HEAD(&dtors, new_dtor, entry); - return (0); -} - -static void -walk_cb_call(struct cxa_thread_dtor *dtor) -{ - struct dl_phdr_info phdr_info; - - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && - __elf_phdr_match_addr(&phdr_info, dtor->func)) - dtor->func(dtor->obj); - else - fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " - "unloaded dso, skipping\n", (void *)(dtor->func)); -} - -static void -walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) -{ -} - -static void -cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) -{ - struct cxa_thread_dtor *dtor, *tdtor; - - LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { - LIST_REMOVE(dtor, entry); - cb(dtor); - free(dtor); - } -} - -/* - * This is the callback function we use to call destructors, once for - * each thread. It is called in exit(3) in libc/stdlib/exit.c and - * before exit_thread() in libthr/thread/thr_exit.c. - */ -void -__cxa_thread_call_dtors(void) -{ - int i; - - for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) - cxa_thread_walk(walk_cb_call); - if (!LIST_EMPTY(&dtors)) { - fprintf(stderr, "Thread %p is exiting with more " - "thread-specific dtors created after %d iterations " - "of destructor calls\n", - _pthread_self(), i); - cxa_thread_walk(walk_cb_nocall); - } + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); } Copied: stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c (from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c Sat Jan 21 11:47:30 2017 (r312589, copy of r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2016, 2017 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * C++11 introduces the thread_local scope (like __thread with some + * additions). As a key-feature it should support non-trivial + * destructors, registered with __cxa_thread_atexit() to be executed + * at the thread termination. + * + * The implemention keeps a _Thread_local list of destructors per each + * thread, and calls __cxa_thread_call_dtors() on each thread's exit + * to do cleanup. For a thread calling exit(3), in particular, for + * the initial thread returning from main(), we call + * __cxa_thread_call_dtors() inside exit(). + * + * It could be possible that a dynamically loaded library, use + * thread_local variable but is dlclose()'d before thread exit. The + * destructor of this variable will then try to access the address, + * for calling it but it's unloaded, so it'll crash. We're using + * __elf_phdr_match_addr() to detect and prevent such cases and so + * prevent the crash. + */ + +#define CXA_DTORS_ITERATIONS 4 + +struct cxa_thread_dtor { + void *obj; + void (*func)(void *); + void *dso; + LIST_ENTRY(cxa_thread_dtor) entry; +}; +static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = + LIST_HEAD_INITIALIZER(dtors); + +int +__cxa_thread_atexit_impl(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); +} + +int +__cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + struct cxa_thread_dtor *new_dtor; + + new_dtor = malloc(sizeof(*new_dtor)); + if (new_dtor == NULL) { + errno = ENOMEM; /* forcibly override malloc(3) error */ + return (-1); + } + + new_dtor->obj = obj; + new_dtor->func = dtor_func; + new_dtor->dso = dso_symbol; + LIST_INSERT_HEAD(&dtors, new_dtor, entry); + return (0); +} + +static void +walk_cb_call(struct cxa_thread_dtor *dtor) +{ + struct dl_phdr_info phdr_info; + + if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + __elf_phdr_match_addr(&phdr_info, dtor->func)) + dtor->func(dtor->obj); + else + fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " + "unloaded dso, skipping\n", (void *)(dtor->func)); +} + +static void +walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) +{ +} + +static void +cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) +{ + struct cxa_thread_dtor *dtor, *tdtor; + + LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + LIST_REMOVE(dtor, entry); + cb(dtor); + free(dtor); + } +} + +/* + * This is the callback function we use to call destructors, once for + * each thread. It is called in exit(3) in libc/stdlib/exit.c and + * before exit_thread() in libthr/thread/thr_exit.c. + */ +void +__cxa_thread_call_dtors(void) +{ + int i; + + for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) + cxa_thread_walk(walk_cb_call); + + if (!LIST_EMPTY(&dtors)) { + fprintf(stderr, "Thread %p is exiting with more " + "thread-specific dtors created after %d iterations " + "of destructor calls\n", + _pthread_self(), i); + cxa_thread_walk(walk_cb_nocall); + } +}