From owner-svn-src-head@freebsd.org Sun Mar 20 03:27:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C231AD69AC; Sun, 20 Mar 2016 03:27:07 +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 4E92B7EC; Sun, 20 Mar 2016 03:27:07 +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 u2K3R6o3040726; Sun, 20 Mar 2016 03:27:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K3R6e9040725; Sun, 20 Mar 2016 03:27:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603200327.u2K3R6e9040725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 20 Mar 2016 03:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297057 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 03:27:07 -0000 Author: pfg Date: Sun Mar 20 03:27:06 2016 New Revision: 297057 URL: https://svnweb.freebsd.org/changeset/base/297057 Log: localedef(1): minor sorting to match Illumos. Illumos recently included space in 'print' class. We already had this but the code had slight sorting differences. Move it some lines up to reduce diffs with Illumos. No functional change. Reference: https://illumos.org/issues/5227 Modified: head/usr.bin/localedef/ctype.c Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Sun Mar 20 03:09:01 2016 (r297056) +++ head/usr.bin/localedef/ctype.c Sun Mar 20 03:27:06 2016 (r297057) @@ -332,14 +332,14 @@ dump_ctype(void) ctn->ctype |= _ISLOWER; if ((wc >= '0') && (wc <= '9')) ctn->ctype |= _ISDIGIT; + if (wc == ' ') + ctn->ctype |= _ISPRINT; if (strchr(" \f\n\r\t\v", (char)wc) != NULL) ctn->ctype |= _ISSPACE; if (strchr("0123456789ABCDEFabcdef", (char)wc) != NULL) ctn->ctype |= _ISXDIGIT; if (strchr(" \t", (char)wc)) ctn->ctype |= _ISBLANK; - if (wc == ' ') - ctn->ctype |= _ISPRINT; /* * Technically these settings are only From owner-svn-src-head@freebsd.org Sun Mar 20 03:54:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 412BBAD617D; Sun, 20 Mar 2016 03:54:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D17221197; Sun, 20 Mar 2016 03:54:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2K3swaU049830; Sun, 20 Mar 2016 03:54:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K3swvK049827; Sun, 20 Mar 2016 03:54:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603200354.u2K3swvK049827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 20 Mar 2016 03:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297058 - in head/sys: dev/urtwn dev/usb/wlan modules modules/urtwn modules/urtwnfw modules/usb modules/usb/urtwn modules/usb/urtwnfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 03:54:59 -0000 Author: adrian Date: Sun Mar 20 03:54:57 2016 New Revision: 297058 URL: https://svnweb.freebsd.org/changeset/base/297058 Log: [urtwn] migrate urtwn out into sys/dev/urtwn/ . There's some upcoming work to add new chipset support here and I'd like to only add 802.11n support to one driver, instead of both urtwn and rtwn. There's also missing support for things like 802.11n, some powersave work, bluetooth integration/coexistence, etc, and also newer parts (like 8192EU, maybe some 11ac parts, not sure yet.) So, this is hopefully the first step in a longer set of steps to unify rtwn/urtwn and extend it with more interesting chipset and functionality support. Reviewed by: kevlo Added: head/sys/dev/urtwn/ head/sys/dev/urtwn/if_urtwn.c - copied, changed from r297057, head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/urtwn/if_urtwnreg.h - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/urtwn/if_urtwnvar.h - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnvar.h head/sys/modules/urtwn/ - copied from r297057, head/sys/modules/usb/urtwn/ head/sys/modules/urtwnfw/ - copied from r297057, head/sys/modules/usb/urtwnfw/ Deleted: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h head/sys/modules/usb/urtwn/ head/sys/modules/usb/urtwnfw/ Modified: head/sys/modules/Makefile head/sys/modules/urtwn/Makefile head/sys/modules/urtwnfw/Makefile.inc head/sys/modules/usb/Makefile Copied and modified: head/sys/dev/urtwn/if_urtwn.c (from r297057, head/sys/dev/usb/wlan/if_urtwn.c) ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Mar 20 03:27:06 2016 (r297057, copy source) +++ head/sys/dev/urtwn/if_urtwn.c Sun Mar 20 03:54:57 2016 (r297058) @@ -78,8 +78,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include #ifdef USB_DEBUG enum { Copied: head/sys/dev/urtwn/if_urtwnreg.h (from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/urtwn/if_urtwnreg.h Sun Mar 20 03:54:57 2016 (r297058, copy of r297057, head/sys/dev/usb/wlan/if_urtwnreg.h) @@ -0,0 +1,2176 @@ +/*- + * Copyright (c) 2010 Damien Bergamini + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ + * $FreeBSD$ + */ + +#define URTWN_CONFIG_INDEX 0 +#define URTWN_IFACE_INDEX 0 + +#define URTWN_NOISE_FLOOR -95 + +#define R92C_MAX_CHAINS 2 + +/* Maximum number of output pipes is 3. */ +#define R92C_MAX_EPOUT 3 + +#define R92C_MAX_TX_PWR 0x3f + +#define R92C_PUBQ_NPAGES 231 +#define R92C_TXPKTBUF_COUNT 256 +#define R92C_TX_PAGE_COUNT 248 +#define R92C_TX_PAGE_BOUNDARY (R92C_TX_PAGE_COUNT + 1) +#define R88E_TXPKTBUF_COUNT 177 +#define R88E_TX_PAGE_COUNT 169 +#define R88E_TX_PAGE_BOUNDARY (R88E_TX_PAGE_COUNT + 1) + +#define R92C_H2C_NBOX 4 + +/* USB Requests. */ +#define R92C_REQ_REGS 0x05 + +/* + * MAC registers. + */ +/* System Configuration. */ +#define R92C_SYS_ISO_CTRL 0x000 +#define R92C_SYS_FUNC_EN 0x002 +#define R92C_APS_FSMCO 0x004 +#define R92C_SYS_CLKR 0x008 +#define R92C_AFE_MISC 0x010 +#define R92C_SPS0_CTRL 0x011 +#define R92C_SPS_OCP_CFG 0x018 +#define R92C_RSV_CTRL 0x01c +#define R92C_RF_CTRL 0x01f +#define R92C_LDOA15_CTRL 0x020 +#define R92C_LDOV12D_CTRL 0x021 +#define R92C_LDOHCI12_CTRL 0x022 +#define R92C_LPLDO_CTRL 0x023 +#define R92C_AFE_XTAL_CTRL 0x024 +#define R92C_AFE_PLL_CTRL 0x028 +#define R92C_EFUSE_CTRL 0x030 +#define R92C_EFUSE_TEST 0x034 +#define R92C_PWR_DATA 0x038 +#define R92C_CAL_TIMER 0x03c +#define R92C_ACLK_MON 0x03e +#define R92C_GPIO_MUXCFG 0x040 +#define R92C_GPIO_IO_SEL 0x042 +#define R92C_MAC_PINMUX_CFG 0x043 +#define R92C_GPIO_PIN_CTRL 0x044 +#define R92C_GPIO_IN 0x044 +#define R92C_GPIO_OUT 0x045 +#define R92C_GPIO_IOSEL 0x046 +#define R92C_GPIO_MOD 0x047 +#define R92C_GPIO_INTM 0x048 +#define R92C_LEDCFG0 0x04c +#define R92C_LEDCFG1 0x04d +#define R92C_LEDCFG2 0x04e +#define R92C_LEDCFG3 0x04f +#define R92C_FSIMR 0x050 +#define R92C_FSISR 0x054 +#define R92C_HSIMR 0x058 +#define R92C_HSISR 0x05c +#define R88E_BB_PAD_CTRL 0x064 +#define R92C_MCUFWDL 0x080 +#define R92C_HMEBOX_EXT(idx) (0x088 + (idx) * 2) +#define R88E_HIMR 0x0b0 +#define R88E_HISR 0x0b4 +#define R88E_HIMRE 0x0b8 +#define R88E_HISRE 0x0bc +#define R92C_EFUSE_ACCESS 0x0cf +#define R92C_BIST_SCAN 0x0d0 +#define R92C_BIST_RPT 0x0d4 +#define R92C_BIST_ROM_RPT 0x0d8 +#define R92C_USB_SIE_INTF 0x0e0 +#define R92C_PCIE_MIO_INTF 0x0e4 +#define R92C_PCIE_MIO_INTD 0x0e8 +#define R92C_HPON_FSM 0x0ec +#define R92C_SYS_CFG 0x0f0 +/* MAC General Configuration. */ +#define R92C_CR 0x100 +#define R92C_MSR 0x102 +#define R92C_PBP 0x104 +#define R92C_TRXDMA_CTRL 0x10c +#define R92C_TRXFF_BNDY 0x114 +#define R92C_TRXFF_STATUS 0x118 +#define R92C_RXFF_PTR 0x11c +#define R92C_HIMR 0x120 +#define R92C_HISR 0x124 +#define R92C_HIMRE 0x128 +#define R92C_HISRE 0x12c +#define R92C_CPWM 0x12f +#define R92C_FWIMR 0x130 +#define R92C_FWISR 0x134 +#define R92C_PKTBUF_DBG_CTRL 0x140 +#define R92C_PKTBUF_DBG_DATA_L 0x144 +#define R92C_PKTBUF_DBG_DATA_H 0x148 +#define R92C_TC0_CTRL(i) (0x150 + (i) * 4) +#define R92C_TCUNIT_BASE 0x164 +#define R92C_MBIST_START 0x174 +#define R92C_MBIST_DONE 0x178 +#define R92C_MBIST_FAIL 0x17c +#define R88E_32K_CTRL 0x194 +#define R92C_C2HEVT_MSG_NORMAL 0x1a0 +#define R92C_C2HEVT_MSG_TEST 0x1b8 +#define R92C_C2HEVT_CLEAR 0x1bf +#define R92C_MCUTST_1 0x1c0 +#define R92C_FMETHR 0x1c8 +#define R92C_HMETFR 0x1cc +#define R92C_HMEBOX(idx) (0x1d0 + (idx) * 4) +#define R92C_LLT_INIT 0x1e0 +#define R92C_BB_ACCESS_CTRL 0x1e8 +#define R92C_BB_ACCESS_DATA 0x1ec +#define R88E_HMEBOX_EXT(idx) (0x1f0 + (idx) * 4) +/* Tx DMA Configuration. */ +#define R92C_RQPN 0x200 +#define R92C_FIFOPAGE 0x204 +#define R92C_TDECTRL 0x208 +#define R92C_TXDMA_OFFSET_CHK 0x20c +#define R92C_TXDMA_STATUS 0x210 +#define R92C_RQPN_NPQ 0x214 +/* Rx DMA Configuration. */ +#define R92C_RXDMA_AGG_PG_TH 0x280 +#define R92C_RXPKT_NUM 0x284 +#define R92C_RXDMA_STATUS 0x288 +/* Protocol Configuration. */ +#define R92C_FWHW_TXQ_CTRL 0x420 +#define R92C_HWSEQ_CTRL 0x423 +#define R92C_TXPKTBUF_BCNQ_BDNY 0x424 +#define R92C_TXPKTBUF_MGQ_BDNY 0x425 +#define R92C_SPEC_SIFS 0x428 +#define R92C_RL 0x42a +#define R92C_DARFRC 0x430 +#define R92C_RARFRC 0x438 +#define R92C_RRSR 0x440 +#define R92C_ARFR(i) (0x444 + (i) * 4) +#define R92C_AGGLEN_LMT 0x458 +#define R92C_AMPDU_MIN_SPACE 0x45c +#define R92C_TXPKTBUF_WMAC_LBK_BF_HD 0x45d +#define R92C_FAST_EDCA_CTRL 0x460 +#define R92C_RD_RESP_PKT_TH 0x463 +#define R92C_INIRTS_RATE_SEL 0x480 +#define R92C_INIDATA_RATE_SEL(macid) (0x484 + (macid)) +#define R92C_MAX_AGGR_NUM 0x4ca +#define R88E_TX_RPT_CTRL 0x4ec +#define R88E_TX_RPT_MACID_MAX 0x4ed +#define R88E_TX_RPT_TIME 0x4f0 +/* EDCA Configuration. */ +#define R92C_EDCA_VO_PARAM 0x500 +#define R92C_EDCA_VI_PARAM 0x504 +#define R92C_EDCA_BE_PARAM 0x508 +#define R92C_EDCA_BK_PARAM 0x50c +#define R92C_BCNTCFG 0x510 +#define R92C_PIFS 0x512 +#define R92C_RDG_PIFS 0x513 +#define R92C_SIFS_CCK 0x514 +#define R92C_SIFS_OFDM 0x516 +#define R92C_AGGR_BREAK_TIME 0x51a +#define R92C_SLOT 0x51b +#define R92C_TX_PTCL_CTRL 0x520 +#define R92C_TXPAUSE 0x522 +#define R92C_DIS_TXREQ_CLR 0x523 +#define R92C_RD_CTRL 0x524 +#define R92C_TBTT_PROHIBIT 0x540 +#define R92C_RD_NAV_NXT 0x544 +#define R92C_NAV_PROT_LEN 0x546 +#define R92C_BCN_CTRL 0x550 +#define R92C_MBID_NUM 0x552 +#define R92C_DUAL_TSF_RST 0x553 +#define R92C_BCN_INTERVAL 0x554 +#define R92C_DRVERLYINT 0x558 +#define R92C_BCNDMATIM 0x559 +#define R92C_ATIMWND 0x55a +#define R92C_USTIME_TSF 0x55c +#define R92C_BCN_MAX_ERR 0x55d +#define R92C_RXTSF_OFFSET_CCK 0x55e +#define R92C_RXTSF_OFFSET_OFDM 0x55f +#define R92C_TSFTR 0x560 +#define R92C_INIT_TSFTR 0x564 +#define R92C_PSTIMER 0x580 +#define R92C_TIMER0 0x584 +#define R92C_TIMER1 0x588 +#define R92C_ACMHWCTRL 0x5c0 +#define R92C_ACMRSTCTRL 0x5c1 +#define R92C_ACMAVG 0x5c2 +#define R92C_VO_ADMTIME 0x5c4 +#define R92C_VI_ADMTIME 0x5c6 +#define R92C_BE_ADMTIME 0x5c8 +#define R92C_EDCA_RANDOM_GEN 0x5cc +#define R92C_SCH_TXCMD 0x5d0 +#define R88E_SCH_TXCMD 0x5f8 +/* WMAC Configuration. */ +#define R92C_APSD_CTRL 0x600 +#define R92C_BWOPMODE 0x603 +#define R92C_RCR 0x608 +#define R92C_RX_DRVINFO_SZ 0x60f +#define R92C_MACID 0x610 +#define R92C_BSSID 0x618 +#define R92C_MAR 0x620 +#define R92C_MAC_SPEC_SIFS 0x63a +#define R92C_R2T_SIFS 0x63c +#define R92C_T2T_SIFS 0x63e +#define R92C_ACKTO 0x640 +#define R92C_CAMCMD 0x670 +#define R92C_CAMWRITE 0x674 +#define R92C_CAMREAD 0x678 +#define R92C_CAMDBG 0x67c +#define R92C_SECCFG 0x680 +#define R92C_RXFLTMAP0 0x6a0 +#define R92C_RXFLTMAP1 0x6a2 +#define R92C_RXFLTMAP2 0x6a4 + +/* Bits for R92C_SYS_ISO_CTRL. */ +#define R92C_SYS_ISO_CTRL_MD2PP 0x0001 +#define R92C_SYS_ISO_CTRL_UA2USB 0x0002 +#define R92C_SYS_ISO_CTRL_UD2CORE 0x0004 +#define R92C_SYS_ISO_CTRL_PA2PCIE 0x0008 +#define R92C_SYS_ISO_CTRL_PD2CORE 0x0010 +#define R92C_SYS_ISO_CTRL_IP2MAC 0x0020 +#define R92C_SYS_ISO_CTRL_DIOP 0x0040 +#define R92C_SYS_ISO_CTRL_DIOE 0x0080 +#define R92C_SYS_ISO_CTRL_EB2CORE 0x0100 +#define R92C_SYS_ISO_CTRL_DIOR 0x0200 +#define R92C_SYS_ISO_CTRL_PWC_EV25V 0x4000 +#define R92C_SYS_ISO_CTRL_PWC_EV12V 0x8000 + +/* Bits for R92C_SYS_FUNC_EN. */ +#define R92C_SYS_FUNC_EN_BBRSTB 0x0001 +#define R92C_SYS_FUNC_EN_BB_GLB_RST 0x0002 +#define R92C_SYS_FUNC_EN_USBA 0x0004 +#define R92C_SYS_FUNC_EN_UPLL 0x0008 +#define R92C_SYS_FUNC_EN_USBD 0x0010 +#define R92C_SYS_FUNC_EN_DIO_PCIE 0x0020 +#define R92C_SYS_FUNC_EN_PCIEA 0x0040 +#define R92C_SYS_FUNC_EN_PPLL 0x0080 +#define R92C_SYS_FUNC_EN_PCIED 0x0100 +#define R92C_SYS_FUNC_EN_DIOE 0x0200 +#define R92C_SYS_FUNC_EN_CPUEN 0x0400 +#define R92C_SYS_FUNC_EN_DCORE 0x0800 +#define R92C_SYS_FUNC_EN_ELDR 0x1000 +#define R92C_SYS_FUNC_EN_DIO_RF 0x2000 +#define R92C_SYS_FUNC_EN_HWPDN 0x4000 +#define R92C_SYS_FUNC_EN_MREGEN 0x8000 + +/* Bits for R92C_APS_FSMCO. */ +#define R92C_APS_FSMCO_PFM_LDALL 0x00000001 +#define R92C_APS_FSMCO_PFM_ALDN 0x00000002 +#define R92C_APS_FSMCO_PFM_LDKP 0x00000004 +#define R92C_APS_FSMCO_PFM_WOWL 0x00000008 +#define R92C_APS_FSMCO_PDN_EN 0x00000010 +#define R92C_APS_FSMCO_PDN_PL 0x00000020 +#define R92C_APS_FSMCO_APFM_ONMAC 0x00000100 +#define R92C_APS_FSMCO_APFM_OFF 0x00000200 +#define R92C_APS_FSMCO_APFM_RSM 0x00000400 +#define R92C_APS_FSMCO_AFSM_HSUS 0x00000800 +#define R92C_APS_FSMCO_AFSM_PCIE 0x00001000 +#define R92C_APS_FSMCO_APDM_MAC 0x00002000 +#define R92C_APS_FSMCO_APDM_HOST 0x00004000 +#define R92C_APS_FSMCO_APDM_HPDN 0x00008000 +#define R92C_APS_FSMCO_RDY_MACON 0x00010000 +#define R92C_APS_FSMCO_SUS_HOST 0x00020000 +#define R92C_APS_FSMCO_ROP_ALD 0x00100000 +#define R92C_APS_FSMCO_ROP_PWR 0x00200000 +#define R92C_APS_FSMCO_ROP_SPS 0x00400000 +#define R92C_APS_FSMCO_SOP_MRST 0x02000000 +#define R92C_APS_FSMCO_SOP_FUSE 0x04000000 +#define R92C_APS_FSMCO_SOP_ABG 0x08000000 +#define R92C_APS_FSMCO_SOP_AMB 0x10000000 +#define R92C_APS_FSMCO_SOP_RCK 0x20000000 +#define R92C_APS_FSMCO_SOP_A8M 0x40000000 +#define R92C_APS_FSMCO_XOP_BTCK 0x80000000 + +/* Bits for R92C_SYS_CLKR. */ +#define R92C_SYS_CLKR_ANAD16V_EN 0x00000001 +#define R92C_SYS_CLKR_ANA8M 0x00000002 +#define R92C_SYS_CLKR_MACSLP 0x00000010 +#define R92C_SYS_CLKR_LOADER_EN 0x00000020 +#define R92C_SYS_CLKR_80M_SSC_DIS 0x00000080 +#define R92C_SYS_CLKR_80M_SSC_EN_HO 0x00000100 +#define R92C_SYS_CLKR_PHY_SSC_RSTB 0x00000200 +#define R92C_SYS_CLKR_SEC_EN 0x00000400 +#define R92C_SYS_CLKR_MAC_EN 0x00000800 +#define R92C_SYS_CLKR_SYS_EN 0x00001000 +#define R92C_SYS_CLKR_RING_EN 0x00002000 + +/* Bits for R92C_RF_CTRL. */ +#define R92C_RF_CTRL_EN 0x01 +#define R92C_RF_CTRL_RSTB 0x02 +#define R92C_RF_CTRL_SDMRSTB 0x04 + +/* Bits for R92C_LDOA15_CTRL. */ +#define R92C_LDOA15_CTRL_EN 0x01 +#define R92C_LDOA15_CTRL_STBY 0x02 +#define R92C_LDOA15_CTRL_OBUF 0x04 +#define R92C_LDOA15_CTRL_REG_VOS 0x08 + +/* Bits for R92C_LDOV12D_CTRL. */ +#define R92C_LDOV12D_CTRL_LDV12_EN 0x01 + +/* Bits for R92C_LPLDO_CTRL. */ +#define R92C_LPLDO_CTRL_SLEEP 0x10 + +/* Bits for R92C_AFE_XTAL_CTRL. */ +#define R92C_AFE_XTAL_CTRL_ADDR_M 0x007ff800 +#define R92C_AFE_XTAL_CTRL_ADDR_S 11 + +/* Bits for R92C_AFE_PLL_CTRL. */ +#define R92C_AFE_PLL_CTRL_EN 0x0001 +#define R92C_AFE_PLL_CTRL_320_EN 0x0002 +#define R92C_AFE_PLL_CTRL_FREF_SEL 0x0004 +#define R92C_AFE_PLL_CTRL_EDGE_SEL 0x0008 +#define R92C_AFE_PLL_CTRL_WDOGB 0x0010 +#define R92C_AFE_PLL_CTRL_LPFEN 0x0020 + +/* Bits for R92C_EFUSE_CTRL. */ +#define R92C_EFUSE_CTRL_DATA_M 0x000000ff +#define R92C_EFUSE_CTRL_DATA_S 0 +#define R92C_EFUSE_CTRL_ADDR_M 0x0003ff00 +#define R92C_EFUSE_CTRL_ADDR_S 8 +#define R92C_EFUSE_CTRL_VALID 0x80000000 + +/* Bits for R92C_GPIO_MUXCFG. */ +#define R92C_GPIO_MUXCFG_ENBT 0x0020 + +/* Bits for R92C_LEDCFG0. */ +#define R92C_LEDCFG0_DIS 0x08 + +/* Bits for R92C_MCUFWDL. */ +#define R92C_MCUFWDL_EN 0x00000001 +#define R92C_MCUFWDL_RDY 0x00000002 +#define R92C_MCUFWDL_CHKSUM_RPT 0x00000004 +#define R92C_MCUFWDL_MACINI_RDY 0x00000008 +#define R92C_MCUFWDL_BBINI_RDY 0x00000010 +#define R92C_MCUFWDL_RFINI_RDY 0x00000020 +#define R92C_MCUFWDL_WINTINI_RDY 0x00000040 +#define R92C_MCUFWDL_RAM_DL_SEL 0x00000080 +#define R92C_MCUFWDL_PAGE_M 0x00070000 +#define R92C_MCUFWDL_PAGE_S 16 +#define R92C_MCUFWDL_CPRST 0x00800000 + +/* Bits for R88E_HIMR. */ +#define R88E_HIMR_CPWM 0x00000100 +#define R88E_HIMR_CPWM2 0x00000200 +#define R88E_HIMR_TBDER 0x04000000 +#define R88E_HIMR_PSTIMEOUT 0x20000000 + +/* Bits for R88E_HIMRE.*/ +#define R88E_HIMRE_RXFOVW 0x00000100 +#define R88E_HIMRE_TXFOVW 0x00000200 +#define R88E_HIMRE_RXERR 0x00000400 +#define R88E_HIMRE_TXERR 0x00000800 + +/* Bits for R92C_EFUSE_ACCESS. */ +#define R92C_EFUSE_ACCESS_OFF 0x00 +#define R92C_EFUSE_ACCESS_ON 0x69 + +/* Bits for R92C_HPON_FSM. */ +#define R92C_HPON_FSM_CHIP_BONDING_ID_S 22 +#define R92C_HPON_FSM_CHIP_BONDING_ID_M 0x00c00000 +#define R92C_HPON_FSM_CHIP_BONDING_ID_92C_1T2R 1 + +/* Bits for R92C_SYS_CFG. */ +#define R92C_SYS_CFG_XCLK_VLD 0x00000001 +#define R92C_SYS_CFG_ACLK_VLD 0x00000002 +#define R92C_SYS_CFG_UCLK_VLD 0x00000004 +#define R92C_SYS_CFG_PCLK_VLD 0x00000008 +#define R92C_SYS_CFG_PCIRSTB 0x00000010 +#define R92C_SYS_CFG_V15_VLD 0x00000020 +#define R92C_SYS_CFG_TRP_B15V_EN 0x00000080 +#define R92C_SYS_CFG_SIC_IDLE 0x00000100 +#define R92C_SYS_CFG_BD_MAC2 0x00000200 +#define R92C_SYS_CFG_BD_MAC1 0x00000400 +#define R92C_SYS_CFG_IC_MACPHY_MODE 0x00000800 +#define R92C_SYS_CFG_CHIP_VER_RTL_M 0x0000f000 +#define R92C_SYS_CFG_CHIP_VER_RTL_S 12 +#define R92C_SYS_CFG_BT_FUNC 0x00010000 +#define R92C_SYS_CFG_VENDOR_UMC 0x00080000 +#define R92C_SYS_CFG_PAD_HWPD_IDN 0x00400000 +#define R92C_SYS_CFG_TRP_VAUX_EN 0x00800000 +#define R92C_SYS_CFG_TRP_BT_EN 0x01000000 +#define R92C_SYS_CFG_BD_PKG_SEL 0x02000000 +#define R92C_SYS_CFG_BD_HCI_SEL 0x04000000 +#define R92C_SYS_CFG_TYPE_92C 0x08000000 + +/* Bits for R92C_CR. */ +#define R92C_CR_HCI_TXDMA_EN 0x0001 +#define R92C_CR_HCI_RXDMA_EN 0x0002 +#define R92C_CR_TXDMA_EN 0x0004 +#define R92C_CR_RXDMA_EN 0x0008 +#define R92C_CR_PROTOCOL_EN 0x0010 +#define R92C_CR_SCHEDULE_EN 0x0020 +#define R92C_CR_MACTXEN 0x0040 +#define R92C_CR_MACRXEN 0x0080 +#define R92C_CR_ENSEC 0x0200 +#define R92C_CR_CALTMR_EN 0x0400 + +/* Bits for R92C_MSR. */ +#define R92C_MSR_NOLINK 0x00 +#define R92C_MSR_ADHOC 0x01 +#define R92C_MSR_INFRA 0x02 +#define R92C_MSR_AP 0x03 +#define R92C_MSR_MASK (R92C_MSR_AP) + +/* Bits for R92C_PBP. */ +#define R92C_PBP_PSRX_M 0x0f +#define R92C_PBP_PSRX_S 0 +#define R92C_PBP_PSTX_M 0xf0 +#define R92C_PBP_PSTX_S 4 +#define R92C_PBP_64 0 +#define R92C_PBP_128 1 +#define R92C_PBP_256 2 +#define R92C_PBP_512 3 +#define R92C_PBP_1024 4 + +/* Bits for R92C_TRXDMA_CTRL. */ +#define R92C_TRXDMA_CTRL_RXDMA_AGG_EN 0x0004 +#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_M 0x0030 +#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_S 4 +#define R92C_TRXDMA_CTRL_TXDMA_VIQ_MAP_M 0x00c0 +#define R92C_TRXDMA_CTRL_TXDMA_VIQ_MAP_S 6 +#define R92C_TRXDMA_CTRL_TXDMA_BEQ_MAP_M 0x0300 +#define R92C_TRXDMA_CTRL_TXDMA_BEQ_MAP_S 8 +#define R92C_TRXDMA_CTRL_TXDMA_BKQ_MAP_M 0x0c00 +#define R92C_TRXDMA_CTRL_TXDMA_BKQ_MAP_S 10 +#define R92C_TRXDMA_CTRL_TXDMA_MGQ_MAP_M 0x3000 +#define R92C_TRXDMA_CTRL_TXDMA_MGQ_MAP_S 12 +#define R92C_TRXDMA_CTRL_TXDMA_HIQ_MAP_M 0xc000 +#define R92C_TRXDMA_CTRL_TXDMA_HIQ_MAP_S 14 +#define R92C_TRXDMA_CTRL_QUEUE_LOW 1 +#define R92C_TRXDMA_CTRL_QUEUE_NORMAL 2 +#define R92C_TRXDMA_CTRL_QUEUE_HIGH 3 +#define R92C_TRXDMA_CTRL_QMAP_M 0xfff0 +/* Shortcuts. */ +#define R92C_TRXDMA_CTRL_QMAP_3EP 0xf5b0 +#define R92C_TRXDMA_CTRL_QMAP_HQ_LQ 0xf5f0 +#define R92C_TRXDMA_CTRL_QMAP_HQ_NQ 0xfaf0 +#define R92C_TRXDMA_CTRL_QMAP_LQ 0x5550 +#define R92C_TRXDMA_CTRL_QMAP_NQ 0xaaa0 +#define R92C_TRXDMA_CTRL_QMAP_HQ 0xfff0 + +/* Bits for R92C_LLT_INIT. */ +#define R92C_LLT_INIT_DATA_M 0x000000ff +#define R92C_LLT_INIT_DATA_S 0 +#define R92C_LLT_INIT_ADDR_M 0x0000ff00 +#define R92C_LLT_INIT_ADDR_S 8 +#define R92C_LLT_INIT_OP_M 0xc0000000 +#define R92C_LLT_INIT_OP_S 30 +#define R92C_LLT_INIT_OP_NO_ACTIVE 0 +#define R92C_LLT_INIT_OP_WRITE 1 + +/* Bits for R92C_RQPN. */ +#define R92C_RQPN_HPQ_M 0x000000ff +#define R92C_RQPN_HPQ_S 0 +#define R92C_RQPN_LPQ_M 0x0000ff00 +#define R92C_RQPN_LPQ_S 8 +#define R92C_RQPN_PUBQ_M 0x00ff0000 +#define R92C_RQPN_PUBQ_S 16 +#define R92C_RQPN_LD 0x80000000 + +/* Bits for R92C_TDECTRL. */ +#define R92C_TDECTRL_BLK_DESC_NUM_M 0x000000f0 +#define R92C_TDECTRL_BLK_DESC_NUM_S 4 +#define R92C_TDECTRL_BCN_VALID 0x00010000 + +/* Bits for R92C_FWHW_TXQ_CTRL. */ +#define R92C_FWHW_TXQ_CTRL_AMPDU_RTY_NEW 0x80 + +/* Bits for R92C_SPEC_SIFS. */ +#define R92C_SPEC_SIFS_CCK_M 0x00ff +#define R92C_SPEC_SIFS_CCK_S 0 +#define R92C_SPEC_SIFS_OFDM_M 0xff00 +#define R92C_SPEC_SIFS_OFDM_S 8 + +/* Bits for R92C_RL. */ +#define R92C_RL_LRL_M 0x003f +#define R92C_RL_LRL_S 0 +#define R92C_RL_SRL_M 0x3f00 +#define R92C_RL_SRL_S 8 + +/* Bits for R92C_RRSR. */ +#define R92C_RRSR_RATE_BITMAP_M 0x000fffff +#define R92C_RRSR_RATE_BITMAP_S 0 +#define R92C_RRSR_RATE_CCK_ONLY_1M 0xffff1 +#define R92C_RRSR_RSC_LOWSUBCHNL 0x00200000 +#define R92C_RRSR_RSC_UPSUBCHNL 0x00400000 +#define R92C_RRSR_SHORT 0x00800000 + +/* Bits for R88E_TX_RPT_CTRL. */ +#define R88E_TX_RPT1_ENA 0x01 +#define R88E_TX_RPT2_ENA 0x02 + +/* Bits for R92C_EDCA_XX_PARAM. */ +#define R92C_EDCA_PARAM_AIFS_M 0x000000ff +#define R92C_EDCA_PARAM_AIFS_S 0 +#define R92C_EDCA_PARAM_ECWMIN_M 0x00000f00 +#define R92C_EDCA_PARAM_ECWMIN_S 8 +#define R92C_EDCA_PARAM_ECWMAX_M 0x0000f000 +#define R92C_EDCA_PARAM_ECWMAX_S 12 +#define R92C_EDCA_PARAM_TXOP_M 0xffff0000 +#define R92C_EDCA_PARAM_TXOP_S 16 + +/* Bits for R92C_HWSEQ_CTRL / R92C_TXPAUSE. */ +#define R92C_TX_QUEUE_VO 0x01 +#define R92C_TX_QUEUE_VI 0x02 +#define R92C_TX_QUEUE_BE 0x04 +#define R92C_TX_QUEUE_BK 0x08 +#define R92C_TX_QUEUE_MGT 0x10 +#define R92C_TX_QUEUE_HIGH 0x20 +#define R92C_TX_QUEUE_BCN 0x40 + +/* Shortcuts. */ +#define R92C_TX_QUEUE_AC \ + (R92C_TX_QUEUE_VO | R92C_TX_QUEUE_VI | \ + R92C_TX_QUEUE_BE | R92C_TX_QUEUE_BK) + +#define R92C_TX_QUEUE_ALL \ + (R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | \ + R92C_TX_QUEUE_HIGH | R92C_TX_QUEUE_BCN | 0x80) /* XXX */ + +/* Bits for R92C_BCN_CTRL. */ +#define R92C_BCN_CTRL_EN_MBSSID 0x02 +#define R92C_BCN_CTRL_TXBCN_RPT 0x04 +#define R92C_BCN_CTRL_EN_BCN 0x08 +#define R92C_BCN_CTRL_DIS_TSF_UDT0 0x10 + +/* Bits for R92C_MBID_NUM. */ +#define R92C_MBID_TXBCN_RPT0 0x08 +#define R92C_MBID_TXBCN_RPT1 0x10 + +/* Bits for R92C_DUAL_TSF_RST. */ +#define R92C_DUAL_TSF_RST0 0x01 +#define R92C_DUAL_TSF_RST1 0x02 + +/* Bits for R92C_ACMHWCTRL. */ +#define R92C_ACMHWCTRL_EN 0x01 +#define R92C_ACMHWCTRL_BE 0x02 +#define R92C_ACMHWCTRL_VI 0x04 +#define R92C_ACMHWCTRL_VO 0x08 +#define R92C_ACMHWCTRL_ACM_MASK 0x0f + +/* Bits for R92C_APSD_CTRL. */ +#define R92C_APSD_CTRL_OFF 0x40 +#define R92C_APSD_CTRL_OFF_STATUS 0x80 + +/* Bits for R92C_BWOPMODE. */ +#define R92C_BWOPMODE_11J 0x01 +#define R92C_BWOPMODE_5G 0x02 +#define R92C_BWOPMODE_20MHZ 0x04 + +/* Bits for R92C_RCR. */ +#define R92C_RCR_AAP 0x00000001 +#define R92C_RCR_APM 0x00000002 +#define R92C_RCR_AM 0x00000004 +#define R92C_RCR_AB 0x00000008 +#define R92C_RCR_ADD3 0x00000010 +#define R92C_RCR_APWRMGT 0x00000020 +#define R92C_RCR_CBSSID_DATA 0x00000040 +#define R92C_RCR_CBSSID_BCN 0x00000080 +#define R92C_RCR_ACRC32 0x00000100 +#define R92C_RCR_AICV 0x00000200 +#define R92C_RCR_ADF 0x00000800 +#define R92C_RCR_ACF 0x00001000 +#define R92C_RCR_AMF 0x00002000 +#define R92C_RCR_HTC_LOC_CTRL 0x00004000 +#define R92C_RCR_MFBEN 0x00400000 +#define R92C_RCR_LSIGEN 0x00800000 +#define R92C_RCR_ENMBID 0x01000000 +#define R92C_RCR_APP_BA_SSN 0x08000000 +#define R92C_RCR_APP_PHYSTS 0x10000000 +#define R92C_RCR_APP_ICV 0x20000000 +#define R92C_RCR_APP_MIC 0x40000000 +#define R92C_RCR_APPFCS 0x80000000 + +/* Bits for R92C_CAMCMD. */ +#define R92C_CAMCMD_ADDR_M 0x0000ffff +#define R92C_CAMCMD_ADDR_S 0 +#define R92C_CAMCMD_WRITE 0x00010000 +#define R92C_CAMCMD_CLR 0x40000000 +#define R92C_CAMCMD_POLLING 0x80000000 + +/* Bits for R92C_SECCFG. */ +#define R92C_SECCFG_TXUCKEY_DEF 0x0001 +#define R92C_SECCFG_RXUCKEY_DEF 0x0002 +#define R92C_SECCFG_TXENC_ENA 0x0004 +#define R92C_SECCFG_RXDEC_ENA 0x0008 +#define R92C_SECCFG_CMP_A2 0x0010 +#define R92C_SECCFG_TXBCKEY_DEF 0x0040 +#define R92C_SECCFG_RXBCKEY_DEF 0x0080 +#define R88E_SECCFG_CHK_KEYID 0x0100 + +/* Bits for R92C_RXFLTMAP*. */ +#define R92C_RXFLTMAP_SUBTYPE(subtype) \ + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) + + +/* + * Baseband registers. + */ +#define R92C_FPGA0_RFMOD 0x800 +#define R92C_FPGA0_TXINFO 0x804 +#define R92C_HSSI_PARAM1(chain) (0x820 + (chain) * 8) +#define R92C_HSSI_PARAM2(chain) (0x824 + (chain) * 8) +#define R92C_TXAGC_RATE18_06(i) (((i) == 0) ? 0xe00 : 0x830) +#define R92C_TXAGC_RATE54_24(i) (((i) == 0) ? 0xe04 : 0x834) +#define R92C_TXAGC_A_CCK1_MCS32 0xe08 +#define R92C_TXAGC_B_CCK1_55_MCS32 0x838 +#define R92C_TXAGC_B_CCK11_A_CCK2_11 0x86c +#define R92C_TXAGC_MCS03_MCS00(i) (((i) == 0) ? 0xe10 : 0x83c) +#define R92C_TXAGC_MCS07_MCS04(i) (((i) == 0) ? 0xe14 : 0x848) +#define R92C_TXAGC_MCS11_MCS08(i) (((i) == 0) ? 0xe18 : 0x84c) +#define R92C_TXAGC_MCS15_MCS12(i) (((i) == 0) ? 0xe1c : 0x868) +#define R92C_LSSI_PARAM(chain) (0x840 + (chain) * 4) +#define R92C_FPGA0_RFIFACEOE(chain) (0x860 + (chain) * 4) +#define R92C_FPGA0_RFIFACESW(idx) (0x870 + (idx) * 4) +#define R92C_FPGA0_RFPARAM(idx) (0x878 + (idx) * 4) +#define R92C_FPGA0_ANAPARAM2 0x884 +#define R92C_LSSI_READBACK(chain) (0x8a0 + (chain) * 4) +#define R92C_HSPI_READBACK(chain) (0x8b8 + (chain) * 4) +#define R92C_FPGA1_RFMOD 0x900 +#define R92C_FPGA1_TXINFO 0x90c +#define R92C_CCK0_SYSTEM 0xa00 +#define R92C_CCK0_AFESETTING 0xa04 +#define R92C_OFDM0_TRXPATHENA 0xc04 +#define R92C_OFDM0_TRMUXPAR 0xc08 +#define R92C_OFDM0_AGCCORE1(chain) (0xc50 + (chain) * 8) +#define R92C_OFDM0_AGCPARAM1 0xc70 +#define R92C_OFDM0_AGCRSSITABLE 0xc78 +#define R92C_OFDM1_LSTF 0xd00 + +/* Bits for R92C_FPGA[01]_RFMOD. */ +#define R92C_RFMOD_40MHZ 0x00000001 +#define R92C_RFMOD_JAPAN 0x00000002 +#define R92C_RFMOD_CCK_TXSC 0x00000030 +#define R92C_RFMOD_CCK_EN 0x01000000 +#define R92C_RFMOD_OFDM_EN 0x02000000 + +/* Bits for R92C_HSSI_PARAM1(i). */ +#define R92C_HSSI_PARAM1_PI 0x00000100 + +/* Bits for R92C_HSSI_PARAM2(i). */ +#define R92C_HSSI_PARAM2_CCK_HIPWR 0x00000200 +#define R92C_HSSI_PARAM2_ADDR_LENGTH 0x00000400 +#define R92C_HSSI_PARAM2_DATA_LENGTH 0x00000800 +#define R92C_HSSI_PARAM2_READ_ADDR_M 0x7f800000 +#define R92C_HSSI_PARAM2_READ_ADDR_S 23 +#define R92C_HSSI_PARAM2_READ_EDGE 0x80000000 + +/* Bits for R92C_TXAGC_A_CCK1_MCS32. */ +#define R92C_TXAGC_A_CCK1_M 0x0000ff00 +#define R92C_TXAGC_A_CCK1_S 8 + +/* Bits for R92C_TXAGC_B_CCK11_A_CCK2_11. */ +#define R92C_TXAGC_B_CCK11_M 0x000000ff +#define R92C_TXAGC_B_CCK11_S 0 +#define R92C_TXAGC_A_CCK2_M 0x0000ff00 +#define R92C_TXAGC_A_CCK2_S 8 +#define R92C_TXAGC_A_CCK55_M 0x00ff0000 +#define R92C_TXAGC_A_CCK55_S 16 +#define R92C_TXAGC_A_CCK11_M 0xff000000 +#define R92C_TXAGC_A_CCK11_S 24 + +/* Bits for R92C_TXAGC_B_CCK1_55_MCS32. */ +#define R92C_TXAGC_B_CCK1_M 0x0000ff00 +#define R92C_TXAGC_B_CCK1_S 8 +#define R92C_TXAGC_B_CCK2_M 0x00ff0000 +#define R92C_TXAGC_B_CCK2_S 16 +#define R92C_TXAGC_B_CCK55_M 0xff000000 +#define R92C_TXAGC_B_CCK55_S 24 + +/* Bits for R92C_TXAGC_RATE18_06(x). */ +#define R92C_TXAGC_RATE06_M 0x000000ff +#define R92C_TXAGC_RATE06_S 0 +#define R92C_TXAGC_RATE09_M 0x0000ff00 +#define R92C_TXAGC_RATE09_S 8 +#define R92C_TXAGC_RATE12_M 0x00ff0000 +#define R92C_TXAGC_RATE12_S 16 +#define R92C_TXAGC_RATE18_M 0xff000000 +#define R92C_TXAGC_RATE18_S 24 + +/* Bits for R92C_TXAGC_RATE54_24(x). */ +#define R92C_TXAGC_RATE24_M 0x000000ff +#define R92C_TXAGC_RATE24_S 0 +#define R92C_TXAGC_RATE36_M 0x0000ff00 +#define R92C_TXAGC_RATE36_S 8 +#define R92C_TXAGC_RATE48_M 0x00ff0000 +#define R92C_TXAGC_RATE48_S 16 +#define R92C_TXAGC_RATE54_M 0xff000000 +#define R92C_TXAGC_RATE54_S 24 + +/* Bits for R92C_TXAGC_MCS03_MCS00(x). */ +#define R92C_TXAGC_MCS00_M 0x000000ff +#define R92C_TXAGC_MCS00_S 0 +#define R92C_TXAGC_MCS01_M 0x0000ff00 +#define R92C_TXAGC_MCS01_S 8 +#define R92C_TXAGC_MCS02_M 0x00ff0000 +#define R92C_TXAGC_MCS02_S 16 +#define R92C_TXAGC_MCS03_M 0xff000000 +#define R92C_TXAGC_MCS03_S 24 + +/* Bits for R92C_TXAGC_MCS07_MCS04(x). */ +#define R92C_TXAGC_MCS04_M 0x000000ff +#define R92C_TXAGC_MCS04_S 0 +#define R92C_TXAGC_MCS05_M 0x0000ff00 +#define R92C_TXAGC_MCS05_S 8 +#define R92C_TXAGC_MCS06_M 0x00ff0000 +#define R92C_TXAGC_MCS06_S 16 +#define R92C_TXAGC_MCS07_M 0xff000000 +#define R92C_TXAGC_MCS07_S 24 + +/* Bits for R92C_TXAGC_MCS11_MCS08(x). */ +#define R92C_TXAGC_MCS08_M 0x000000ff +#define R92C_TXAGC_MCS08_S 0 +#define R92C_TXAGC_MCS09_M 0x0000ff00 +#define R92C_TXAGC_MCS09_S 8 +#define R92C_TXAGC_MCS10_M 0x00ff0000 +#define R92C_TXAGC_MCS10_S 16 +#define R92C_TXAGC_MCS11_M 0xff000000 +#define R92C_TXAGC_MCS11_S 24 + +/* Bits for R92C_TXAGC_MCS15_MCS12(x). */ +#define R92C_TXAGC_MCS12_M 0x000000ff +#define R92C_TXAGC_MCS12_S 0 +#define R92C_TXAGC_MCS13_M 0x0000ff00 +#define R92C_TXAGC_MCS13_S 8 +#define R92C_TXAGC_MCS14_M 0x00ff0000 +#define R92C_TXAGC_MCS14_S 16 +#define R92C_TXAGC_MCS15_M 0xff000000 +#define R92C_TXAGC_MCS15_S 24 + +/* Bits for R92C_LSSI_PARAM(i). */ +#define R92C_LSSI_PARAM_DATA_M 0x000fffff +#define R92C_LSSI_PARAM_DATA_S 0 +#define R92C_LSSI_PARAM_ADDR_M 0x03f00000 +#define R92C_LSSI_PARAM_ADDR_S 20 +#define R88E_LSSI_PARAM_ADDR_M 0x0ff00000 +#define R88E_LSSI_PARAM_ADDR_S 20 + +/* Bits for R92C_FPGA0_ANAPARAM2. */ +#define R92C_FPGA0_ANAPARAM2_CBW20 0x00000400 + +/* Bits for R92C_LSSI_READBACK(i). */ +#define R92C_LSSI_READBACK_DATA_M 0x000fffff +#define R92C_LSSI_READBACK_DATA_S 0 + +/* Bits for R92C_OFDM0_AGCCORE1(i). */ +#define R92C_OFDM0_AGCCORE1_GAIN_M 0x0000007f +#define R92C_OFDM0_AGCCORE1_GAIN_S 0 + + +/* + * USB registers. + */ +#define R92C_USB_SUSPEND 0xfe10 +#define R92C_USB_INFO 0xfe17 +#define R92C_USB_SPECIAL_OPTION 0xfe55 +#define R92C_USB_HCPWM 0xfe57 +#define R92C_USB_HRPWM 0xfe58 +#define R92C_USB_DMA_AGG_TO 0xfe5b +#define R92C_USB_AGG_TO 0xfe5c +#define R92C_USB_AGG_TH 0xfe5d +#define R92C_USB_VID 0xfe60 +#define R92C_USB_PID 0xfe62 +#define R92C_USB_OPTIONAL 0xfe64 +#define R92C_USB_EP 0xfe65 +#define R92C_USB_PHY 0xfe68 +#define R92C_USB_MAC_ADDR 0xfe70 +#define R92C_USB_STRING 0xfe80 + +/* Bits for R92C_USB_SPECIAL_OPTION. */ +#define R92C_USB_SPECIAL_OPTION_AGG_EN 0x08 +#define R92C_USB_SPECIAL_OPTION_INT_BULK_SEL 0x10 + +/* Bits for R92C_USB_EP. */ +#define R92C_USB_EP_HQ_M 0x000f +#define R92C_USB_EP_HQ_S 0 +#define R92C_USB_EP_NQ_M 0x00f0 +#define R92C_USB_EP_NQ_S 4 +#define R92C_USB_EP_LQ_M 0x0f00 +#define R92C_USB_EP_LQ_S 8 + + +/* + * Firmware base address. + */ +#define R92C_FW_START_ADDR 0x1000 +#define R92C_FW_PAGE_SIZE 4096 + + +/* + * RF (6052) registers. + */ +#define R92C_RF_AC 0x00 +#define R92C_RF_IQADJ_G(i) (0x01 + (i)) +#define R92C_RF_POW_TRSW 0x05 +#define R92C_RF_GAIN_RX 0x06 +#define R92C_RF_GAIN_TX 0x07 +#define R92C_RF_TXM_IDAC 0x08 +#define R92C_RF_BS_IQGEN 0x0f +#define R92C_RF_MODE1 0x10 +#define R92C_RF_MODE2 0x11 +#define R92C_RF_RX_AGC_HP 0x12 +#define R92C_RF_TX_AGC 0x13 +#define R92C_RF_BIAS 0x14 +#define R92C_RF_IPA 0x15 +#define R92C_RF_POW_ABILITY 0x17 +#define R92C_RF_CHNLBW 0x18 +#define R92C_RF_RX_G1 0x1a +#define R92C_RF_RX_G2 0x1b +#define R92C_RF_RX_BB2 0x1c +#define R92C_RF_RX_BB1 0x1d +#define R92C_RF_RCK1 0x1e +#define R92C_RF_RCK2 0x1f +#define R92C_RF_TX_G(i) (0x20 + (i)) +#define R92C_RF_TX_BB1 0x23 +#define R92C_RF_T_METER 0x24 +#define R92C_RF_SYN_G(i) (0x25 + (i)) +#define R92C_RF_RCK_OS 0x30 +#define R92C_RF_TXPA_G(i) (0x31 + (i)) +#define R88E_RF_T_METER 0x42 + +/* Bits for R92C_RF_AC. */ +#define R92C_RF_AC_MODE_M 0x70000 +#define R92C_RF_AC_MODE_S 16 +#define R92C_RF_AC_MODE_STANDBY 1 + +/* Bits for R92C_RF_CHNLBW. */ +#define R92C_RF_CHNLBW_CHNL_M 0x003ff +#define R92C_RF_CHNLBW_CHNL_S 0 +#define R92C_RF_CHNLBW_BW20 0x00400 +#define R88E_RF_CHNLBW_BW20 0x00c00 +#define R92C_RF_CHNLBW_LCSTART 0x08000 + +/* Bits for R92C_RF_T_METER. */ +#define R92C_RF_T_METER_START 0x60 +#define R92C_RF_T_METER_VAL_M 0x1f +#define R92C_RF_T_METER_VAL_S 0 + +/* Bits for R88E_RF_T_METER. */ +#define R88E_RF_T_METER_VAL_M 0x0fc00 +#define R88E_RF_T_METER_VAL_S 10 +#define R88E_RF_T_METER_START 0x30000 + + +/* + * CAM entries. + */ +#define R92C_CAM_ENTRY_COUNT 32 + +#define R92C_CAM_CTL0(entry) ((entry) * 8 + 0) +#define R92C_CAM_CTL1(entry) ((entry) * 8 + 1) +#define R92C_CAM_KEY(entry, i) ((entry) * 8 + 2 + (i)) + +/* Bits for R92C_CAM_CTL0(i). */ +#define R92C_CAM_KEYID_M 0x00000003 +#define R92C_CAM_KEYID_S 0 +#define R92C_CAM_ALGO_M 0x0000001c +#define R92C_CAM_ALGO_S 2 +#define R92C_CAM_ALGO_NONE 0 +#define R92C_CAM_ALGO_WEP40 1 +#define R92C_CAM_ALGO_TKIP 2 +#define R92C_CAM_ALGO_AES 4 +#define R92C_CAM_ALGO_WEP104 5 +#define R92C_CAM_VALID 0x00008000 +#define R92C_CAM_MACLO_M 0xffff0000 +#define R92C_CAM_MACLO_S 16 + +/* Rate adaptation modes. */ +#define R92C_RAID_11GN 1 +#define R92C_RAID_11N 3 +#define R92C_RAID_11BG 4 +#define R92C_RAID_11G 5 /* "pure" 11g */ +#define R92C_RAID_11B 6 + + +/* + * Macros to access subfields in registers. + */ +/* Mask and Shift (getter). */ +#define MS(val, field) \ + (((val) & field##_M) >> field##_S) + +/* Shift and Mask (setter). */ +#define SM(field, val) \ + (((val) << field##_S) & field##_M) + +/* Rewrite. */ +#define RW(var, field, val) \ + (((var) & ~field##_M) | SM(field, val)) + +/* + * Firmware image header. + */ +struct r92c_fw_hdr { + /* QWORD0 */ + uint16_t signature; + uint8_t category; + uint8_t function; + uint16_t version; + uint16_t subversion; + /* QWORD1 */ + uint8_t month; + uint8_t date; + uint8_t hour; + uint8_t minute; + uint16_t ramcodesize; + uint16_t reserved2; + /* QWORD2 */ + uint32_t svnidx; + uint32_t reserved3; + /* QWORD3 */ + uint32_t reserved4; + uint32_t reserved5; +} __packed; + +/* + * Host to firmware commands. + */ +struct r92c_fw_cmd { + uint8_t id; +#define R92C_CMD_AP_OFFLOAD 0 +#define R92C_CMD_SET_PWRMODE 1 +#define R92C_CMD_JOINBSS_RPT 2 +#define R92C_CMD_RSVD_PAGE 3 +#define R92C_CMD_RSSI 4 +#define R92C_CMD_RSSI_SETTING 5 +#define R92C_CMD_MACID_CONFIG 6 +#define R92C_CMD_MACID_PS_MODE 7 +#define R92C_CMD_P2P_PS_OFFLOAD 8 +#define R92C_CMD_SELECTIVE_SUSPEND 9 +#define R92C_CMD_FLAG_EXT 0x80 + + uint8_t msg[5]; +} __packed; + +/* Structure for R92C_CMD_RSSI_SETTING. */ +struct r92c_fw_cmd_rssi { + uint8_t macid; + uint8_t reserved; + uint8_t pwdb; +} __packed; + +/* Structure for R92C_CMD_MACID_CONFIG. */ +struct r92c_fw_cmd_macid_cfg { + uint32_t mask; + uint8_t macid; +#define URTWN_MACID_BSS 0 +#define URTWN_MACID_BC 4 /* Broadcast. */ +#define R92C_MACID_MAX 31 +#define R88E_MACID_MAX 63 +#define URTWN_MACID_MAX(sc) (((sc)->chip & URTWN_CHIP_88E) ? \ + R88E_MACID_MAX : R92C_MACID_MAX) +#define URTWN_MACID_UNDEFINED (uint8_t)-1 +#define URTWN_MACID_VALID 0x80 +} __packed; + +/* + * RTL8192CU ROM image. + */ +struct r92c_rom { + uint16_t id; /* 0x8192 */ + uint8_t reserved1[5]; + uint8_t dbg_sel; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Mar 20 11:40:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D9E3AD6CE7; Sun, 20 Mar 2016 11:40:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35011F18; Sun, 20 Mar 2016 11:40:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KBeqTO091098; Sun, 20 Mar 2016 11:40:52 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KBeqH4091097; Sun, 20 Mar 2016 11:40:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201140.u2KBeqH4091097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 11:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297060 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 11:40:53 -0000 Author: dchagin Date: Sun Mar 20 11:40:52 2016 New Revision: 297060 URL: https://svnweb.freebsd.org/changeset/base/297060 Log: Rework r296543: 1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer(). Assert that kern_setitimer() returns 0. Remove bogus cast of secs. Fix style(9) issues. 2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does. Pointed out by: [1] Bruce Evans MFC after: 1 week Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun Mar 20 05:01:40 2016 (r297059) +++ head/sys/compat/linux/linux_misc.c Sun Mar 20 11:40:52 2016 (r297060) @@ -191,32 +191,33 @@ linux_alarm(struct thread *td, struct li { struct itimerval it, old_it; u_int secs; + int error; #ifdef DEBUG if (ldebug(alarm)) printf(ARGS(alarm, "%u"), args->secs); #endif - secs = args->secs; - - if (secs > INT_MAX) - secs = INT_MAX; - - it.it_value.tv_sec = (long) secs; - it.it_value.tv_usec = 0; - it.it_interval.tv_sec = 0; - it.it_interval.tv_usec = 0; /* - * According to POSIX and Linux implementation - * the alarm() system call is always successfull. - * Ignore errors and return 0 as a Linux does. + * Linux alarm() is always successfull. Limit secs to INT32_MAX / 2 + * to match kern_setitimer()'s limit to avoid error from it. + * + * XXX. Linux limit secs to INT_MAX on 32 and does not limit on 64-bit + * platforms. */ - kern_setitimer(td, ITIMER_REAL, &it, &old_it); - if (timevalisset(&old_it.it_value)) { - if (old_it.it_value.tv_usec != 0) - old_it.it_value.tv_sec++; - td->td_retval[0] = old_it.it_value.tv_sec; - } + if (secs > INT32_MAX / 2) + secs = INT32_MAX / 2; + + it.it_value.tv_sec = secs; + it.it_value.tv_usec = 0; + timevalclear(&it.it_interval); + error = kern_setitimer(td, ITIMER_REAL, &it, &old_it); + KASSERT(error == 0, ("kern_setitimer returns %d", error)); + + if ((old_it.it_value.tv_sec == 0 && old_it.it_value.tv_usec > 0) || + old_it.it_value.tv_usec >= 500000) + old_it.it_value.tv_sec++; + td->td_retval[0] = old_it.it_value.tv_sec; return (0); } From owner-svn-src-head@freebsd.org Sun Mar 20 13:21:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2209AD6C98; Sun, 20 Mar 2016 13:21:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A694215D1; Sun, 20 Mar 2016 13:21:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KDLKDc024576; Sun, 20 Mar 2016 13:21:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KDLKsN024570; Sun, 20 Mar 2016 13:21:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201321.u2KDLKsN024570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 13:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297061 - in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 13:21:21 -0000 Author: dchagin Date: Sun Mar 20 13:21:20 2016 New Revision: 297061 URL: https://svnweb.freebsd.org/changeset/base/297061 Log: Implement fstatfs64 system call. PR: 181012 Submitted by: John Wehle MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/linux_stats.c head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/amd64/linux32/linux32_dummy.c Sun Mar 20 13:21:20 2016 (r297061) @@ -69,7 +69,6 @@ DUMMY(mincore); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/amd64/linux32/syscalls.master Sun Mar 20 13:21:20 2016 (r297061) @@ -450,7 +450,7 @@ 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } -269 AUE_FSTATFS STD { int linux_fstatfs64(void); } +269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 13:21:20 2016 (r297061) @@ -460,6 +460,27 @@ linux_statfs64(struct thread *td, struct bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } + +int +linux_fstatfs64(struct thread *td, struct linux_fstatfs64_args *args) +{ + struct l_statfs64 linux_statfs; + struct statfs bsd_statfs; + int error; + +#ifdef DEBUG + if (ldebug(fstatfs64)) + printf(ARGS(fstatfs64, "%d, *"), args->fd); +#endif + if (args->bufsize != sizeof(struct l_statfs64)) + return (EINVAL); + + error = kern_fstatfs(td, args->fd, &bsd_statfs); + if (error) + return error; + bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); +} #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/i386/linux/linux_dummy.c Sun Mar 20 13:21:20 2016 (r297061) @@ -71,7 +71,6 @@ DUMMY(pivot_root); DUMMY(mincore); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/i386/linux/syscalls.master Sun Mar 20 13:21:20 2016 (r297061) @@ -452,7 +452,7 @@ 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } -269 AUE_FSTATFS STD { int linux_fstatfs64(void); } +269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } From owner-svn-src-head@freebsd.org Sun Mar 20 13:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF086AD6D13; Sun, 20 Mar 2016 13:23:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC6B1A16; Sun, 20 Mar 2016 13:23:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KDN2lA024715; Sun, 20 Mar 2016 13:23:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KDN17Y024704; Sun, 20 Mar 2016 13:23:01 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201323.u2KDN17Y024704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 13:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297062 - in head/sys: amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 13:23:03 -0000 Author: dchagin Date: Sun Mar 20 13:23:01 2016 New Revision: 297062 URL: https://svnweb.freebsd.org/changeset/base/297062 Log: Regen for r297061 (fstatfs64 Linux syscall). MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_proto.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #ifndef _LINUX32_SYSPROTO_H_ @@ -844,7 +844,9 @@ struct linux_statfs64_args { char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { - register_t dummy; + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_tgkill_args { char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_syscall.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #define LINUX32_SYS_linux_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_syscalls.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ const char *linux32_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_sysent.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #include "opt_compat.h" @@ -288,7 +288,7 @@ struct sysent linux32_sysent[] = { { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 267 = linux_clock_nanosleep */ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ + { AS(linux_fstatfs64_args), (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sun Mar 20 13:23:01 2016 (r297062) @@ -1820,7 +1820,11 @@ systrace_args(int sysnum, void *params, } /* linux_fstatfs64 */ case 269: { - *n_args = 0; + struct linux_fstatfs64_args *p = params; + iarg[0] = p->fd; /* l_uint */ + uarg[1] = p->bufsize; /* size_t */ + uarg[2] = (intptr_t) p->buf; /* struct l_statfs64_buf * */ + *n_args = 3; break; } /* linux_tgkill */ @@ -5118,6 +5122,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fstatfs64 */ case 269: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "struct l_statfs64_buf *"; + break; + default: + break; + }; break; /* linux_tgkill */ case 270: @@ -6878,6 +6895,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fstatfs64 */ case 269: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tgkill */ case 270: if (ndx == 0 || ndx == 1) Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_proto.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -848,7 +848,9 @@ struct linux_statfs64_args { char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { - register_t dummy; + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_tgkill_args { char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_syscall.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_syscalls.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_sysent.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #include @@ -287,7 +287,7 @@ struct sysent linux_sysent[] = { { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 267 = linux_clock_nanosleep */ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ + { AS(linux_fstatfs64_args), (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_systrace_args.c Sun Mar 20 13:23:01 2016 (r297062) @@ -1870,7 +1870,11 @@ systrace_args(int sysnum, void *params, } /* linux_fstatfs64 */ case 269: { - *n_args = 0; + struct linux_fstatfs64_args *p = params; + iarg[0] = p->fd; /* l_uint */ + uarg[1] = p->bufsize; /* size_t */ + uarg[2] = (intptr_t) p->buf; /* struct l_statfs64_buf * */ + *n_args = 3; break; } /* linux_tgkill */ @@ -5265,6 +5269,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fstatfs64 */ case 269: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "struct l_statfs64_buf *"; + break; + default: + break; + }; break; /* linux_tgkill */ case 270: @@ -7138,6 +7155,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fstatfs64 */ case 269: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tgkill */ case 270: if (ndx == 0 || ndx == 1) From owner-svn-src-head@freebsd.org Sun Mar 20 13:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7371BAD6DFE; Sun, 20 Mar 2016 13:26:57 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4379E1BCD; Sun, 20 Mar 2016 13:26:56 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KDQiVA016684 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 20 Mar 2016 13:26:46 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KDQcXi088488 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 20 Mar 2016 16:26:38 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u2KDQcTD088487; Sun, 20 Mar 2016 16:26:38 +0300 (MSK) (envelope-from dchagin) Date: Sun, 20 Mar 2016 16:26:37 +0300 From: Chagin Dmitry To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296543 - head/sys/compat/linux Message-ID: <20160320132637.GA88466@chd.heemeyer.club> References: <201603081920.u28JKvbM088851@repo.freebsd.org> <20160309160342.P1249@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160309160342.P1249@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 13:26:57 -0000 On Wed, Mar 09, 2016 at 07:16:27PM +1100, Bruce Evans wrote: > On Tue, 8 Mar 2016, Dmitry Chagin wrote: > > > Log: > > Put a commit message from r296502 about Linux alarm() system call > > behaviour to the source. > > ... > > Modified: head/sys/compat/linux/linux_misc.c > > ============================================================================== > > --- head/sys/compat/linux/linux_misc.c Tue Mar 8 19:08:55 2016 (r296542) > > +++ head/sys/compat/linux/linux_misc.c Tue Mar 8 19:20:57 2016 (r296543) > > @@ -206,6 +206,11 @@ linux_alarm(struct thread *td, struct li > > it.it_value.tv_usec = 0; > > it.it_interval.tv_sec = 0; > > it.it_interval.tv_usec = 0; > > + /* > > + * According to POSIX and Linux implementation > > + * the alarm() system call is always successfull. > > + * Ignore errors and return 0 as a Linux do. > > + */ > > Why does this need a comment referring to external sources? FreeBSD's > own man page also says that there is no error return for alarm(3). > However, the man page and the implementation are quite broken. The > implementation in libc does have an error return, but this is > undocumented. The documentation says that that the maximum number of > seconds is 100000000 (100 million), but doesn't say what happens when > this limit is exceeded. The implementation of this is broken too. > What actually happens for the libc version is: > - secs <= 100 million works in all kernel versions > - in old kernel versions, secs > 100 million fails to set the alarm; > it sets errno to EINVAL and returns (u_int)-1 to misindicate the error > - in FreeBSD-~[6-9], secs > 100 million works with 64-bit time_t. With > 32-bit time_t, secs > INT_MAX fails; secs between INT_MAX and about > 1000 million (= the time from now until overflow) causes undefined > behaviour due to overflow, but this might simulate working; secs between > about 1000 million and 100 million work. > - in FreeBSD-~[10-current], secs > INT32_MAX / 2 fail and other cases have > a chance of working. In the failing cases, the error is misindicated as > in old versions except for the different threshold. > > > kern_setitimer(td, ITIMER_REAL, &it, &old_it); > > Removing the error check broke this completely. > > > if (timevalisset(&old_it.it_value)) { > > if (old_it.it_value.tv_usec != 0) > > old_it is stack garbage when kern_setitimer() fails. The value in > this stack garbage is now returned and errno is not set. When the > error was checked, the consistent garbage value (u_int)-1 was returned, > and errno was not set. > > This function worked almost correctly in FreeBSD-5, by duplicating > most of the internals of setitimer() including its limit of 100 million > which was not broken then. This limit was to avoid overflow with 32-bit > time_t unless the current time is after year 2035. It was broken in > 2005. It remained just broken with 32-bit time_t until FreeBSD-9. > Starting in FreeBSD-10, sbintime_t is used. This reduces the brokenness > with 32-bit time_t but increases it with 64-bit time_t. sbintime_t has > the same signed 32-bit limit for seconds as 32-bit time_t. New ittimer > code using sbintime_t is more careful about overflow, but it cannot > support alarm() or large times in setitimer() even with 64-bit time_t. > It actually enforces a limit of INT32_MAX / 2 (~ 1000 million) and > doesn't documement this, where old code enforces a limit of 100 million > and does document this. Man pages still document the old limit, but > no implmentations of alarm() except the old one for linux are aware > of this. > > Complete description of bugs in this function: > > X int > X linux_alarm(struct thread *td, struct linux_alarm_args *args) > X { > X struct itimerval it, old_it; > X u_int secs; > X > X #ifdef DEBUG > X if (ldebug(alarm)) > X printf(ARGS(alarm, "%u"), args->secs); > X #endif > X > X secs = args->secs; > X > > Style bug: extra blank line to separate related code. Strict KNF doesn't > even allow blank lines to separate unrelated code. The one after the > DEBUG ifdef is an example. But bugs in indent(1) give extra blank lines > for ifdefs. > > X if (secs > INT_MAX) > X secs = INT_MAX; > > A bounds check is needed, but this one is very wrong. We are going to > assign secs to tv_sec, and need to ensure that this doesn't overflow. > tv_sec used to have type long, so the correct limit for this was LONG_MAX. > POSIX broke this type, and FreeBSD was broken to conform in 2005. Then > the correct limit became TIME_T_MAX, but this is unavailable under that > spelling. INT_MAX accidentally works as well as possible for its intended > purpose it time_t is 32 bits and int is also 32 bits, but if time_t is > 64-bits then it unnecessarily breaks alarm() in versions before sbintime_t. > > However, the limit of INT_MAX doesn't work for the purpose of breaking > alarm() as little as possible. It just ensured that kern_setitimer() > and thus this function always fails if kern_settimer() enforced its > documented limit of 100 million. I think the change to use this limit > was made after setitimer()'s limit was broken. Then this limit worked > for a while with 64-bit time_t, but with 32-bit time_t, using it always > gave overflow by adding INT_MAX to the current time. Now with > sbintime_t and its limit of INT32_MAX / 2, using INT_MAX here ensures > that kern_settimer() and thus this function always fails... > > The best limit to use here is 100 million, or perhaps INT32_MAX / 2 to > match kern_setitimer()s new limit, after checking that this works > (sbintime_t must be careful not to add INT32_MAX / 2 to either the > current time or more than 1 other value near INT_MAX32 / 2). > > X > > Style bug: extra blank line. > > X it.it_value.tv_sec = (long) secs; > > Style bugs: bogus cast, and space before cast. The cast was not incorrect > before POSIX broke the type of tv_sec, but it should never have been > necessary (for avoiding compiler warnings) since compilers should see > that the limited value fits in tv_sec. > > X it.it_value.tv_usec = 0; > X it.it_interval.tv_sec = 0; > X it.it_interval.tv_usec = 0; > > Style bug in previous 2 lines: the corresponding libc code uses > timevalclear(). (Normally I prefer explicit code, but this function uses > a macro later.) > > X /* > X * According to POSIX and Linux implementation > X * the alarm() system call is always successfull. > X * Ignore errors and return 0 as a Linux does. > X */ > > Style bugs: dubious commit, and formatting of this comment for ~60 column > terminals. There are many delicate points in the error (mis)handling, > but the comment only describes an uninteresting one. Comments should > probably be formatted narrow terminals, but that is an unusual style. > Other comment in this file use random right margins but many go out to > nearly column 89. > > X kern_setitimer(td, ITIMER_REAL, &it, &old_it); > > Bug: lost error handling. > > After fixing the above limit of INT_MAX, the error here should never > occur, and you could assert that, but the error always occurs now > if secs > INT32_MAX / 2. secs <= INT32_MAX / 2 is so sure to work with > the current sbintime_t code that this is not worth asserting. (Perhaps > it will fail due to overflow, but kern_setitimer() will succeed.) > secs <= 100000000 is even more sure to work (until 2035). > > X if (timevalisset(&old_it.it_value)) { > > Bug: beginning of accesses to the uninitialized variable old_it in the > error case. > > Style bugs: unnecessary test, and inconsistent use of macros. libc > doesn't do this test. All it does is extra work in the test to avoid > doing anything more in the usual case where the old timeout has expired. > > X if (old_it.it_value.tv_usec != 0) > X old_it.it_value.tv_sec++; > X td->td_retval[0] = old_it.it_value.tv_sec; > > Bug: return of garbage in the error case. > > X } > X return (0); > X } > > Bruce Thank you very match, Bruce for you pont! Should I correct setitimer/alarm man pages about maximum seconds? From owner-svn-src-head@freebsd.org Sun Mar 20 14:06:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6E7AD6976; Sun, 20 Mar 2016 14:06:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5475FDFB; Sun, 20 Mar 2016 14:06:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KE6RxU036827; Sun, 20 Mar 2016 14:06:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KE6RdN036826; Sun, 20 Mar 2016 14:06:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201406.u2KE6RdN036826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 14:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297063 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 14:06:28 -0000 Author: dchagin Date: Sun Mar 20 14:06:27 2016 New Revision: 297063 URL: https://svnweb.freebsd.org/changeset/base/297063 Log: Whitespaces, style(9) fixes. No functional changes. MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 13:23:01 2016 (r297062) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 14:06:27 2016 (r297063) @@ -257,7 +257,7 @@ static int stat_copyout(struct stat *buf, void *ubuf) { struct l_stat lbuf; - + bzero(&lbuf, sizeof(lbuf)); lbuf.st_dev = buf->st_dev; lbuf.st_ino = buf->st_ino; @@ -303,7 +303,7 @@ linux_stat(struct thread *td, struct lin return (error); } LFREEPATH(path); - return(stat_copyout(&buf, args->up)); + return (stat_copyout(&buf, args->up)); } int @@ -325,7 +325,7 @@ linux_lstat(struct thread *td, struct li return (error); } LFREEPATH(path); - return(stat_copyout(&buf, args->up)); + return (stat_copyout(&buf, args->up)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -416,7 +416,7 @@ linux_statfs(struct thread *td, struct l if (error) return (error); bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -458,7 +458,7 @@ linux_statfs64(struct thread *td, struct if (error) return (error); bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } int @@ -498,7 +498,7 @@ linux_fstatfs(struct thread *td, struct if (error) return error; bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } struct l_ustat From owner-svn-src-head@freebsd.org Sun Mar 20 14:21:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88F6AD6D1C; Sun, 20 Mar 2016 14:21:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87EDE7BF; Sun, 20 Mar 2016 14:21:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KEL7cE040824; Sun, 20 Mar 2016 14:21:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KEL7uX040823; Sun, 20 Mar 2016 14:21:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603201421.u2KEL7uX040823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Mar 2016 14:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297065 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 14:21:08 -0000 Author: jhibbits Date: Sun Mar 20 14:21:07 2016 New Revision: 297065 URL: https://svnweb.freebsd.org/changeset/base/297065 Log: Convert a long to rman_res_t, fixing a sign extension bug. ahci.c had one signed long, which was passed into rman, rather than u_long. After the switch of rman_res_t from size u_long to size uintmax_t, the sign extension caused ranges to get messed up, and ahcich* to not attach. There may be more signed longs used in this way, which will be fixed as they're reported. Reported by: pho Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Mar 20 14:11:37 2016 (r297064) +++ head/sys/dev/ahci/ahci.c Sun Mar 20 14:21:07 2016 (r297065) @@ -527,7 +527,7 @@ ahci_alloc_resource(device_t dev, device { struct ahci_controller *ctlr = device_get_softc(dev); struct resource *res; - long st; + rman_res_t st; int offset, size, unit; unit = (intptr_t)device_get_ivars(child); From owner-svn-src-head@freebsd.org Sun Mar 20 16:48:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8B0AD6CBD; Sun, 20 Mar 2016 16:48:31 +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 D0AE9DE8; Sun, 20 Mar 2016 16:48:30 +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 u2KGmU1b089008; Sun, 20 Mar 2016 16:48:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KGmUcM089007; Sun, 20 Mar 2016 16:48:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603201648.u2KGmUcM089007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Mar 2016 16:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297068 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 16:48:31 -0000 Author: ian Date: Sun Mar 20 16:48:29 2016 New Revision: 297068 URL: https://svnweb.freebsd.org/changeset/base/297068 Log: Remove FREEBSD_BOOT_LOADER that already exists in std.armv6 config file. PR: 207728 Submitted by: Jia-Shiun Li Modified: head/sys/arm/broadcom/bcm2835/std.rpi Modified: head/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.rpi Sun Mar 20 16:00:05 2016 (r297067) +++ head/sys/arm/broadcom/bcm2835/std.rpi Sun Mar 20 16:48:29 2016 (r297068) @@ -2,5 +2,4 @@ options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 -options FREEBSD_BOOT_LOADER options LINUX_BOOT_ABI From owner-svn-src-head@freebsd.org Sun Mar 20 17:50:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9768AD7A2E; Sun, 20 Mar 2016 17:50:30 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A41E81A34; Sun, 20 Mar 2016 17:50:28 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KHoNjG018354 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 20 Mar 2016 17:50:25 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KHoFd0093760 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 20 Mar 2016 20:50:15 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u2KHoFxM093737; Sun, 20 Mar 2016 20:50:15 +0300 (MSK) (envelope-from dchagin) Date: Sun, 20 Mar 2016 20:50:15 +0300 From: Chagin Dmitry To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297058 - in head/sys: dev/urtwn dev/usb/wlan modules modules/urtwn modules/urtwnfw modules/usb modules/usb/urtwn modules/usb/urtwnfw Message-ID: <20160320175015.GA80201@chd.heemeyer.club> References: <201603200354.u2K3swvK049827@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603200354.u2K3swvK049827@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 17:50:31 -0000 On Sun, Mar 20, 2016 at 03:54:58AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 20 03:54:57 2016 > New Revision: 297058 > URL: https://svnweb.freebsd.org/changeset/base/297058 > > Log: > [urtwn] migrate urtwn out into sys/dev/urtwn/ . > > There's some upcoming work to add new chipset support here and I'd > like to only add 802.11n support to one driver, instead of both > urtwn and rtwn. > > There's also missing support for things like 802.11n, some powersave > work, bluetooth integration/coexistence, etc, and also newer parts > (like 8192EU, maybe some 11ac parts, not sure yet.) > > So, this is hopefully the first step in a longer set of steps to unify > rtwn/urtwn and extend it with more interesting chipset and functionality > support. > > Reviewed by: kevlo > > Added: > head/sys/dev/urtwn/ > head/sys/dev/urtwn/if_urtwn.c > - copied, changed from r297057, head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/urtwn/if_urtwnreg.h > - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h > head/sys/dev/urtwn/if_urtwnvar.h > - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnvar.h > head/sys/modules/urtwn/ > - copied from r297057, head/sys/modules/usb/urtwn/ > head/sys/modules/urtwnfw/ > - copied from r297057, head/sys/modules/usb/urtwnfw/ > Deleted: > head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/usb/wlan/if_urtwnreg.h > head/sys/dev/usb/wlan/if_urtwnvar.h > head/sys/modules/usb/urtwn/ > head/sys/modules/usb/urtwnfw/ > Modified: > head/sys/modules/Makefile > head/sys/modules/urtwn/Makefile > head/sys/modules/urtwnfw/Makefile.inc > head/sys/modules/usb/Makefile > this commit broke the LINT build, fix sys/conf/files please. From owner-svn-src-head@freebsd.org Sun Mar 20 17:52:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3BCAD7B41; Sun, 20 Mar 2016 17:52:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 580091D86; Sun, 20 Mar 2016 17:52:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1B90842404F; Mon, 21 Mar 2016 04:52:04 +1100 (AEDT) Date: Mon, 21 Mar 2016 04:52:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chagin Dmitry cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296543 - head/sys/compat/linux In-Reply-To: <20160320132637.GA88466@chd.heemeyer.club> Message-ID: <20160321003223.T2314@besplex.bde.org> References: <201603081920.u28JKvbM088851@repo.freebsd.org> <20160309160342.P1249@besplex.bde.org> <20160320132637.GA88466@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=0A-rwh1xptyzP0wGFi4A:9 a=QvDe-Mn7VEfrFuiQ:21 a=Gvi1W6LLpHJzkWJ-:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 17:52:12 -0000 On Sun, 20 Mar 2016, Chagin Dmitry wrote: > On Wed, Mar 09, 2016 at 07:16:27PM +1100, Bruce Evans wrote: >> On Tue, 8 Mar 2016, Dmitry Chagin wrote: >> >>> Log: >>> Put a commit message from r296502 about Linux alarm() system call >>> behaviour to the source. >>> ... >>> Modified: head/sys/compat/linux/linux_misc.c >>> ============================================================================== >>> --- head/sys/compat/linux/linux_misc.c Tue Mar 8 19:08:55 2016 (r296542) >>> +++ head/sys/compat/linux/linux_misc.c Tue Mar 8 19:20:57 2016 (r296543) >>> @@ -206,6 +206,11 @@ linux_alarm(struct thread *td, struct li >>> it.it_value.tv_usec = 0; >>> it.it_interval.tv_sec = 0; >>> it.it_interval.tv_usec = 0; >>> + /* >>> + * According to POSIX and Linux implementation >>> + * the alarm() system call is always successfull. >>> + * Ignore errors and return 0 as a Linux do. >>> + */ >> >> Why does this need a comment referring to external sources? FreeBSD's >> own man page also says that there is no error return for alarm(3). >> However, the man page and the implementation are quite broken. The >> implementation in libc does have an error return, but this is >> undocumented. The documentation says that that the maximum number of >> seconds is 100000000 (100 million), but doesn't say what happens when >> this limit is exceeded. The implementation of this is broken too. >> ... > Thank you very match, Bruce for you pont! Should I correct setitimer/alarm man pages > about maximum seconds? Yes, the current limit seems to work well enough, since it adds at most 1 copy of INT32_MAX / 2 to the current uptime, and the current uptime is limited to well below INT32_MAX / 2 in practice. This is related to the brokenness of timeouts across suspend/resume. alarm(86400) doesn't work to get an alarm every day, because timeouts are relative to the uptime, and the uptime doesn't count time across suspend/resume. Most FreeBSD time functions are broken by this. I noticed some neary bugs while checking this: - realitexpire() has a rotted comment about its previous use of tvtohz() - the loop to add it_interval in realitexpire() has some denial of service potential. In FreeBSD-9, the overflow bug exists and can be used to create a negative expiry time, but in my tests the loop was not reached in that case. If it were reached, then it would iterate about 2**22 times with 64-bit time_t. - itimerfix() has a rotted comment about its minimal value. (I think POSIX doesn't allow rewriting the timeouts like that. The timeouts should be const. If rewriting them is permitted, then we could "fix" large times in the same way.) - POSIX realtimers still use code similar to the old itimer code. It has no bounds checks but needs them more since it supports absolute times and all clock ids. Bruce From owner-svn-src-head@freebsd.org Sun Mar 20 17:53:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B548AD7B98; Sun, 20 Mar 2016 17:53:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD7271F39; Sun, 20 Mar 2016 17:53:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KHrVi0010331; Sun, 20 Mar 2016 17:53:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KHrV4t010330; Sun, 20 Mar 2016 17:53:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603201753.u2KHrV4t010330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 20 Mar 2016 17:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297069 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 17:53:32 -0000 Author: adrian Date: Sun Mar 20 17:53:30 2016 New Revision: 297069 URL: https://svnweb.freebsd.org/changeset/base/297069 Log: Now that urtwn is its own device, and it'll get hotplug loaded by devd/ifconfig/etc, don't build it in the kernel. This should fix the build as well! Notice by: dchagin Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 20 16:48:29 2016 (r297068) +++ head/sys/conf/files Sun Mar 20 17:53:30 2016 (r297069) @@ -2678,50 +2678,6 @@ dev/usb/wlan/if_uath.c optional uath dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural dev/usb/wlan/if_urtw.c optional urtw -dev/usb/wlan/if_urtwn.c optional urtwn -urtwn-rtl8188eufw.c optional urtwn-rtl8188eufw | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8188eufw.fw:urtwn-rtl8188eufw:111 -murtwn-rtl8188eufw -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8188eufw.c" -urtwn-rtl8188eufw.fwo optional urtwn-rtl8188eufw | urtwnfw \ - dependency "urtwn-rtl8188eufw.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8188eufw.fwo" -urtwn-rtl8188eufw.fw optional urtwn-rtl8188eufw | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8188eufw.fw" -urtwn-rtl8192cfwT.c optional urtwn-rtl8192cfwT | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8192cfwT.c" -urtwn-rtl8192cfwT.fwo optional urtwn-rtl8192cfwT | urtwnfw \ - dependency "urtwn-rtl8192cfwT.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8192cfwT.fwo" -urtwn-rtl8192cfwT.fw optional urtwn-rtl8192cfwT | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8192cfwT.fw" -urtwn-rtl8192cfwU.c optional urtwn-rtl8192cfwU | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwU.fw:urtwn-rtl8192cfwU:111 -murtwn-rtl8192cfwU -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8192cfwU.c" -urtwn-rtl8192cfwU.fwo optional urtwn-rtl8192cfwU | urtwnfw \ - dependency "urtwn-rtl8192cfwU.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8192cfwU.fwo" -urtwn-rtl8192cfwU.fw optional urtwn-rtl8192cfwU | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8192cfwU.fw" - dev/usb/wlan/if_zyd.c optional zyd # # USB serial and parallel port drivers From owner-svn-src-head@freebsd.org Sun Mar 20 18:31:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09CD4AD68F8; Sun, 20 Mar 2016 18:31:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04FB881; Sun, 20 Mar 2016 18:31:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KIVVQr020710; Sun, 20 Mar 2016 18:31:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KIVVlB020709; Sun, 20 Mar 2016 18:31:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201831.u2KIVVlB020709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 18:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297070 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 18:31:32 -0000 Author: dchagin Date: Sun Mar 20 18:31:30 2016 New Revision: 297070 URL: https://svnweb.freebsd.org/changeset/base/297070 Log: Return EOVERFLOW in case when actual statfs values are large enough and not fit into 32 bit fileds of a Linux struct statfs. PR: 181012 MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 17:53:30 2016 (r297069) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 18:31:30 2016 (r297070) @@ -381,10 +381,22 @@ bsd_to_linux_ftype(const char *fstypenam return (0L); } -static void +static int bsd_to_linux_statfs(struct statfs *bsd_statfs, struct l_statfs *linux_statfs) { +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + uint64_t tmp; +#define LINUX_HIBITS 0xffffffff00000000ULL + + tmp = bsd_statfs->f_blocks | bsd_statfs->f_bfree | bsd_statfs->f_files | + bsd_statfs->f_bsize; + if ((bsd_statfs->f_bavail != -1 && (bsd_statfs->f_bavail & LINUX_HIBITS)) || + (bsd_statfs->f_ffree != -1 && (bsd_statfs->f_ffree & LINUX_HIBITS)) || + (tmp & LINUX_HIBITS)) + return (EOVERFLOW); +#undef LINUX_HIBITS +#endif linux_statfs->f_type = bsd_to_linux_ftype(bsd_statfs->f_fstypename); linux_statfs->f_bsize = bsd_statfs->f_bsize; linux_statfs->f_blocks = bsd_statfs->f_blocks; @@ -395,6 +407,8 @@ bsd_to_linux_statfs(struct statfs *bsd_s linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; + + return (0); } int From owner-svn-src-head@freebsd.org Sun Mar 20 19:06:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E16CBAD79D5; Sun, 20 Mar 2016 19:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B396BA74; Sun, 20 Mar 2016 19:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KJ6LEx036636; Sun, 20 Mar 2016 19:06:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJ6LbO036635; Sun, 20 Mar 2016 19:06:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201906.u2KJ6LbO036635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 19:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297072 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 19:06:23 -0000 Author: dchagin Date: Sun Mar 20 19:06:21 2016 New Revision: 297072 URL: https://svnweb.freebsd.org/changeset/base/297072 Log: Check bsd_to_linux_statfs() return value. Forgotten in r297070. MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 18:56:03 2016 (r297071) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 19:06:21 2016 (r297072) @@ -429,7 +429,9 @@ linux_statfs(struct thread *td, struct l LFREEPATH(path); if (error) return (error); - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } @@ -510,8 +512,10 @@ linux_fstatfs(struct thread *td, struct #endif error = kern_fstatfs(td, args->fd, &bsd_statfs); if (error) - return error; - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + return (error); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } From owner-svn-src-head@freebsd.org Sun Mar 20 21:48:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFADEACE1DD; Sun, 20 Mar 2016 21:48:27 +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 9136E691; Sun, 20 Mar 2016 21:48:27 +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 u2KLmQlC088237; Sun, 20 Mar 2016 21:48:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KLmQ4p088236; Sun, 20 Mar 2016 21:48:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603202148.u2KLmQ4p088236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Mar 2016 21:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297086 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 21:48:27 -0000 Author: ian Date: Sun Mar 20 21:48:26 2016 New Revision: 297086 URL: https://svnweb.freebsd.org/changeset/base/297086 Log: It appears nfs_mountroot() will use the env var "boot.netif.mtu" if it exists, so mention that along with all the other boot.netif vars. Modified: head/sys/nfs/nfs_diskless.c Modified: head/sys/nfs/nfs_diskless.c ============================================================================== --- head/sys/nfs/nfs_diskless.c Sun Mar 20 20:37:26 2016 (r297085) +++ head/sys/nfs/nfs_diskless.c Sun Mar 20 21:48:26 2016 (r297086) @@ -154,6 +154,7 @@ nfs_parse_options(const char *envopts, s * boot.netif.netmask netmask on boot interface * boot.netif.gateway default gateway (optional) * boot.netif.hwaddr hardware address of boot interface + * boot.netif.mtu interface mtu from bootp/dhcp (optional) * boot.nfsroot.server IP address of root filesystem server * boot.nfsroot.path path of the root filesystem on server * boot.nfsroot.nfshandle NFS handle for root filesystem on server From owner-svn-src-head@freebsd.org Mon Mar 21 00:29:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26597AD6842; Mon, 21 Mar 2016 00:29:47 +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 E578F1944; Mon, 21 Mar 2016 00:29:46 +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 u2L0Tk4g039155; Mon, 21 Mar 2016 00:29:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0TjOI039144; Mon, 21 Mar 2016 00:29:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603210029.u2L0TjOI039144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Mar 2016 00:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297124 - in head: contrib/ofed/libcxgb4/src sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 00:29:47 -0000 Author: np Date: Mon Mar 21 00:29:45 2016 New Revision: 297124 URL: https://svnweb.freebsd.org/changeset/base/297124 Log: iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4. This commit includes internal changesets 6785 8111 8149 8478 8617 8648 8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730 11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/contrib/ofed/libcxgb4/src/cq.c head/contrib/ofed/libcxgb4/src/dev.c head/contrib/ofed/libcxgb4/src/libcxgb4.h head/contrib/ofed/libcxgb4/src/qp.c head/contrib/ofed/libcxgb4/src/t4.h head/contrib/ofed/libcxgb4/src/verbs.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h head/sys/dev/cxgbe/iw_cxgbe/user.h Modified: head/contrib/ofed/libcxgb4/src/cq.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/cq.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/cq.c Mon Mar 21 00:29:45 2016 (r297124) @@ -697,7 +697,7 @@ static int c4iw_poll_cq_one(struct c4iw_ default: PDBG("Unexpected cqe_status 0x%x for QPID=0x%0x\n", CQE_STATUS(&cqe), CQE_QPID(&cqe)); - ret = -EINVAL; + wc->status = IBV_WC_FATAL_ERR; } } if (wc->status && wc->status != IBV_WC_WR_FLUSH_ERR) Modified: head/contrib/ofed/libcxgb4/src/dev.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/dev.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/dev.c Mon Mar 21 00:29:45 2016 (r297124) @@ -54,7 +54,6 @@ struct { \ unsigned vendor; \ unsigned device; \ - unsigned chip_version; \ } hca_table[] = { #define CH_PCI_DEVICE_ID_FUNCTION \ @@ -64,7 +63,6 @@ { \ .vendor = PCI_VENDOR_ID_CHELSIO, \ .device = (__DeviceID), \ - .chip_version = CHELSIO_PCI_ID_CHIP_VERSION(__DeviceID), \ } #define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \ @@ -493,7 +491,8 @@ found: } PDBG("%s found vendor %d device %d type %d\n", - __FUNCTION__, vendor, device, hca_table[i].chip_version); + __FUNCTION__, vendor, device, + CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device)); dev = calloc(1, sizeof *dev); if (!dev) { @@ -502,7 +501,7 @@ found: pthread_spin_init(&dev->lock, PTHREAD_PROCESS_PRIVATE); dev->ibv_dev.ops = c4iw_dev_ops; - dev->chip_version = hca_table[i].chip_version; + dev->chip_version = CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device); dev->abi_version = abi_version; PDBG("%s device claimed\n", __FUNCTION__); Modified: head/contrib/ofed/libcxgb4/src/libcxgb4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/libcxgb4.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/libcxgb4.h Mon Mar 21 00:29:45 2016 (r297124) @@ -69,6 +69,11 @@ static inline int dev_is_t5(struct c4iw_ return dev->chip_version == CHELSIO_T5; } +static inline int dev_is_t4(struct c4iw_dev *dev) +{ + return dev->chip_version == CHELSIO_T4; +} + struct c4iw_context { struct ibv_context ibv_ctx; struct t4_dev_status_page *status_page; Modified: head/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/qp.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/qp.c Mon Mar 21 00:29:45 2016 (r297124) @@ -362,7 +362,7 @@ int c4iw_post_send(struct ibv_qp *ibqp, err = build_rdma_read(wqe, wr, &len16); if (err) break; - swsqe->read_len = wr->sg_list[0].length; + swsqe->read_len = wr->sg_list ? wr->sg_list[0].length : 0; if (!qhp->wq.sq.oldest_read) qhp->wq.sq.oldest_read = swsqe; break; Modified: head/contrib/ofed/libcxgb4/src/t4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/t4.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/t4.h Mon Mar 21 00:29:45 2016 (r297124) @@ -328,6 +328,7 @@ struct t4_sq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; void *ma_sync; u16 in_use; u16 size; @@ -336,6 +337,7 @@ struct t4_sq { u16 wq_pidx; u16 flags; short flush_cidx; + int wc_reg_available; }; struct t4_swrqe { @@ -348,6 +350,7 @@ struct t4_rq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; u32 msn; u32 rqt_hwaddr; u16 rqt_size; @@ -356,6 +359,7 @@ struct t4_rq { u16 cidx; u16 pidx; u16 wq_pidx; + int wc_reg_available; }; struct t4_wq { @@ -485,14 +489,14 @@ static inline void t4_ring_sq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); copy_wqe_to_udb(wq->sq.udb + 14, wqe); } else { PDBG("%s: DB wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); - writel(V_PIDX_T5(inc), wq->sq.udb); + writel(V_QID(wq->sq.bar2_qid) | V_PIDX_T5(inc), wq->sq.udb); } wc_wmb(); return; @@ -518,14 +522,14 @@ static inline void t4_ring_rq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); copy_wqe_to_udb(wq->rq.udb + 14, wqe); } else { PDBG("%s: DB wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); - writel(V_PIDX_T5(inc), wq->rq.udb); + writel(V_QID(wq->rq.bar2_qid) | V_PIDX_T5(inc), wq->rq.udb); } wc_wmb(); return; Modified: head/contrib/ofed/libcxgb4/src/verbs.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/verbs.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/verbs.c Mon Mar 21 00:29:45 2016 (r297124) @@ -213,7 +213,7 @@ struct ibv_cq *c4iw_create_cq(struct ibv goto err3; if (dev_is_t5(chp->rhp)) - chp->cq.ugts += 3; + chp->cq.ugts += 5; else chp->cq.ugts += 1; chp->cq.sw_queue = calloc(chp->cq.size, sizeof *chp->cq.queue); @@ -460,8 +460,14 @@ static struct ibv_qp *create_qp(struct i goto err3; } qhp->wq.sq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.sq.udb += (128*(qhp->wq.sq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.sq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.sq.udb += segment_offset / 4; + qhp->wq.sq.wc_reg_available = 1; + } else + qhp->wq.sq.bar2_qid = qhp->wq.sq.qid & qhp->wq.qid_mask; qhp->wq.sq.udb += 2; } @@ -479,8 +485,14 @@ static struct ibv_qp *create_qp(struct i if (dbva == MAP_FAILED) goto err5; qhp->wq.rq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.rq.udb += (128*(qhp->wq.rq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.rq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.rq.udb += segment_offset / 4; + qhp->wq.rq.wc_reg_available = 1; + } else + qhp->wq.rq.bar2_qid = qhp->wq.rq.qid & qhp->wq.qid_mask; qhp->wq.rq.udb += 2; } qhp->wq.rq.queue = mmap(NULL, qhp->wq.rq.memsize, Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 21 00:29:45 2016 (r297124) @@ -80,7 +80,7 @@ static spinlock_t timeout_lock; static void process_req(struct work_struct *ctx); static void start_ep_timer(struct c4iw_ep *ep); -static void stop_ep_timer(struct c4iw_ep *ep); +static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -96,14 +96,14 @@ static void send_mpa_req(struct c4iw_ep static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); -static int abort_connection(struct c4iw_ep *ep); +static int send_abort(struct c4iw_ep *ep); static void peer_close_upcall(struct c4iw_ep *ep); static void peer_abort_upcall(struct c4iw_ep *ep); static void connect_reply_upcall(struct c4iw_ep *ep, int status); static int connect_request_upcall(struct c4iw_ep *ep); static void established_upcall(struct c4iw_ep *ep); -static void process_mpa_reply(struct c4iw_ep *ep); -static void process_mpa_request(struct c4iw_ep *ep); +static int process_mpa_reply(struct c4iw_ep *ep); +static int process_mpa_request(struct c4iw_ep *ep); static void process_peer_close(struct c4iw_ep *ep); static void process_conn_error(struct c4iw_ep *ep); static void process_close_complete(struct c4iw_ep *ep); @@ -123,11 +123,11 @@ static void release_ep_resources(struct } while (0) #define STOP_EP_TIMER(ep) \ - do { \ + ({ \ CTR3(KTR_IW_CXGBE, "stop_ep_timer (%s:%d) ep %p", \ __func__, __LINE__, (ep)); \ stop_ep_timer(ep); \ - } while (0) + }) #ifdef KTR static char *states[] = { @@ -147,6 +147,34 @@ static char *states[] = { }; #endif + +static void deref_cm_id(struct c4iw_ep_common *epc) +{ + epc->cm_id->rem_ref(epc->cm_id); + epc->cm_id = NULL; + set_bit(CM_ID_DEREFED, &epc->history); +} + +static void ref_cm_id(struct c4iw_ep_common *epc) +{ + set_bit(CM_ID_REFED, &epc->history); + epc->cm_id->add_ref(epc->cm_id); +} + +static void deref_qp(struct c4iw_ep *ep) +{ + c4iw_qp_rem_ref(&ep->com.qp->ibqp); + clear_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_DEREFED, &ep->com.history); +} + +static void ref_qp(struct c4iw_ep *ep) +{ + set_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_REFED, &ep->com.history); + c4iw_qp_add_ref(&ep->com.qp->ibqp); +} + static void process_req(struct work_struct *ctx) { @@ -304,9 +332,7 @@ process_peer_close(struct c4iw_ep *ep) disconnect = 0; STOP_EP_TIMER(ep); close_socket(&ep->com, 0); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); release = 1; break; @@ -490,6 +516,7 @@ process_close_complete(struct c4iw_ep *e /* The cm_id may be null if we failed to connect */ mutex_lock(&ep->com.mutex); + set_bit(CLOSE_CON_RPL, &ep->com.history); switch (ep->com.state) { @@ -580,13 +607,14 @@ static void process_data(struct c4iw_ep *ep) { struct sockaddr_in *local, *remote; + int disconnect = 0; CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sbused %d", __func__, ep->com.so, ep, states[ep->com.state], sbused(&ep->com.so->so_rcv)); switch (state_read(&ep->com)) { case MPA_REQ_SENT: - process_mpa_reply(ep); + disconnect = process_mpa_reply(ep); break; case MPA_REQ_WAIT: in_getsockaddr(ep->com.so, (struct sockaddr **)&local); @@ -595,7 +623,7 @@ process_data(struct c4iw_ep *ep) ep->com.remote_addr = *remote; free(local, M_SONAME); free(remote, M_SONAME); - process_mpa_request(ep); + disconnect = process_mpa_request(ep); break; default: if (sbused(&ep->com.so->so_rcv)) @@ -605,6 +633,9 @@ process_data(struct c4iw_ep *ep) ep->com.so->so_state, sbused(&ep->com.so->so_rcv)); break; } + if (disconnect) + c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); + } static void @@ -749,9 +780,9 @@ int db_delay_usecs = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RWTUN, &db_delay_usecs, 0, "Usecs to delay awaiting db fifo to drain"); -static int dack_mode = 1; +static int dack_mode = 0; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, - "Delayed ack mode (default = 1)"); + "Delayed ack mode (default = 0)"); int c4iw_max_read_depth = 8; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_max_read_depth, CTLFLAG_RWTUN, &c4iw_max_read_depth, 0, @@ -773,9 +804,9 @@ int c4iw_debug = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_debug, CTLFLAG_RWTUN, &c4iw_debug, 0, "Enable debug logging (default = 0)"); -static int peer2peer; +static int peer2peer = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, peer2peer, CTLFLAG_RWTUN, &peer2peer, 0, - "Support peer2peer ULPs (default = 0)"); + "Support peer2peer ULPs (default = 1)"); static int p2p_type = FW_RI_INIT_P2PTYPE_READ_REQ; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, p2p_type, CTLFLAG_RWTUN, &p2p_type, 0, @@ -827,14 +858,16 @@ start_ep_timer(struct c4iw_ep *ep) add_timer(&ep->timer); } -static void +static int stop_ep_timer(struct c4iw_ep *ep) { del_timer_sync(&ep->timer); if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { c4iw_put_ep(&ep->com); + return 0; } + return 1; } static enum @@ -900,6 +933,8 @@ void _c4iw_free_ep(struct kref *kref) epc = &ep->com; KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list", __func__, epc)); + if (test_bit(QP_REFERENCED, &ep->com.flags)) + deref_qp(ep); kfree(ep); } @@ -1175,20 +1210,17 @@ static void close_complete_upcall(struct CTR2(KTR_IW_CXGBE, "%s:ccu1 %1", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(CLOSE_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:ccuE %p", __func__, ep); } -static int abort_connection(struct c4iw_ep *ep) +static int send_abort(struct c4iw_ep *ep) { int err; CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - state_set(&ep->com, ABORTING); abort_socket(ep); err = close_socket(&ep->com, 0); set_bit(ABORT_CONN, &ep->com.history); @@ -1226,9 +1258,7 @@ static void peer_abort_upcall(struct c4i CTR2(KTR_IW_CXGBE, "%s:pau1 %p", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(ABORT_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:pauE %p", __func__, ep); @@ -1282,9 +1312,7 @@ static void connect_reply_upcall(struct if (status < 0) { CTR3(KTR_IW_CXGBE, "%s:cru4 %p %d", __func__, ep, status); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:cruE %p", __func__, ep); @@ -1353,8 +1381,19 @@ static void established_upcall(struct c4 } - -static void process_mpa_reply(struct c4iw_ep *ep) +/* + * process_mpa_reply - process streaming mode MPA reply + * + * Returns: + * + * 0 upon success indicating a connect request was delivered to the ULP + * or the mpa request is incomplete but valid so far. + * + * 1 if a failure requires the caller to close the connection. + * + * 2 if a failure requires the caller to abort the connection. + */ +static int process_mpa_reply(struct c4iw_ep *ep) { struct mpa_message *mpa; struct mpa_v2_conn_params *mpa_v2_params; @@ -1367,17 +1406,17 @@ static void process_mpa_reply(struct c4i struct mbuf *top, *m; int flags = MSG_DONTWAIT; struct uio uio; + int disconnect = 0; CTR2(KTR_IW_CXGBE, "%s:pmrB %p", __func__, ep); /* - * Stop mpa timer. If it expired, then the state has - * changed and we bail since ep_timeout already aborted - * the connection. + * Stop mpa timer. If it expired, then + * we ignore the MPA reply. process_timeout() + * will abort the connection. */ - STOP_EP_TIMER(ep); - if (state_read(&ep->com) != MPA_REQ_SENT) - return; + if (STOP_EP_TIMER(ep)) + return 0; uio.uio_resid = 1000000; uio.uio_td = ep->com.thread; @@ -1389,7 +1428,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr1 %p", __func__, ep); START_EP_TIMER(ep); - return; + return 0; } err = -err; CTR2(KTR_IW_CXGBE, "%s:pmr2 %p", __func__, ep); @@ -1417,7 +1456,7 @@ static void process_mpa_reply(struct c4i CTR3(KTR_IW_CXGBE, "%s:pmr5 %p %d", __func__, ep, ep->mpa_pkt_len + m->m_len); err = (-EINVAL); - goto err; + goto err_stop_timer; } /* @@ -1435,8 +1474,9 @@ static void process_mpa_reply(struct c4i /* * if we don't even have the mpa message, then bail. */ - if (ep->mpa_pkt_len < sizeof(*mpa)) - return; + if (ep->mpa_pkt_len < sizeof(*mpa)) { + return 0; + } mpa = (struct mpa_message *) ep->mpa_pkt; /* Validate MPA header. */ @@ -1447,14 +1487,14 @@ static void process_mpa_reply(struct c4i printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d, " " Received = %d\n", __func__, mpa_rev, mpa->revision); err = -EPROTO; - goto err; + goto err_stop_timer; } if (memcmp(mpa->key, MPA_KEY_REP, sizeof(mpa->key))) { CTR2(KTR_IW_CXGBE, "%s:pmr7 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } plen = ntohs(mpa->private_data_size); @@ -1466,7 +1506,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr8 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } /* @@ -1475,8 +1515,9 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmr9 %p", __func__, ep); + STOP_EP_TIMER(ep); err = -EPROTO; - goto err; + goto err_stop_timer; } ep->plen = (u8) plen; @@ -1488,14 +1529,14 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmra %p", __func__, ep); - return; + return 0; } if (mpa->flags & MPA_REJECT) { CTR2(KTR_IW_CXGBE, "%s:pmrb %p", __func__, ep); err = -ECONNREFUSED; - goto err; + goto err_stop_timer; } /* @@ -1638,6 +1679,7 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; + disconnect = 1; goto out; } @@ -1658,19 +1700,33 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; + disconnect = 1; goto out; } goto out; +err_stop_timer: + STOP_EP_TIMER(ep); err: - state_set(&ep->com, ABORTING); - abort_connection(ep); + disconnect = 2; out: connect_reply_upcall(ep, err); CTR2(KTR_IW_CXGBE, "%s:pmrE %p", __func__, ep); - return; + return disconnect; } -static void +/* + * process_mpa_request - process streaming mode MPA request + * + * Returns: + * + * 0 upon success indicating a connect request was delivered to the ULP + * or the mpa request is incomplete but valid so far. + * + * 1 if a failure requires the caller to close the connection. + * + * 2 if a failure requires the caller to abort the connection. + */ +static int process_mpa_request(struct c4iw_ep *ep) { struct mpa_message *mpa; @@ -1684,7 +1740,7 @@ process_mpa_request(struct c4iw_ep *ep) CTR3(KTR_IW_CXGBE, "%s: ep %p, state %s", __func__, ep, states[state]); if (state != MPA_REQ_WAIT) - return; + return 0; iov.iov_base = &ep->mpa_pkt[ep->mpa_pkt_len]; iov.iov_len = sizeof(ep->mpa_pkt) - ep->mpa_pkt_len; @@ -1698,13 +1754,10 @@ process_mpa_request(struct c4iw_ep *ep) rc = soreceive(ep->com.so, NULL, &uio, NULL, NULL, &flags); if (rc == EAGAIN) - return; - else if (rc) { -abort: - STOP_EP_TIMER(ep); - abort_connection(ep); - return; - } + return 0; + else if (rc) + goto err_stop_timer; + KASSERT(uio.uio_offset > 0, ("%s: sorecieve on so %p read no data", __func__, ep->com.so)); ep->mpa_pkt_len += uio.uio_offset; @@ -1718,7 +1771,7 @@ abort: /* Don't even have the MPA message. Wait for more data to arrive. */ if (ep->mpa_pkt_len < sizeof(*mpa)) - return; + return 0; mpa = (struct mpa_message *) ep->mpa_pkt; /* @@ -1727,24 +1780,24 @@ abort: if (mpa->revision > mpa_rev) { log(LOG_ERR, "%s: MPA version mismatch. Local = %d," " Received = %d\n", __func__, mpa_rev, mpa->revision); - goto abort; + goto err_stop_timer; } if (memcmp(mpa->key, MPA_KEY_REQ, sizeof(mpa->key))) - goto abort; + goto err_stop_timer; /* * Fail if there's too much private data. */ plen = ntohs(mpa->private_data_size); if (plen > MPA_MAX_PRIVATE_DATA) - goto abort; + goto err_stop_timer; /* * If plen does not account for pkt size */ if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) - goto abort; + goto err_stop_timer; ep->plen = (u8) plen; @@ -1752,7 +1805,7 @@ abort: * If we don't have all the pdata yet, then bail. */ if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) - return; + return 0; /* * If we get here we have accumulated the entire mpa @@ -1794,7 +1847,7 @@ abort: ep->mpa_attr.p2p_type = p2p_type; if (set_tcpinfo(ep)) - goto abort; + goto err_stop_timer; CTR5(KTR_IW_CXGBE, "%s: crc_enabled = %d, recv_marker_enabled = %d, " "xmit_marker_enabled = %d, version = %d", __func__, @@ -1802,17 +1855,22 @@ abort: ep->mpa_attr.xmit_marker_enabled, ep->mpa_attr.version); state_set(&ep->com, MPA_REQ_RCVD); - STOP_EP_TIMER(ep); /* drive upcall */ mutex_lock(&ep->parent_ep->com.mutex); if (ep->parent_ep->com.state != DEAD) { - if(connect_request_upcall(ep)) { - abort_connection(ep); - } - }else - abort_connection(ep); + if(connect_request_upcall(ep)) + goto err_out; + }else { + goto err_out; + } mutex_unlock(&ep->parent_ep->com.mutex); + return 0; + +err_stop_timer: + STOP_EP_TIMER(ep); +err_out: + return 2; } /* @@ -1825,6 +1883,7 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i int err; struct c4iw_ep *ep = to_ep(cm_id); CTR2(KTR_IW_CXGBE, "%s:crcB %p", __func__, ep); + int disconnect = 0; if (state_read(&ep->com) == DEAD) { @@ -1838,7 +1897,7 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i if (mpa_rev == 0) { CTR2(KTR_IW_CXGBE, "%s:crc2 %p", __func__, ep); - abort_connection(ep); + disconnect = 2; } else { @@ -1847,6 +1906,8 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i err = soshutdown(ep->com.so, 3); } c4iw_put_ep(&ep->com); + if (disconnect) + err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); CTR2(KTR_IW_CXGBE, "%s:crc4 %p", __func__, ep); return 0; } @@ -1859,6 +1920,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i struct c4iw_ep *ep = to_ep(cm_id); struct c4iw_dev *h = to_c4iw_dev(cm_id->device); struct c4iw_qp *qp = get_qhp(h, conn_param->qpn); + int abort = 0; CTR2(KTR_IW_CXGBE, "%s:cacB %p", __func__, ep); @@ -1866,7 +1928,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i CTR2(KTR_IW_CXGBE, "%s:cac1 %p", __func__, ep); err = -ECONNRESET; - goto err; + goto err_out; } BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); @@ -1878,9 +1940,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i (conn_param->ird > c4iw_max_read_depth)) { CTR2(KTR_IW_CXGBE, "%s:cac2 %p", __func__, ep); - abort_connection(ep); err = -EINVAL; - goto err; + goto err_abort; } if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) { @@ -1894,9 +1955,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i ep->ord = conn_param->ord; send_mpa_reject(ep, conn_param->private_data, conn_param->private_data_len); - abort_connection(ep); err = -ENOMEM; - goto err; + goto err_abort; } if (conn_param->ird > ep->ord) { @@ -1910,9 +1970,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i } else { CTR2(KTR_IW_CXGBE, "%s:cac7 %p", __func__, ep); - abort_connection(ep); err = -ENOMEM; - goto err; + goto err_abort; } } @@ -1932,9 +1991,10 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i } - cm_id->add_ref(cm_id); ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.qp = qp; + ref_qp(ep); //ep->ofld_txq = TOEPCB(ep->com.so)->ofld_txq; /* bind QP to EP and move to RTS */ @@ -1956,7 +2016,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i if (err) { CTR2(KTR_IW_CXGBE, "%s:caca %p", __func__, ep); - goto err1; + goto err_defef_cm_id; } err = send_mpa_reply(ep, conn_param->private_data, conn_param->private_data_len); @@ -1964,7 +2024,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i if (err) { CTR2(KTR_IW_CXGBE, "%s:caca %p", __func__, ep); - goto err1; + goto err_defef_cm_id; } state_set(&ep->com, FPDU_MODE); @@ -1972,11 +2032,13 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cacE %p", __func__, ep); return 0; -err1: - ep->com.cm_id = NULL; - ep->com.qp = NULL; - cm_id->rem_ref(cm_id); -err: +err_defef_cm_id: + deref_cm_id(&ep->com); +err_abort: + abort = 1; +err_out: + if (abort) + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cacE err %p", __func__, ep); return err; @@ -2028,9 +2090,9 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->ord = 1; } - cm_id->add_ref(cm_id); ep->com.dev = dev; ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.qp = get_qhp(dev, conn_param->qpn); if (!ep->com.qp) { @@ -2039,6 +2101,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, err = -EINVAL; goto fail2; } + ref_qp(ep); ep->com.thread = curthread; ep->com.so = cm_id->so; @@ -2096,7 +2159,7 @@ fail3: CTR2(KTR_IW_CXGBE, "%s:ccb %p", __func__, ep); fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); fail2: - cm_id->rem_ref(cm_id); + deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); out: CTR2(KTR_IW_CXGBE, "%s:ccE %p", __func__, ep); @@ -2124,8 +2187,8 @@ c4iw_create_listen_ep(struct iw_cm_id *c goto failed; } - cm_id->add_ref(cm_id); ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.dev = dev; ep->backlog = backlog; ep->com.local_addr = cm_id->local_addr; @@ -2150,7 +2213,7 @@ c4iw_destroy_listen_ep(struct iw_cm_id * cm_id->so, states[ep->com.state]); state_set(&ep->com, DEAD); - cm_id->rem_ref(cm_id); + deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); return; @@ -2232,7 +2295,8 @@ int c4iw_ep_disconnect(struct c4iw_ep *e CTR2(KTR_IW_CXGBE, "%s:ced4 %p", __func__, ep); set_bit(EP_DISC_ABORT, &ep->com.history); - ret = abort_connection(ep); + close_complete_upcall(ep, -ECONNRESET); + ret = send_abort(ep); } else { CTR2(KTR_IW_CXGBE, "%s:ced5 %p", __func__, ep); @@ -2250,8 +2314,25 @@ int c4iw_ep_disconnect(struct c4iw_ep *e } if (fatal) { + set_bit(EP_DISC_FAIL, &ep->com.history); + if (!abrupt) { + STOP_EP_TIMER(ep); + close_complete_upcall(ep, -EIO); + } + if (ep->com.qp) { + struct c4iw_qp_attributes attrs; + attrs.next_state = C4IW_QP_STATE_ERROR; + ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, + &attrs, 1); + if (ret) { + CTR2(KTR_IW_CXGBE, "%s:ced7 %p", __func__, ep); + printf("%s - qp <- error failed!\n", __func__); + } + } release_ep_resources(ep); + ep->com.state = DEAD; CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); } CTR2(KTR_IW_CXGBE, "%s:cedE %p", __func__, ep); @@ -2290,8 +2371,13 @@ static void ep_timeout(unsigned long arg if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { - list_add_tail(&ep->entry, &timeout_list); - kickit = 1; + /* + * Only insert if it is not already on the list. + */ + if (!ep->entry.next) { + list_add_tail(&ep->entry, &timeout_list); + kickit = 1; + } } spin_unlock(&timeout_lock); Modified: head/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Mar 21 00:29:45 2016 (r297124) @@ -724,7 +724,7 @@ static int c4iw_poll_cq_one(struct c4iw_ default: printf("Unexpected cqe_status 0x%x for QPID = 0x%0x\n", CQE_STATUS(&cqe), CQE_QPID(&cqe)); - ret = -EINVAL; + wc->status = IB_WC_FATAL_ERR; } } out: @@ -861,6 +861,7 @@ c4iw_create_cq(struct ib_device *ibdev, if (!mm2) goto err4; + memset(&uresp, 0, sizeof(uresp)); uresp.qid_mask = rhp->rdev.cqmask; uresp.cqid = chp->cq.cqid; uresp.size = chp->cq.size; @@ -871,7 +872,8 @@ c4iw_create_cq(struct ib_device *ibdev, uresp.gts_key = ucontext->key; ucontext->key += PAGE_SIZE; spin_unlock(&ucontext->mmap_lock); - ret = ib_copy_to_udata(udata, &uresp, sizeof uresp); + ret = ib_copy_to_udata(udata, &uresp, + sizeof(uresp) - sizeof(uresp.reserved)); if (ret) goto err5; Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 21 00:29:45 2016 (r297124) @@ -157,7 +157,7 @@ static inline int c4iw_fatal_error(struc static inline int c4iw_num_stags(struct c4iw_rdev *rdev) { - return min((int)T4_MAX_NUM_STAG, (int)(rdev->adap->vres.stag.size >> 5)); + return (int)(rdev->adap->vres.stag.size >> 5); } #define C4IW_WR_TO (10*HZ) @@ -435,6 +435,7 @@ struct c4iw_qp { atomic_t refcnt; wait_queue_head_t wait; struct timer_list timer; + int sq_sig_all; }; static inline struct c4iw_qp *to_c4iw_qp(struct ib_qp *ibqp) @@ -712,7 +713,8 @@ enum c4iw_ep_flags { ABORT_REQ_IN_PROGRESS = 1, RELEASE_RESOURCES = 2, CLOSE_SENT = 3, - TIMEOUT = 4 + TIMEOUT = 4, + QP_REFERENCED = 5 }; enum c4iw_ep_history { @@ -737,7 +739,13 @@ enum c4iw_ep_history { EP_DISC_ABORT = 18, CONN_RPL_UPCALL = 19, ACT_RETRY_NOMEM = 20, - ACT_RETRY_INUSE = 21 + ACT_RETRY_INUSE = 21, + CLOSE_CON_RPL = 22, + EP_DISC_FAIL = 24, + QP_REFED = 25, + QP_DEREFED = 26, + CM_ID_REFED = 27, + CM_ID_DEREFED = 28 }; struct c4iw_ep_common { Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Mar 21 00:29:00 2016 (r297123) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Mar 21 00:52:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5357BAD6D3E; Mon, 21 Mar 2016 00:52:27 +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 14C767B8; Mon, 21 Mar 2016 00:52:27 +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 u2L0qQhw047845; Mon, 21 Mar 2016 00:52:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0qOIu047832; Mon, 21 Mar 2016 00:52:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603210052.u2L0qOIu047832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 00:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297127 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/lpc arm/ti dev/mmc dev/mmc/host dev/sdhci powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 00:52:27 -0000 Author: ian Date: Mon Mar 21 00:52:24 2016 New Revision: 297127 URL: https://svnweb.freebsd.org/changeset/base/297127 Log: Fix fallout from r292180 (Dec 2015)... ensure that every driver which has a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc. This is because the kernel linker only searches for symbols in dependent modules, so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc was not compiled into the kernel (even if you hand-loaded mmc first). (Thanks to jilles@ for providing the vital clue about the kernel linker.) Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/at91/at91_mci.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/ti/ti_sdhci.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/mmc.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c head/sys/powerpc/mpc85xx/fsl_sdhc.c Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/allwinner/a10_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -943,3 +943,4 @@ static driver_t a10_mmc_driver = { DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(a10_mmc, mmc, 1, 1, 1); Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1099,3 +1099,4 @@ DRIVER_MODULE(aml8726_mmc, simplebus, am aml8726_mmc_devclass, 0, 0); MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_mmc, mmc, 1, 1, 1); Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1378,3 +1378,4 @@ DRIVER_MODULE(aml8726_sdxc, simplebus, a aml8726_sdxc_devclass, 0, 0); MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_sdxc, mmc, 1, 1, 1); Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/at91/at91_mci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1412,3 +1412,4 @@ DRIVER_MODULE(at91_mci, atmelarm, at91_m NULL); #endif DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(at91_mci, mmc, 1, 1, 1); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -672,3 +672,4 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_bcm, mmc, 1, 1, 1); Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/freescale/imx/imx_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -836,3 +836,4 @@ static driver_t imx_sdhci_driver = { DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_imx, mmc, 1, 1, 1); Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/lpc/lpc_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -776,3 +776,4 @@ static driver_t lpc_mmc_driver = { DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(lpcmmc, mmc, 1, 1, 1); Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/ti/ti_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -722,3 +722,4 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_ti, mmc, 1, 1, 1); Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/mmc/host/dwmmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1178,3 +1178,4 @@ static devclass_t dwmmc_devclass; DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(dwmmc, mmc, 1, 1, 1); Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/mmc/mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1811,3 +1811,5 @@ driver_t mmc_driver = { sizeof(struct mmc_softc), }; devclass_t mmc_devclass; + +MODULE_VERSION(mmc, 1); Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/sdhci/sdhci_fdt.c Mon Mar 21 00:52:24 2016 (r297127) @@ -308,3 +308,4 @@ DRIVER_MODULE(sdhci_fdt, simplebus, sdhc NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_fdt, mmc, 1, 1, 1); Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/sdhci/sdhci_pci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -475,3 +475,4 @@ DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_ NULL); MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_pci, mmc, 1, 1, 1); Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -126,7 +126,7 @@ static devclass_t fsl_sdhc_devclass; DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); - +MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); /***************************************************************************** * Private methods From owner-svn-src-head@freebsd.org Mon Mar 21 00:59:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDDC1AD6EC6; Mon, 21 Mar 2016 00:59:31 +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 9660DA87; Mon, 21 Mar 2016 00:59:31 +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 u2L0xUiW048110; Mon, 21 Mar 2016 00:59:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0xUoQ048109; Mon, 21 Mar 2016 00:59:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603210059.u2L0xUoQ048109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Mar 2016 00:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297128 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 00:59:32 -0000 Author: emaste Date: Mon Mar 21 00:59:30 2016 New Revision: 297128 URL: https://svnweb.freebsd.org/changeset/base/297128 Log: i915: disable GEN6_MBCTL write in gen6_init_clock_gating This write came from Linux commit b4ae3f22d238 which has been implicated in Sandy Bridge power consumption issues (albeit under different conditions on Linux). Disabling it restores normal power consumption on my Sandy Bridge laptop (Thinkpad X220). PR: 207889 Reviewed by: cem, dumbbell Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5665 Modified: head/sys/dev/drm2/i915/intel_pm.c Modified: head/sys/dev/drm2/i915/intel_pm.c ============================================================================== --- head/sys/dev/drm2/i915/intel_pm.c Mon Mar 21 00:52:24 2016 (r297127) +++ head/sys/dev/drm2/i915/intel_pm.c Mon Mar 21 00:59:30 2016 (r297128) @@ -3672,9 +3672,39 @@ static void gen6_init_clock_gating(struc ILK_DPARBUNIT_CLOCK_GATE_ENABLE | ILK_DPFDUNIT_CLOCK_GATE_ENABLE); + +#ifdef FREEBSD_WIP + /* NOTE Linux<->FreeBSD: Disable GEN6_MBCTL write. + * + * This arrived in Linux 3.6 in commit + * b4ae3f22d238617ca11610b29fde16cf8c0bc6e0 and causes significantly + * increased power consumption after kldloading i915kms.ko on FreeBSD + * on (some) Sandy Bridge laptops. A Thinkpad X220 reported about 11W + * after booting while idle at the vt(4) console and about double that + * after loading the driver. + * + * There were reports in Linux of increased consumption after a suspend + * and resume cycle due to that change. + * + * Linux bug reports: + * https://bugs.freedesktop.org/show_bug.cgi?id=54089 + * https://bugzilla.kernel.org/show_bug.cgi?id=58971 + * + * This suspend and resume issue is reportedly fixed in Linux with + * commits 7dcd2677ea912573d9ed4bcd629b0023b2d11505 and + * 7dcd2677ea912573d9ed4bcd629b0023b2d11505 (Linux 3.11). However, I + * found that those changes did not help on FreeBSD, where increased + * power consumption is observed after loading i915kms.ko without + * suspending and resuming. + * + * This workaround should be removed after updating to a future Linux + * i915 version and verifying normal power consumption on Sandy Bridge. + */ + /* WaMbcDriverBootEnable */ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) | GEN6_MBCTL_ENABLE_BOOT_FETCH); +#endif /* FREEBSD_WIP */ for_each_pipe(pipe) { I915_WRITE(DSPCNTR(pipe), From owner-svn-src-head@freebsd.org Mon Mar 21 02:38:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F19EAD6117; Mon, 21 Mar 2016 02:38:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 557DC37D; Mon, 21 Mar 2016 02:38:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L2cL1a078253; Mon, 21 Mar 2016 02:38:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L2cLj2078252; Mon, 21 Mar 2016 02:38:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603210238.u2L2cLj2078252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 21 Mar 2016 02:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297131 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 02:38:22 -0000 Author: adrian Date: Mon Mar 21 02:38:21 2016 New Revision: 297131 URL: https://svnweb.freebsd.org/changeset/base/297131 Log: Remove urtwn/urtwnfw; it's built as a module now. Modified: head/sys/arm/conf/RK3188 Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Mon Mar 21 01:17:48 2016 (r297130) +++ head/sys/arm/conf/RK3188 Mon Mar 21 02:38:21 2016 (r297131) @@ -101,8 +101,6 @@ device wlan # 802.11 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support -device urtwn -device urtwnfw device firmware # Used by the above # USB Ethernet support, requires miibus From owner-svn-src-head@freebsd.org Mon Mar 21 03:16:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA626AD6AC4; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC68D6E; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L3GuhN091544; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3GuXO091542; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603210316.u2L3GuXO091542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 21 Mar 2016 03:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297132 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 03:16:58 -0000 Author: loos Date: Mon Mar 21 03:16:56 2016 New Revision: 297132 URL: https://svnweb.freebsd.org/changeset/base/297132 Log: Enable multicast addresses on vlan ports. Fixes the reception of broadcast packets on vlan aware mode. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 03:16:56 2016 (r297132) @@ -140,7 +140,8 @@ static void cpsw_ale_read_entry(struct c static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t, uint32_t *); static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t, int, uint8_t *); static void cpsw_ale_dump_table(struct cpsw_softc *); -static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int); +static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int, int, + int); static int cpswp_ale_update_addresses(struct cpswp_softc *, int); /* Statistics and sysctls. */ @@ -1148,8 +1149,9 @@ cpswp_init_locked(void *arg) cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1), sc->vlan & 0xfff); cpsw_ale_update_vlan_table(sc->swsc, sc->vlan, - (1 << (sc->unit + 1)) | (1 << 0), - (1 << (sc->unit + 1)) | (1 << 0)); + (1 << (sc->unit + 1)) | (1 << 0), /* Member list */ + (1 << (sc->unit + 1)) | (1 << 0), /* Untagged egress */ + (1 << (sc->unit + 1)) | (1 << 0), 0); /* mcast reg flood */ } mii_mediachg(sc->mii); @@ -2368,7 +2370,8 @@ cpswp_ale_update_addresses(struct cpswp_ } static int -cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, int untag) +cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, + int untag, int mcregflood, int mcunregflood) { int free_index, i, matching_index; uint32_t ale_entry[3]; @@ -2394,7 +2397,8 @@ cpsw_ale_update_vlan_table(struct cpsw_s i = free_index; } - ale_entry[0] = (untag & 7) << 24 | (ports & 7); + ale_entry[0] = (untag & 7) << 24 | (mcregflood & 7) << 16 | + (mcunregflood & 7) << 8 | (ports & 7); ale_entry[1] = ALE_TYPE_VLAN << 28 | vlan << 16; ale_entry[2] = 0; cpsw_ale_write_entry(sc, i, ale_entry); Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 03:16:56 2016 (r297132) @@ -98,8 +98,8 @@ #define ALE_TYPE_VLAN 2 #define ALE_TYPE_VLAN_ADDR 3 #define ALE_VLAN(_a) ((_a[1] >> 16) & 0xfff) -#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 8) & 7) -#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 16) & 7) +#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 8) & 7) +#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 16) & 7) #define ALE_VLAN_UNTAG(_a) ((_a[0] >> 24) & 7) #define ALE_VLAN_MEMBERS(_a) (_a[0] & 7) #define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04)) From owner-svn-src-head@freebsd.org Mon Mar 21 03:39:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 632D6AD6FCA; Mon, 21 Mar 2016 03:39:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A1919CA; Mon, 21 Mar 2016 03:39:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L3dcq0098122; Mon, 21 Mar 2016 03:39:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3dcJt098121; Mon, 21 Mar 2016 03:39:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603210339.u2L3dcJt098121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 21 Mar 2016 03:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297134 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 03:39:39 -0000 Author: loos Date: Mon Mar 21 03:39:38 2016 New Revision: 297134 URL: https://svnweb.freebsd.org/changeset/base/297134 Log: Use the internal references for ADC, this fixes the ADC readings on uBMC. Tested on BBB and uBMC. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Mar 21 03:29:45 2016 (r297133) +++ head/sys/arm/ti/ti_adc.c Mon Mar 21 03:39:38 2016 (r297134) @@ -161,11 +161,9 @@ ti_adc_input_setup(struct ti_adc_softc * /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Set the samples average. */ val &= ~ADC_STEP_AVG_MSK; @@ -450,11 +448,9 @@ ti_adc_idlestep_init(struct ti_adc_softc /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Connect the input to VREFN. */ val &= ~ADC_STEP_INP_MSK; @@ -484,6 +480,11 @@ ti_adc_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -509,11 +510,6 @@ ti_adc_attach(device_t dev) return (ENXIO); } - /* Activate the ADC_TSC module. */ - err = ti_prcm_clk_enable(TSC_ADC_CLK); - if (err) - return (err); - /* Check the ADC revision. */ rev = ADC_READ4(sc, ADC_REVISION); device_printf(dev, From owner-svn-src-head@freebsd.org Mon Mar 21 05:51:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B76DAD6894; Mon, 21 Mar 2016 05:51:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDEE2EF; Mon, 21 Mar 2016 05:51:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L5pLAn037312; Mon, 21 Mar 2016 05:51:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L5pL1X037311; Mon, 21 Mar 2016 05:51:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603210551.u2L5pL1X037311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 21 Mar 2016 05:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297136 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 05:51:22 -0000 Author: adrian Date: Mon Mar 21 05:51:21 2016 New Revision: 297136 URL: https://svnweb.freebsd.org/changeset/base/297136 Log: Remove from NOTES - it's built as a module now. Noticed by: sephe Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 21 05:47:59 2016 (r297135) +++ head/sys/conf/NOTES Mon Mar 21 05:51:21 2016 (r297136) @@ -2792,9 +2792,6 @@ device urndis # Realtek RTL8187B/L wireless driver device urtw # -# Realtek RTL8188CU/RTL8192CU wireless driver -device urtwn -# # ZyDas ZD1211/ZD1211B wireless driver device zyd # From owner-svn-src-head@freebsd.org Mon Mar 21 05:59:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DC45AD6B9B; Mon, 21 Mar 2016 05:59:06 +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 53FA0A78; Mon, 21 Mar 2016 05:59:06 +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 u2L5x53p040793; Mon, 21 Mar 2016 05:59:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L5x5tk040792; Mon, 21 Mar 2016 05:59:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210559.u2L5x5tk040792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 05:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297137 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 05:59:06 -0000 Author: kib Date: Mon Mar 21 05:59:05 2016 New Revision: 297137 URL: https://svnweb.freebsd.org/changeset/base/297137 Log: Fix typo. MFC after: 3 days Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Mon Mar 21 05:51:21 2016 (r297136) +++ head/lib/libthr/Makefile Mon Mar 21 05:59:05 2016 (r297137) @@ -38,7 +38,7 @@ SYMBOL_MAPS=${.CURDIR}/pthread.map MAN= libthr.3 -# enable extra internal consistancy checks +# enable extra internal consistency checks CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= From owner-svn-src-head@freebsd.org Mon Mar 21 06:40:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67AB9AD7429; Mon, 21 Mar 2016 06:40:55 +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 4414FCFF; Mon, 21 Mar 2016 06:40:55 +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 u2L6es0A053602; Mon, 21 Mar 2016 06:40:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6eslK053601; Mon, 21 Mar 2016 06:40:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210640.u2L6eslK053601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297138 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 06:40:55 -0000 Author: kib Date: Mon Mar 21 06:40:54 2016 New Revision: 297138 URL: https://svnweb.freebsd.org/changeset/base/297138 Log: Implement process-shared spinlocks. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_pspinlock.c Modified: head/lib/libthr/thread/thr_pspinlock.c ============================================================================== --- head/lib/libthr/thread/thr_pspinlock.c Mon Mar 21 05:59:05 2016 (r297137) +++ head/lib/libthr/thread/thr_pspinlock.c Mon Mar 21 06:40:54 2016 (r297138) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 David Xu + * Copyright (c) 2016 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: @@ -46,93 +50,100 @@ int _pthread_spin_init(pthread_spinlock_t *lock, int pshared) { struct pthread_spinlock *lck; - int ret; - if (lock == NULL || pshared != PTHREAD_PROCESS_PRIVATE) - ret = EINVAL; - else if ((lck = malloc(sizeof(struct pthread_spinlock))) == NULL) - ret = ENOMEM; - else { - _thr_umutex_init(&lck->s_lock); + if (lock == NULL) + return (EINVAL); + if (pshared == PTHREAD_PROCESS_PRIVATE) { + lck = malloc(sizeof(struct pthread_spinlock)); + if (lck == NULL) + return (ENOMEM); *lock = lck; - ret = 0; + } else if (pshared == PTHREAD_PROCESS_SHARED) { + lck = __thr_pshared_offpage(lock, 1); + if (lck == NULL) + return (EFAULT); + *lock = THR_PSHARED_PTR; + } else { + return (EINVAL); } - - return (ret); + _thr_umutex_init(&lck->s_lock); + return (0); } int _pthread_spin_destroy(pthread_spinlock_t *lock) { + void *l; int ret; - if (lock == NULL || *lock == NULL) + if (lock == NULL || *lock == NULL) { ret = EINVAL; - else { + } else if (*lock == THR_PSHARED_PTR) { + l = __thr_pshared_offpage(lock, 0); + if (l != NULL) + __thr_pshared_destroy(l); + ret = 0; + } else { free(*lock); *lock = NULL; ret = 0; } - return (ret); } int _pthread_spin_trylock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; - int ret; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else - ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock); - return (ret); + if (lock == NULL || *lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + return (THR_UMUTEX_TRYLOCK(_get_curthread(), &lck->s_lock)); } int _pthread_spin_lock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; struct pthread_spinlock *lck; - int ret, count; + int count; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else { - count = SPIN_COUNT; - while ((ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock)) != 0) { - while (lck->s_lock.m_owner) { - if (!_thr_is_smp) { + if (lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + + curthread = _get_curthread(); + count = SPIN_COUNT; + while (THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock) != 0) { + while (lck->s_lock.m_owner) { + if (!_thr_is_smp) { + _pthread_yield(); + } else { + CPU_SPINWAIT; + if (--count <= 0) { + count = SPIN_COUNT; _pthread_yield(); - } else { - CPU_SPINWAIT; - - if (--count <= 0) { - count = SPIN_COUNT; - _pthread_yield(); - } } } } - ret = 0; } - - return (ret); + return (0); } int _pthread_spin_unlock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; - int ret; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else { - ret = THR_UMUTEX_UNLOCK(curthread, &lck->s_lock); - } - return (ret); + if (lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + return (THR_UMUTEX_UNLOCK(_get_curthread(), &lck->s_lock)); } From owner-svn-src-head@freebsd.org Mon Mar 21 06:46:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1C1AD76E9; Mon, 21 Mar 2016 06:46:17 +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 81AEB241; Mon, 21 Mar 2016 06:46:17 +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 u2L6kGul055906; Mon, 21 Mar 2016 06:46:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6kGFq055904; Mon, 21 Mar 2016 06:46:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210646.u2L6kGFq055904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297139 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 06:46:17 -0000 Author: kib Date: Mon Mar 21 06:46:16 2016 New Revision: 297139 URL: https://svnweb.freebsd.org/changeset/base/297139 Log: From libthr, remove special and strange code to set up session and control terminal, activated when running with pid 1. It is application duty to handle this, and unsuspecting init replacements which are linked with libthr would be broken by this. The pre-resolving of getpid() is restored, just in case. Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Mar 21 06:40:54 2016 (r297138) +++ head/lib/libthr/thread/thr_init.c Mon Mar 21 06:46:16 2016 (r297139) @@ -305,7 +305,7 @@ _thread_init_hack(void) void _libpthread_init(struct pthread *curthread) { - int fd, first, dlopened; + int first, dlopened; /* Check if this function has already been called: */ if ((_thr_initial != NULL) && (curthread == NULL)) @@ -321,27 +321,6 @@ _libpthread_init(struct pthread *curthre memcpy(__thr_jtable, jmp_table, sizeof(jmp_table)); __thr_interpose_libc(); - /* - * Check for the special case of this process running as - * or in place of init as pid = 1: - */ - if ((_thr_pid = getpid()) == 1) { - /* - * Setup a new session for this process which is - * assumed to be running as root. - */ - if (setsid() == -1) - PANIC("Can't set session ID"); - if (revoke(_PATH_CONSOLE) != 0) - PANIC("Can't revoke console"); - if ((fd = __sys_openat(AT_FDCWD, _PATH_CONSOLE, O_RDWR)) < 0) - PANIC("Can't open console"); - if (setlogin("root") == -1) - PANIC("Can't set login to root"); - if (_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) - PANIC("Can't set controlling terminal"); - } - /* Initialize pthread private data. */ init_private(); Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Mon Mar 21 06:40:54 2016 (r297138) +++ head/lib/libthr/thread/thr_rtld.c Mon Mar 21 06:46:16 2016 (r297139) @@ -227,6 +227,7 @@ _thr_rtld_init(void) _rtld_atfork_post(NULL); _malloc_prefork(); _malloc_postfork(); + getpid(); syscall(SYS_getpid); /* mask signals, also force to resolve __sys_sigprocmask PLT */ From owner-svn-src-head@freebsd.org Mon Mar 21 06:48:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 660F9AD7840; Mon, 21 Mar 2016 06:48:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2998065A; Mon, 21 Mar 2016 06:48:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L6mBgV056010; Mon, 21 Mar 2016 06:48:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6mBf4056009; Mon, 21 Mar 2016 06:48:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210648.u2L6mBf4056009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297140 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 06:48:12 -0000 Author: kib Date: Mon Mar 21 06:48:11 2016 New Revision: 297140 URL: https://svnweb.freebsd.org/changeset/base/297140 Log: Provide more information on failing checks in mutex_assert_is_owned() and mutex_assert_not_owned(). snprintf() use in this context should be safe. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Mon Mar 21 06:46:16 2016 (r297139) +++ head/lib/libthr/thread/thr_mutex.c Mon Mar 21 06:48:11 2016 (r297140) @@ -124,8 +124,14 @@ mutex_assert_is_owned(struct pthread_mut { #if defined(_PTHREADS_INVARIANTS) - if (__predict_false(m->m_qe.tqe_prev == NULL)) - PANIC("mutex is not on list"); + if (__predict_false(m->m_qe.tqe_prev == NULL)) { + char msg[128]; + snprintf(msg, sizeof(msg), + "mutex %p own %#x %#x is not on list %p %p", + m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, + m->m_qe.tqe_next); + PANIC(msg); + } #endif } @@ -135,8 +141,14 @@ mutex_assert_not_owned(struct pthread_mu #if defined(_PTHREADS_INVARIANTS) if (__predict_false(m->m_qe.tqe_prev != NULL || - m->m_qe.tqe_next != NULL)) - PANIC("mutex is on list"); + m->m_qe.tqe_next != NULL)) { + char msg[128]; + snprintf(msg, sizeof(msg), + "mutex %p own %#x %#x is on list %p %p", + m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, + m->m_qe.tqe_next); + PANIC(msg); + } #endif } From owner-svn-src-head@freebsd.org Mon Mar 21 06:52:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A41AD7A17; Mon, 21 Mar 2016 06:52:36 +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 8FE39A79; Mon, 21 Mar 2016 06:52:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L6qZn7058781; Mon, 21 Mar 2016 06:52:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6qZRi058776; Mon, 21 Mar 2016 06:52:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210652.u2L6qZRi058776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297141 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 06:52:36 -0000 Author: kib Date: Mon Mar 21 06:52:35 2016 New Revision: 297141 URL: https://svnweb.freebsd.org/changeset/base/297141 Log: Lock pshared_lock shared around fork, to ensure that the COW snapshot of the pshared hash in child is consistent and can be safely used. Reported and tested by: "Oleg V. Nauman" Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_pshared.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_fork.c Mon Mar 21 06:52:35 2016 (r297141) @@ -168,6 +168,7 @@ __thr_fork(void) if (_thr_isthreaded() != 0) { was_threaded = 1; _malloc_prefork(); + __thr_pshared_atfork_pre(); _rtld_atfork_pre(rtld_locks); } else { was_threaded = 0; @@ -202,8 +203,10 @@ __thr_fork(void) _thr_signal_postfork_child(); - if (was_threaded) + if (was_threaded) { _rtld_atfork_post(rtld_locks); + __thr_pshared_atfork_post(); + } _thr_setthreaded(0); /* reinitalize library. */ @@ -236,6 +239,7 @@ __thr_fork(void) if (was_threaded) { _rtld_atfork_post(rtld_locks); + __thr_pshared_atfork_post(); _malloc_postfork(); } Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_init.c Mon Mar 21 06:52:35 2016 (r297141) @@ -445,7 +445,6 @@ init_private(void) _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); - __thr_pshared_init(); _thr_wake_addr_init(); _sleepq_init(); _single_thread = NULL; @@ -456,6 +455,7 @@ init_private(void) * e.g. after a fork(). */ if (init_once == 0) { + __thr_pshared_init(); /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_private.h Mon Mar 21 06:52:35 2016 (r297141) @@ -952,6 +952,8 @@ void _tcb_dtor(struct tcb *); void __thr_pshared_init(void) __hidden; void *__thr_pshared_offpage(void *key, int doalloc) __hidden; void __thr_pshared_destroy(void *key) __hidden; +void __thr_pshared_atfork_pre(void) __hidden; +void __thr_pshared_atfork_post(void) __hidden; __END_DECLS Modified: head/lib/libthr/thread/thr_pshared.c ============================================================================== --- head/lib/libthr/thread/thr_pshared.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_pshared.c Mon Mar 21 06:52:35 2016 (r297141) @@ -252,3 +252,17 @@ __thr_pshared_destroy(void *key) pshared_clean(key, val); pshared_gc(curthread); } + +void +__thr_pshared_atfork_pre(void) +{ + + _thr_rwl_rdlock(&pshared_lock); +} + +void +__thr_pshared_atfork_post(void) +{ + + _thr_rwl_unlock(&pshared_lock); +} From owner-svn-src-head@freebsd.org Mon Mar 21 06:54:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62EF0AD7A81; Mon, 21 Mar 2016 06:54:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A703C02; Mon, 21 Mar 2016 06:54:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L6sMnG058881; Mon, 21 Mar 2016 06:54:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6sMNU058878; Mon, 21 Mar 2016 06:54:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603210654.u2L6sMNU058878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 21 Mar 2016 06:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297142 - in head/sys/dev/hyperv: include utilities vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 06:54:23 -0000 Author: sephe Date: Mon Mar 21 06:54:21 2016 New Revision: 297142 URL: https://svnweb.freebsd.org/changeset/base/297142 Log: hyperv: Factor out snprinf_hv_guid() Submitted by: Ju Sun Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5651 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/include/hyperv.h Mon Mar 21 06:54:21 2016 (r297142) @@ -124,6 +124,8 @@ typedef struct hv_guid { unsigned char data[16]; } __packed hv_guid; +int snprintf_hv_guid(char *, size_t, const hv_guid *); + #define HV_NIC_GUID \ .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Mon Mar 21 06:54:21 2016 (r297142) @@ -304,28 +304,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - int guid_index; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ char if_name[4]; - unsigned char guid_instance[40]; - char *guid_data = NULL; char buf[39]; - struct guid_extract { - char a1[2]; - char a2[2]; - char a3[2]; - char a4[2]; - char b1[2]; - char b2[2]; - char c1[2]; - char c2[2]; - char d[4]; - char e[12]; - }; - - struct guid_extract *id; device_t *devs; int devcnt; @@ -352,17 +335,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru /* Trying to find GUID of Network Device */ hv_dev = sc->hn_dev_obj; - for (guid_index = 0; guid_index < 16; guid_index++) { - sprintf(&guid_instance[guid_index * 2], "%02x", - hv_dev->device_id.data[guid_index]); - } - - guid_data = (char *)guid_instance; - id = (struct guid_extract *)guid_data; - snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", - id->a4, id->a3, id->a2, id->a1, - id->b2, id->b1, id->c2, id->c1, id->d, id->e); - guid_data = NULL; + snprintf_hv_guid(buf, sizeof(buf), &hv_dev->device_id); sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:54:21 2016 (r297142) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_vmbus_priv.h" #include @@ -300,15 +301,17 @@ hv_vmbus_child_device_create( return (child_dev); } -static void -print_dev_guid(struct hv_device *dev) +int +snprintf_hv_guid(char *buf, size_t sz, const hv_guid *guid) { - int i; - unsigned char guid_name[100]; - for (i = 0; i < 32; i += 2) - sprintf(&guid_name[i], "%02x", dev->class_id.data[i / 2]); - if(bootverbose) - printf("VMBUS: Class ID: %s\n", guid_name); + int cnt; + const unsigned char *d = guid->data; + + cnt = snprintf(buf, sz, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6], + d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); + return (cnt); } int @@ -317,8 +320,11 @@ hv_vmbus_child_device_register(struct hv device_t child; int ret = 0; - print_dev_guid(child_dev); - + if (bootverbose) { + char name[40]; + snprintf_hv_guid(name, sizeof(name), &child_dev->class_id); + printf("VMBUS: Class ID: %s\n", name); + } child = device_add_child(vmbus_devp, NULL, -1); child_dev->device = child; From owner-svn-src-head@freebsd.org Mon Mar 21 07:16:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93204AD7FC1; Mon, 21 Mar 2016 07:16:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 649697E8; Mon, 21 Mar 2016 07:16:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L7GUbm065179; Mon, 21 Mar 2016 07:16:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L7GULq065178; Mon, 21 Mar 2016 07:16:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603210716.u2L7GULq065178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 21 Mar 2016 07:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297143 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 07:16:31 -0000 Author: sephe Date: Mon Mar 21 07:16:30 2016 New Revision: 297143 URL: https://svnweb.freebsd.org/changeset/base/297143 Log: hyperv/vmbus: Implement bus_child_pnpinfo_str method Submitted by: Jun Su Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5669 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:54:21 2016 (r297142) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 07:16:30 2016 (r297143) @@ -280,6 +280,23 @@ vmbus_write_ivar( return (ENOENT); } +static int +vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) +{ + char guidbuf[40]; + struct hv_device *dev_ctx = device_get_ivars(child); + + strlcat(buf, "classid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); + strlcat(buf, guidbuf, buflen); + + strlcat(buf, " deviceid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); + strlcat(buf, guidbuf, buflen); + + return (0); +} + struct hv_device* hv_vmbus_child_device_create( hv_guid type, @@ -720,6 +737,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_write_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), { 0, 0 } }; From owner-svn-src-head@freebsd.org Mon Mar 21 08:03:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8B7AD7D7A; Mon, 21 Mar 2016 08:03:51 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1D2AD; Mon, 21 Mar 2016 08:03:51 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L83o8g080285; Mon, 21 Mar 2016 08:03:50 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L83ou5080284; Mon, 21 Mar 2016 08:03:50 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201603210803.u2L83ou5080284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 21 Mar 2016 08:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297145 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 08:03:51 -0000 Author: maxim Date: Mon Mar 21 08:03:50 2016 New Revision: 297145 URL: https://svnweb.freebsd.org/changeset/base/297145 Log: o "avaliable" -> "available". PR: 208141 Submitted by: Tyler Littlefield Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Mar 21 07:36:02 2016 (r297144) +++ head/sys/kern/uipc_socket.c Mon Mar 21 08:03:50 2016 (r297145) @@ -358,7 +358,7 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, &maxsockets, 0, sysctl_maxsockets, "IU", - "Maximum number of sockets avaliable"); + "Maximum number of sockets available"); /* * Socket operation routines. These routines are called by the routines in From owner-svn-src-head@freebsd.org Mon Mar 21 08:30:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D899EAD73FA; Mon, 21 Mar 2016 08:30:59 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7E41D6A; Mon, 21 Mar 2016 08:30:59 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L8Uwnq086605; Mon, 21 Mar 2016 08:30:58 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L8UwE2086604; Mon, 21 Mar 2016 08:30:58 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201603210830.u2L8UwE2086604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 21 Mar 2016 08:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297146 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 08:30:59 -0000 Author: phk Date: Mon Mar 21 08:30:58 2016 New Revision: 297146 URL: https://svnweb.freebsd.org/changeset/base/297146 Log: Unquote NANO_PACKAGE_LIST so that it actually can be a list and so that the default value of "*" works. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Mar 21 08:03:50 2016 (r297145) +++ head/tools/tools/nanobsd/defaults.sh Mon Mar 21 08:30:58 2016 (r297146) @@ -916,7 +916,7 @@ cust_pkgng ( ) ( mkdir -p ${NANO_WORLDDIR}/Pkg ( cd "${NANO_PACKAGE_DIR}" - find "${NANO_PACKAGE_LIST}" -print | + find ${NANO_PACKAGE_LIST} -print | cpio -Ldumpv ${NANO_WORLDDIR}/Pkg ) From owner-svn-src-head@freebsd.org Mon Mar 21 14:21:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B552AD7DD1; Mon, 21 Mar 2016 14:21: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 447B91E34; Mon, 21 Mar 2016 14:21: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 u2LELWmU095552; Mon, 21 Mar 2016 14:21:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LELWKt095550; Mon, 21 Mar 2016 14:21:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211421.u2LELWKt095550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297147 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 14:21:33 -0000 Author: ian Date: Mon Mar 21 14:21:32 2016 New Revision: 297147 URL: https://svnweb.freebsd.org/changeset/base/297147 Log: Garbage collect the bswap routines from libstand. The declaration was wrapped in an i386 ifdef with a comment questioning their usefulness even there. It turns out they aren't referenced anywhere, but their presence prevents using sys/endian.h in libstand code. These days, sys/endian.h provides much better support for such things, using compiler builtins and inline functions (and creating connections between libstand code and header files from sys/ would not be breaking new ground). Modified: head/lib/libstand/Makefile head/lib/libstand/stand.h Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon Mar 21 08:30:58 2016 (r297146) +++ head/lib/libstand/Makefile Mon Mar 21 14:21:32 2016 (r297147) @@ -25,7 +25,7 @@ WARNS?= 0 CFLAGS+= -I${LIBSTAND_SRC} # standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ sbrk.c twiddle.c zalloc.c zalloc_malloc.c Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Mon Mar 21 08:30:58 2016 (r297146) +++ head/lib/libstand/stand.h Mon Mar 21 14:21:32 2016 (r297147) @@ -335,11 +335,6 @@ static __inline quad_t qmin(quad_t a, qu static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); } static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); } -/* swaps (undocumented, useful?) */ -#ifdef __i386__ -extern u_int32_t bswap32(u_int32_t x); -extern u_int64_t bswap64(u_int64_t x); -#endif /* null functions for device/filesystem switches (undocumented) */ extern int nodev(void); From owner-svn-src-head@freebsd.org Mon Mar 21 14:28:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C4AAD7E6C; Mon, 21 Mar 2016 14:28:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8921AF; Mon, 21 Mar 2016 14:28:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id ig19so68833774igb.1; Mon, 21 Mar 2016 07:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TL/HgRab++KMaNedQcnY/tA4UcG0Llp+7Rj/ppXQcXQ=; b=zb46tALW5gkrCeOwOkR3Ewr0guCpPp/a4TGogDSR5ObYZGC7TmyMfwOJWxKX2UKiPE VEcKGM2G9lrcRF57hNVfiUKn4N0oY+hzZa8cieSrzWu5cEsLUHzeMAIMecPQZUehKz9d uzRnLkEuY64By6okXHFlzb7noRIBWfRdigOrrNESJehJj9qlIL1lMRnWGMfMlW79kW8F Gqqwt65ofphJiOUD0FLHe4ev1oSNqqks8QmanlwejqpQUMCLhgJA7UaIW0A9Y93xFTk7 c8sF9VBXsruDGJg6pHZ/lifgPEHruPh4VLsFIb3T2p9LSiLvYxDWpB/ton663dJ9Juke iKMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=TL/HgRab++KMaNedQcnY/tA4UcG0Llp+7Rj/ppXQcXQ=; b=ScvcnGXYcLtf6rt6m7VQY8N/BBM3o9MjFCTWP6RT3uWASAnVdj/YnHwk/NSbHyeFBo 6sIXThFd6OeyiMCczfoIwm4hMrONG6xFpeiqSLh4t5mSS1VSQ/NVirPoUutryhQxNNPG fPGfy3j/HLS+qyIjRaWoB3OCWJH4x/uqm3TNWuQE/gc+StJj7wB9MypTCzjPiOqy7VAc Tu9RIP6dEcdlBWEnxXin/m3wimFpB5HwJ2RIh9vkulxz15trutYLYzzqwi/a2Nyx1YBG RYotevFeXBDzE2OqbdT8fUKm6OFRWvbhNJKgLfRbE5feY3FRxzb5o0JvNhkZMi/Mznh3 xO+g== X-Gm-Message-State: AD7BkJJnFVgToQAvMqZ6yE6ihIkwthaoURuh/y0dkso/jdUpWReYmY7TZYbM1LfwCYWRf1TZpIbSuuGR2+5yqg== X-Received: by 10.50.132.102 with SMTP id ot6mr11612784igb.97.1458570530549; Mon, 21 Mar 2016 07:28:50 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Mon, 21 Mar 2016 07:28:31 -0700 (PDT) In-Reply-To: <20160315061641.GI11339@ivaldir.etoilebsd.net> References: <201603122144.u2CLiXv5023698@repo.freebsd.org> <20160315061641.GI11339@ivaldir.etoilebsd.net> From: Ed Maste Date: Mon, 21 Mar 2016 10:28:31 -0400 X-Google-Sender-Auth: Xse7Te0E8oZWFjI19WfC-KMsFyU Message-ID: Subject: Re: svn commit: r296769 - in head/sys/boot/efi: boot1 loader To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 14:28:51 -0000 On 15 March 2016 at 02:16, Baptiste Daroussin wrote: > On Sat, Mar 12, 2016 at 09:44:33PM +0000, Ed Maste wrote: >> Author: emaste >> Date: Sat Mar 12 21:44:33 2016 >> New Revision: 296769 >> URL: https://svnweb.freebsd.org/changeset/base/296769 >> >> Log: >> boot/efi: Prefer nm to objdump > > [...] > grep -q maybe to avoid extra noise? I intentionally did not hide grep's output so that if there are undefined symbols the reason for the build failure is apparent. In the normal case this should produce no output. From owner-svn-src-head@freebsd.org Mon Mar 21 14:39:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF581AD80E7; Mon, 21 Mar 2016 14:39:04 +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 97474B99; Mon, 21 Mar 2016 14:39:04 +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 u2LEd3in099641; Mon, 21 Mar 2016 14:39:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEd37V099640; Mon, 21 Mar 2016 14:39:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211439.u2LEd37V099640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297148 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 14:39:05 -0000 Author: ian Date: Mon Mar 21 14:39:03 2016 New Revision: 297148 URL: https://svnweb.freebsd.org/changeset/base/297148 Log: Actually garbage collect the unused code, as mentioned in r297147, which this change should have been part of. Deleted: head/lib/libstand/bswap.c From owner-svn-src-head@freebsd.org Mon Mar 21 14:51:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25295AD83E5; Mon, 21 Mar 2016 14:51:53 +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 CE84A3EE; Mon, 21 Mar 2016 14:51:52 +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 u2LEppfD005746; Mon, 21 Mar 2016 14:51:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEppS7005745; Mon, 21 Mar 2016 14:51:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211451.u2LEppS7005745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297149 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 14:51:53 -0000 Author: ian Date: Mon Mar 21 14:51:51 2016 New Revision: 297149 URL: https://svnweb.freebsd.org/changeset/base/297149 Log: If the dhcp server provides an interface-mtu option, parse the value and set that mtu on the interface. These changes are based on the patch submitted by Robert Blayzor in the PR, but I changed things around a bit, so the blame for any mistakes belongs to me. PR: 187094 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Mon Mar 21 14:39:03 2016 (r297148) +++ head/sys/nfs/bootp_subr.c Mon Mar 21 14:51:51 2016 (r297149) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -158,6 +159,7 @@ struct bootpc_ifcontext { int dhcpquerytype; /* dhcp type sent */ struct in_addr dhcpserver; int gotdhcpserver; + uint16_t mtu; }; #define TAG_MAXLEN 1024 @@ -199,6 +201,7 @@ struct bootpc_globalcontext { #define TAG_ROUTERS 3 /* Routers (in order of preference) */ #define TAG_HOSTNAME 12 /* Client host name */ #define TAG_ROOT 17 /* Root path */ +#define TAG_INTF_MTU 26 /* Interface MTU Size (RFC2132) */ /* DHCP specific tags */ #define TAG_OVERLOAD 52 /* Option Overload */ @@ -1034,7 +1037,19 @@ bootpc_adjust_interface(struct bootpc_if return (0); } - printf("Adjusted interface %s\n", ifctx->ireq.ifr_name); + printf("Adjusted interface %s", ifctx->ireq.ifr_name); + + /* Do BOOTP interface options */ + if (ifctx->mtu != 0) { + printf(" (MTU=%d%s)", ifctx->mtu, + (ifctx->mtu > 1514) ? "/JUMBO" : ""); + ifr->ifr_mtu = ifctx->mtu; + error = ifioctl(bootp_so, SIOCSIFMTU, (caddr_t) ifr, td); + if (error != 0) + panic("%s: SIOCSIFMTU, error=%d", __func__, error); + } + printf("\n"); + /* * Do enough of ifconfig(8) so that the chosen interface * can talk to the servers. (just set the address) @@ -1522,6 +1537,11 @@ bootpc_decode_reply(struct nfsv3_diskles p[i] = '\0'; } + p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, + TAG_INTF_MTU); + if (p != NULL) { + ifctx->mtu = be16dec(p); + } printf("\n"); From owner-svn-src-head@freebsd.org Mon Mar 21 14:58:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BBD9AD8680; Mon, 21 Mar 2016 14:58:14 +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 C46A1ABD; Mon, 21 Mar 2016 14:58:13 +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 u2LEwC6a006069; Mon, 21 Mar 2016 14:58:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEwC0C006065; Mon, 21 Mar 2016 14:58:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211458.u2LEwC0C006065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297150 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 14:58:14 -0000 Author: ian Date: Mon Mar 21 14:58:12 2016 New Revision: 297150 URL: https://svnweb.freebsd.org/changeset/base/297150 Log: If the dhcp server delivers an interface-mtu option, parse it and store the value in a new global intf_mtu for use by the application. These changes were inspired by the patch provided by Robert Blayzor in PR 187094, and will allow loader(8) to propagate the value to the kernel along with the other nfs_diskless parms delivered via environment vars. Modified: head/lib/libstand/bootp.c head/lib/libstand/bootp.h head/lib/libstand/globals.c head/lib/libstand/net.h Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/bootp.c Mon Mar 21 14:58:12 2016 (r297150) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -393,6 +394,13 @@ vend_rfc1048(cp, len) val = (const char *)cp; strlcpy(hostname, val, sizeof(hostname)); } + if (tag == TAG_INTF_MTU) { + if ((val = getenv("dhcp.interface-mtu")) != NULL) { + intf_mtu = (u_int)strtoul(val, NULL, 0); + } else { + intf_mtu = be16dec(cp); + } + } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { if(*cp != expected_dhcpmsgtype) Modified: head/lib/libstand/bootp.h ============================================================================== --- head/lib/libstand/bootp.h Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/bootp.h Mon Mar 21 14:58:12 2016 (r297150) @@ -91,6 +91,7 @@ struct bootp { #define TAG_DOMAINNAME ((unsigned char) 15) #define TAG_SWAPSERVER ((unsigned char) 16) #define TAG_ROOTPATH ((unsigned char) 17) +#define TAG_INTF_MTU ((unsigned char) 26) #ifdef SUPPORT_DHCP #define TAG_REQ_ADDR ((unsigned char) 50) Modified: head/lib/libstand/globals.c ============================================================================== --- head/lib/libstand/globals.c Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/globals.c Mon Mar 21 14:58:12 2016 (r297150) @@ -32,5 +32,6 @@ struct in_addr rootip; /* root ip addr struct in_addr swapip; /* swap ip address */ struct in_addr gateip; /* swap ip address */ n_long netmask = 0xffffff00; /* subnet or net mask */ +u_int intf_mtu; /* interface mtu from bootp/dhcp */ int errno; /* our old friend */ Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/net.h Mon Mar 21 14:58:12 2016 (r297150) @@ -83,6 +83,7 @@ extern struct in_addr swapip; extern struct in_addr gateip; extern struct in_addr nameip; extern n_long netmask; +extern u_int intf_mtu; extern int debug; /* defined in the machdep sources */ From owner-svn-src-head@freebsd.org Mon Mar 21 15:06:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C31AD887E; Mon, 21 Mar 2016 15:06:51 +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 B5705FE5; Mon, 21 Mar 2016 15:06:51 +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 u2LF6oHF009053; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LF6ovE009051; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211506.u2LF6ovE009051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 15:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297151 - in head/sys/boot: common i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 15:06:52 -0000 Author: ian Date: Mon Mar 21 15:06:50 2016 New Revision: 297151 URL: https://svnweb.freebsd.org/changeset/base/297151 Log: If the dhcp server provided an interface-mtu option, transcribe the value to the boot.netif.mtu env var, which will be picked up by pre-existing code in nfs_mountroot() and used to configure the interface accordingly. This should bring the same functionality when the bootp/dhcp work is done by loader(8) as r297150 does for the in-kernel BOOTP case. Modified: head/sys/boot/common/dev_net.c head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/common/dev_net.c Mon Mar 21 15:06:50 2016 (r297151) @@ -169,6 +169,12 @@ net_open(struct open_file *f, ...) setenv("boot.netif.gateway", inet_ntoa(gateip), 1); setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } + } netdev_opens++; f->f_devdata = &netdev_sock; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/i386/libi386/pxe.c Mon Mar 21 15:06:50 2016 (r297151) @@ -310,6 +310,11 @@ pxe_open(struct open_file *f, ...) sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); } + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } #ifdef LOADER_NFS_SUPPORT printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); printf("pxe_open: server path: %s\n", rootpath); From owner-svn-src-head@freebsd.org Mon Mar 21 17:49:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA227AD836A; Mon, 21 Mar 2016 17:49:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC61FA4F; Mon, 21 Mar 2016 17:49:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 83311B94B; Mon, 21 Mar 2016 13:49:36 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297069 - head/sys/conf Date: Sun, 20 Mar 2016 12:16:08 -0700 Message-ID: <14182835.aVTA7WFHK4@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603201753.u2KHrV4t010330@repo.freebsd.org> References: <201603201753.u2KHrV4t010330@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 Mar 2016 13:49:36 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 17:49:37 -0000 On Sunday, March 20, 2016 05:53:31 PM Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 20 17:53:30 2016 > New Revision: 297069 > URL: https://svnweb.freebsd.org/changeset/base/297069 > > Log: > Now that urtwn is its own device, and it'll get hotplug loaded by > devd/ifconfig/etc, don't build it in the kernel. > > This should fix the build as well! > > Notice by: dchagin You should fix the entries instead. Not everyone uses modules and we shouldn't prohibit building devices into a custom kernel. This also means the device isn't in NOTES either which is a bug. Looks like you need to fix rtwn as well while you are at it. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 21 18:02:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7F23AD8B62; Mon, 21 Mar 2016 18:02:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF90B12A3; Mon, 21 Mar 2016 18:02:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LI2R03068110; Mon, 21 Mar 2016 18:02:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LI2RiD068103; Mon, 21 Mar 2016 18:02:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603211802.u2LI2RiD068103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 18:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297154 - in head: sbin/kldstat sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsloader targets/pseudo/userland/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 18:02:29 -0000 Author: bdrewery Date: Mon Mar 21 18:02:26 2016 New Revision: 297154 URL: https://svnweb.freebsd.org/changeset/base/297154 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/sys/boot/geli/Makefile.depend (contents, props changed) Modified: head/sbin/kldstat/Makefile.depend head/sys/boot/i386/gptboot/Makefile.depend head/sys/boot/i386/gptzfsboot/Makefile.depend head/sys/boot/i386/libi386/Makefile.depend head/sys/boot/i386/loader/Makefile.depend head/sys/boot/i386/zfsloader/Makefile.depend head/targets/pseudo/userland/misc/Makefile.depend Modified: head/sbin/kldstat/Makefile.depend ============================================================================== --- head/sbin/kldstat/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sbin/kldstat/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -5,6 +5,7 @@ DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ include \ + include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Added: head/sys/boot/geli/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libmd \ + lib/libstand \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/sys/boot/i386/gptboot/Makefile.depend ============================================================================== --- head/sys/boot/i386/gptboot/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/gptboot/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -3,6 +3,10 @@ DIRDEPS = \ include \ + include/xlocale \ + lib/libmd \ + lib/libstand \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/lib \ sys/boot/libstand32 \ Modified: head/sys/boot/i386/gptzfsboot/Makefile.depend ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/gptzfsboot/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -4,6 +4,9 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libmd \ + lib/libstand \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/lib \ sys/boot/libstand32 \ Modified: head/sys/boot/i386/libi386/Makefile.depend ============================================================================== --- head/sys/boot/i386/libi386/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/libi386/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libmd \ .include Modified: head/sys/boot/i386/loader/Makefile.depend ============================================================================== --- head/sys/boot/i386/loader/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/loader/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libstand \ sys/boot/ficl32 \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/btxldr \ sys/boot/i386/btx/lib \ Modified: head/sys/boot/i386/zfsloader/Makefile.depend ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/zfsloader/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libstand \ sys/boot/ficl32 \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/btxldr \ sys/boot/i386/btx/lib \ Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/targets/pseudo/userland/misc/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -32,6 +32,7 @@ DIRDEPS+= \ DIRDEPS.x86sys= \ sys/boot/efi/libefi \ + sys/boot/geli \ sys/boot/i386/boot0 \ sys/boot/i386/boot0sio \ sys/boot/i386/boot2 \ From owner-svn-src-head@freebsd.org Mon Mar 21 18:15:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F31AD8DC8; Mon, 21 Mar 2016 18:15:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 136291AD7; Mon, 21 Mar 2016 18:15:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 253D7B9C5; Mon, 21 Mar 2016 14:15:56 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Date: Mon, 21 Mar 2016 11:12:57 -0700 Message-ID: <1866602.Bp7VFd5f42@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160319032216.GZ1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 Mar 2016 14:15:56 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 18:15:57 -0000 On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > - for (x = 0; x < delay; x += 5) { > > + for (x = 0; x < delay; x++) { > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > APIC_DELSTAT_IDLE) > > return (1); > > - DELAY(5); > > + DELAY(1); > > } > > return (0); > > } > > Ideally we would structure the loop differently. I think it is more > efficient WRT latency to only block execution by ia32_pause(), and > compare the the getbinuptime() results to calculate spent time, on each > loop step. Yes. I've thought about using the TSC directly to do that, but folks are worried about the TSC being unstable due to vcpus in a VM migrating across physical CPUs. DELAY() does seem to DTRT in that case assuming the hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to essentially duplicate DELAY() (really delay_tc()) inline. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 21 18:48:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBA2CAD672E; Mon, 21 Mar 2016 18:48:21 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A576F182; Mon, 21 Mar 2016 18:48:21 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LImKtE080940; Mon, 21 Mar 2016 18:48:20 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LImK1Z080938; Mon, 21 Mar 2016 18:48:20 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201603211848.u2LImK1Z080938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 21 Mar 2016 18:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297155 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 18:48:21 -0000 Author: davidcs Date: Mon Mar 21 18:48:20 2016 New Revision: 297155 URL: https://svnweb.freebsd.org/changeset/base/297155 Log: Modifications to achieve a common source base from FreeBSD7.x thru 10.x MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Mar 21 18:02:26 2016 (r297154) +++ head/sys/dev/bxe/bxe.c Mon Mar 21 18:48:20 2016 (r297155) @@ -3063,7 +3063,7 @@ bxe_tpa_stop(struct bxe_softc * #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + BXE_SET_FLOWID(m); #endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); @@ -3352,7 +3352,7 @@ bxe_rxeof(struct bxe_softc *sc, #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + BXE_SET_FLOWID(m); #endif next_rx: @@ -4829,6 +4829,8 @@ bxe_dump_mbuf(struct bxe_softc *sc, } while (m) { + +#if __FreeBSD_version >= 1000000 BLOGD(sc, DBG_MBUF, "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", i, m, m->m_len, m->m_flags, M_FLAG_BITS, m->m_data); @@ -4839,6 +4841,26 @@ bxe_dump_mbuf(struct bxe_softc *sc, i, m->m_pkthdr.len, m->m_flags, M_FLAG_BITS, (int)m->m_pkthdr.csum_flags, CSUM_BITS); } +#else + BLOGD(sc, DBG_MBUF, + "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", + i, m, m->m_len, m->m_flags, + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY", m->m_data); + + if (m->m_flags & M_PKTHDR) { + BLOGD(sc, DBG_MBUF, + "%02d: - m_pkthdr: tot_len=%d flags=0x%b csum_flags=%b\n", + i, m->m_pkthdr.len, m->m_flags, + "\20\12M_BCAST\13M_MCAST\14M_FRAG" + "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" + "\22M_PROMISC\23M_NOFREE", + (int)m->m_pkthdr.csum_flags, + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" + "\12CSUM_IP_VALID\13CSUM_DATA_VALID" + "\14CSUM_PSEUDO_HDR"); + } +#endif /* #if __FreeBSD_version >= 1000000 */ if (m->m_flags & M_EXT) { switch (m->m_ext.ext_type) { @@ -5222,7 +5244,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st sc = fp->sc; +#if __FreeBSD_version >= 800000 M_ASSERTPKTHDR(*m_head); +#endif /* #if __FreeBSD_version >= 800000 */ m0 = *m_head; rc = defragged = nbds = ovlan = vlan_off = total_pkt_size = 0; @@ -5741,7 +5765,7 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - rc = drbr_enqueue_drv(ifp, tx_br, m); + rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } @@ -5756,7 +5780,7 @@ bxe_tx_mq_start_locked(struct bxe_softc next = drbr_dequeue_drv(ifp, tx_br); } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { /* have both new and pending work, maintain packet order */ - rc = drbr_enqueue_drv(ifp, tx_br, m); + rc = drbr_enqueue(ifp, tx_br, m); if (rc != 0) { fp->eth_q_stats.tx_soft_errors++; goto bxe_tx_mq_start_locked_exit; @@ -5785,7 +5809,7 @@ bxe_tx_mq_start_locked(struct bxe_softc /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); /* XXX this may reorder the frame */ - rc = drbr_enqueue_drv(ifp, tx_br, next); + rc = drbr_enqueue(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; } @@ -5837,7 +5861,8 @@ bxe_tx_mq_start(struct ifnet *ifp, fp_index = 0; /* default is the first queue */ /* check if flowid is set */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + + if (BXE_VALID_FLOWID(m)) fp_index = (m->m_pkthdr.flowid % sc->num_queues); fp = &sc->fp[fp_index]; @@ -5846,7 +5871,7 @@ bxe_tx_mq_start(struct ifnet *ifp, rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); BXE_FP_TX_UNLOCK(fp); } else - rc = drbr_enqueue_drv(ifp, fp->tx_br, m); + rc = drbr_enqueue(ifp, fp->tx_br, m); return (rc); } @@ -15677,18 +15702,11 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RD, BXE_DRIVER_VERSION, 0, "version"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", - CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, - "bootcode version"); - snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d", BCM_5710_FW_MAJOR_VERSION, BCM_5710_FW_MINOR_VERSION, BCM_5710_FW_REVISION_VERSION, BCM_5710_FW_ENGINEERING_VERSION); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", - CTLFLAG_RD, sc->fw_ver_str, 0, - "firmware version"); snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s", ((sc->devinfo.mf_info.mf_mode == SINGLE_FUNCTION) ? "Single" : @@ -15696,32 +15714,58 @@ bxe_add_sysctls(struct bxe_softc *sc) (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_SI) ? "MF-SI" : (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" : "Unknown")); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", - CTLFLAG_RD, sc->mf_mode_str, 0, - "multifunction mode"); - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics", CTLFLAG_RD, &sc->devinfo.mf_info.vnics_per_port, 0, "multifunction vnics per port"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", - CTLFLAG_RD, sc->mac_addr_str, 0, - "mac address"); - snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d", ((sc->devinfo.pcie_link_speed == 1) ? "2.5GT/s" : (sc->devinfo.pcie_link_speed == 2) ? "5.0GT/s" : (sc->devinfo.pcie_link_speed == 4) ? "8.0GT/s" : "???GT/s"), sc->devinfo.pcie_link_width); + + sc->debug = bxe_debug; + +#if __FreeBSD_version >= 900000 + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", + CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, + "bootcode version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", + CTLFLAG_RD, sc->fw_ver_str, 0, + "firmware version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", + CTLFLAG_RD, sc->mf_mode_str, 0, + "multifunction mode"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", + CTLFLAG_RD, sc->mac_addr_str, 0, + "mac address"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", CTLFLAG_RD, sc->pci_link_str, 0, "pci link status"); - - sc->debug = bxe_debug; SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug", CTLFLAG_RW, &sc->debug, "debug logging mode"); +#else + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", + CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0, + "bootcode version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", + CTLFLAG_RD, &sc->fw_ver_str, 0, + "firmware version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", + CTLFLAG_RD, &sc->mf_mode_str, 0, + "multifunction mode"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", + CTLFLAG_RD, &sc->mac_addr_str, 0, + "mac address"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", + CTLFLAG_RD, &sc->pci_link_str, 0, + "pci link status"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug", + CTLFLAG_RW, &sc->debug, 0, + "debug logging mode"); +#endif /* #if __FreeBSD_version >= 900000 */ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", CTLTYPE_UINT | CTLFLAG_RW, sc, 0, Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Mon Mar 21 18:02:26 2016 (r297154) +++ head/sys/dev/bxe/bxe.h Mon Mar 21 18:48:20 2016 (r297155) @@ -2271,6 +2271,17 @@ void bxe_dump_mem(struct bxe_softc *sc, void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); + +#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 1000000 +#define BXE_SET_FLOWID(m) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE) +#define BXE_VALID_FLOWID(m) (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) +#else +#define BXE_VALID_FLOWID(m) ((m->m_flags & M_FLOWID) != 0) +#define BXE_SET_FLOWID(m) m->m_flags |= M_FLOWID +#endif +#endif /* #if __FreeBSD_version >= 800000 */ + /***********/ /* INLINES */ /***********/ From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 677C4AD7EBC; Mon, 21 Mar 2016 20:29:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 378CC34F; Mon, 21 Mar 2016 20:29:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTS4O010975; Mon, 21 Mar 2016 20:29:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTSJp010970; Mon, 21 Mar 2016 20:29:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTSJp010970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297156 - in head: share/man/man4 sys/dev/filemon sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:29 -0000 Author: bdrewery Date: Mon Mar 21 20:29:27 2016 New Revision: 297156 URL: https://svnweb.freebsd.org/changeset/base/297156 Log: Track filemon usage via a proc.p_filemon pointer rather than its own lists. - proc.p_filemon is added which is protected by PROC_LOCK. This improves performance and avoids double-fork issues, taking allproc_lock while in syscalls, and walking the process tree in syscalls. A particular proc.p_filemon can only be changed to NULL or another filemon, or the filemon inherited, while the filemon->lock is held. - Filemon are reference counted. On the last reference the log will be closed. - When closing the devfs file handle, the filemon will be detached from all processes and inheritance prevented. - Disallow attaching to a process already being traced since filemon is typically intended to be used on children only. This is allowed for curproc as bmake relies on this behavior for rare cases when combining .MAKE with .META. - Detach any previously tracked process on ioctl(FILEMON_SET_PID). - Handle error from devfs_set_cdevpriv() in filemon_open(). - The global filemon lock and lists are removed. - A free list is no longer kept. Previously this list was forever-expanding and never garbage cleaned. - No longer loses track of double-forks. If the process holding the filemon handle closes it will close the log rather than wait on a daemonized process, but it will log all activity until it closes its handle. The filemon will be removed from the process and not inherited. - A separate process count is kept only as an optimization for forced detachment to avoid taking allproc_lock and walking the entire process tree. - struct filemon access is protected by sx(9) filemon->lock as it was before. - Add more comments and KASSERTS. MFC after: 2 weeks Reviewed by: kib, mjg, markj (all on previous versions) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5520 Deleted: head/sys/dev/filemon/filemon_lock.c Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c head/sys/sys/param.h head/sys/sys/proc.h Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 18:48:20 2016 (r297155) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:27 2016 (r297156) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2016 +.Dd March 21, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -116,6 +116,10 @@ Each takes a single argument. Write the internal tracing buffer to the supplied open file descriptor. .It Dv FILEMON_SET_PID Child process ID to trace. +This should normally be done under the control of a parent in the child after +.Xr fork 2 +but before anything else. +See the example below. .El .Sh RETURN VALUES .\" .Rv -std ioctl @@ -138,6 +142,20 @@ The .Nm handle is already associated with a file descriptor. .El +.Pp +The +.Fn ioctl +system call +with +.Dv FILEMON_SET_PID +will fail if: +.Bl -tag -width Er +.It Bq Er ESRCH +No process having the specified process ID exists. +.It Bq Er EBUSY +The process ID specified is already being traced and was not the current +process. +.El .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon @@ -199,14 +217,5 @@ A device appeared in .Fx 9.1 . .Sh BUGS -Loading -.Nm -may reduce system performance for the noted syscalls. -.Pp -Only children of the set process are logged. -Processes can escape being traced by double forking. -This is not seen as a problem as the intended use is build monitoring, which -does not make sense to have daemons for. -.Pp Unloading the module may panic the system, thus requires using .Ic kldunload -f . Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/dev/filemon/filemon.c Mon Mar 21 20:29:27 2016 (r297156) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. - * Copyright (c) 2015, EMC Corp. + * Copyright (c) 2015-2016, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -80,23 +79,126 @@ static struct cdevsw filemon_cdevsw = { MALLOC_DECLARE(M_FILEMON); MALLOC_DEFINE(M_FILEMON, "filemon", "File access monitor"); +/* + * The filemon->lock protects several things currently: + * - fname1/fname2/msgbufr are pre-allocated and used per syscall + * for logging and copyins rather than stack variables. + * - Serializing the filemon's log output. + * - Preventing inheritance or removal of the filemon into proc.p_filemon. + */ struct filemon { - TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ - struct sx lock; /* Lock mutex for this filemon. */ + struct sx lock; /* Lock for this filemon. */ struct file *fp; /* Output file pointer. */ - struct proc *p; /* The process being monitored. */ char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ + u_int refcnt; /* Pointer reference count. */ + u_int proccnt; /* Process count. */ }; -static TAILQ_HEAD(, filemon) filemons_inuse = TAILQ_HEAD_INITIALIZER(filemons_inuse); -static TAILQ_HEAD(, filemon) filemons_free = TAILQ_HEAD_INITIALIZER(filemons_free); -static struct sx access_lock; - static struct cdev *filemon_dev; +static void filemon_output(struct filemon *filemon, char *msg, size_t len); + +static __inline struct filemon * +filemon_acquire(struct filemon *filemon) +{ + + if (filemon != NULL) + refcount_acquire(&filemon->refcnt); + return (filemon); +} + +/* + * Release a reference and on the last one write the footer and free the + * filemon. + */ +static void +filemon_release(struct filemon *filemon) +{ + size_t len; + struct timeval now; + + if (refcount_release(&filemon->refcnt) == 0) + return; + /* + * There are valid cases of releasing while locked, such as in + * filemon_untrack_processes, but none which are done where there + * is not at least 1 reference remaining. + */ + sx_assert(&filemon->lock, SA_UNLOCKED); + + if (filemon->fp != NULL) { + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), + "# Stop %ju.%06ju\n# Bye bye\n", + (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); + + filemon_output(filemon, filemon->msgbufr, len); + fdrop(filemon->fp, curthread); + } + + sx_destroy(&filemon->lock); + free(filemon, M_FILEMON); +} + +/* + * Acquire the proc's p_filemon reference and lock the filemon. + * The proc's p_filemon may not match this filemon on return. + */ +static struct filemon * +filemon_proc_get(struct proc *p) +{ + struct filemon *filemon; + + PROC_LOCK(p); + filemon = filemon_acquire(p->p_filemon); + PROC_UNLOCK(p); + + if (filemon == NULL) + return (NULL); + /* + * The p->p_filemon may have changed by now. That case is handled + * by the exit and fork hooks and filemon_attach_proc specially. + */ + sx_xlock(&filemon->lock); + return (filemon); +} + +/* Remove and release the filemon on the given process. */ +static void +filemon_proc_drop(struct proc *p) +{ + struct filemon *filemon; + + KASSERT(p->p_filemon != NULL, ("%s: proc %p NULL p_filemon", + __func__, p)); + sx_assert(&p->p_filemon->lock, SA_XLOCKED); + PROC_LOCK(p); + filemon = p->p_filemon; + p->p_filemon = NULL; + --filemon->proccnt; + PROC_UNLOCK(p); + /* + * This should not be the last reference yet. filemon_release() + * cannot be called with filemon locked, which the caller expects + * will stay locked. + */ + KASSERT(filemon->refcnt > 1, ("%s: proc %p dropping filemon %p " + "with last reference", __func__, p, filemon)); + filemon_release(filemon); +} + +/* Unlock and release the filemon. */ +static __inline void +filemon_drop(struct filemon *filemon) +{ + + sx_xunlock(&filemon->lock); + filemon_release(filemon); +} -#include "filemon_lock.c" #include "filemon_wrapper.c" static void @@ -115,35 +217,120 @@ filemon_comment(struct filemon *filemon) filemon_output(filemon, filemon->msgbufr, len); } +/* + * Invalidate the passed filemon in all processes. + */ static void -filemon_dtr(void *data) +filemon_untrack_processes(struct filemon *filemon) { - struct filemon *filemon = data; + struct proc *p; - if (filemon != NULL) { - struct file *fp; + sx_assert(&filemon->lock, SA_XLOCKED); - /* Follow same locking order as filemon_pid_check. */ - filemon_lock_write(); - sx_xlock(&filemon->lock); + /* Avoid allproc loop if there is no need. */ + if (filemon->proccnt == 0) + return; + + /* + * Processes in this list won't go away while here since + * filemon_event_process_exit() will lock on filemon->lock + * which we hold. + */ + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + /* + * No PROC_LOCK is needed to compare here since it is + * guaranteed to not change since we have its filemon + * locked. Everything that changes this p_filemon will + * be locked on it. + */ + if (p->p_filemon == filemon) + filemon_proc_drop(p); + } + sx_sunlock(&allproc_lock); - /* Remove from the in-use list. */ - TAILQ_REMOVE(&filemons_inuse, filemon, link); + /* + * It's possible some references were acquired but will be + * dropped shortly as they are restricted from being + * inherited. There is at least the reference in cdevpriv remaining. + */ + KASSERT(filemon->refcnt > 0, ("%s: filemon %p should have " + "references still.", __func__, filemon)); + KASSERT(filemon->proccnt == 0, ("%s: filemon %p should not have " + "attached procs still.", __func__, filemon)); +} - fp = filemon->fp; - filemon->fp = NULL; - filemon->p = NULL; - /* Add to the free list. */ - TAILQ_INSERT_TAIL(&filemons_free, filemon, link); +/* The devfs file is being closed. Untrace all processes. */ +static void +filemon_dtr(void *data) +{ + struct filemon *filemon = data; - /* Give up write access. */ - sx_xunlock(&filemon->lock); - filemon_unlock_write(); + if (filemon == NULL) + return; + + sx_xlock(&filemon->lock); + /* + * Detach the filemon. The actual closing of it may not + * occur until syscalls in other threads with references complete. + * The filemon cannot be inherited after this though. + */ + filemon_untrack_processes(filemon); + filemon_drop(filemon); +} + +/* Attach the filemon to the process. */ +static int +filemon_attach_proc(struct filemon *filemon, struct proc *p) +{ + struct filemon *filemon2; - if (fp != NULL) - fdrop(fp, curthread); + sx_assert(&filemon->lock, SA_XLOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + KASSERT((p->p_flag & P_WEXIT) == 0, + ("%s: filemon %p attaching to exiting process %p", + __func__, filemon, p)); + + if (p->p_filemon == filemon) + return (0); + /* + * Don't allow truncating other process traces. It is + * not really intended to trace procs other than curproc + * anyhow. + */ + if (p->p_filemon != NULL && p != curproc) + return (EBUSY); + /* + * Historic behavior of filemon has been to let a child initiate + * tracing on itself and cease existing tracing. Bmake + * .META + .MAKE relies on this. It is only relevant for attaching to + * curproc. + */ + while (p->p_filemon != NULL) { + PROC_UNLOCK(p); + sx_xunlock(&filemon->lock); + while ((filemon2 = filemon_proc_get(p)) != NULL) { + /* It may have changed. */ + if (p->p_filemon == filemon2) + filemon_proc_drop(p); + filemon_drop(filemon2); + } + sx_xlock(&filemon->lock); + PROC_LOCK(p); + /* + * It may have been attached to, though unlikely. + * Try again if needed. + */ } + + KASSERT(p->p_filemon == NULL, + ("%s: proc %p didn't detach filemon %p", __func__, p, + p->p_filemon)); + p->p_filemon = filemon_acquire(filemon); + ++filemon->proccnt; + + return (0); } static int @@ -178,10 +365,16 @@ filemon_ioctl(struct cdev *dev, u_long c /* Set the monitored process ID. */ case FILEMON_SET_PID: + /* Invalidate any existing processes already set. */ + filemon_untrack_processes(filemon); + error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error == 0) { - filemon->p = p; + KASSERT(p->p_filemon != filemon, + ("%s: proc %p didn't untrack filemon %p", + __func__, p, filemon)); + error = filemon_attach_proc(filemon, p); PROC_UNLOCK(p); } break; @@ -199,35 +392,19 @@ static int filemon_open(struct cdev *dev, int oflags __unused, int devtype __unused, struct thread *td __unused) { + int error; struct filemon *filemon; - /* Get exclusive write access. */ - filemon_lock_write(); - - if ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) - TAILQ_REMOVE(&filemons_free, filemon, link); + filemon = malloc(sizeof(*filemon), M_FILEMON, + M_WAITOK | M_ZERO); + sx_init(&filemon->lock, "filemon"); + refcount_init(&filemon->refcnt, 1); + + error = devfs_set_cdevpriv(filemon, filemon_dtr); + if (error != 0) + filemon_release(filemon); - /* Give up write access. */ - filemon_unlock_write(); - - if (filemon == NULL) { - filemon = malloc(sizeof(struct filemon), M_FILEMON, - M_WAITOK | M_ZERO); - sx_init(&filemon->lock, "filemon"); - } - - devfs_set_cdevpriv(filemon, filemon_dtr); - - /* Get exclusive write access. */ - filemon_lock_write(); - - /* Add to the in-use list. */ - TAILQ_INSERT_TAIL(&filemons_inuse, filemon, link); - - /* Give up write access. */ - filemon_unlock_write(); - - return (0); + return (error); } static int @@ -241,7 +418,6 @@ filemon_close(struct cdev *dev __unused, static void filemon_load(void *dummy __unused) { - sx_init(&access_lock, "filemons_inuse"); /* Install the syscall wrappers. */ filemon_wrapper_install(); @@ -253,38 +429,11 @@ filemon_load(void *dummy __unused) static int filemon_unload(void) { - struct filemon *filemon; - int error = 0; - /* Get exclusive write access. */ - filemon_lock_write(); + destroy_dev(filemon_dev); + filemon_wrapper_deinstall(); - if (TAILQ_FIRST(&filemons_inuse) != NULL) - error = EBUSY; - else { - destroy_dev(filemon_dev); - - /* Deinstall the syscall wrappers. */ - filemon_wrapper_deinstall(); - } - - /* Give up write access. */ - filemon_unlock_write(); - - if (error == 0) { - /* free() filemon structs free list. */ - filemon_lock_write(); - while ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) { - TAILQ_REMOVE(&filemons_free, filemon, link); - sx_destroy(&filemon->lock); - free(filemon, M_FILEMON); - } - filemon_unlock_write(); - - sx_destroy(&access_lock); - } - - return (error); + return (0); } static int Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:27 2016 (r297156) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. - * Copyright (c) 2015, EMC Corp. + * Copyright (c) 2015-2016, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,33 +65,6 @@ filemon_output(struct filemon *filemon, fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); } -static struct filemon * -filemon_pid_check(struct proc *p) -{ - struct filemon *filemon; - - filemon_lock_read(); - if (TAILQ_EMPTY(&filemons_inuse)) { - filemon_unlock_read(); - return (NULL); - } - sx_slock(&proctree_lock); - while (p->p_pid != 0) { - TAILQ_FOREACH(filemon, &filemons_inuse, link) { - if (p == filemon->p) { - sx_sunlock(&proctree_lock); - sx_xlock(&filemon->lock); - filemon_unlock_read(); - return (filemon); - } - } - p = proc_realparent(p); - } - sx_sunlock(&proctree_lock); - filemon_unlock_read(); - return (NULL); -} - static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { @@ -101,7 +74,7 @@ filemon_wrapper_chdir(struct thread *td, struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -111,7 +84,7 @@ filemon_wrapper_chdir(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -126,7 +99,7 @@ filemon_event_process_exec(void *arg __u char *fullpath, *freepath; size_t len; - if ((filemon = filemon_pid_check(p)) != NULL) { + if ((filemon = filemon_proc_get(p)) != NULL) { fullpath = ""; freepath = NULL; @@ -139,7 +112,7 @@ filemon_event_process_exec(void *arg __u filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); free(freepath, M_TEMP); } @@ -154,7 +127,7 @@ filemon_wrapper_open(struct thread *td, struct filemon *filemon; if ((ret = sys_open(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -177,7 +150,7 @@ filemon_wrapper_open(struct thread *td, curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -193,7 +166,7 @@ filemon_wrapper_openat(struct thread *td struct filemon *filemon; if ((ret = sys_openat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -229,7 +202,7 @@ filemon_wrapper_openat(struct thread *td curproc->p_pid, filemon->fname2, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -245,7 +218,7 @@ filemon_wrapper_rename(struct thread *td struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->from, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->to, filemon->fname2, @@ -257,7 +230,7 @@ filemon_wrapper_rename(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -273,7 +246,7 @@ filemon_wrapper_link(struct thread *td, struct filemon *filemon; if ((ret = sys_link(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -285,7 +258,7 @@ filemon_wrapper_link(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -301,7 +274,7 @@ filemon_wrapper_symlink(struct thread *t struct filemon *filemon; if ((ret = sys_symlink(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -313,7 +286,7 @@ filemon_wrapper_symlink(struct thread *t filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -329,7 +302,7 @@ filemon_wrapper_linkat(struct thread *td struct filemon *filemon; if ((ret = sys_linkat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path1, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->path2, filemon->fname2, @@ -341,7 +314,7 @@ filemon_wrapper_linkat(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -357,7 +330,7 @@ filemon_wrapper_stat(struct thread *td, struct filemon *filemon; if ((ret = sys_stat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -367,7 +340,7 @@ filemon_wrapper_stat(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -385,7 +358,7 @@ filemon_wrapper_freebsd32_stat(struct th struct filemon *filemon; if ((ret = freebsd32_stat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -395,7 +368,7 @@ filemon_wrapper_freebsd32_stat(struct th filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -408,29 +381,25 @@ filemon_event_process_exit(void *arg __u { size_t len; struct filemon *filemon; - struct timeval now; - /* Get timestamp before locking. */ - getmicrotime(&now); - - if ((filemon = filemon_pid_check(p)) != NULL) { + if ((filemon = filemon_proc_get(p)) != NULL) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "X %d %d %d\n", p->p_pid, p->p_xexit, p->p_xsig); filemon_output(filemon, filemon->msgbufr, len); - /* Check if the monitored process is about to exit. */ - if (filemon->p == p) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), - "# Stop %ju.%06ju\n# Bye bye\n", - (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); - - filemon_output(filemon, filemon->msgbufr, len); - filemon->p = NULL; - } + /* + * filemon_untrack_processes() may have dropped this p_filemon + * already while in filemon_proc_get() before acquiring the + * filemon lock. + */ + KASSERT(p->p_filemon == NULL || p->p_filemon == filemon, + ("%s: p %p was attached while exiting, expected " + "filemon %p or NULL", __func__, p, filemon)); + if (p->p_filemon == filemon) + filemon_proc_drop(p); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -443,7 +412,7 @@ filemon_wrapper_unlink(struct thread *td struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -453,7 +422,7 @@ filemon_wrapper_unlink(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -467,14 +436,34 @@ filemon_event_process_fork(void *arg __u size_t len; struct filemon *filemon; - if ((filemon = filemon_pid_check(p1)) != NULL) { + if ((filemon = filemon_proc_get(p1)) != NULL) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %d\n", p1->p_pid, p2->p_pid); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + /* + * filemon_untrack_processes() or + * filemon_ioctl(FILEMON_SET_PID) may have changed the parent's + * p_filemon while in filemon_proc_get() before acquiring the + * filemon lock. Only inherit if the parent is still traced by + * this filemon. + */ + if (p1->p_filemon == filemon) { + PROC_LOCK(p2); + /* + * It may have been attached to already by a new + * filemon. + */ + if (p2->p_filemon == NULL) { + p2->p_filemon = filemon_acquire(filemon); + ++filemon->proccnt; + } + PROC_UNLOCK(p2); + } + + filemon_drop(filemon); } } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/sys/param.h Mon Mar 21 20:29:27 2016 (r297156) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100103 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100104 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/sys/proc.h Mon Mar 21 20:29:27 2016 (r297156) @@ -162,6 +162,7 @@ struct pargs { */ struct cpuset; struct filecaps; +struct filemon; struct kaioinfo; struct kaudit_record; struct kdtrace_proc; @@ -580,6 +581,7 @@ struct proc { struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ u_int p_treeflag; /* (e) P_TREE flags */ int p_pendingexits; /* (c) Count of pending thread exits. */ + struct filemon *p_filemon; /* (c) filemon-specific data. */ /* End area that is zeroed on creation. */ #define p_endzero p_magic From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ADAEAD7EE6; Mon, 21 Mar 2016 20:29:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAFD06B8; Mon, 21 Mar 2016 20:29:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTerY011024; Mon, 21 Mar 2016 20:29:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTeXI011022; Mon, 21 Mar 2016 20:29:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTeXI011022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297157 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:43 -0000 Author: bdrewery Date: Mon Mar 21 20:29:39 2016 New Revision: 297157 URL: https://svnweb.freebsd.org/changeset/base/297157 Log: Stop tracking stat(2). None of lstat(2), fstat(2), fstatat(2) were tracked either. The other filemon implementations also do not track stat(2), nor does bmake utilize it. The act of opening a file for read should be enough to decide that a file is a dependency. There could be rare cases where just having a file would cause a dependency but it is unlikely. MFC after: 2 weeks Also noted by: sjg Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 20:29:27 2016 (r297156) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:39 2016 (r297157) @@ -83,8 +83,6 @@ System calls are denoted using the follo .It Ql R .Xr open 2 for read -.It Ql S -.Xr stat 2 .It Ql W .Xr open 2 for write Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:27 2016 (r297156) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:39 2016 (r297157) @@ -321,61 +321,6 @@ filemon_wrapper_linkat(struct thread *td return (ret); } -static int -filemon_wrapper_stat(struct thread *td, struct stat_args *uap) -{ - int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = sys_stat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "S %d %s\n", - curproc->p_pid, filemon->fname1); - - filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); - } - } - - return (ret); -} - -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) -static int -filemon_wrapper_freebsd32_stat(struct thread *td, - struct freebsd32_stat_args *uap) -{ - int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = freebsd32_stat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "S %d %s\n", - curproc->p_pid, filemon->fname1); - - filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); - } - } - - return (ret); -} -#endif - static void filemon_event_process_exit(void *arg __unused, struct proc *p) { @@ -480,7 +425,6 @@ filemon_wrapper_install(void) sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[SYS_stat].sy_call = (sy_call_t *) filemon_wrapper_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; @@ -493,7 +437,6 @@ filemon_wrapper_install(void) sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; @@ -521,7 +464,6 @@ filemon_wrapper_deinstall(void) sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[SYS_stat].sy_call = (sy_call_t *)sys_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; @@ -534,7 +476,6 @@ filemon_wrapper_deinstall(void) sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *)freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64B4FAD7EEC; Mon, 21 Mar 2016 20:29:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC8B6BB; Mon, 21 Mar 2016 20:29:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTh1m011070; Mon, 21 Mar 2016 20:29:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTh6T011069; Mon, 21 Mar 2016 20:29:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTh6T011069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297158 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:44 -0000 Author: bdrewery Date: Mon Mar 21 20:29:43 2016 New Revision: 297158 URL: https://svnweb.freebsd.org/changeset/base/297158 Log: Consolidate open(2) and openat(2) code. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:39 2016 (r297157) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:43 2016 (r297158) @@ -118,93 +118,70 @@ filemon_event_process_exec(void *arg __u } } -static int -filemon_wrapper_open(struct thread *td, struct open_args *uap) +static void +_filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { - int ret; size_t done; size_t len; struct filemon *filemon; - if ((ret = sys_open(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - if (uap->flags & O_RDWR) { - /* - * We'll get the W record below, but need - * to also output an R to distingish from - * O_WRONLY. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s\n", - curproc->p_pid, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } - + if ((filemon = filemon_proc_get(curproc)) != NULL) { + copyinstr(upath, filemon->fname1, + sizeof(filemon->fname1), &done); + filemon->fname2[0] = '\0'; + if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { + /* + * rats - we cannot do too much about this. + * the trace should show a dir we read + * recently.. output an A record as a clue + * until we can do better. + */ len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s\n", - (uap->flags & O_ACCMODE) ? 'W':'R', + sizeof(filemon->msgbufr), "A %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); } - } + if (flags & O_RDWR) { + /* + * We'll get the W record below, but need + * to also output an R to distinguish from + * O_WRONLY. + */ + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "R %d %s%s\n", + curproc->p_pid, filemon->fname2, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + } - return (ret); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "%c %d %s%s\n", + (flags & O_ACCMODE) ? 'W':'R', + curproc->p_pid, filemon->fname2, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + + filemon_drop(filemon); + } } static int -filemon_wrapper_openat(struct thread *td, struct openat_args *uap) +filemon_wrapper_open(struct thread *td, struct open_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - if ((ret = sys_openat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - filemon->fname2[0] = '\0'; - if (filemon->fname1[0] != '/' && uap->fd != AT_FDCWD) { - /* - * rats - we cannot do too much about this. - * the trace should show a dir we read - * recently.. output an A record as a clue - * until we can do better. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "A %d %s\n", - curproc->p_pid, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } - if (uap->flag & O_RDWR) { - /* - * We'll get the W record below, but need - * to also output an R to distingish from - * O_WRONLY. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s%s\n", - curproc->p_pid, filemon->fname2, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } + if ((ret = sys_open(td, uap)) == 0) + _filemon_wrapper_openat(td, uap->path, uap->flags, AT_FDCWD); + return (ret); +} - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s%s\n", - (uap->flag & O_ACCMODE) ? 'W':'R', - curproc->p_pid, filemon->fname2, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); +static int +filemon_wrapper_openat(struct thread *td, struct openat_args *uap) +{ + int ret; - filemon_drop(filemon); - } - } + if ((ret = sys_openat(td, uap)) == 0) + _filemon_wrapper_openat(td, uap->path, uap->flag, uap->fd); return (ret); } From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B92CAD7F10; Mon, 21 Mar 2016 20:29:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE767BE; Mon, 21 Mar 2016 20:29:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTkrV011117; Mon, 21 Mar 2016 20:29:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTk1H011116; Mon, 21 Mar 2016 20:29:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTk1H011116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297159 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:48 -0000 Author: bdrewery Date: Mon Mar 21 20:29:46 2016 New Revision: 297159 URL: https://svnweb.freebsd.org/changeset/base/297159 Log: Use curthread for vn_fullpath. No functional change. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:43 2016 (r297158) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:46 2016 (r297159) @@ -103,8 +103,7 @@ filemon_event_process_exec(void *arg __u fullpath = ""; freepath = NULL; - vn_fullpath(FIRST_THREAD_IN_PROC(p), imgp->vp, &fullpath, - &freepath); + vn_fullpath(curthread, imgp->vp, &fullpath, &freepath); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B053AD7F3D; Mon, 21 Mar 2016 20:29:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE25B8AC; Mon, 21 Mar 2016 20:29:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTnaq011162; Mon, 21 Mar 2016 20:29:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTnCH011161; Mon, 21 Mar 2016 20:29:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTnCH011161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297160 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:51 -0000 Author: bdrewery Date: Mon Mar 21 20:29:49 2016 New Revision: 297160 URL: https://svnweb.freebsd.org/changeset/base/297160 Log: Document openat(2) behavior. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 20:29:46 2016 (r297159) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:49 2016 (r297160) @@ -64,6 +64,9 @@ to handle incremental builds more smartl System calls are denoted using the following single letters: .Pp .Bl -tag -width indent -compact +.It Ql A +.Xr openat 2 . +The next log entry may be lacking an absolute path or be inaccurate. .It Ql C .Xr chdir 2 .It Ql D @@ -82,9 +85,13 @@ System calls are denoted using the follo .Xr rename 2 .It Ql R .Xr open 2 +or +.Xr openat 2 for read .It Ql W .Xr open 2 +or +.Xr openat 2 for write .It Ql X .Xr _exit 2 From owner-svn-src-head@freebsd.org Mon Mar 21 20:29:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62249AD7F65; Mon, 21 Mar 2016 20:29:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23CE09B3; Mon, 21 Mar 2016 20:29:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKTrZO011209; Mon, 21 Mar 2016 20:29:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTrEQ011208; Mon, 21 Mar 2016 20:29:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTrEQ011208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297161 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:29:54 -0000 Author: bdrewery Date: Mon Mar 21 20:29:53 2016 New Revision: 297161 URL: https://svnweb.freebsd.org/changeset/base/297161 Log: Attempt to use the namecache for openat(2) path resolution. This finishes the work done in D2810. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:49 2016 (r297160) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:53 2016 (r297161) @@ -29,8 +29,9 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include #include #include @@ -122,24 +123,42 @@ _filemon_wrapper_openat(struct thread *t { size_t done; size_t len; + struct file *fp; struct filemon *filemon; + char *atpath, *freepath; + cap_rights_t rights; if ((filemon = filemon_proc_get(curproc)) != NULL) { + atpath = ""; + freepath = NULL; + fp = NULL; + copyinstr(upath, filemon->fname1, sizeof(filemon->fname1), &done); - filemon->fname2[0] = '\0'; if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* * rats - we cannot do too much about this. * the trace should show a dir we read * recently.. output an A record as a clue * until we can do better. + * XXX: This may be able to come out with + * the namecache lookup now. */ len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "A %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); + /* + * Try to resolve the path from the vnode using the + * namecache. It may be inaccurate, but better + * than nothing. + */ + if (getvnode(td, fd, + cap_rights_init(&rights, CAP_LOOKUP), &fp) == 0) { + vn_fullpath(td, fp->f_vnode, &atpath, + &freepath); + } } if (flags & O_RDWR) { /* @@ -148,18 +167,23 @@ _filemon_wrapper_openat(struct thread *t * O_WRONLY. */ len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s%s\n", - curproc->p_pid, filemon->fname2, filemon->fname1); + sizeof(filemon->msgbufr), "R %d %s%s%s\n", + curproc->p_pid, atpath, + atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); } len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s%s\n", + sizeof(filemon->msgbufr), "%c %d %s%s%s\n", (flags & O_ACCMODE) ? 'W':'R', - curproc->p_pid, filemon->fname2, filemon->fname1); + curproc->p_pid, atpath, + atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); filemon_drop(filemon); + if (fp != NULL) + fdrop(fp, td); + free(freepath, M_TEMP); } } From owner-svn-src-head@freebsd.org Mon Mar 21 20:35:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B5FDAD81C5; Mon, 21 Mar 2016 20:35:36 +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 1753E223; Mon, 21 Mar 2016 20:35:35 +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 u2LKZSjx023260 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Mar 2016 13:35:29 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2LKZSw9023259; Mon, 21 Mar 2016 13:35:28 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 21 Mar 2016 13:35:28 -0700 From: Gleb Smirnoff To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297136 - head/sys/conf Message-ID: <20160321203528.GC1254@FreeBSD.org> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603210551.u2L5pL1X037311@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:35:36 -0000 On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Mon Mar 21 05:51:21 2016 A> New Revision: 297136 A> URL: https://svnweb.freebsd.org/changeset/base/297136 A> A> Log: A> Remove from NOTES - it's built as a module now. You are doing wrong. A driver must be buildable as a module and statically as well. It is legitimate to remove from GENERIC, but not from NOTES. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Mar 21 20:39:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B725AD82A0; Mon, 21 Mar 2016 20:39:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F142F6E8; Mon, 21 Mar 2016 20:39:46 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKdkKC014284; Mon, 21 Mar 2016 20:39:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKdkh6014283; Mon, 21 Mar 2016 20:39:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212039.u2LKdkh6014283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 20:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297162 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:39:47 -0000 Author: avos Date: Mon Mar 21 20:39:45 2016 New Revision: 297162 URL: https://svnweb.freebsd.org/changeset/base/297162 Log: net80211: add missing SLEEP -> AUTH state transition for station mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5269 Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:29:53 2016 (r297161) +++ head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:39:45 2016 (r297162) @@ -341,12 +341,13 @@ sta_newstate(struct ieee80211vap *vap, e break; } break; + case IEEE80211_S_SLEEP: case IEEE80211_S_RUN: switch (arg & 0xff) { case IEEE80211_FC0_SUBTYPE_AUTH: IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, 2); - vap->iv_state = ostate; /* stay RUN */ + vap->iv_state = IEEE80211_S_RUN; /* stay RUN */ break; case IEEE80211_FC0_SUBTYPE_DEAUTH: ieee80211_sta_leave(ni); From owner-svn-src-head@freebsd.org Mon Mar 21 20:48:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69245AD8652; Mon, 21 Mar 2016 20:48:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 345D5E28; Mon, 21 Mar 2016 20:48:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id m184so223802884iof.1; Mon, 21 Mar 2016 13:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=GshI+5vjVR9APKc1Q2yONFDqsjOyLN0I2KZ2uwPoUCg=; b=I7W0UVkhbX360vsrYkCKbHsxrsJoCsNS+bcWHNdUeMoQDf3IvDKCF7uBGy7QUsqsjO OKzc3XCt40w6Bc1hYsF9zh3g4+dXQ8vtGwuMyn+8zpzxhUpcRL9oedAOCPCnh2RNCVU6 2zDREhEAXYJmBco6fBup3ufyQYHKe/CShxP+NO5ODLJzVvuNmV1mB6W8XPUo9hDhvQYp 1JDGQNt/vOaZg0xTjR5xEnmKqZGTGgLLuhjsw9ac+zSdmIxyyqdeQDTDl15U2AOJHUNi vEbhASUuAxNWgf1sxR7cJ09/XbgxPoqbsGoZFM966jAjdyrO1IR5TOkPnln/Fn0Hy5KM tyig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=GshI+5vjVR9APKc1Q2yONFDqsjOyLN0I2KZ2uwPoUCg=; b=LDno16ZynfcVJ/f5d6K5WfrMoVJV2LJFIMflYSXuPG8tK/jR9W0e0u4CACKsPkmEEz lVvL1s4JsESae/x+fIduMis9wSV5St5/MvS9GplbL6ZXLtpgWStMmBZxcE+9xOf1QA1W t/gSeGzCUAnIzUnBRQlxv8Ig4EtS/K1yxgkA3iUEA1r0A+CEIiWv6q6dFvfYbDeauX18 w8NWWlHBdawCNvgs9scTF/3rtrNdhGpMOJNwBvkmc7nU8L2ClZMuxjQKanJKr8dNtrcJ M7jxonNm22mT+txPVD1+NDqGcweW/Y7TtmUYBfjmqczrHg3INECK2KLWMSEGN2jRD4kP 7VIw== X-Gm-Message-State: AD7BkJIiWtlLp9+B/xuc6odsvNc8bUYHk7gR/FUlBpXwKSiEI+X7RtpGu6S8BJNj//zzXRNi5IHZjeTb4mjJVg== MIME-Version: 1.0 X-Received: by 10.107.11.162 with SMTP id 34mr29481182iol.165.1458593332587; Mon, 21 Mar 2016 13:48:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:48:52 -0700 (PDT) In-Reply-To: <20160321203528.GC1254@FreeBSD.org> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> Date: Mon, 21 Mar 2016 13:48:52 -0700 X-Google-Sender-Auth: wtWaG8JK16xCO5686wl0Kmyidoo Message-ID: Subject: Re: svn commit: r297136 - head/sys/conf From: Adrian Chadd To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:48:53 -0000 On 21 March 2016 at 13:35, Gleb Smirnoff wrote: > On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Mon Mar 21 05:51:21 2016 > A> New Revision: 297136 > A> URL: https://svnweb.freebsd.org/changeset/base/297136 > A> > A> Log: > A> Remove from NOTES - it's built as a module now. > > You are doing wrong. A driver must be buildable as a module and > statically as well. > > It is legitimate to remove from GENERIC, but not from NOTES. Hiya, I'll put it back once I finish surgery on urtwn. Thanks, -adrian From owner-svn-src-head@freebsd.org Mon Mar 21 20:49:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B10EAD869A; Mon, 21 Mar 2016 20:49:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 56A5EF8A; Mon, 21 Mar 2016 20:49:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id c63so44359191iof.0; Mon, 21 Mar 2016 13:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=7tgPCi/cfwOPaNUTjmciW8BdB3K7eot9tOBkqEanexQ=; b=GeiUA4dG4Z3SYPvbZPxQ+/pmYcNmqw4Cq3JaTirhZBuWozmA7OY0GGKRRz9jDPOnhR 3SwrICvDnS/K7YJkNLTM0FgVRpwGcqiLP8NEW6ZWc7QvoeTDlQsPtmoCqnT1g3Jhxvxf HtoIRdChCcrNcc0DoSkZ84E9XWRTVqSHZLrCXFwlDqPd995/am5Y25QpscKNwgdg7KXu AqzW/6rFVe0REEQj9mZna9ixCdfKrHflqoh09gq/m4vYQzi7DyCXL7GW+p8QRCKUSal8 /bMBrmM6BeTxb1XcG3IaAK8oByUqo6RorqLIBrXLmuqeIOyEhgqe45JtpJih7n2Ie6ce tDlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=7tgPCi/cfwOPaNUTjmciW8BdB3K7eot9tOBkqEanexQ=; b=HHmx49MJp0KcSgunA60K6F1gvvo4J8r/Ooz0bWdgZT1OMsTZ/t59xAXNPWOCTBBQ9L EG/kjTL+KQktyVKwXUVXGrVylmkiwnpGNEjvJlDAW+sJqHzlsoh69/sHODQyYTf3YeMc 5tS0zGdHh+9lLnYxNQoDXxvzGl4tt0vGL+y4PA08fuidxalngRq0pacdZNM6hwI9aoZs MAj4xCAjZcDSX00E20IzYl2Fwiuks+KmWzkpDRdefB/rLRCmGOX1tAvZDIXi9z9lGVYu y1wemIQuQdnNn1nUDW17aYB5QbMbHKFEzJtDwl7scmlxNt/0aSVCeaEb3rzLIhKD9PBp kOlQ== X-Gm-Message-State: AD7BkJIFOj3hhCeYUqfutpXyoc646I8JMGR5jgfLdp3M/McEWVvSZvMhC8xX7YgmQq8ZhlbYVh8h3jSXkrH/Ug== MIME-Version: 1.0 X-Received: by 10.107.19.73 with SMTP id b70mr29807757ioj.75.1458593361704; Mon, 21 Mar 2016 13:49:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:49:21 -0700 (PDT) In-Reply-To: <14182835.aVTA7WFHK4@ralph.baldwin.cx> References: <201603201753.u2KHrV4t010330@repo.freebsd.org> <14182835.aVTA7WFHK4@ralph.baldwin.cx> Date: Mon, 21 Mar 2016 13:49:21 -0700 X-Google-Sender-Auth: PNhdtnILczPsx33Fyu-zdmGu5rg Message-ID: Subject: Re: svn commit: r297069 - head/sys/conf From: Adrian Chadd To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:49:22 -0000 Yeah, I'll recover this, and if_otus, once I finish cutting up urtwn a bit. Thanks, -adrian On 20 March 2016 at 12:16, John Baldwin wrote: > On Sunday, March 20, 2016 05:53:31 PM Adrian Chadd wrote: >> Author: adrian >> Date: Sun Mar 20 17:53:30 2016 >> New Revision: 297069 >> URL: https://svnweb.freebsd.org/changeset/base/297069 >> >> Log: >> Now that urtwn is its own device, and it'll get hotplug loaded by >> devd/ifconfig/etc, don't build it in the kernel. >> >> This should fix the build as well! >> >> Notice by: dchagin > > You should fix the entries instead. Not everyone uses modules and we > shouldn't prohibit building devices into a custom kernel. This also > means the device isn't in NOTES either which is a bug. Looks like you > need to fix rtwn as well while you are at it. > > -- > John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 21 20:51:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7692AD871F; Mon, 21 Mar 2016 20:51:36 +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 8F15912A0; Mon, 21 Mar 2016 20:51:36 +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 u2LKpZlL017760; Mon, 21 Mar 2016 20:51:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKpZOC017759; Mon, 21 Mar 2016 20:51:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603212051.u2LKpZOC017759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Mar 2016 20:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297163 - head/tools/tools/vt/setfont X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:51:36 -0000 Author: emaste Date: Mon Mar 21 20:51:35 2016 New Revision: 297163 URL: https://svnweb.freebsd.org/changeset/base/297163 Log: Remove tools/vt/setfont It is included in vidcontrol as of r266836. Sponsored by: The FreeBSD Foundation Deleted: head/tools/tools/vt/setfont/ From owner-svn-src-head@freebsd.org Mon Mar 21 20:52:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B454AAD8768; Mon, 21 Mar 2016 20:52:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9136814BD; Mon, 21 Mar 2016 20:52:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LKq9JW019912; Mon, 21 Mar 2016 20:52:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKq9va019748; Mon, 21 Mar 2016 20:52:09 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212052.u2LKq9va019748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297164 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:52:10 -0000 Author: avos Date: Mon Mar 21 20:52:09 2016 New Revision: 297164 URL: https://svnweb.freebsd.org/changeset/base/297164 Log: net80211: enable software beacon miss timer in SLEEP state Tested with WUSB54GC, STA mode (w/ power saving enabled) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5545 Modified: head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Mon Mar 21 20:51:35 2016 (r297163) +++ head/sys/net80211/ieee80211_proto.c Mon Mar 21 20:52:09 2016 (r297164) @@ -1531,7 +1531,7 @@ beacon_miss(void *arg, int npending) IEEE80211_LOCK(ic); TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { /* - * We only pass events through for sta vap's in RUN state; + * We only pass events through for sta vap's in RUN+ state; * may be too restrictive but for now this saves all the * handlers duplicating these checks. */ @@ -1550,7 +1550,7 @@ beacon_swmiss(void *arg, int npending) struct ieee80211com *ic = vap->iv_ic; IEEE80211_LOCK(ic); - if (vap->iv_state == IEEE80211_S_RUN) { + if (vap->iv_state >= IEEE80211_S_RUN) { /* XXX Call multiple times if npending > zero? */ vap->iv_bmiss(vap); } @@ -1570,8 +1570,7 @@ ieee80211_swbmiss(void *arg) IEEE80211_LOCK_ASSERT(ic); - /* XXX sleep state? */ - KASSERT(vap->iv_state == IEEE80211_S_RUN, + KASSERT(vap->iv_state >= IEEE80211_S_RUN, ("wrong state %d", vap->iv_state)); if (ic->ic_flags & IEEE80211_F_SCAN) { Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:51:35 2016 (r297163) +++ head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:52:09 2016 (r297164) @@ -206,6 +206,24 @@ sta_authretry(struct ieee80211vap *vap, } } +static void +sta_swbmiss_start(struct ieee80211vap *vap) +{ + + if (vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) { + /* + * Start s/w beacon miss timer for devices w/o + * hardware support. We fudge a bit here since + * we're doing this in software. + */ + vap->iv_swbmiss_period = IEEE80211_TU_TO_TICKS( + 2 * vap->iv_bmissthreshold * vap->iv_bss->ni_intval); + vap->iv_swbmiss_count = 0; + callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period, + ieee80211_swbmiss, vap); + } +} + /* * IEEE80211_M_STA vap state machine handler. * This routine handles the main states in the 802.11 protocol. @@ -419,19 +437,8 @@ sta_newstate(struct ieee80211vap *vap, e goto invalid; } ieee80211_sync_curchan(ic); - if (ostate != IEEE80211_S_RUN && - (vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS)) { - /* - * Start s/w beacon miss timer for devices w/o - * hardware support. We fudge a bit here since - * we're doing this in software. - */ - vap->iv_swbmiss_period = IEEE80211_TU_TO_TICKS( - 2 * vap->iv_bmissthreshold * ni->ni_intval); - vap->iv_swbmiss_count = 0; - callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period, - ieee80211_swbmiss, vap); - } + if (ostate != IEEE80211_S_RUN) + sta_swbmiss_start(vap); /* * When 802.1x is not in use mark the port authorized * at this point so traffic can flow. @@ -451,6 +458,7 @@ sta_newstate(struct ieee80211vap *vap, e goto invalid; break; case IEEE80211_S_SLEEP: + sta_swbmiss_start(vap); vap->iv_sta_ps(vap, 1); break; default: From owner-svn-src-head@freebsd.org Mon Mar 21 20:52:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C799DAD889D for ; Mon, 21 Mar 2016 20:52:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F733187D for ; Mon, 21 Mar 2016 20:52:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pf0-x22e.google.com with SMTP id 4so147612107pfd.0 for ; Mon, 21 Mar 2016 13:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=f1UhImSJSCLxA8VTdJwH0jmr9BP9bbqDaEjleu2DRSw=; b=vbzhabNG3N0Ff8FvmL381Bdea6VaV9SdOzZ7R1OibWam2rHo02LYXwewexp2ZAd6fo 83qZzxkZbTzsVE6YUOBntxj3XsMSVD9TbtywjzsUCzacrN+vYek+MesAx0ByN9aVOAI4 GJE1WJMvTZ4a0ePWX1cbDVLCaiUyNw/UD9vs6AEvhdt6nzi/9g5I+pTPm/VRpn0vBD7g TAZbU1OT+p8Jzja4F8/Q9zGWPobATbMomrIuS+RxWZcHEEbG4fb7KkBNTPg7lZlFeHJI FBpDojWNQwMlw+thXHPDiVYeBIgDVLJVuNkp0K71IXFyF1PYuPGpQuqOLUtNtgrIlhcM 3Pog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=f1UhImSJSCLxA8VTdJwH0jmr9BP9bbqDaEjleu2DRSw=; b=B1BstW8IYWyfYp7Ndd5cBGRMMw3y3ueUcPWR+M4tE5XExReaLzVCbcsH4Uqm155aLi mBKHEw/4Dn7lTvRgDVdBrncuu0obm8s7HeNr2aknRI/AaU9B7eCbk08OTqaoDRz6ZGWo 97WpCSujLJngm18sUPcidMoMUMpHEq5EKoNNhjoGMk5bXmqKFc9MufGPj4u254b4vsOw DEwmYuQDGAnWl3PdwPZ2AwOqrFwwRU0bq9Z9FylcRrcezf/th498Sh2ejPXIGwzZOBLd BwOh5QWYnb05Jmv9xxSi1HT1OBPgnqaqKe+gXeIvB4PU+kMHBwsiOvG0L2WWdgGNGlLO WXrQ== X-Gm-Message-State: AD7BkJJH+eu3Uylpif0zNMiXe4lVBnHLzAYRztbWXunfqtpCM16tYOx+BCrFtVS48SNkPw== X-Received: by 10.66.102.8 with SMTP id fk8mr48772063pab.12.1458593563167; Mon, 21 Mar 2016 13:52:43 -0700 (PDT) Received: from [100.127.129.191] ([69.53.245.19]) by smtp.gmail.com with ESMTPSA id 27sm42790876pfo.58.2016.03.21.13.52.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 13:52:42 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r297136 - head/sys/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <20160321203528.GC1254@FreeBSD.org> Date: Mon, 21 Mar 2016 14:52:38 -0600 Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:52:43 -0000 --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 21, 2016, at 2:35 PM, Gleb Smirnoff = wrote: >=20 > On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Mon Mar 21 05:51:21 2016 > A> New Revision: 297136 > A> URL: https://svnweb.freebsd.org/changeset/base/297136 > A> > A> Log: > A> Remove from NOTES - it's built as a module now. >=20 > You are doing wrong. A driver must be buildable as a module and > statically as well. >=20 > It is legitimate to remove from GENERIC, but not from NOTES. In private conversations with Adrian, he indicated that he=E2=80=99s = about to reorganize this driver substantially. He=E2=80=99ll make sure it works = during the record period as a module, but can=E2=80=99t guarantee he won=E2=80=99t = break building it into the kernel. So he took it out from here so that the LINT build doesn=E2=80=99t break. He intends to reconnect it once he=E2=80=99s done = with the rearrangement. Warner --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043 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 iQIcBAEBCgAGBQJW8F8XAAoJEGwc0Sh9sBEAFt8P/2LU1mBtmZqPghy1F8eyq1FG evVF6HbdxCj5VwnU0nXA/s7mN7nUoOCpHqPan+jDAzZuNaxY4WNDkffGLoHXs0aF o7nu75XaPn8Ll7r/LmbyqfO7IRHlNyk2wZ2oa9Ndj7YB3OYH1DXrfL2e0R8t8RIp +6AkcKnEMRbdZRFg7iaEtwdhpG4CWMqEDLs2MnNDzooEOEsbkY2hXyWD5urgAyWd ZN9wi2Y5HEAfqaRhPgzquo5FdwwCkqiXU9A8SPMTw1fS3ifAE8rjybHwWgGR8vBm eDZp0ghj2BihLhteyDEoCXEuvVF38s6x1+7OY7qGhgLuKY48ggahMy9KtwmNuD/7 macHNXXH6bbns9vq/ehSTFq1+/MvZvOMvxhLYw84Xr/vkukA5kz1aiTqXzTK2mTm HzG6YtiA9F/FIR97S98z8w8H6atHOA+Rdeg7BwhsMI6ze+8RbeEvc83FLo15XPka hKcc7b9dXb3xOEJWKrD08Ut7ULnq02ALrFPH7IHHjxFaNSGdZRuD7urBHmaaTkfL 6R5Ia3wkxQ1lPtXpG8K2ARDmi09q1xxoxN62jsRydI9NNDC37nkMjLovgbDWXJ1K NHfv6b9W7xQKaeLhw8vCBjblW606LXsFJe9bjNTwXf6U9CFFPtM2vMyKsGGF+3WL nLlfo9ni+g6Ff7LShsNw =WpXH -----END PGP SIGNATURE----- --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043-- From owner-svn-src-head@freebsd.org Mon Mar 21 20:56:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA49AD89A2; Mon, 21 Mar 2016 20:56:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F611B3E; Mon, 21 Mar 2016 20:56:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x231.google.com with SMTP id nk17so80769513igb.1; Mon, 21 Mar 2016 13:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-transfer-encoding; bh=WCSTT6W8VUtl6s+PW1WWb20P70/pf6bSkaGGNJLld9A=; b=goxMZcbcj+ofl4Gj9ybbhG3zsLZbHxBWduJngGzqKcc3rvBpkt8DLhyo4/i2Y3hRzF 8li1I7fRZYFg5BHK/W5agu8iJxLiipQSlibBdzY7uTyrEgzDNG9vXNW9IfOomnYrbT6r QIZj6XwONA6OGJN7PGHEr9T7q5A1QDgftQ8X8uFTQbrlaI116HM+ohQ0vY1S6CzSspRk jTbDNYFRfE3r9iiDmcvm7N+24btqa/BsYXMmVW7Zzgc7ryvPVEeUM9eyT5VK4+mQm1iG WYkEiRMUo8IHCyNiMbSXNGIYGvsiYUp9M+HiIzmKzhZ5OSVG+AVNSkPOXSqNdnXI5ZVi JeIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=WCSTT6W8VUtl6s+PW1WWb20P70/pf6bSkaGGNJLld9A=; b=MppKNC0PZNCfNu4fcUUlptuEawEDhd1iNoAeFup5h4TS1ellxjdZRvnMHJa6KcLTJw sKonsfccclzklNQvsEig3BWKVNuFqjPUhJ2jB4CLyaCRWtU4Q8RAAinMLNg/8sjFTtru 70IQckTAlBBXCQvgW0vKv9RQZrP2WSNCnUqhMn4b/VzaFtDC40PlGtJmTX5VdpUM2mh2 nsjelS5ZA2iVcM91FLvPkT+LzYyrt+whYMGbxnuCd04JLQyEXhf0fF+UKRyXJ/+iq92V j3l/BSywa5zCSgtNtt8k3wImrs0JBHABl2mfaPy9Dmzwqw3oRWX6rUIwPLfQBfSBgfHV lLng== X-Gm-Message-State: AD7BkJI0cMWTLF6w7noOMLsguwkRJmxDIxQ0iEsYK1QDPRNLMQh3eK7nANmefw3vD4FcPLjbeaoQxVtRUfOo4g== MIME-Version: 1.0 X-Received: by 10.50.78.200 with SMTP id d8mr14015545igx.61.1458593778011; Mon, 21 Mar 2016 13:56:18 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:56:17 -0700 (PDT) In-Reply-To: <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> Date: Mon, 21 Mar 2016 13:56:17 -0700 X-Google-Sender-Auth: e-frHU8b-gEv6rDGZWM-zzGG_0g Message-ID: Subject: Re: svn commit: r297136 - head/sys/conf From: Adrian Chadd To: Warner Losh Cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 20:56:19 -0000 On 21 March 2016 at 13:52, Warner Losh wrote: > >> On Mar 21, 2016, at 2:35 PM, Gleb Smirnoff wrote: >> >> On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: >> A> Author: adrian >> A> Date: Mon Mar 21 05:51:21 2016 >> A> New Revision: 297136 >> A> URL: https://svnweb.freebsd.org/changeset/base/297136 >> A> >> A> Log: >> A> Remove from NOTES - it's built as a module now. >> >> You are doing wrong. A driver must be buildable as a module and >> statically as well. >> >> It is legitimate to remove from GENERIC, but not from NOTES. > > In private conversations with Adrian, he indicated that he=E2=80=99s abou= t to > reorganize this driver substantially. He=E2=80=99ll make sure it works du= ring the > record period as a module, but can=E2=80=99t guarantee he won=E2=80=99t b= reak building > it into the kernel. So he took it out from here so that the LINT build > doesn=E2=80=99t break. He intends to reconnect it once he=E2=80=99s done = with the > rearrangement. +1 here. rtwn and urtwn are effectively the same family but with a different DMA front-end, so I'd like to take a stab at unifying all of that. Otherwise adding 11ac drivers in that family will just be annoyingly duplicate-y. -adrian From owner-svn-src-head@freebsd.org Mon Mar 21 21:02:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E8F7AD8CA0; Mon, 21 Mar 2016 21:02:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26EF6C6; Mon, 21 Mar 2016 21:02:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LL2vRM023588; Mon, 21 Mar 2016 21:02:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LL2vu3023587; Mon, 21 Mar 2016 21:02:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212102.u2LL2vu3023587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 21:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297165 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 21:02:58 -0000 Author: avos Date: Mon Mar 21 21:02:57 2016 New Revision: 297165 URL: https://svnweb.freebsd.org/changeset/base/297165 Log: rum: separate some microcontroller vendor-specific requests into rum_do_mcu_request() This change should be no-op. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5542 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 20:52:09 2016 (r297164) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:02:57 2016 (r297165) @@ -154,6 +154,7 @@ static usb_callback_t rum_bulk_write_cal static usb_error_t rum_do_request(struct rum_softc *sc, struct usb_device_request *req, void *data); +static usb_error_t rum_do_mcu_request(struct rum_softc *sc, int); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -629,6 +630,20 @@ rum_do_request(struct rum_softc *sc, return (err); } +static usb_error_t +rum_do_mcu_request(struct rum_softc *sc, int request) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2573_MCU_CNTL; + USETW(req.wValue, request); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + return (rum_do_request(sc, &req, NULL)); +} + static struct ieee80211vap * rum_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -2460,7 +2475,6 @@ rum_stop(struct rum_softc *sc) static void rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size) { - struct usb_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; usb_error_t err; @@ -2475,14 +2489,8 @@ rum_load_microcode(struct rum_softc *sc, } } - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = RT2573_MCU_CNTL; - USETW(req.wValue, RT2573_MCU_RUN); - USETW(req.wIndex, 0); - USETW(req.wLength, 0); - - err = rum_do_request(sc, &req, NULL); - if (err != 0) { + err = rum_do_mcu_request(sc, RT2573_MCU_RUN); + if (err != USB_ERR_NORMAL_COMPLETION) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usbd_errstr(err)); } From owner-svn-src-head@freebsd.org Mon Mar 21 21:33:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C976AD834A; Mon, 21 Mar 2016 21:33:31 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2A381B; Mon, 21 Mar 2016 21:33:31 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LLXUbw032860; Mon, 21 Mar 2016 21:33:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLXUKM032859; Mon, 21 Mar 2016 21:33:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212133.u2LLXUKM032859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 21:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297166 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 21:33:31 -0000 Author: avos Date: Mon Mar 21 21:33:30 2016 New Revision: 297166 URL: https://svnweb.freebsd.org/changeset/base/297166 Log: rum: do not try to restore bssid/TSF synchronization when device is not associated. Tested with WUSB54GC, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5543 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:02:57 2016 (r297165) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:33:30 2016 (r297166) @@ -2932,14 +2932,15 @@ rum_scan_end(struct ieee80211com *ic) { struct rum_softc *sc = ic->ic_softc; - RUM_LOCK(sc); - if (ic->ic_opmode != IEEE80211_M_AHDEMO) - rum_enable_tsf_sync(sc); - else - rum_enable_tsf(sc); - rum_set_bssid(sc, sc->sc_bssid); - RUM_UNLOCK(sc); - + if (ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) { + RUM_LOCK(sc); + if (ic->ic_opmode != IEEE80211_M_AHDEMO) + rum_enable_tsf_sync(sc); + else + rum_enable_tsf(sc); + rum_set_bssid(sc, sc->sc_bssid); + RUM_UNLOCK(sc); + } } static void From owner-svn-src-head@freebsd.org Mon Mar 21 21:37:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5943CAD8508; Mon, 21 Mar 2016 21:37:35 +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 1715DAE2; Mon, 21 Mar 2016 21:37:35 +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 u2LLbYAw033054; Mon, 21 Mar 2016 21:37:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLbX46033048; Mon, 21 Mar 2016 21:37:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603212137.u2LLbX46033048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Mar 2016 21:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297167 - in head: lib/libc/sys sys/kern sys/sys tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 21:37:35 -0000 Author: jhb Date: Mon Mar 21 21:37:33 2016 New Revision: 297167 URL: https://svnweb.freebsd.org/changeset/base/297167 Log: Fully handle size_t lengths in AIO requests. First, update the return types of aio_return() and aio_waitcomplete() to ssize_t. POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason. aio_return() has used ssize_t in since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int. Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value. Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. aio_read/write should now honor the same length limits as normal read/write. Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned. Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file. Modified: head/lib/libc/sys/aio_return.2 head/lib/libc/sys/aio_waitcomplete.2 head/sys/kern/syscalls.master head/sys/kern/vfs_aio.c head/sys/sys/aio.h head/tests/sys/aio/aio_test.c Modified: head/lib/libc/sys/aio_return.2 ============================================================================== --- head/lib/libc/sys/aio_return.2 Mon Mar 21 21:33:30 2016 (r297166) +++ head/lib/libc/sys/aio_return.2 Mon Mar 21 21:37:33 2016 (r297167) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2006 +.Dd March 21, 2016 .Dt AIO_RETURN 2 .Os .Sh NAME @@ -34,7 +34,7 @@ .Lb libc .Sh SYNOPSIS .In aio.h -.Ft int +.Ft ssize_t .Fn aio_return "struct aiocb *iocb" .Sh DESCRIPTION The Modified: head/lib/libc/sys/aio_waitcomplete.2 ============================================================================== --- head/lib/libc/sys/aio_waitcomplete.2 Mon Mar 21 21:33:30 2016 (r297166) +++ head/lib/libc/sys/aio_waitcomplete.2 Mon Mar 21 21:37:33 2016 (r297167) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2000 +.Dd March 21, 2016 .Dt AIO_WAITCOMPLETE 2 .Os .Sh NAME @@ -34,7 +34,7 @@ .Lb libc .Sh SYNOPSIS .In aio.h -.Ft int +.Ft ssize_t .Fn aio_waitcomplete "struct aiocb **iocbp" "struct timespec *timeout" .Sh DESCRIPTION The Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/kern/syscalls.master Mon Mar 21 21:37:33 2016 (r297167) @@ -554,7 +554,7 @@ 312 AUE_SETRESGID STD { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL STD { int aio_return(struct aiocb *aiocbp); } +314 AUE_NULL STD { ssize_t aio_return(struct aiocb *aiocbp); } 315 AUE_NULL STD { int aio_suspend( \ struct aiocb * const * aiocbp, int nent, \ const struct timespec *timeout); } @@ -643,7 +643,7 @@ 358 AUE_EXTATTR_DELETE_FILE STD { int extattr_delete_file(const char *path, \ int attrnamespace, \ const char *attrname); } -359 AUE_NULL STD { int aio_waitcomplete( \ +359 AUE_NULL STD { ssize_t aio_waitcomplete( \ struct aiocb **aiocbp, \ struct timespec *timeout); } 360 AUE_GETRESUID STD { int getresuid(uid_t *ruid, uid_t *euid, \ Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/kern/vfs_aio.c Mon Mar 21 21:37:33 2016 (r297167) @@ -743,7 +743,7 @@ aio_process_rw(struct kaiocb *job) struct file *fp; struct uio auio; struct iovec aiov; - int cnt; + ssize_t cnt; int error; int oublock_st, oublock_end; int inblock_st, inblock_end; @@ -1447,8 +1447,7 @@ aio_aqueue(struct thread *td, struct aio return (error); } - /* XXX: aio_nbytes is later casted to signed types. */ - if (job->uaiocb.aio_nbytes > INT_MAX) { + if (job->uaiocb.aio_nbytes > IOSIZE_MAX) { uma_zfree(aiocb_zone, job); return (EINVAL); } @@ -1789,7 +1788,7 @@ kern_aio_return(struct thread *td, struc struct proc *p = td->td_proc; struct kaiocb *job; struct kaioinfo *ki; - int status, error; + long status, error; ki = p->p_aioinfo; if (ki == NULL) @@ -2345,7 +2344,8 @@ kern_aio_waitcomplete(struct thread *td, struct kaioinfo *ki; struct kaiocb *job; struct aiocb *ujob; - int error, status, timo; + long error, status; + int timo; ops->store_aiocb(ujobp, NULL); Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/sys/aio.h Mon Mar 21 21:37:33 2016 (r297167) @@ -238,7 +238,7 @@ int aio_suspend(const struct aiocb * con int aio_mlock(struct aiocb *); #ifdef __BSD_VISIBLE -int aio_waitcomplete(struct aiocb **, struct timespec *); +ssize_t aio_waitcomplete(struct aiocb **, struct timespec *); #endif int aio_fsync(int op, struct aiocb *aiocbp); Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Mon Mar 21 21:33:30 2016 (r297166) +++ head/tests/sys/aio/aio_test.c Mon Mar 21 21:37:33 2016 (r297167) @@ -649,6 +649,81 @@ ATF_TC_BODY(aio_md_test, tc) aio_md_cleanup(&arg); } +ATF_TC_WITHOUT_HEAD(aio_large_read_test); +ATF_TC_BODY(aio_large_read_test, tc) +{ + char pathname[PATH_MAX]; + struct aiocb cb, *cbp; + ssize_t nread; + size_t len; + int fd; +#ifdef __LP64__ + int clamped; +#endif + + ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); + +#ifdef __LP64__ + len = sizeof(clamped); + if (sysctlbyname("debug.iosize_max_clamp", &clamped, &len, NULL, 0) == + -1) + atf_libc_error(errno, "Failed to read debug.iosize_max_clamp"); +#endif + + /* Determine the maximum supported read(2) size. */ + len = SSIZE_MAX; +#ifdef __LP64__ + if (clamped) + len = INT_MAX; +#endif + + strcpy(pathname, PATH_TEMPLATE); + fd = mkstemp(pathname); + ATF_REQUIRE_MSG(fd != -1, "mkstemp failed: %s", strerror(errno)); + + unlink(pathname); + + memset(&cb, 0, sizeof(cb)); + cb.aio_nbytes = len; + cb.aio_fildes = fd; + cb.aio_buf = NULL; + if (aio_read(&cb) == -1) + atf_tc_fail("aio_read() of maximum read size failed: %s", + strerror(errno)); + + nread = aio_waitcomplete(&cbp, NULL); + if (nread == -1) + atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); + if (nread != 0) + atf_tc_fail("aio_read() from /dev/null returned data: %zd", + nread); + + memset(&cb, 0, sizeof(cb)); + cb.aio_nbytes = len + 1; + cb.aio_fildes = fd; + cb.aio_buf = NULL; + if (aio_read(&cb) == -1) { + if (errno == EINVAL) + goto finished; + atf_tc_fail("aio_read() of too large read size failed: %s", + strerror(errno)); + } + + nread = aio_waitcomplete(&cbp, NULL); + if (nread == -1) { + if (errno == EINVAL) + goto finished; + atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); + } + atf_tc_fail( + "aio_read() of too large read size from /dev/null returned: %zd", + nread); + +finished: + close(fd); +} + ATF_TP_ADD_TCS(tp) { @@ -658,6 +733,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_pty_test); ATF_TP_ADD_TC(tp, aio_pipe_test); ATF_TP_ADD_TC(tp, aio_md_test); + ATF_TP_ADD_TC(tp, aio_large_read_test); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon Mar 21 21:38:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E607AAD8561; Mon, 21 Mar 2016 21:38:36 +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 C0996C63; Mon, 21 Mar 2016 21:38:36 +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 u2LLcZEd033134; Mon, 21 Mar 2016 21:38:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLcZ0t033128; Mon, 21 Mar 2016 21:38:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603212138.u2LLcZ0t033128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Mar 2016 21:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297168 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 21:38:37 -0000 Author: jhb Date: Mon Mar 21 21:38:35 2016 New Revision: 297168 URL: https://svnweb.freebsd.org/changeset/base/297168 Log: Regen. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/init_sysent.c Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/syscalls.c Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/systrace_args.c Mon Mar 21 21:38:35 2016 (r297168) @@ -9796,7 +9796,7 @@ systrace_return_setargdesc(int sysnum, i /* aio_return */ case 314: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* aio_suspend */ case 315: @@ -9972,7 +9972,7 @@ systrace_return_setargdesc(int sysnum, i /* aio_waitcomplete */ case 359: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* getresuid */ case 360: Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/syscall.h Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/syscall.mk Mon Mar 21 21:38:35 2016 (r297168) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/sysproto.h Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-head@freebsd.org Mon Mar 21 22:14:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F24AD8EB3; Mon, 21 Mar 2016 22:14:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52B4875D; Mon, 21 Mar 2016 22:14:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LMEmLC045177; Mon, 21 Mar 2016 22:14:48 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMEm7l045176; Mon, 21 Mar 2016 22:14:48 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212214.u2LMEm7l045176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 22:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297169 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 22:14:49 -0000 Author: avos Date: Mon Mar 21 22:14:48 2016 New Revision: 297169 URL: https://svnweb.freebsd.org/changeset/base/297169 Log: rum: simplify error handling in rum_newstate(). Tested with WUSB54GC, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5544 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:38:35 2016 (r297168) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:14:48 2016 (r297169) @@ -819,7 +819,7 @@ rum_newstate(struct ieee80211vap *vap, e const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; - int ret; + int ret = 0; ostate = vap->iv_state; DPRINTF("%s -> %s\n", @@ -872,6 +872,7 @@ rum_newstate(struct ieee80211vap *vap, e tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) rum_ratectl_start(sc, ni); +run_fail: ieee80211_free_node(ni); break; default: @@ -879,13 +880,7 @@ rum_newstate(struct ieee80211vap *vap, e } RUM_UNLOCK(sc); IEEE80211_LOCK(ic); - return (rvp->newstate(vap, nstate, arg)); - -run_fail: - RUM_UNLOCK(sc); - IEEE80211_LOCK(ic); - ieee80211_free_node(ni); - return ret; + return (ret == 0 ? rvp->newstate(vap, nstate, arg) : ret); } static void From owner-svn-src-head@freebsd.org Mon Mar 21 22:19:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 006B8AD8FFE; Mon, 21 Mar 2016 22:19:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3CA1A94; Mon, 21 Mar 2016 22:19:54 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LMJr38045543; Mon, 21 Mar 2016 22:19:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMJrb5045539; Mon, 21 Mar 2016 22:19:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603212219.u2LMJrb5045539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 21 Mar 2016 22:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297170 - in head/sys/dev: mvs siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 22:19:55 -0000 Author: jhibbits Date: Mon Mar 21 22:19:53 2016 New Revision: 297170 URL: https://svnweb.freebsd.org/changeset/base/297170 Log: Fix some more long -> rman_res_t Reported by: Michael Butler (siis breakage) Modified: head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/siis/siis.c Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/mvs/mvs_pci.c Mon Mar 21 22:19:53 2016 (r297170) @@ -396,7 +396,7 @@ mvs_alloc_resource(device_t dev, device_ int unit = ((struct mvs_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = HC_BASE(unit >> 2) + PORT_BASE(unit & 0x03); - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/mvs/mvs_soc.c Mon Mar 21 22:19:53 2016 (r297170) @@ -342,7 +342,7 @@ mvs_alloc_resource(device_t dev, device_ int unit = ((struct mvs_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = PORT_BASE(unit & 0x03); - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/siis/siis.c Mon Mar 21 22:19:53 2016 (r297170) @@ -320,7 +320,7 @@ siis_alloc_resource(device_t dev, device int unit = ((struct siis_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = unit << 13; - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: From owner-svn-src-head@freebsd.org Mon Mar 21 22:29:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D839CAD81C1; Mon, 21 Mar 2016 22:29:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29B2F8E; Mon, 21 Mar 2016 22:29:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LMTONK048970; Mon, 21 Mar 2016 22:29:24 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMTOOs048967; Mon, 21 Mar 2016 22:29:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212229.u2LMTOOs048967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 22:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297171 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 22:29:26 -0000 Author: avos Date: Mon Mar 21 22:29:24 2016 New Revision: 297171 URL: https://svnweb.freebsd.org/changeset/base/297171 Log: rum: add legacy power saving support (STA mode). Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5546 Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumreg.h head/sys/dev/usb/wlan/if_rumvar.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:29:24 2016 (r297171) @@ -166,6 +166,11 @@ static int rum_cmd_sleepable(struct rum static void rum_tx_free(struct rum_tx_data *, int); static void rum_setup_tx_list(struct rum_softc *); static void rum_unsetup_tx_list(struct rum_softc *); +static void rum_beacon_miss(struct ieee80211vap *); +static void rum_sta_recv_mgmt(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, int, int); +static int rum_set_power_state(struct rum_softc *, int); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint8_t rum_crypto_mode(struct rum_softc *, u_int, int); @@ -233,6 +238,8 @@ static int rum_init(struct rum_softc *) static void rum_stop(struct rum_softc *); static void rum_load_microcode(struct rum_softc *, const uint8_t *, size_t); +static int rum_set_sleep_time(struct rum_softc *, uint16_t); +static int rum_reset(struct ieee80211vap *, u_long); static int rum_set_beacon(struct rum_softc *, struct ieee80211vap *); static int rum_alloc_beacon(struct rum_softc *, @@ -531,6 +538,8 @@ rum_attach(device_t self) | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ | IEEE80211_C_WME /* 802.11e */ + | IEEE80211_C_PMGT /* Station-side power mgmt */ + | IEEE80211_C_SWSLEEP /* net80211 managed power mgmt */ ; ic->ic_cryptocaps = @@ -674,8 +683,24 @@ rum_vap_create(struct ieee80211com *ic, vap->iv_key_set = rum_key_set; vap->iv_key_delete = rum_key_delete; vap->iv_update_beacon = rum_update_beacon; + vap->iv_reset = rum_reset; vap->iv_max_aid = RT2573_ADDR_MAX; + if (opmode == IEEE80211_M_STA) { + /* + * Move device to the sleep state when + * beacon is received and there is no data for us. + * + * Used only for IEEE80211_S_SLEEP state. + */ + rvp->recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = rum_sta_recv_mgmt; + + /* Ignored while sleeping. */ + rvp->bmiss = vap->iv_bmiss; + vap->iv_bmiss = rum_beacon_miss; + } + usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); ieee80211_ratectl_init(vap); @@ -810,6 +835,89 @@ rum_unsetup_tx_list(struct rum_softc *sc } } +static void +rum_beacon_miss(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + struct rum_softc *sc = ic->ic_softc; + struct rum_vap *rvp = RUM_VAP(vap); + int sleep; + + RUM_LOCK(sc); + if (sc->sc_sleeping && sc->sc_sleep_end < ticks) { + DPRINTFN(12, "dropping 'sleeping' bit, " + "device must be awake now\n"); + + sc->sc_sleeping = 0; + } + + sleep = sc->sc_sleeping; + RUM_UNLOCK(sc); + + if (!sleep) + rvp->bmiss(vap); +#ifdef USB_DEBUG + else + DPRINTFN(13, "bmiss event is ignored whilst sleeping\n"); +#endif +} + +static void +rum_sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, + const struct ieee80211_rx_stats *rxs, + int rssi, int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct rum_softc *sc = vap->iv_ic->ic_softc; + struct rum_vap *rvp = RUM_VAP(vap); + + if (vap->iv_state == IEEE80211_S_SLEEP && + subtype == IEEE80211_FC0_SUBTYPE_BEACON) { + RUM_LOCK(sc); + DPRINTFN(12, "beacon, mybss %d (flags %02X)\n", + !!(sc->last_rx_flags & RT2573_RX_MYBSS), + sc->last_rx_flags); + + if ((sc->last_rx_flags & (RT2573_RX_MYBSS | RT2573_RX_BC)) == + (RT2573_RX_MYBSS | RT2573_RX_BC)) { + /* + * Put it to sleep here; in case if there is a data + * for us, iv_recv_mgmt() will wakeup the device via + * SLEEP -> RUN state transition. + */ + rum_set_power_state(sc, 1); + } + RUM_UNLOCK(sc); + } + + rvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); +} + +static int +rum_set_power_state(struct rum_softc *sc, int sleep) +{ + usb_error_t uerror; + + RUM_LOCK_ASSERT(sc); + + DPRINTFN(12, "moving to %s state (sleep time %u)\n", + sleep ? "sleep" : "awake", sc->sc_sleep_time); + + uerror = rum_do_mcu_request(sc, + sleep ? RT2573_MCU_SLEEP : RT2573_MCU_WAKEUP); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + device_printf(sc->sc_dev, + "%s: could not change power state: %s\n", + __func__, usbd_errstr(uerror)); + return (EIO); + } + + sc->sc_sleeping = !!sleep; + sc->sc_sleep_end = sleep ? ticks + sc->sc_sleep_time : 0; + + return (0); +} + static int rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -819,6 +927,7 @@ rum_newstate(struct ieee80211vap *vap, e const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; + usb_error_t uerror; int ret = 0; ostate = vap->iv_state; @@ -830,6 +939,17 @@ rum_newstate(struct ieee80211vap *vap, e RUM_LOCK(sc); usb_callout_stop(&rvp->ratectl_ch); + if (ostate == IEEE80211_S_SLEEP && vap->iv_opmode == IEEE80211_M_STA) { + rum_clrbits(sc, RT2573_TXRX_CSR4, RT2573_ACKCTS_PWRMGT); + rum_clrbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + + /* + * Ignore any errors; + * any subsequent TX will wakeup it anyway + */ + (void) rum_set_power_state(sc, 0); + } + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) @@ -838,6 +958,9 @@ rum_newstate(struct ieee80211vap *vap, e break; case IEEE80211_S_RUN: + if (ostate == IEEE80211_S_SLEEP) + break; /* already handled */ + ni = ieee80211_ref_node(vap->iv_bss); if (vap->iv_opmode != IEEE80211_M_MONITOR) { @@ -875,6 +998,30 @@ rum_newstate(struct ieee80211vap *vap, e run_fail: ieee80211_free_node(ni); break; + case IEEE80211_S_SLEEP: + /* Implemented for STA mode only. */ + if (vap->iv_opmode != IEEE80211_M_STA) + break; + + uerror = rum_setbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + ret = EIO; + break; + } + + uerror = rum_setbits(sc, RT2573_TXRX_CSR4, RT2573_ACKCTS_PWRMGT); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + ret = EIO; + break; + } + + ret = rum_set_power_state(sc, 1); + if (ret != 0) { + device_printf(sc->sc_dev, + "%s: could not move to the SLEEP state: %s\n", + __func__, usbd_errstr(uerror)); + } + break; default: break; } @@ -1011,6 +1158,7 @@ rum_bulk_read_callback(struct usb_xfer * rssi = rum_get_rssi(sc, sc->sc_rx_desc.rssi); flags = le32toh(sc->sc_rx_desc.flags); + sc->last_rx_flags = flags; if (flags & RT2573_RX_CRC_ERROR) { /* * This should not happen since we did not @@ -2005,6 +2153,7 @@ rum_enable_tsf_sync(struct rum_softc *sc struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; + uint16_t bintval; if (vap->iv_opmode != IEEE80211_M_STA) { /* @@ -2018,7 +2167,8 @@ rum_enable_tsf_sync(struct rum_softc *sc tmp = rum_read(sc, RT2573_TXRX_CSR9) & 0xff000000; /* set beacon interval (in 1/16ms unit) */ - tmp |= vap->iv_bss->ni_intval * 16; + bintval = vap->iv_bss->ni_intval; + tmp |= bintval * 16; tmp |= RT2573_TSF_TIMER_EN | RT2573_TBTT_TIMER_EN; switch (vap->iv_opmode) { @@ -2052,7 +2202,8 @@ rum_enable_tsf_sync(struct rum_softc *sc if (rum_write(sc, RT2573_TXRX_CSR9, tmp) != 0) return EIO; - return 0; + /* refresh current sleep time */ + return (rum_set_sleep_time(sc, bintval)); } static void @@ -2495,6 +2646,72 @@ rum_load_microcode(struct rum_softc *sc, } static int +rum_set_sleep_time(struct rum_softc *sc, uint16_t bintval) +{ + struct ieee80211com *ic = &sc->sc_ic; + usb_error_t uerror; + int exp, delay; + + RUM_LOCK_ASSERT(sc); + + exp = ic->ic_lintval / bintval; + delay = ic->ic_lintval % bintval; + + if (exp > RT2573_TBCN_EXP_MAX) + exp = RT2573_TBCN_EXP_MAX; + if (delay > RT2573_TBCN_DELAY_MAX) + delay = RT2573_TBCN_DELAY_MAX; + + uerror = rum_modbits(sc, RT2573_MAC_CSR11, + RT2573_TBCN_EXP(exp) | + RT2573_TBCN_DELAY(delay), + RT2573_TBCN_EXP(RT2573_TBCN_EXP_MAX) | + RT2573_TBCN_DELAY(RT2573_TBCN_DELAY_MAX)); + + if (uerror != USB_ERR_NORMAL_COMPLETION) + return (EIO); + + sc->sc_sleep_time = IEEE80211_TU_TO_TICKS(exp * bintval + delay); + + return (0); +} + +static int +rum_reset(struct ieee80211vap *vap, u_long cmd) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_node *ni; + struct rum_softc *sc = ic->ic_softc; + int error; + + switch (cmd) { + case IEEE80211_IOC_POWERSAVE: + error = 0; + break; + case IEEE80211_IOC_POWERSAVESLEEP: + ni = ieee80211_ref_node(vap->iv_bss); + + RUM_LOCK(sc); + error = rum_set_sleep_time(sc, ni->ni_intval); + if (vap->iv_state == IEEE80211_S_SLEEP) { + /* Use new values for wakeup timer. */ + rum_clrbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + rum_setbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + } + /* XXX send reassoc */ + RUM_UNLOCK(sc); + + ieee80211_free_node(ni); + break; + default: + error = ENETRESET; + break; + } + + return (error); +} + +static int rum_set_beacon(struct rum_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; Modified: head/sys/dev/usb/wlan/if_rumreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumreg.h Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rumreg.h Mon Mar 21 22:29:24 2016 (r297171) @@ -136,6 +136,13 @@ /* possible flags for register MAC_CSR5 */ #define RT2573_NUM_BSSID_MSK(n) (((n * 3) & 3) << 16) +/* possible flags for register MAC_CSR11 */ +#define RT2573_AUTO_WAKEUP (1 << 15) +#define RT2573_TBCN_EXP(n) ((n) << 8) +#define RT2573_TBCN_EXP_MAX 0x7f +#define RT2573_TBCN_DELAY(t) (t) +#define RT2573_TBCN_DELAY_MAX 0xff + /* possible flags for register TXRX_CSR0 */ /* Tx filter flags are in the low 16 bits */ #define RT2573_AUTO_TX_SEQ (1 << 15) @@ -152,6 +159,7 @@ #define RT2573_DROP_ACKCTS (1 << 25) /* possible flags for register TXRX_CSR4 */ +#define RT2573_ACKCTS_PWRMGT (1 << 16) #define RT2573_SHORT_PREAMBLE (1 << 18) #define RT2573_MRR_ENABLED (1 << 19) #define RT2573_MRR_CCK_FALLBACK (1 << 22) @@ -188,7 +196,10 @@ #define RT2573_LED_ON 0x1e1e #define RT2573_LED_OFF 0x0 -#define RT2573_MCU_RUN (1 << 3) +/* USB vendor requests */ +#define RT2573_MCU_SLEEP 7 +#define RT2573_MCU_RUN 8 +#define RT2573_MCU_WAKEUP 9 #define RT2573_SMART_MODE (1 << 0) Modified: head/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumvar.h Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rumvar.h Mon Mar 21 22:29:24 2016 (r297171) @@ -96,6 +96,11 @@ struct rum_vap { int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); + void (*bmiss)(struct ieee80211vap *); + void (*recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, + int, int); }; #define RUM_VAP(vap) ((struct rum_vap *)(vap)) @@ -124,6 +129,10 @@ struct rum_softc { struct mtx sc_mtx; + int sc_sleep_end; + int sc_sleep_time; + uint8_t last_rx_flags; + struct rum_cmdq cmdq[RUM_CMDQ_SIZE]; struct mtx cmdq_mtx; struct task cmdq_task; @@ -135,6 +144,7 @@ struct rum_softc { uint8_t txpow[44]; u_int sc_detached:1, sc_running:1, + sc_sleeping:1, sc_clr_shkeys:1; uint8_t sc_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-head@freebsd.org Mon Mar 21 22:36:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F59CAD83FF; Mon, 21 Mar 2016 22:36:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0140498A; Mon, 21 Mar 2016 22:36:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11939B9B2; Mon, 21 Mar 2016 18:36:09 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297167 - in head: lib/libc/sys sys/kern sys/sys tests/sys/aio Date: Mon, 21 Mar 2016 14:40:04 -0700 Message-ID: <1676365.VT1hrVG4ID@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603212137.u2LLbX46033048@repo.freebsd.org> References: <201603212137.u2LLbX46033048@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 Mar 2016 18:36:09 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 22:36:10 -0000 On Monday, March 21, 2016 09:37:33 PM John Baldwin wrote: > Author: jhb > Date: Mon Mar 21 21:37:33 2016 > New Revision: 297167 > URL: https://svnweb.freebsd.org/changeset/base/297167 > > Log: > Fully handle size_t lengths in AIO requests. > > First, update the return types of aio_return() and aio_waitcomplete() to > ssize_t. > > POSIX requires aio_return() to return a ssize_t so that it can represent > all return values from read() and write(). aio_waitcomplete() should use > ssize_t for the same reason. > > aio_return() has used ssize_t in since r31620 but the manpage and > system call entry were not updated. aio_waitcomplete() has always > returned int. > > Note that this does not require new system call stubs as this is > effectively only an API change in how the compiler interprets the return > value. > > Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. > > aio_read/write should now honor the same length limits as normal read/write. > > Third, use longs instead of ints in the aio_return() and aio_waitcomplete() > system call functions so that the 64-bit size_t in the in-kernel aiocb > isn't truncated to 32-bits before being copied out to userland or > being returned. > > Finally, a simple test has been added to verify the bounds checking on the > maximum read size from a file. Oops, missed the metadata: Reviewed by: kib (not the test, I added that later) Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D5679 -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 21 23:22:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE9EAD8D9D; Mon, 21 Mar 2016 23:22:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 994F51DD4; Mon, 21 Mar 2016 23:22:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LNMJF0067003; Mon, 21 Mar 2016 23:22:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNMJwJ067002; Mon, 21 Mar 2016 23:22:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212322.u2LNMJwJ067002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 23:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297172 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 23:22:20 -0000 Author: bdrewery Date: Mon Mar 21 23:22:19 2016 New Revision: 297172 URL: https://svnweb.freebsd.org/changeset/base/297172 Log: Consolidate common link(2) logic. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 22:29:24 2016 (r297171) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 23:22:19 2016 (r297172) @@ -237,58 +237,46 @@ filemon_wrapper_rename(struct thread *td return (ret); } -static int -filemon_wrapper_link(struct thread *td, struct link_args *uap) +static void +_filemon_wrapper_link(struct thread *td, char *upath1, char *upath2) { - int ret; - size_t done; - size_t len; struct filemon *filemon; + size_t len; - if ((ret = sys_link(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, - sizeof(filemon->fname2), &done); + if ((filemon = filemon_proc_get(curproc)) != NULL) { + copyinstr(upath1, filemon->fname1, + sizeof(filemon->fname1), NULL); + copyinstr(upath2, filemon->fname2, + sizeof(filemon->fname2), NULL); - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); - filemon_output(filemon, filemon->msgbufr, len); + filemon_output(filemon, filemon->msgbufr, len); - filemon_drop(filemon); - } + filemon_drop(filemon); } - - return (ret); } static int -filemon_wrapper_symlink(struct thread *td, struct symlink_args *uap) +filemon_wrapper_link(struct thread *td, struct link_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - if ((ret = sys_symlink(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, - sizeof(filemon->fname2), &done); + if ((ret = sys_link(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path, uap->link); - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); + return (ret); +} - filemon_output(filemon, filemon->msgbufr, len); +static int +filemon_wrapper_symlink(struct thread *td, struct symlink_args *uap) +{ + int ret; - filemon_drop(filemon); - } - } + if ((ret = sys_symlink(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path, uap->link); return (ret); } @@ -297,26 +285,9 @@ static int filemon_wrapper_linkat(struct thread *td, struct linkat_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = sys_linkat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path1, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->path2, filemon->fname2, - sizeof(filemon->fname2), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); - - filemon_output(filemon, filemon->msgbufr, len); - filemon_drop(filemon); - } - } + if ((ret = sys_linkat(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path1, uap->path2); return (ret); } From owner-svn-src-head@freebsd.org Mon Mar 21 23:25:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B593BAD8E07; Mon, 21 Mar 2016 23:25:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68AA51F83; Mon, 21 Mar 2016 23:25:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LNPfkU067168; Mon, 21 Mar 2016 23:25:41 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNPfoR067166; Mon, 21 Mar 2016 23:25:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212325.u2LNPfoR067166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 23:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297173 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 23:25:42 -0000 Author: avos Date: Mon Mar 21 23:25:41 2016 New Revision: 297173 URL: https://svnweb.freebsd.org/changeset/base/297173 Log: wpi: remove internal taskqueue - Replace sc_reinittask() by ieee80211_restart_all() (mostly the same). - Revert r282377 (seems to be unneeded now). Tested with Intel 3945BG, STA mode. Differential Revision: https://reviews.freebsd.org/D5056 Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Mar 21 23:22:19 2016 (r297172) +++ head/sys/dev/wpi/if_wpi.c Mon Mar 21 23:25:41 2016 (r297173) @@ -284,7 +284,6 @@ static void wpi_scan_end(struct ieee8021 static void wpi_set_channel(struct ieee80211com *); static void wpi_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void wpi_scan_mindwell(struct ieee80211_scan_state *); -static void wpi_hw_reset(void *, int); static device_method_t wpi_methods[] = { /* Device interface */ @@ -531,18 +530,9 @@ wpi_attach(device_t dev) callout_init_mtx(&sc->scan_timeout, &sc->rxon_mtx, 0); callout_init_mtx(&sc->tx_timeout, &sc->txq_state_mtx, 0); callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); TASK_INIT(&sc->sc_radioon_task, 0, wpi_radio_on, sc); - sc->sc_tq = taskqueue_create("wpi_taskq", M_WAITOK, - taskqueue_thread_enqueue, &sc->sc_tq); - error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "wpi_taskq"); - if (error != 0) { - device_printf(dev, "can't start threads, error %d\n", error); - goto fail; - } - wpi_sysctlattach(sc); /* @@ -695,14 +685,10 @@ wpi_detach(device_t dev) if (ic->ic_vap_create == wpi_vap_create) { ieee80211_draintask(ic, &sc->sc_radioon_task); + ieee80211_draintask(ic, &sc->sc_radiooff_task); wpi_stop(sc); - if (sc->sc_tq != NULL) { - taskqueue_drain_all(sc->sc_tq); - taskqueue_free(sc->sc_tq); - } - callout_drain(&sc->watchdog_rfkill); callout_drain(&sc->tx_timeout); callout_drain(&sc->scan_timeout); @@ -2332,7 +2318,7 @@ wpi_notif_intr(struct wpi_softc *sc) WPI_NT_LOCK(sc); wpi_clear_node_table(sc); WPI_NT_UNLOCK(sc); - taskqueue_enqueue(sc->sc_tq, + ieee80211_runtask(ic, &sc->sc_radiooff_task); return; } @@ -2569,6 +2555,8 @@ wpi_intr(void *arg) WPI_WRITE(sc, WPI_FH_INT, r2); if (__predict_false(r1 & (WPI_INT_SW_ERR | WPI_INT_HW_ERR))) { + struct ieee80211com *ic = &sc->sc_ic; + device_printf(sc->sc_dev, "fatal firmware error\n"); #ifdef WPI_DEBUG wpi_debug_registers(sc); @@ -2577,7 +2565,7 @@ wpi_intr(void *arg) DPRINTF(sc, WPI_DEBUG_HW, "(%s)\n", (r1 & WPI_INT_SW_ERR) ? "(Software Error)" : "(Hardware Error)"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); goto end; } @@ -3200,7 +3188,7 @@ wpi_scan_timeout(void *arg) struct ieee80211com *ic = &sc->sc_ic; ic_printf(ic, "scan timeout\n"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); } static void @@ -3210,7 +3198,7 @@ wpi_tx_timeout(void *arg) struct ieee80211com *ic = &sc->sc_ic; ic_printf(ic, "device timeout\n"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); } static void @@ -3227,8 +3215,10 @@ wpi_parent(struct ieee80211com *ic) ieee80211_notify_radio(ic, 0); ieee80211_stop(vap); } - } else + } else { + ieee80211_notify_radio(ic, 0); wpi_stop(sc); + } } /* @@ -5654,23 +5644,3 @@ wpi_scan_mindwell(struct ieee80211_scan_ { /* NB: don't try to abort scan; wait for firmware to finish */ } - -static void -wpi_hw_reset(void *arg, int pending) -{ - struct wpi_softc *sc = arg; - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); - - ieee80211_notify_radio(ic, 0); - if (vap != NULL && (ic->ic_flags & IEEE80211_F_SCAN)) - ieee80211_cancel_scan(vap); - - wpi_stop(sc); - if (vap != NULL) { - ieee80211_stop(vap); - ieee80211_init(vap); - } -} Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Mon Mar 21 23:22:19 2016 (r297172) +++ head/sys/dev/wpi/if_wpivar.h Mon Mar 21 23:25:41 2016 (r297173) @@ -228,13 +228,9 @@ struct wpi_softc { struct wpi_dma_info fw_dma; /* Tasks used by the driver. */ - struct task sc_reinittask; struct task sc_radiooff_task; struct task sc_radioon_task; - /* Taskqueue */ - struct taskqueue *sc_tq; - /* Eeprom info. */ uint8_t cap; uint16_t rev; From owner-svn-src-head@freebsd.org Mon Mar 21 23:32:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7125AD8FE1; Mon, 21 Mar 2016 23:32:14 +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 7F3996DC; Mon, 21 Mar 2016 23:32:14 +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 u2LNWDAK070121; Mon, 21 Mar 2016 23:32:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNWDe7070120; Mon, 21 Mar 2016 23:32:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603212332.u2LNWDe7070120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 23:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297174 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 23:32:14 -0000 Author: ian Date: Mon Mar 21 23:32:13 2016 New Revision: 297174 URL: https://svnweb.freebsd.org/changeset/base/297174 Log: Build the zfs module on armv6, but not on older arm. There have been reports in the past that zfs works on armv6, and now people are wanting to test it again, so let's give them something to work with. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Mar 21 23:25:41 2016 (r297173) +++ head/sys/conf/kern.opts.mk Mon Mar 21 23:32:13 2016 (r297174) @@ -65,9 +65,8 @@ __DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OP # Things that don't work based on the CPU .if ${MACHINE_CPUARCH} == "arm" -BROKEN_OPTIONS+= ZFS . if ${MACHINE_ARCH:Marmv6*} == "" -BROKEN_OPTIONS+= CDDL +BROKEN_OPTIONS+= CDDL ZFS . endif .endif From owner-svn-src-head@freebsd.org Tue Mar 22 01:09:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77BE6AD0BA5; Tue, 22 Mar 2016 01:09:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 461C3EDD; Tue, 22 Mar 2016 01:09:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M19Fxf097465; Tue, 22 Mar 2016 01:09:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M19Fh5097464; Tue, 22 Mar 2016 01:09:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603220109.u2M19Fh5097464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Mar 2016 01:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297175 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 01:09:16 -0000 Author: adrian Date: Tue Mar 22 01:09:15 2016 New Revision: 297175 URL: https://svnweb.freebsd.org/changeset/base/297175 Log: [urtwn] welcome basic 11n support to urtwn. This is a pretty good reference for teaching an almost-11n-capable driver about 11n. It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support for transmit. That'll come later. This means that receive throughput should be higher, but transmit throughput won't have changed much. * Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX, so until we correctly handle it in software driven scans, disable. * Add null 11n methods for channel width / ampdu_enable. the firmware can apparently handle ampdu tx (and hopefully block-ack handling and retransmission) so I'll go review the linux code and figure it out. * Set the number of tx/rx streams. I /hope/ that nchains == nstreams here. * Add 11n channels in the call to ieee80211_init_channels(). * Don't enable HT40 for now - I'll have to verify the channel set command and tidy it up a bit first. * Teach the RX path about M_AMPDU for 11n nodes. Kinda wonder why we aren't just doing this in net80211 already, this is the fourth driver I've had to do this to. * Teach rate2ridx() about MCS rates and what hardware rates to use. * Teach the urtwn_tx_data() routine about MCS/11ng transmission. It doesn't know about short-gi and 40MHz modes yet; that'll come later. * For 8192CU firmware, teach the rate table code about MCS rates. * Ensure that the fixed rate transmit sets the right transmit flag so the firmware obeys the driver transmit path. * Set the default transmit rate to MCS4 if no rate control is available. * Add HT protection (RTS-CTS exchange) support. * Add appropriate XXX TODO entries. TODO: * 40MHz, short-gi, etc - channel tuning, TX, RX; * teach urtwn_tx_raw() about (more) 11n stuff; * A-MPDU TX would be nice! Thanks to Andriy (avos@) for reviewing the code and testing it on IRC. Tested: * RTL8188EU - STA (me) * RTL8192CU - STA (me) * RTL8188EU - hostap (avos) * RTL8192CU - STA (avos) Reviewed by: avos Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Mar 21 23:32:13 2016 (r297174) +++ head/sys/dev/urtwn/if_urtwn.c Tue Mar 22 01:09:15 2016 (r297175) @@ -95,6 +95,7 @@ enum { URTWN_DEBUG_ROM = 0x00000200, /* various ROM info */ URTWN_DEBUG_KEY = 0x00000400, /* crypto keys management */ URTWN_DEBUG_TXPWR = 0x00000800, /* dump Tx power values */ + URTWN_DEBUG_RSSI = 0x00001000, /* dump RSSI lookups */ URTWN_DEBUG_ANY = 0xffffffff }; @@ -109,6 +110,9 @@ enum { #define IEEE80211_HAS_ADDR4(wh) IEEE80211_IS_DSTODS(wh) +static int urtwn_enable_11n = 1; +TUNABLE_INT("hw.usb.urtwn.enable_11n", &urtwn_enable_11n); + /* various supported device vendors/products */ static const STRUCT_USB_HOST_ID urtwn_devs[] = { #define URTWN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } @@ -465,6 +469,19 @@ urtwn_match(device_t self) return (usbd_lookup_id_by_uaa(urtwn_devs, sizeof(urtwn_devs), uaa)); } +static void +urtwn_update_chw(struct ieee80211com *ic) +{ +} + +static int +urtwn_ampdu_enable(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) +{ + + /* We're driving this ourselves (eventually); don't involve net80211 */ + return (0); +} + static int urtwn_attach(device_t self) { @@ -555,7 +572,9 @@ urtwn_attach(device_t self) | IEEE80211_C_HOSTAP /* hostap mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ +#if 0 | IEEE80211_C_BGSCAN /* capable of bg scanning */ +#endif | IEEE80211_C_WPA /* 802.11i */ | IEEE80211_C_WME /* 802.11e */ ; @@ -565,9 +584,27 @@ urtwn_attach(device_t self) IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_AES_CCM; + /* Assume they're all 11n capable for now */ + if (urtwn_enable_11n) { + device_printf(self, "enabling 11n\n"); + ic->ic_htcaps = IEEE80211_HTC_HT | + IEEE80211_HTC_AMPDU | + IEEE80211_HTC_AMSDU | + IEEE80211_HTCAP_MAXAMSDU_3839 | + IEEE80211_HTCAP_SMPS_OFF; + /* no HT40 just yet */ + // ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40; + + /* XXX TODO: verify chains versus streams for urtwn */ + ic->ic_txstream = sc->ntxchains; + ic->ic_rxstream = sc->nrxchains; + } + memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); + if (urtwn_enable_11n) + setbit(bands, IEEE80211_MODE_11NG); ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); @@ -589,6 +626,8 @@ urtwn_attach(device_t self) sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = urtwn_r88e_node_free; } + ic->ic_update_chw = urtwn_update_chw; + ic->ic_ampdu_enable = urtwn_ampdu_enable; ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), URTWN_TX_RADIOTAP_PRESENT, @@ -1005,6 +1044,9 @@ urtwn_rx_frame(struct urtwn_softc *sc, s tap->wr_tsft &= 0xffffffff00000000; tap->wr_tsft += stat->rxdw5; + /* XXX 20/40? */ + /* XXX shortgi? */ + /* Map HW rate index to 802.11 rate. */ if (!(rxdw3 & R92C_RXDW3_HT)) { tap->wr_rate = ridx2rate[rate]; @@ -1081,6 +1123,8 @@ tr_setup: nf = URTWN_NOISE_FLOOR; if (ni != NULL) { + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; (void)ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else { @@ -1827,7 +1871,7 @@ urtwn_ra_init(struct urtwn_softc *sc) struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni; - struct ieee80211_rateset *rs; + struct ieee80211_rateset *rs, *rs_ht; struct r92c_fw_cmd_macid_cfg cmd; uint32_t rates, basicrates; uint8_t mode; @@ -1835,10 +1879,13 @@ urtwn_ra_init(struct urtwn_softc *sc) ni = ieee80211_ref_node(vap->iv_bss); rs = &ni->ni_rates; + rs_ht = (struct ieee80211_rateset *) &ni->ni_htrates; /* Get normal and basic rates mask. */ rates = basicrates = 0; maxrate = maxbasicrate = 0; + + /* This is for 11bg */ for (i = 0; i < rs->rs_nrates; i++) { /* Convert 802.11 rate to HW rate index. */ for (j = 0; j < nitems(ridx2rate); j++) @@ -1856,10 +1903,32 @@ urtwn_ra_init(struct urtwn_softc *sc) maxbasicrate = j; } } + + /* If we're doing 11n, enable 11n rates */ + if (ni->ni_flags & IEEE80211_NODE_HT) { + for (i = 0; i < rs_ht->rs_nrates; i++) { + if ((rs_ht->rs_rates[i] & 0x7f) > 0xf) + continue; + /* 11n rates start at index 12 */ + j = ((rs_ht->rs_rates[i]) & 0xf) + 12; + rates |= (1 << j); + + /* Guard against the rate table being oddly ordered */ + if (j > maxrate) + maxrate = j; + } + } + +#if 0 + if (ic->ic_curmode == IEEE80211_MODE_11NG) + raid = R92C_RAID_11GN; +#endif + /* NB: group addressed frames are done at 11bg rates for now */ if (ic->ic_curmode == IEEE80211_MODE_11B) mode = R92C_RAID_11B; else mode = R92C_RAID_11BG; + /* XXX misleading 'mode' value here for unicast frames */ URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: mode 0x%x, rates 0x%08x, basicrates 0x%08x\n", __func__, mode, rates, basicrates); @@ -1874,6 +1943,7 @@ urtwn_ra_init(struct urtwn_softc *sc) "could not add broadcast station\n"); return (error); } + /* Set initial MRR rate. */ URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: maxbasicrate %d\n", __func__, maxbasicrate); @@ -1881,6 +1951,12 @@ urtwn_ra_init(struct urtwn_softc *sc) maxbasicrate); /* Set rates mask for unicast frames. */ + if (ni->ni_flags & IEEE80211_NODE_HT) + mode = R92C_RAID_11GN; + else if (ic->ic_curmode == IEEE80211_MODE_11B) + mode = R92C_RAID_11B; + else + mode = R92C_RAID_11BG; cmd.macid = URTWN_MACID_BSS | URTWN_MACID_VALID; cmd.mask = htole32(mode << 28 | rates); error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd)); @@ -1896,7 +1972,11 @@ urtwn_ra_init(struct urtwn_softc *sc) maxrate); /* Indicate highest supported rate. */ - ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; + if (ni->ni_flags & IEEE80211_NODE_HT) + ni->ni_txrate = rs_ht->rs_rates[rs_ht->rs_nrates - 1] + | IEEE80211_RATE_MCS; + else + ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; ieee80211_free_node(ni); return (0); @@ -2559,7 +2639,7 @@ urtwn_update_avgrssi(struct urtwn_softc sc->avg_pwdb = ((sc->avg_pwdb * 19 + pwdb) / 20) + 1; else sc->avg_pwdb = ((sc->avg_pwdb * 19 + pwdb) / 20); - URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: PWDB %d, EMA %d\n", __func__, + URTWN_DPRINTF(sc, URTWN_DEBUG_RSSI, "%s: PWDB %d, EMA %d\n", __func__, pwdb, sc->avg_pwdb); } @@ -2643,7 +2723,12 @@ urtwn_r88e_get_rssi(struct urtwn_softc * static __inline uint8_t rate2ridx(uint8_t rate) { + if (rate & IEEE80211_RATE_MCS) { + /* 11n rates start at idx 12 */ + return ((rate & 0xf) + 12); + } switch (rate) { + /* 11g */ case 12: return 4; case 18: return 5; case 24: return 6; @@ -2652,6 +2737,7 @@ rate2ridx(uint8_t rate) case 72: return 9; case 96: return 10; case 108: return 11; + /* 11b */ case 2: return 0; case 4: return 1; case 11: return 2; @@ -2711,15 +2797,24 @@ urtwn_tx_data(struct urtwn_softc *sc, st (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } else { - if (ic->ic_curmode != IEEE80211_MODE_11B) + /* XXX TODO: drop the default rate for 11b/11g? */ + if (ni->ni_flags & IEEE80211_NODE_HT) + rate = IEEE80211_RATE_MCS | 0x4; /* MCS4 */ + else if (ic->ic_curmode != IEEE80211_MODE_11B) rate = 108; else rate = 22; } } + /* + * XXX TODO: this should be per-node, for 11b versus 11bg + * nodes in hostap mode + */ ridx = rate2ridx(rate); - if (ic->ic_curmode != IEEE80211_MODE_11B) + if (ni->ni_flags & IEEE80211_NODE_HT) + raid = R92C_RAID_11GN; + else if (ic->ic_curmode != IEEE80211_MODE_11B) raid = R92C_RAID_11BG; else raid = R92C_RAID_11B; @@ -2763,7 +2858,10 @@ urtwn_tx_data(struct urtwn_softc *sc, st } else txd->txdw1 |= htole32(R92C_TXDW1_AGGBK); - if (ic->ic_flags & IEEE80211_F_USEPROT) { + /* protmode, non-HT */ + /* XXX TODO: noack frames? */ + if ((rate & 0x80) == 0 && + (ic->ic_flags & IEEE80211_F_USEPROT)) { switch (ic->ic_protmode) { case IEEE80211_PROT_CTSONLY: txd->txdw4 |= htole32( @@ -2779,8 +2877,21 @@ urtwn_tx_data(struct urtwn_softc *sc, st break; } } + + /* protmode, HT */ + /* XXX TODO: noack frames? */ + if ((rate & 0x80) && + (ic->ic_htprotmode == IEEE80211_PROT_RTSCTS)) { + txd->txdw4 |= htole32( + R92C_TXDW4_RTSEN | + R92C_TXDW4_HWRTSEN); + } + + /* XXX TODO: rtsrate is configurable? 24mbit may + * be a bit high for RTS rate? */ txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, URTWN_RIDX_OFDM24)); + txd->txdw5 |= htole32(0x0001ff00); } else /* IEEE80211_FC0_TYPE_MGT */ qsel = R92C_TXDW1_QSEL_MGNT; @@ -2793,14 +2904,21 @@ urtwn_tx_data(struct urtwn_softc *sc, st SM(R92C_TXDW1_QSEL, qsel) | SM(R92C_TXDW1_RAID, raid)); + /* XXX TODO: 40MHZ flag? */ + /* XXX TODO: AMPDU flag? (AGG_ENABLE or AGG_BREAK?) Density shift? */ + /* XXX Short preamble? */ + /* XXX Short-GI? */ + if (sc->chip & URTWN_CHIP_88E) txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, macid)); else txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, macid)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); + /* Force this rate if needed. */ if (URTWN_CHIP_HAS_RATECTL(sc) || ismcast || + (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) || (m->m_flags & M_EAPOL) || type != IEEE80211_FC0_TYPE_DATA) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); @@ -2888,6 +3006,8 @@ urtwn_tx_raw(struct urtwn_softc *sc, str } } + /* XXX TODO: 11n checks, matching urtwn_tx_data() */ + wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; @@ -2916,6 +3036,7 @@ urtwn_tx_raw(struct urtwn_softc *sc, str else txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC)); + /* XXX TODO: rate index/config (RAID) for 11n? */ txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT)); txd->txdw1 |= htole32(SM(R92C_TXDW1_CIPHER, cipher)); From owner-svn-src-head@freebsd.org Tue Mar 22 05:48:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB158AD882D; Tue, 22 Mar 2016 05:48:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD2F02BA; Tue, 22 Mar 2016 05:48:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M5mpN1081705; Tue, 22 Mar 2016 05:48:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M5mpnc081701; Tue, 22 Mar 2016 05:48:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220548.u2M5mpnc081701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 05:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297176 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 05:48:53 -0000 Author: sephe Date: Tue Mar 22 05:48:51 2016 New Revision: 297176 URL: https://svnweb.freebsd.org/changeset/base/297176 Log: hyperv/evttimer: Use an independent message slot so that it can work Using the same message slot as the other types of the messages has the side effect that the event timer message could be deferred to the swi threads to run (lacking of trapframe and the original code didn't even handle that, so the event timer was actually broken). As of this commit we use an independent message slot for event timer, so that we could handle all of event timer messages in the interrupt handler directly. Note, the message slot for event timer is still bind to the same interrupt vector as the other types of messages. Submitted by: Jun Su Reviewed by: sephe Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5696 Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_et.c Tue Mar 22 05:48:51 2016 (r297176) @@ -60,7 +60,7 @@ hv_et_start(struct eventtimer *et, sbint timer_cfg.as_uint64 = 0; timer_cfg.auto_enable = 1; - timer_cfg.sintx = HV_VMBUS_MESSAGE_SINT; + timer_cfg.sintx = HV_VMBUS_TIMER_SINT; periodticks[curcpu] = sbintime2tick(periodtime); if (firsttime == 0) Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Tue Mar 22 05:48:51 2016 (r297176) @@ -368,6 +368,9 @@ hv_vmbus_synic_init(void *arg) wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); + /* Enable the global synic bit */ sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); sctrl.u.enable = 1; @@ -404,12 +407,23 @@ void hv_vmbus_synic_cleanup(void *arg) shared_sint.u.masked = 1; /* - * Disable the interrupt + * Disable the interrupt 0 */ wrmsr( HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + shared_sint.as_uint64_t = rdmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); + + shared_sint.u.masked = 1; + + /* + * Disable the interrupt 1 + */ + wrmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); simp.u.simp_enabled = 0; simp.u.base_simp_gpa = 0; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 05:48:51 2016 (r297176) @@ -175,12 +175,15 @@ hv_vmbus_isr(struct trapframe *frame) /* Check if there are actual msgs to be process */ page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { msg->header.message_type = HV_MESSAGE_TYPE_NONE; + /* call intrrupt handler of event timer */ + hv_et_intr(frame); + /* * Make sure the write to message_type (ie set to * HV_MESSAGE_TYPE_NONE) happens before we read the @@ -197,10 +200,9 @@ hv_vmbus_isr(struct trapframe *frame) */ wrmsr(HV_X64_MSR_EOM, 0); } - hv_et_intr(frame); - return (FILTER_HANDLED); } + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 05:48:51 2016 (r297176) @@ -180,7 +180,8 @@ enum { HV_VMBUS_EVENT_PORT_ID = 2, HV_VMBUS_MONITOR_CONNECTION_ID = 3, HV_VMBUS_MONITOR_PORT_ID = 3, - HV_VMBUS_MESSAGE_SINT = 2 + HV_VMBUS_MESSAGE_SINT = 2, + HV_VMBUS_TIMER_SINT = 4, }; #define HV_PRESENT_BIT 0x80000000 From owner-svn-src-head@freebsd.org Tue Mar 22 06:13:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E5FAD8CC6; Tue, 22 Mar 2016 06:13:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 144D7F86; Tue, 22 Mar 2016 06:13:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M6DSBd090744; Tue, 22 Mar 2016 06:13:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6DSAb090742; Tue, 22 Mar 2016 06:13:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220613.u2M6DSAb090742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297177 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:13:29 -0000 Author: sephe Date: Tue Mar 22 06:13:27 2016 New Revision: 297177 URL: https://svnweb.freebsd.org/changeset/base/297177 Log: hyperv/vmbus: Use taskqueue_fast for non-performance critical messages This gets rid of the per-cpu SWIs. Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 05:48:51 2016 (r297176) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:13:27 2016 (r297177) @@ -76,7 +76,7 @@ static char *vmbus_ids[] = { "VMBUS", NU * the hypervisor. */ static void -vmbus_msg_swintr(void *arg) +vmbus_msg_swintr(void *arg, int pending __unused) { int cpu; void* page_addr; @@ -204,7 +204,7 @@ hv_vmbus_isr(struct trapframe *frame) msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); + taskqueue_enqueue(taskqueue_fast, &hv_vmbus_g_context.hv_msg_task[cpu]); } return (FILTER_HANDLED); @@ -510,9 +510,6 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.msg_swintr[j] = NULL; - snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); intrcnt_add(buf, &hv_vmbus_intr_cpu[j]); @@ -539,30 +536,9 @@ vmbus_bus_init(void) "hvevent%d", j); /* - * Setup software interrupt thread and handler for msg handling. + * Setup tasks to handle msg */ - ret = swi_add(&hv_vmbus_g_context.hv_msg_intr_event[j], - "hv_msg", vmbus_msg_swintr, (void *)(long)j, SWI_CLOCK, 0, - &hv_vmbus_g_context.msg_swintr[j]); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to setup msg swi for " - "cpu %d\n", j); - goto cleanup1; - } - - /* - * Bind the swi thread to the cpu. - */ - ret = intr_event_bind(hv_vmbus_g_context.hv_msg_intr_event[j], - j); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to bind msg swi thread " - "to cpu %d\n", j); - goto cleanup1; - } - + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, vmbus_msg_swintr, (void *)(long)j); /* * Prepare the per cpu msg and event pages to be called on each cpu. */ @@ -601,11 +577,10 @@ vmbus_bus_init(void) * remove swi and vmbus callback vector; */ CPU_FOREACH(j) { - if (hv_vmbus_g_context.hv_event_queue[j] != NULL) + if (hv_vmbus_g_context.hv_event_queue[j] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.msg_swintr[j] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[j]); - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; + hv_vmbus_g_context.hv_event_queue[j] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -670,11 +645,10 @@ vmbus_bus_exit(void) /* remove swi */ CPU_FOREACH(i) { - if (hv_vmbus_g_context.hv_event_queue[i] != NULL) + if (hv_vmbus_g_context.hv_event_queue[i] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); - if (hv_vmbus_g_context.msg_swintr[i] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[i]); - hv_vmbus_g_context.hv_msg_intr_event[i] = NULL; + hv_vmbus_g_context.hv_event_queue[i] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 05:48:51 2016 (r297176) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 06:13:27 2016 (r297177) @@ -204,8 +204,7 @@ typedef struct { * event and msg handling. */ struct taskqueue *hv_event_queue[MAXCPU]; - struct intr_event *hv_msg_intr_event[MAXCPU]; - void *msg_swintr[MAXCPU]; + struct task hv_msg_task[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel * event and msg. From owner-svn-src-head@freebsd.org Tue Mar 22 06:23:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8389AD8EC7; Tue, 22 Mar 2016 06:23:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA2F86E4; Tue, 22 Mar 2016 06:23:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M6N938093693; Tue, 22 Mar 2016 06:23:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6N9kp093692; Tue, 22 Mar 2016 06:23:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220623.u2M6N9kp093692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297178 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:23:11 -0000 Author: sephe Date: Tue Mar 22 06:23:09 2016 New Revision: 297178 URL: https://svnweb.freebsd.org/changeset/base/297178 Log: hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK) Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:13:27 2016 (r297177) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:23:09 2016 (r297178) @@ -526,11 +526,6 @@ vmbus_bus_init(void) */ hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.hv_event_queue[j] == NULL) { - if (bootverbose) - printf("VMBUS: failed to setup taskqueue\n"); - goto cleanup1; - } CPU_SETOF(j, &cpu_mask); taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, &cpu_mask, "hvevent%d", j); From owner-svn-src-head@freebsd.org Tue Mar 22 06:24:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879B6AD8F25; Tue, 22 Mar 2016 06:24:53 +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 463BB8A0; Tue, 22 Mar 2016 06:24:53 +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 u2M6Oqpj093786; Tue, 22 Mar 2016 06:24:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6OqNo093785; Tue, 22 Mar 2016 06:24:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603220624.u2M6OqNo093785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Mar 2016 06:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297179 - head/sys/dev/ipmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:24:53 -0000 Author: mav Date: Tue Mar 22 06:24:52 2016 New Revision: 297179 URL: https://svnweb.freebsd.org/changeset/base/297179 Log: Optimize IPMI watchdog patting. Set watchdog timer parameters only when they really need to be changed. In other cases just restart the timer with single Reset command instead of two (Set and Reset). From one side this visually reduces amount of CPU time burned in tight loop waiting while some slow BMC configures its watchdog hardware, that seems to be much more complicated task then just resetting the timer. From another side on some BMCs those slow Set commands sometimes tend to timeout, that leads to noisy log messages and even more CPU time burned, so avoiding them can provide even bigger bonuses. MFC after: 2 weeks Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Tue Mar 22 06:23:09 2016 (r297178) +++ head/sys/dev/ipmi/ipmi.c Tue Mar 22 06:24:52 2016 (r297179) @@ -603,6 +603,20 @@ ipmi_polled_enqueue_request(struct ipmi_ */ static int +ipmi_reset_watchdog(struct ipmi_softc *sc) +{ + struct ipmi_request *req; + int error; + + IPMI_ALLOC_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), + IPMI_RESET_WDOG, 0, 0); + error = ipmi_submit_driver_request(sc, req, 0); + if (error) + device_printf(sc->ipmi_dev, "Failed to reset watchdog\n"); + return (error); +} + +static int ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; @@ -613,7 +627,6 @@ ipmi_set_watchdog(struct ipmi_softc *sc, IPMI_ALLOC_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); - if (sec) { req->ir_request[0] = IPMI_SET_WD_TIMER_DONT_STOP | IPMI_SET_WD_TIMER_SMS_OS; @@ -630,24 +643,10 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[4] = 0; req->ir_request[5] = 0; } - error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - else if (sec) { - IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), - IPMI_RESET_WDOG, 0, 0); - - error = ipmi_submit_driver_request(sc, req, 0); - if (error) - device_printf(sc->ipmi_dev, - "Failed to reset watchdog\n"); - } - return (error); - /* - dump_watchdog(sc); - */ } static void @@ -665,12 +664,24 @@ ipmi_wd_event(void *arg, unsigned int cm timeout = ((uint64_t)1 << cmd) / 1000000000; if (timeout == 0) timeout = 1; - e = ipmi_set_watchdog(sc, timeout); - if (e == 0) { - *error = 0; - sc->ipmi_watchdog_active = 1; - } else - (void)ipmi_set_watchdog(sc, 0); + if (timeout != sc->ipmi_watchdog_active) { + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) { + sc->ipmi_watchdog_active = timeout; + } else { + (void)ipmi_set_watchdog(sc, 0); + sc->ipmi_watchdog_active = 0; + } + } + if (sc->ipmi_watchdog_active != 0) { + e = ipmi_reset_watchdog(sc); + if (e == 0) { + *error = 0; + } else { + (void)ipmi_set_watchdog(sc, 0); + sc->ipmi_watchdog_active = 0; + } + } } else if (atomic_readandclear_int(&sc->ipmi_watchdog_active) != 0) { e = ipmi_set_watchdog(sc, 0); if (e != 0 && cmd == 0) From owner-svn-src-head@freebsd.org Tue Mar 22 06:31:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D25F4AD80C0; Tue, 22 Mar 2016 06:31:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FCF5C2F; Tue, 22 Mar 2016 06:31:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M6VdnV096745; Tue, 22 Mar 2016 06:31:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6Vd2G096744; Tue, 22 Mar 2016 06:31:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220631.u2M6Vd2G096744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297180 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:31:40 -0000 Author: sephe Date: Tue Mar 22 06:31:39 2016 New Revision: 297180 URL: https://svnweb.freebsd.org/changeset/base/297180 Log: hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings This mainly used to improve ACK timeliness when multiple RX rings are enabled. This value gives the best performance in both Azure and Hyper-V environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS} kernel. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5691 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:24:52 2016 (r297179) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:31:39 2016 (r297180) @@ -181,6 +181,7 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8 (CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) +#define HN_LRO_LENLIM_MULTIRX_DEF (12 * ETHERMTU) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ #define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) @@ -530,6 +531,21 @@ netvsc_attach(device_t dev) device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); +#if __FreeBSD_version >= 1100099 + if (sc->hn_rx_ring_inuse > 1) { + int i; + + /* + * Reduce TCP segment aggregation limit for multiple + * RX rings to increase ACK timeliness. + */ + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + sc->hn_rx_ring[i].hn_lro.lro_length_lim = + HN_LRO_LENLIM_MULTIRX_DEF; + } + } +#endif + if (device_info.link_state == 0) { sc->hn_carrier = 1; } From owner-svn-src-head@freebsd.org Tue Mar 22 06:42:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58B58AD8450; Tue, 22 Mar 2016 06:42:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 074A227C; Tue, 22 Mar 2016 06:42:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M6gOjr099716; Tue, 22 Mar 2016 06:42:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6gO5Y099715; Tue, 22 Mar 2016 06:42:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220642.u2M6gO5Y099715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297181 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:42:25 -0000 Author: sephe Date: Tue Mar 22 06:42:24 2016 New Revision: 297181 URL: https://svnweb.freebsd.org/changeset/base/297181 Log: hyperv/hn: Factor out hn_set_lro_lenlim() MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5692 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:31:39 2016 (r297180) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:42:24 2016 (r297181) @@ -334,6 +334,17 @@ static void hn_xmit_txeof(struct hn_tx_r static void hn_xmit_taskfunc(void *, int); static void hn_xmit_txeof_taskfunc(void *, int); +#if __FreeBSD_version >= 1100099 +static void +hn_set_lro_lenlim(struct hn_softc *sc, int lenlim) +{ + int i; + + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) + sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; +} +#endif + static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -533,16 +544,11 @@ netvsc_attach(device_t dev) #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { - int i; - /* * Reduce TCP segment aggregation limit for multiple * RX rings to increase ACK timeliness. */ - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { - sc->hn_rx_ring[i].hn_lro.lro_length_lim = - HN_LRO_LENLIM_MULTIRX_DEF; - } + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MULTIRX_DEF); } #endif @@ -1465,14 +1471,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ NV_LOCK(sc); if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < - HN_LRO_LENLIM_MIN(ifp)) { - int i; - - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { - sc->hn_rx_ring[i].hn_lro.lro_length_lim = - HN_LRO_LENLIM_MIN(ifp); - } - } + HN_LRO_LENLIM_MIN(ifp)) + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); NV_UNLOCK(sc); #endif @@ -1805,7 +1805,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS { struct hn_softc *sc = arg1; unsigned int lenlim; - int error, i; + int error; lenlim = sc->hn_rx_ring[0].hn_lro.lro_length_lim; error = sysctl_handle_int(oidp, &lenlim, 0, req); @@ -1817,8 +1817,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS return EINVAL; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) - sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; + hn_set_lro_lenlim(sc, lenlim); NV_UNLOCK(sc); return 0; } From owner-svn-src-head@freebsd.org Tue Mar 22 07:08:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7F8AD893E; Tue, 22 Mar 2016 07:08:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF22E8F; Tue, 22 Mar 2016 07:08:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M78laP005890; Tue, 22 Mar 2016 07:08:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M78lkE005889; Tue, 22 Mar 2016 07:08:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220708.u2M78lkE005889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 07:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297182 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 07:08:48 -0000 Author: sephe Date: Tue Mar 22 07:08:47 2016 New Revision: 297182 URL: https://svnweb.freebsd.org/changeset/base/297182 Log: hyperv/hn: When short of mbufs on the RX path, don't spam the console. Instead, increase the IQDROPS counter. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5693 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:42:24 2016 (r297181) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 07:08:47 2016 (r297182) @@ -1260,8 +1260,10 @@ netvsc_recv(struct hv_vmbus_channel *cha return (0); } else if (packet->tot_data_buf_len <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); + } memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; @@ -1281,7 +1283,7 @@ netvsc_recv(struct hv_vmbus_channel *cha m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - if_printf(ifp, "alloc mbuf failed.\n"); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); } From owner-svn-src-head@freebsd.org Tue Mar 22 08:12:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E936AD8B5D; Tue, 22 Mar 2016 08:12:46 +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 10600F74; Tue, 22 Mar 2016 08:12: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 u2M8Cja8026633; Tue, 22 Mar 2016 08:12:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M8CjL6026632; Tue, 22 Mar 2016 08:12:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603220812.u2M8CjL6026632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Mar 2016 08:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297183 - head/tests/sys/geom/class X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 08:12:46 -0000 Author: ngie Date: Tue Mar 22 08:12:45 2016 New Revision: 297183 URL: https://svnweb.freebsd.org/changeset/base/297183 Log: Use a SKIP testplan instead of bailing out if/when the tester isn't root, or the geom class can't be loaded cleanly [*] This makes sure that scenarios that are easy to hit aren't counted as false positives with kyua test MFC after: 1 week PR: 208101 Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/geom/class/geom_subr.sh Modified: head/tests/sys/geom/class/geom_subr.sh ============================================================================== --- head/tests/sys/geom/class/geom_subr.sh Tue Mar 22 07:08:47 2016 (r297182) +++ head/tests/sys/geom/class/geom_subr.sh Tue Mar 22 08:12:45 2016 (r297183) @@ -35,16 +35,14 @@ geom_test_cleanup() } if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 + echo '1..0 # SKIP tests must be run as root' + exit 0 fi # If the geom class isn't already loaded, try loading it. if ! kldstat -q -m g_${class}; then if ! geom ${class} load; then - echo "Could not load module for geom class=${class}" - echo 'Bail out!' - exit 1 + echo "1..0 # SKIP could not load module for geom class=${class}" + exit 0 fi fi From owner-svn-src-head@freebsd.org Tue Mar 22 08:36:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB137AD8039; Tue, 22 Mar 2016 08:36:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D614AEA; Tue, 22 Mar 2016 08:36:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2M8aPSd032959; Tue, 22 Mar 2016 08:36:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M8aPV6032958; Tue, 22 Mar 2016 08:36:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603220836.u2M8aPV6032958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Mar 2016 08:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297184 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 08:36:26 -0000 Author: andrew Date: Tue Mar 22 08:36:25 2016 New Revision: 297184 URL: https://svnweb.freebsd.org/changeset/base/297184 Log: Use the saved program state register to detect when an exception frame is from userpsace. Previously we could have triggered a panic by trying to jump to a kernel address from userland as the trap handling code thought we received an ast in kernel mode. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Tue Mar 22 08:12:45 2016 (r297183) +++ head/sys/arm64/include/cpu.h Tue Mar 22 08:36:25 2016 (r297184) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2016 The FreeBSD Foundation * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -46,7 +46,7 @@ #include #define TRAPF_PC(tfp) ((tfp)->tf_lr) -#define TRAPF_USERMODE(tfp) (((tfp)->tf_elr & (1ul << 63)) == 0) +#define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t) #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) From owner-svn-src-head@freebsd.org Tue Mar 22 09:44:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41375AD7603 for ; Tue, 22 Mar 2016 09:44:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6811B1; Tue, 22 Mar 2016 09:44:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id DCF883AC9C; Tue, 22 Mar 2016 10:39:30 +0100 (CET) Subject: Re: svn commit: r297047 - head/sys/conf To: "Bjoern A. Zeeb" , svn-src-head@freebsd.org References: <201603182355.u2INtPfi039124@repo.freebsd.org> From: Michal Meloun X-Enigmail-Draft-Status: N1110 Message-ID: <56F112D2.1000006@FreeBSD.org> Date: Tue, 22 Mar 2016 10:39:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201603182355.u2INtPfi039124@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Tue, 22 Mar 2016 10:39:30 +0100 (CET) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 09:44:52 -0000 Dne 19.03.2016 v 0:55 Bjoern A. Zeeb napsal(a): > Author: bz > Date: Fri Mar 18 23:55:25 2016 > New Revision: 297047 > URL: https://svnweb.freebsd.org/changeset/base/297047 > > Log: > Allow pci_host_generic to be compiled into ARM kernels, used, e.g., in > simulators. > > Sponsored by: DARPA/AFRL > > Modified: > head/sys/conf/files.arm > > Modified: head/sys/conf/files.arm > ============================================================================== > --- head/sys/conf/files.arm Fri Mar 18 22:52:11 2016 (r297046) > +++ head/sys/conf/files.arm Fri Mar 18 23:55:25 2016 (r297047) > @@ -103,6 +103,7 @@ dev/hwpmc/hwpmc_arm.c optional hwpmc > dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 > dev/iicbus/twsi/twsi.c optional twsi > dev/ofw/ofw_cpu.c optional fdt > +dev/pci/pci_host_generic.c optional pci fdt > dev/psci/psci.c optional psci > dev/psci/psci_arm.S optional psci > dev/syscons/scgfbrndr.c optional sc > This commit broke Tegra and all others boards with PCI(e) interface. The pci_host_generic.c driver is unconditionally build into all kernels with PCI and FDT defined. But, for now, we don't support multiple different pcib in one kernel (all pcib drivers must have same driver name 'pcib', because pci bus binding). Please, convert this driver to standard device form (e.g.'device pci_host_generic'). Michal From owner-svn-src-head@freebsd.org Tue Mar 22 10:51:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35C0BAD94AD; Tue, 22 Mar 2016 10:51:44 +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 EB2C4266; Tue, 22 Mar 2016 10:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MAphLp074525; Tue, 22 Mar 2016 10:51:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MAphFa074523; Tue, 22 Mar 2016 10:51:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603221051.u2MAphFa074523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Mar 2016 10:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297185 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 10:51:44 -0000 Author: kib Date: Tue Mar 22 10:51:42 2016 New Revision: 297185 URL: https://svnweb.freebsd.org/changeset/base/297185 Log: Apparently there are some popular programs around which assume that it is safe to call pthread_mutex_init() on the same shared mutex several times. POSIX claims that the behaviour in this case is undefined. Make this working by only allowing one caller to initialize the mutex. Other callers either see already completed initialization and do nothing, or busy-loop yielding while designated initializer finishes. Also make the API requirements loose by initializing mutexes on other pthread_mutex*() calls if they see uninitialized shared mutex. Only mutexes provide the hack for now, but it could be also implemented for other process shared primitives from libthr. Reported and tested by: "Oleg V. Nauman" Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue Mar 22 08:36:25 2016 (r297184) +++ head/lib/libthr/thread/thr_mutex.c Tue Mar 22 10:51:42 2016 (r297185) @@ -38,6 +38,7 @@ * $FreeBSD$ */ +#include #include "namespace.h" #include #include @@ -264,6 +265,51 @@ set_inherited_priority(struct pthread *c m->m_lock.m_ceilings[1] = -1; } +static void +shared_mutex_init(struct pthread_mutex *pmtx, const struct + pthread_mutex_attr *mutex_attr) +{ + static const struct pthread_mutex_attr foobar_mutex_attr = { + .m_type = PTHREAD_MUTEX_DEFAULT, + .m_protocol = PTHREAD_PRIO_NONE, + .m_ceiling = 0, + .m_pshared = PTHREAD_PROCESS_SHARED + }; + bool done; + + /* + * Hack to allow multiple pthread_mutex_init() calls on the + * same process-shared mutex. We rely on kernel allocating + * zeroed offpage for the mutex, i.e. the + * PMUTEX_INITSTAGE_ALLOC value must be zero. + */ + for (done = false; !done;) { + switch (pmtx->m_ps) { + case PMUTEX_INITSTAGE_DONE: + atomic_thread_fence_acq(); + done = true; + break; + case PMUTEX_INITSTAGE_ALLOC: + if (atomic_cmpset_int(&pmtx->m_ps, + PMUTEX_INITSTAGE_ALLOC, PMUTEX_INITSTAGE_BUSY)) { + if (mutex_attr == NULL) + mutex_attr = &foobar_mutex_attr; + mutex_init_body(pmtx, mutex_attr); + atomic_store_rel_int(&pmtx->m_ps, + PMUTEX_INITSTAGE_DONE); + done = true; + } + break; + case PMUTEX_INITSTAGE_BUSY: + _pthread_yield(); + break; + default: + PANIC("corrupted offpage"); + break; + } + } +} + int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr) @@ -285,7 +331,7 @@ __pthread_mutex_init(pthread_mutex_t *mu if (pmtx == NULL) return (EFAULT); *mutex = THR_PSHARED_PTR; - mutex_init_body(pmtx, *mutex_attr); + shared_mutex_init(pmtx, *mutex_attr); return (0); } @@ -426,6 +472,7 @@ check_and_init_mutex(pthread_mutex_t *mu *m = __thr_pshared_offpage(mutex, 0); if (*m == NULL) ret = EINVAL; + shared_mutex_init(*m, NULL); } else if (__predict_false(*m <= THR_MUTEX_DESTROYED)) { if (*m == THR_MUTEX_DESTROYED) { ret = EINVAL; @@ -588,6 +635,7 @@ _pthread_mutex_unlock(pthread_mutex_t *m mp = __thr_pshared_offpage(mutex, 0); if (mp == NULL) return (EINVAL); + shared_mutex_init(mp, NULL); } else { mp = *mutex; } @@ -815,6 +863,7 @@ _pthread_mutex_getprioceiling(pthread_mu m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (EINVAL); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) @@ -839,6 +888,7 @@ _pthread_mutex_setprioceiling(pthread_mu m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (EINVAL); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) @@ -942,12 +992,13 @@ __pthread_mutex_setyieldloops_np(pthread int _pthread_mutex_isowned_np(pthread_mutex_t *mutex) { - struct pthread_mutex *m; + struct pthread_mutex *m; if (*mutex == THR_PSHARED_PTR) { m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (0); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Mar 22 08:36:25 2016 (r297184) +++ head/lib/libthr/thread/thr_private.h Tue Mar 22 10:51:42 2016 (r297185) @@ -146,6 +146,13 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); #define MAX_DEFER_WAITERS 50 +/* + * Values for pthread_mutex m_ps indicator. + */ +#define PMUTEX_INITSTAGE_ALLOC 0 +#define PMUTEX_INITSTAGE_BUSY 1 +#define PMUTEX_INITSTAGE_DONE 2 + struct pthread_mutex { /* * Lock for accesses to this structure. @@ -156,6 +163,7 @@ struct pthread_mutex { int m_count; int m_spinloops; int m_yieldloops; + int m_ps; /* pshared init stage */ /* * Link for all mutexes a thread currently owns, of the same * prio type. From owner-svn-src-head@freebsd.org Tue Mar 22 11:39:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24AD1AD9F5A for ; Tue, 22 Mar 2016 11:39:39 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2BF4F22; Tue, 22 Mar 2016 11:39:38 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aiKev-0007Si-FQ; Tue, 22 Mar 2016 12:39:37 +0100 To: svn-src-head@freebsd.org, Bryan Drewery References: <201603152227.u2FMRUAc003895@repo.freebsd.org> Subject: Re: svn commit: r296921 - head/share/mk From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56F12EF2.9010601@FreeBSD.org> Date: Tue, 22 Mar 2016 12:39:30 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603152227.u2FMRUAc003895@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mnOTfVLLQfNBDXi5IgBjQLB3dWKqLFSmj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 11:39:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mnOTfVLLQfNBDXi5IgBjQLB3dWKqLFSmj Content-Type: multipart/mixed; boundary="IrDS9MrUAl9Uick8p7KfrSmxL8ijjxTKS" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: svn-src-head@freebsd.org, Bryan Drewery Message-ID: <56F12EF2.9010601@FreeBSD.org> Subject: Re: svn commit: r296921 - head/share/mk References: <201603152227.u2FMRUAc003895@repo.freebsd.org> In-Reply-To: <201603152227.u2FMRUAc003895@repo.freebsd.org> --IrDS9MrUAl9Uick8p7KfrSmxL8ijjxTKS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! I can't install world with a read-only /usr/obj anymore: https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 It looks related to r296921 but I don't fully understand our build system to be sure of that. What do you think? --=20 Jean-S=C3=A9bastien P=C3=A9dron --IrDS9MrUAl9Uick8p7KfrSmxL8ijjxTKS-- --mnOTfVLLQfNBDXi5IgBjQLB3dWKqLFSmj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJW8S7yXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMS4cQAKijS+iSLyEZQ0kGy7AtIK+z ybHkUCLyslNS9pL+yHXym59HWj3eZkqB3vXvY4DfngaYuEoKRHfFpyVADTbkpNq1 3oJM4BjUjvT3JeNFxmeojCWOABlRIxBkFgtf8WvywuEHqXZa4WoD2jqknodLOrLR 2oFDE1ow1G3BXQR2xXMKWilqjtfVoaQYIrH3kz9G2UJCkYcaHDOKYltKcwvvXpIe CwBh7NhS7g6465XVl02yFiQwjZ8g9m5JmdSwDbx8vxBeO5o3OKi+JzLEzAo+KvPU UwTyx1/FDLWNGEw1C4uJ22f9HDsa4hC/7kEz1K9f6HFUDEma5YronUBUytjer8EC 2wqdi/z6gW9Mslhic8lfuNuopA/ExQgHcgsfaUNY529pkD4n6hTeeSGcAJXH6Sly cQZR2ewf9C1dFCJOE9HurILbCYUbK16Tqli8kZMqmQjdtjNN2wu1Rl2beZvpUIJB BYroGA+khM2n5HhsZjsmcyyznXwoWTlblpBk/FzecHOHcPkuJaysVxQNm687F6oM 6igpSKm62o5VxLy/s/vPUQnPRTUSlju4kEPm8cA6xQFpgN5W7G0bC4pULyIBpAqV QWYKBmOedsdj2AdDNOrA+9y/eUP8s1fp9PkLWyFzOOQe89C9Nd0NJ8nUzPUU8XUR jbhA7afe0CM+ELSt8QCD =+r0X -----END PGP SIGNATURE----- --mnOTfVLLQfNBDXi5IgBjQLB3dWKqLFSmj-- From owner-svn-src-head@freebsd.org Tue Mar 22 12:12:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BD1AD73B2; Tue, 22 Mar 2016 12:12:02 +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 8F6C817C0; Tue, 22 Mar 2016 12:12:02 +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 u2MCC1vj099535; Tue, 22 Mar 2016 12:12:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MCC18F099534; Tue, 22 Mar 2016 12:12:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221212.u2MCC18F099534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 12:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297186 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 12:12:02 -0000 Author: bz Date: Tue Mar 22 12:12:01 2016 New Revision: 297186 URL: https://svnweb.freebsd.org/changeset/base/297186 Log: Adding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface. Make it a device option to be included in the kernel configs that request this file. Reported by: mmel Suggested by: mmel Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D5699 Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Mar 22 10:51:42 2016 (r297185) +++ head/sys/conf/files.arm Tue Mar 22 12:12:01 2016 (r297186) @@ -103,7 +103,7 @@ dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/iicbus/twsi/twsi.c optional twsi dev/ofw/ofw_cpu.c optional fdt -dev/pci/pci_host_generic.c optional pci fdt +dev/pci/pci_host_generic.c optional pci_host_generic pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc From owner-svn-src-head@freebsd.org Tue Mar 22 12:40:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B643AD7E66; Tue, 22 Mar 2016 12:40:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F07D88B7; Tue, 22 Mar 2016 12:40:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MCeAv2006833; Tue, 22 Mar 2016 12:40:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MCeAVM006831; Tue, 22 Mar 2016 12:40:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603221240.u2MCeAVM006831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 22 Mar 2016 12:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297187 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 12:40:11 -0000 Author: tuexen Date: Tue Mar 22 12:40:09 2016 New Revision: 297187 URL: https://svnweb.freebsd.org/changeset/base/297187 Log: Support checksum offloading for TCP/IPV6 and UDP/IPV6. Support SCTP checksum offloading for SCTP/IPV6. Support SCTP checksum offloading on all controllers except 82575. Reviewed by: sbruno@, erj@ MFC after: 4 weeks Differential Revision: D5193 Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Mar 22 12:12:01 2016 (r297186) +++ head/sys/dev/e1000/if_igb.c Tue Mar 22 12:40:09 2016 (r297187) @@ -1184,10 +1184,27 @@ igb_ioctl(struct ifnet *ifp, u_long comm } } #endif +#if __FreeBSD_version >= 1000000 + /* HW cannot turn these on/off separately */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + ifp->if_capenable ^= IFCAP_RXCSUM; + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + reinit = 1; + } + if (mask & IFCAP_TXCSUM) { + ifp->if_capenable ^= IFCAP_TXCSUM; + reinit = 1; + } + if (mask & IFCAP_TXCSUM_IPV6) { + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + reinit = 1; + } +#else if (mask & IFCAP_HWCSUM) { ifp->if_capenable ^= IFCAP_HWCSUM; reinit = 1; } +#endif if (mask & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; reinit = 1; @@ -1266,14 +1283,26 @@ igb_init_locked(struct adapter *adapter) /* Set hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) { +#if __FreeBSD_version >= 1000000 + ifp->if_hwassist |= (CSUM_IP_TCP | CSUM_IP_UDP); + if (adapter->hw.mac.type != e1000_82575) + ifp->if_hwassist |= CSUM_IP_SCTP; +#else ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); #if __FreeBSD_version >= 800000 - if ((adapter->hw.mac.type == e1000_82576) || - (adapter->hw.mac.type == e1000_82580)) + if (adapter->hw.mac.type != e1000_82575) ifp->if_hwassist |= CSUM_SCTP; #endif +#endif } +#if __FreeBSD_version >= 1000000 + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) { + ifp->if_hwassist |= (CSUM_IP6_TCP | CSUM_IP6_UDP); + if (adapter->hw.mac.type != e1000_82575) + ifp->if_hwassist |= CSUM_IP6_SCTP; + } +#endif if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; @@ -3160,6 +3189,9 @@ igb_setup_interface(device_t dev, struct ifp->if_capabilities = ifp->if_capenable = 0; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; +#if __FreeBSD_version >= 1000000 + ifp->if_capabilities |= IFCAP_HWCSUM_IPV6; +#endif ifp->if_capabilities |= IFCAP_TSO; ifp->if_capabilities |= IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; @@ -3933,17 +3965,29 @@ igb_tx_ctx_setup(struct tx_ring *txr, st switch (ipproto) { case IPPROTO_TCP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_TCP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP; break; case IPPROTO_UDP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_UDP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP; break; #if __FreeBSD_version >= 800000 case IPPROTO_SCTP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_SCTP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP; break; #endif @@ -4701,8 +4745,7 @@ igb_initialize_receive_units(struct adap rxcsum |= E1000_RXCSUM_PCSD; #if __FreeBSD_version >= 800000 /* For SCTP Offload */ - if (((hw->mac.type == e1000_82576) || - (hw->mac.type == e1000_82580)) && + if ((hw->mac.type != e1000_82575) && (ifp->if_capenable & IFCAP_RXCSUM)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif @@ -4711,8 +4754,7 @@ igb_initialize_receive_units(struct adap if (ifp->if_capenable & IFCAP_RXCSUM) { rxcsum |= E1000_RXCSUM_IPPCSE; #if __FreeBSD_version >= 800000 - if ((adapter->hw.mac.type == e1000_82576) || - (adapter->hw.mac.type == e1000_82580)) + if (adapter->hw.mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Tue Mar 22 12:12:01 2016 (r297186) +++ head/sys/dev/e1000/if_igb.h Tue Mar 22 12:40:09 2016 (r297187) @@ -291,7 +291,11 @@ #define ETH_ADDR_LEN 6 /* Offload bits in mbuf flag */ -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 1000000 +#define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_IP_TCP|CSUM_IP_UDP|CSUM_IP_SCTP) +#define CSUM_OFFLOAD_IPV6 (CSUM_IP6_TCP|CSUM_IP6_UDP|CSUM_IP6_SCTP) +#define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6) +#elif __FreeBSD_version >= 800000 #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #else #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP) From owner-svn-src-head@freebsd.org Tue Mar 22 13:16:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 796F8AD98C4; Tue, 22 Mar 2016 13:16:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45C859AA; Tue, 22 Mar 2016 13:16:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MDGrku020254; Tue, 22 Mar 2016 13:16:53 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MDGrNJ020249; Tue, 22 Mar 2016 13:16:53 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603221316.u2MDGrNJ020249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 22 Mar 2016 13:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297188 - in head: share/dtrace sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 13:16:54 -0000 Author: gnn Date: Tue Mar 22 13:16:52 2016 New Revision: 297188 URL: https://svnweb.freebsd.org/changeset/base/297188 Log: Add an mbuf provider to DTrace. The mbuf provider is made up of a set of Statically Defined Tracepoints which help us look into mbufs as they are allocated and freed. This can be used to inspect the buffers or for a simplified mbuf leak detector. New tracepoints are: mbuf:::m-init mbuf:::m-gethdr mbuf:::m-get mbuf:::m-getcl mbuf:::m-clget mbuf:::m-cljget mbuf:::m-cljset mbuf:::m-free mbuf:::m-freem There is also a translator for mbufs which gives some visibility into the structure, see mbuf.d for more details. Reviewed by: bz, markj MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D5682 Added: head/share/dtrace/mbuf.d (contents, props changed) Modified: head/share/dtrace/Makefile head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Tue Mar 22 12:40:09 2016 (r297187) +++ head/share/dtrace/Makefile Tue Mar 22 13:16:52 2016 (r297188) @@ -30,4 +30,10 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace +DSRCS= mbuf.d + +FILES= ${DSRCS} +FILESDIR= /usr/lib/dtrace +FILESMODE= ${NOBINMODE} + .include Added: head/share/dtrace/mbuf.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/mbuf.d Tue Mar 22 13:16:52 2016 (r297188) @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2016 George V. Neville-Neil + * 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$ + * + * Translators and flags for the mbuf structure. FreeBSD specific code. + * + */ + +#pragma D depends_on module kernel +#pragma D depends_on provider mbuf + +/* + * mbuf flags of global significance and layer crossing. + * Those of only protocol/layer specific significance are to be mapped + * to M_PROTO[1-12] and cleared at layer handoff boundaries. + * NB: Limited to the lower 24 bits. + */ + +#pragma D binding "1.6.3" M_EXT +inline int M_EXT = 0x00000001; /* has associated external storage */ +#pragma D binding "1.6.3" M_PKTHDR +inline int M_PKTHDR = 0x00000002; /* start of record */ +#pragma D binding "1.6.3" M_EOR +inline int M_EOR = 0x00000004; /* end of record */ +#pragma D binding "1.6.3" M_RDONLY +inline int M_RDONLY = 0x00000008; /* associated data is marked read-only */ +#pragma D binding "1.6.3" M_BCAST +inline int M_BCAST = 0x00000010; /* send/received as link-level broadcast */ +#pragma D binding "1.6.3" M_MCAST +inline int M_MCAST = 0x00000020; /* send/received as link-level multicast */ +#pragma D binding "1.6.3" M_PROMISC +inline int M_PROMISC = 0x00000040; /* packet was not for us */ +#pragma D binding "1.6.3" M_VLANTAG +inline int M_VLANTAG = 0x00000080; /* ether_vtag is valid */ +#pragma D binding "1.6.3" M_UNUSED_8 +inline int M_UNUSED_8 = 0x00000100; /* --available-- */ +#pragma D binding "1.6.3" M_NOFREE +inline int M_NOFREE = 0x00000200; /* do not free mbuf, embedded in cluster */ + +#pragma D binding "1.6.3" M_PROTO1 +inline int M_PROTO1 = 0x00001000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO2 +inline int M_PROTO2 = 0x00002000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO3 +inline int M_PROTO3 = 0x00004000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO4 +inline int M_PROTO4 = 0x00008000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO5 +inline int M_PROTO5 = 0x00010000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO6 +inline int M_PROTO6 = 0x00020000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO7 +inline int M_PROTO7 = 0x00040000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO8 +inline int M_PROTO8 = 0x00080000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO9 +inline int M_PROTO9 = 0x00100000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO10 +inline int M_PROTO10 = 0x00200000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO11 +inline int M_PROTO11 = 0x00400000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO12 +inline int M_PROTO12 = 0x00800000; /* protocol-specific */ + +#pragma D binding "1.6.3" mbufflags_string +inline string mbufflags_string[uint32_t flags] = + flags & M_EXT ? "M_EXT" : + flags & M_PKTHDR ? "M_PKTHDR" : + flags & M_EOR ? "M_EOR" : + flags & M_RDONLY ? "M_RDONLY" : + flags & M_BCAST ? "M_BCAST" : + flags & M_MCAST ? "M_MCAST" : + flags & M_PROMISC ? "M_PROMISC" : + flags & M_VLANTAG ? "M_VLANTAG" : + flags & M_UNUSED_8 ? "M_UNUSED_8" : + flags & M_NOFREE ? "M_NOFREE" : + flags & M_PROTO1 ? "M_PROTO1" : + flags & M_PROTO2 ? "M_PROTO2" : + flags & M_PROTO3 ? "M_PROTO3" : + flags & M_PROTO4 ? "M_PROTO4" : + flags & M_PROTO5 ? "M_PROTO5" : + flags & M_PROTO6 ? "M_PROTO6" : + flags & M_PROTO7 ? "M_PROTO7" : + flags & M_PROTO8 ? "M_PROTO8" : + flags & M_PROTO9 ? "M_PROTO9" : + flags & M_PROTO10 ? "M_PROTO10" : + flags & M_PROTO11 ? "M_PROTO11" : + flags & M_PROTO12 ? "M_PROTO12" : + "none" ; + +/* + * Packet tag structure (see below for details). + */ +typedef struct m_tag { + u_int16_t m_tag_id; /* Tag ID */ + u_int16_t m_tag_len; /* Length of data */ + u_int32_t m_tag_cookie; /* ABI/Module ID */ +} m_tag_t; + +/* + * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. + * Size ILP32: 48 + * LP64: 56 + * Compile-time assertions in uipc_mbuf.c test these values to ensure that + * they are correct. + */ +typedef struct pkthdr { +/* struct ifnet *rcvif; */ /* rcv interface */ + int32_t len; /* total packet length */ + + /* Layer crossing persistent information. */ + uint32_t flowid; /* packet's 4-tuple system */ + uint64_t csum_flags; /* checksum and offload features */ + uint16_t fibnum; /* this packet should use this fib */ + uint8_t cosqos; /* class/quality of service */ + uint8_t rsstype; /* hash type */ +} pkthdr_t; + +/* + * Description of external storage mapped into mbuf; valid only if M_EXT is + * set. + * Size ILP32: 28 + * LP64: 48 + * Compile-time assertions in uipc_mbuf.c test these values to ensure that + * they are correct. + */ +typedef struct m_ext { + volatile u_int *ext_cnt; /* pointer to ref count info */ + caddr_t ext_buf; /* start of buffer */ + uint32_t ext_size; /* size of buffer, for ext_free */ + uint32_t ext_type:8, /* type of external storage */ + ext_flags:24; /* external storage mbuf flags */ + void *ext_arg1; /* optional argument pointer */ + void *ext_arg2; /* optional argument pointer */ +} m_ext_t; + +/* + * The core of the mbuf object along with some shortcut defines for practical + * purposes. + */ +struct mbuf { + uintptr_t mbuf_addr; + /* + * Header present at the beginning of every mbuf. + * Size ILP32: 24 + * LP64: 32 + * Compile-time assertions in uipc_mbuf.c test these values to ensure + * that they are correct. + */ + caddr_t m_data; /* location of data */ + int32_t m_len; /* amount of data in this mbuf */ + uint32_t m_type:8, /* type of data in this mbuf */ + m_flags:24; /* flags; see below */ + /* + * A set of optional headers (packet header, external storage header) + * and internal data storage. Historically, these arrays were sized + * to MHLEN (space left after a packet header) and MLEN (space left + * after only a regular mbuf header); they are now variable size in + * order to support future work on variable-size mbufs. + */ + /* union { */ + /* struct { */ + /* struct pkthdr m_pkthdr; */ + /* union { */ + /* struct m_ext m_ext; */ + /* char m_pktdat[0]; */ + /* }; */ + /* }; */ + /* char m_dat[0]; */ + /* }; */ + char *m_dat; +}; + +typedef struct mbufinfo { + uintptr_t mbuf_addr; + caddr_t m_data; + int32_t m_len; + uint8_t m_type; + uint32_t m_flags; +} mbufinfo_t; + +translator mbufinfo_t < struct mbuf *p > { + mbuf_addr = (uintptr_t)p; + m_data = p->m_data; + m_len = p->m_len; + m_type = p->m_type & 0xff000000; + m_flags = p->m_type & 0x00ffffff; +}; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/kern/kern_mbuf.c Tue Mar 22 13:16:52 2016 (r297188) @@ -731,6 +731,7 @@ m_clget(struct mbuf *m, int how) zone_drain(zone_pack); uma_zalloc_arg(zone_clust, m, how); } + MBUF_PROBE2(m__clget, m, how); return (m->m_flags & M_EXT); } @@ -745,7 +746,8 @@ void * m_cljget(struct mbuf *m, int how, int size) { uma_zone_t zone; - + void *retval; + if (m != NULL) { KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", __func__, m)); @@ -753,7 +755,11 @@ m_cljget(struct mbuf *m, int how, int si } zone = m_getzone(size); - return (uma_zalloc_arg(zone, m, how)); + retval = uma_zalloc_arg(zone, m, how); + + MBUF_PROBE4(m__cljget, m, how, size, retval); + + return (retval); } /* @@ -933,6 +939,7 @@ m_extadd(struct mbuf *mb, caddr_t buf, u void m_freem(struct mbuf *mb) { + MBUF_PROBE1(m__freem, mb); while (mb != NULL) mb = m_free(mb); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/kern/uipc_mbuf.c Tue Mar 22 13:16:52 2016 (r297188) @@ -47,6 +47,51 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +SDT_PROVIDER_DEFINE(mbuf); + +SDT_PROBE_DEFINE5_XLATE(mbuf, , , m__init, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__gethdr, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__get, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__getcl, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__clget, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t"); + +SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__cljget, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t", + "void*", "void*"); + +SDT_PROBE_DEFINE(mbuf, , , m__cljset); + +SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__free, + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__freem, + "struct mbuf *", "mbufinfo_t *"); #include Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/sys/mbuf.h Tue Mar 22 13:16:52 2016 (r297188) @@ -44,6 +44,34 @@ #endif #endif +#ifdef _KERNEL +#include + +#define MBUF_PROBE1(probe, arg0) \ + SDT_PROBE1(mbuf, , , probe, arg0) +#define MBUF_PROBE2(probe, arg0, arg1) \ + SDT_PROBE2(mbuf, , , probe, arg0, arg1) +#define MBUF_PROBE3(probe, arg0, arg1, arg2) \ + SDT_PROBE3(mbuf, , , probe, arg0, arg1, arg2) +#define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ + SDT_PROBE4(mbuf, , , probe, arg0, arg1, arg2, arg3) +#define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE5(mbuf, , , probe, arg0, arg1, arg2, arg3, arg4) + +SDT_PROVIDER_DECLARE(mbuf); + +SDT_PROBE_DECLARE(mbuf, , , m__init); +SDT_PROBE_DECLARE(mbuf, , , m__gethdr); +SDT_PROBE_DECLARE(mbuf, , , m__get); +SDT_PROBE_DECLARE(mbuf, , , m__getcl); +SDT_PROBE_DECLARE(mbuf, , , m__clget); +SDT_PROBE_DECLARE(mbuf, , , m__cljget); +SDT_PROBE_DECLARE(mbuf, , , m__cljset); +SDT_PROBE_DECLARE(mbuf, , , m__free); +SDT_PROBE_DECLARE(mbuf, , , m__freem); + +#endif /* _KERNEL */ + /* * Mbufs are of a single size, MSIZE (sys/param.h), which includes overhead. * An mbuf may add a single "mbuf cluster" of size MCLBYTES (also in @@ -664,7 +692,7 @@ m_getzone(int size) static __inline int m_init(struct mbuf *m, int how, short type, int flags) { - int error; + int error = 0; m->m_next = NULL; m->m_nextpkt = NULL; @@ -672,42 +700,50 @@ m_init(struct mbuf *m, int how, short ty m->m_len = 0; m->m_flags = flags; m->m_type = type; - if (flags & M_PKTHDR) { - if ((error = m_pkthdr_init(m, how)) != 0) - return (error); - } + if (flags & M_PKTHDR) + error = m_pkthdr_init(m, how); - return (0); + MBUF_PROBE5(m__init, m, how, type, flags, error); + return (error); } static __inline struct mbuf * m_get(int how, short type) { + struct mbuf *m; struct mb_args args; args.flags = 0; args.type = type; - return (uma_zalloc_arg(zone_mbuf, &args, how)); + m = uma_zalloc_arg(zone_mbuf, &args, how); + MBUF_PROBE3(m__get, how, type, m); + return (m); } static __inline struct mbuf * m_gethdr(int how, short type) { + struct mbuf *m; struct mb_args args; args.flags = M_PKTHDR; args.type = type; - return (uma_zalloc_arg(zone_mbuf, &args, how)); + m = uma_zalloc_arg(zone_mbuf, &args, how); + MBUF_PROBE3(m__gethdr, how, type, m); + return (m); } static __inline struct mbuf * m_getcl(int how, short type, int flags) { + struct mbuf *m; struct mb_args args; args.flags = flags; args.type = type; - return (uma_zalloc_arg(zone_pack, &args, how)); + m = uma_zalloc_arg(zone_pack, &args, how); + MBUF_PROBE4(m__getcl, how, type, flags, m); + return (m); } /* @@ -747,6 +783,7 @@ m_cljset(struct mbuf *m, void *cl, int t m->m_ext.ext_flags = EXT_FLAG_EMBREF; m->m_ext.ext_count = 1; m->m_flags |= M_EXT; + MBUF_PROBE3(m__cljset, m, cl, type); } static __inline void @@ -1122,6 +1159,7 @@ m_free(struct mbuf *m) { struct mbuf *n = m->m_next; + MBUF_PROBE1(m__free, m); if ((m->m_flags & (M_PKTHDR|M_NOFREE)) == (M_PKTHDR|M_NOFREE)) m_tag_delete_chain(m, NULL); if (m->m_flags & M_EXT) From owner-svn-src-head@freebsd.org Tue Mar 22 13:46:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62257AD929F; Tue, 22 Mar 2016 13:46:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FC6E0D; Tue, 22 Mar 2016 13:46:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MDk1g6029624; Tue, 22 Mar 2016 13:46:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MDk1XH029623; Tue, 22 Mar 2016 13:46:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603221346.u2MDk1XH029623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 22 Mar 2016 13:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297190 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 13:46:02 -0000 Author: trasz Date: Tue Mar 22 13:46:01 2016 New Revision: 297190 URL: https://svnweb.freebsd.org/changeset/base/297190 Log: Wait for root mount tokens before showing the root mount prompt. This restores the pre-r290196 behaviour, eliminating the need to manually press '.' a couple of times to get USB to finish probing. Note that there's still something wrong with the console (character echoing doesn't quite work), and there's also a reported problem with BHyVe, but those two don't seem related to the problem above. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Tue Mar 22 13:32:34 2016 (r297189) +++ head/sys/kern/vfs_mountroot.c Tue Mar 22 13:46:01 2016 (r297190) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); static int parse_mount(char **); static struct mntarg *parse_mountroot_options(struct mntarg *, const char *); static int sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS); +static void vfs_mountroot_wait(void); static int vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev); /* @@ -488,6 +489,8 @@ parse_dir_ask(char **conf) char *mnt; int error; + vfs_mountroot_wait(); + printf("\nLoader variables:\n"); parse_dir_ask_printenv("vfs.root.mountfrom"); parse_dir_ask_printenv("vfs.root.mountfrom.options"); From owner-svn-src-head@freebsd.org Tue Mar 22 14:08:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027C6AD97D1; Tue, 22 Mar 2016 14:08:02 +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 C287ABC7; Tue, 22 Mar 2016 14:08:01 +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 u2ME8024035661; Tue, 22 Mar 2016 14:08:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ME80rd035660; Tue, 22 Mar 2016 14:08:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221408.u2ME80rd035660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 14:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297191 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 14:08:02 -0000 Author: bz Date: Tue Mar 22 14:08:00 2016 New Revision: 297191 URL: https://svnweb.freebsd.org/changeset/base/297191 Log: Correct comment. MFC after: 2 weeks Modified: head/lib/libstand/globals.c Modified: head/lib/libstand/globals.c ============================================================================== --- head/lib/libstand/globals.c Tue Mar 22 13:46:01 2016 (r297190) +++ head/lib/libstand/globals.c Tue Mar 22 14:08:00 2016 (r297191) @@ -30,7 +30,7 @@ struct in_addr myip; /* my ip address struct in_addr nameip; /* DNS server ip address */ struct in_addr rootip; /* root ip address */ struct in_addr swapip; /* swap ip address */ -struct in_addr gateip; /* swap ip address */ +struct in_addr gateip; /* gateway ip address */ n_long netmask = 0xffffff00; /* subnet or net mask */ u_int intf_mtu; /* interface mtu from bootp/dhcp */ int errno; /* our old friend */ From owner-svn-src-head@freebsd.org Tue Mar 22 14:25:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE994AD9BDA; Tue, 22 Mar 2016 14:25:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1886828; Tue, 22 Mar 2016 14:25:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ob0-x235.google.com with SMTP id fp4so202424082obb.2; Tue, 22 Mar 2016 07:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=vYhrz4lb01/oKQCPnfzWIReqLJMHFCxKRYf/aP9SRnQ=; b=P0KZ94SkC1AWblbdn5X5qgU231fPcD1J9Wg8ImcwYKzkehHuF2zH5YXTsmVLU+APeJ ZmvZ9fZI7OY+LmApnnQc5tLgkzdc5uxyXP6YAfREu2NHpbVnBx+8TTUsLZXa483WX8c+ jcQ/yQfMp79U8LS12PYAAfTBjgUfer84ETkFPmU8jrcfWZdfDzFDuNKRdl3Hof+rwZNQ bcMl6DwzIZY7+dNOgPloMTjSJS2nSlxCy0HkoxqNCpmIqxwiJn4ACqWUn71Y9l9SyfDv WeNxuGOV0eSQjyPEf00nG5v7lYzh85AHGx5Dp5Xz6v5y3DtS8p1gTiImNjTYbvDHnwEH s+2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=vYhrz4lb01/oKQCPnfzWIReqLJMHFCxKRYf/aP9SRnQ=; b=Msk/V3iTVOOqRXm5rEtgRV9vEYjUJxCn+17v3f4UgAPYFtUGaMN80876ilvdUZrBUi IwfKX9D0Zg7M9i+ndrY4DYBVMdbuADjPS7wkESAA5k6NjhQhCE+fsmqlClQUfpLGtcc0 zGOPshcHwyLoIOapWPicL2O3BTFv2UW6GqrDQJsiHY/0qzMz31CJN1MJvAXzIKAo4Sgw A+jzE4VqhBtcaQyNUp2m4rpxP2DWMkhYcE24YjGc/qFNCt1DCDxNxrTsHKEBgEwRKNAq ocpX+N/ERaKbP+VNj8VjeIfRt3A6MQwUdDPdeaITGSE2UErth/wwcOX1EtF1jqi1dhoD Uo4w== X-Gm-Message-State: AD7BkJIQCFcK4VG0yQKgyxCFyHbekCir2OghVg32XPxRyKIQMs1fSVqqx/wZy/DwIrq1ShGBPJV9lkXoBYQk/A== MIME-Version: 1.0 X-Received: by 10.60.142.67 with SMTP id ru3mr20144922oeb.37.1458656748889; Tue, 22 Mar 2016 07:25:48 -0700 (PDT) Received: by 10.157.40.69 with HTTP; Tue, 22 Mar 2016 07:25:48 -0700 (PDT) In-Reply-To: <201603221051.u2MAphFa074523@repo.freebsd.org> References: <201603221051.u2MAphFa074523@repo.freebsd.org> Date: Tue, 22 Mar 2016 09:25:48 -0500 Message-ID: Subject: Re: svn commit: r297185 - head/lib/libthr/thread From: Benjamin Kaduk To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 14:25:50 -0000 On Tue, Mar 22, 2016 at 5:51 AM, Konstantin Belousov wrote: > Author: kib > Date: Tue Mar 22 10:51:42 2016 > New Revision: 297185 > URL: https://svnweb.freebsd.org/changeset/base/297185 > > Log: > Apparently there are some popular programs around which assume that it > is safe to call pthread_mutex_init() on the same shared mutex several > times. POSIX claims that the behaviour in this case is undefined. > Has anyone volunteered to tell KDE they're doing it wrong? (Do we know of anything other than KDE?) -Ben From owner-svn-src-head@freebsd.org Tue Mar 22 15:26:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9F55AD8981 for ; Tue, 22 Mar 2016 15:26:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B4C8EB76; Tue, 22 Mar 2016 15:26:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id AE5521A43; Tue, 22 Mar 2016 15:26:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 2F95F15D94; Tue, 22 Mar 2016 15:26:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id FDereYmPp-d0; Tue, 22 Mar 2016 15:26:28 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 24B0415D8A To: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , svn-src-head@freebsd.org References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56F16415.8020207@FreeBSD.org> Date: Tue, 22 Mar 2016 08:26:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56F12EF2.9010601@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="58JxWtE3imM0LSf8bpN6hkQk5GjeumFiv" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:26:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --58JxWtE3imM0LSf8bpN6hkQk5GjeumFiv Content-Type: multipart/mixed; boundary="Gk9ueeLgPThitT5dajq0nwWGnutRuQ8I8" From: Bryan Drewery To: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , svn-src-head@freebsd.org Message-ID: <56F16415.8020207@FreeBSD.org> Subject: Re: svn commit: r296921 - head/share/mk References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> In-Reply-To: <56F12EF2.9010601@FreeBSD.org> --Gk9ueeLgPThitT5dajq0nwWGnutRuQ8I8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: > Hi! >=20 > I can't install world with a read-only /usr/obj anymore: > https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >=20 > It looks related to r296921 but I don't fully understand our build > system to be sure of that. >=20 > What do you think? >=20 Definitely, but I don't think it would have worked before "r284345 | sjg | 2015-06-13" anyhow. The better fix here involves a lot of rework to the LIB32 build. I might be able to come up with a hack to fix read-only /usr/obj here until the major LIB32 work can be done. --=20 Regards, Bryan Drewery --Gk9ueeLgPThitT5dajq0nwWGnutRuQ8I8-- --58JxWtE3imM0LSf8bpN6hkQk5GjeumFiv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJW8WQVAAoJEDXXcbtuRpfPdIEH+wZy/Te7a8hAukNqP2XQlmwi Mlpi0O7NT1ICVjF+0SDQ4VgOnrv0Clxtd5ARdHKuYGha0Y1iIiL1DIv0bgCc+Yst OZxLCpsqwkBdjkh40hzwBPP2h3Kzz7pD+zP2VIlRPtWXkoQ1v9RYSH/I3W3ptaBX NJAawCEGG6o1dnE/zXpRRpNYRGaHjrORjNhh6J2XdByxW8a8RXscLTaIxuH4cxMK I062GviDo2T26PBwqPYgpZ4Qsix7cPLg3ACDoDdFryaQurGn/uJYAhWKJHg/enHZ rjEyv06t+AYvyO+fWtIJcaLHszrYpSVtUVC0SnQN1eiZEvlbInJoCD0DL9STL/Q= =Kd3f -----END PGP SIGNATURE----- --58JxWtE3imM0LSf8bpN6hkQk5GjeumFiv-- From owner-svn-src-head@freebsd.org Tue Mar 22 15:27:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3818EAD89B1; Tue, 22 Mar 2016 15:27:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD249BA8; Tue, 22 Mar 2016 15:27:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2MFRnEr009152 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 22 Mar 2016 17:27:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2MFRnEr009152 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2MFRnQM009151; Tue, 22 Mar 2016 17:27:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Mar 2016 17:27:49 +0200 From: Konstantin Belousov To: Benjamin Kaduk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297185 - head/lib/libthr/thread Message-ID: <20160322152749.GT1741@kib.kiev.ua> References: <201603221051.u2MAphFa074523@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:27:59 -0000 On Tue, Mar 22, 2016 at 09:25:48AM -0500, Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 5:51 AM, Konstantin Belousov > wrote: > > > Author: kib > > Date: Tue Mar 22 10:51:42 2016 > > New Revision: 297185 > > URL: https://svnweb.freebsd.org/changeset/base/297185 > > > > Log: > > Apparently there are some popular programs around which assume that it > > is safe to call pthread_mutex_init() on the same shared mutex several > > times. POSIX claims that the behaviour in this case is undefined. > > > > Has anyone volunteered to tell KDE they're doing it wrong? (Do we know of > anything other than KDE?) I am not aware is the answer to both your questions. For useful report to KDE people, somebody should at least do some debugging on KDE side. E.g., what is the lock which was initialized twice, and how does it happen ? I looked at the issue from the internal side of the libthr, and have no energy to read and understand KDE code. From owner-svn-src-head@freebsd.org Tue Mar 22 15:43:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A707AD8E7E; Tue, 22 Mar 2016 15:43:49 +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 D0C908C1; Tue, 22 Mar 2016 15:43:48 +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 u2MFhm8a065634; Tue, 22 Mar 2016 15:43:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MFhlPx065629; Tue, 22 Mar 2016 15:43:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221543.u2MFhlPx065629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 15:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297192 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:43:49 -0000 Author: bz Date: Tue Mar 22 15:43:47 2016 New Revision: 297192 URL: https://svnweb.freebsd.org/changeset/base/297192 Log: Mfp4 @180378: Factor out nd6 and in6_attach initialization to their own files. Also move destruction into those files though still called from the central initialization. Sponsored by: CK Software GmbH Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D5033 Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/ip6_input.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/in6_ifattach.c Tue Mar 22 15:43:47 2016 (r297192) @@ -890,3 +890,29 @@ in6_purgemaddrs(struct ifnet *ifp) IN6_MULTI_UNLOCK(); } + +void +in6_ifattach_destroy(void) +{ + + callout_drain(&V_in6_tmpaddrtimer_ch); +} + +static void +in6_ifattach_init(void *dummy) +{ + + /* Timer for regeneranation of temporary addresses randomize ID. */ + callout_init(&V_in6_tmpaddrtimer_ch, 0); + callout_reset(&V_in6_tmpaddrtimer_ch, + (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - + V_ip6_temp_regen_advance) * hz, + in6_tmpaddrtimer, curvnet); +} + +/* + * Cheat. + * This must be after route_init(), which is now SI_ORDER_THIRD. + */ +SYSINIT(in6_ifattach_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, + in6_ifattach_init, NULL); Modified: head/sys/netinet6/in6_ifattach.h ============================================================================== --- head/sys/netinet6/in6_ifattach.h Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/in6_ifattach.h Tue Mar 22 15:43:47 2016 (r297192) @@ -35,6 +35,7 @@ #ifdef _KERNEL void in6_ifattach(struct ifnet *, struct ifnet *); +void in6_ifattach_destroy(void); void in6_ifdetach(struct ifnet *); int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int); void in6_tmpaddrtimer(void *); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/ip6_input.c Tue Mar 22 15:43:47 2016 (r297192) @@ -156,9 +156,6 @@ static struct netisr_handler ip6_direct_ }; #endif -VNET_DECLARE(struct callout, in6_tmpaddrtimer_ch); -#define V_in6_tmpaddrtimer_ch VNET(in6_tmpaddrtimer_ch) - VNET_DEFINE(struct pfil_head, inet6_pfil_hook); VNET_PCPUSTAT_DEFINE(struct ip6stat, ip6stat); @@ -170,7 +167,6 @@ VNET_PCPUSTAT_SYSUNINIT(ip6stat); struct rmlock in6_ifaddr_lock; RM_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock"); -static void ip6_init2(void *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -331,40 +327,11 @@ ip6_destroy() } hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); nd6_destroy(); - callout_drain(&V_in6_tmpaddrtimer_ch); + in6_ifattach_destroy(); } #endif static int -ip6_init2_vnet(const void *unused __unused) -{ - - /* nd6_timer_init */ - callout_init(&V_nd6_timer_ch, 0); - callout_reset(&V_nd6_timer_ch, hz, nd6_timer, curvnet); - - /* timer for regeneranation of temporary addresses randomize ID */ - callout_init(&V_in6_tmpaddrtimer_ch, 0); - callout_reset(&V_in6_tmpaddrtimer_ch, - (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - - V_ip6_temp_regen_advance) * hz, - in6_tmpaddrtimer, curvnet); - - return (0); -} - -static void -ip6_init2(void *dummy) -{ - - ip6_init2_vnet(NULL); -} - -/* cheat */ -/* This must be after route_init(), which is now SI_ORDER_THIRD */ -SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); - -static int ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, int *nxt, int *ours) { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/nd6.c Tue Mar 22 15:43:47 2016 (r297192) @@ -142,6 +142,7 @@ static VNET_DEFINE(struct callout, nd6_s #define V_nd6_slowtimo_ch VNET(nd6_slowtimo_ch) VNET_DEFINE(struct callout, nd6_timer_ch); +#define V_nd6_timer_ch VNET(nd6_timer_ch) static void nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) @@ -213,11 +214,14 @@ nd6_init(void) /* initialization of the default router list */ TAILQ_INIT(&V_nd_defrouter); - /* start timer */ + /* Start timers. */ callout_init(&V_nd6_slowtimo_ch, 0); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); + callout_init(&V_nd6_timer_ch, 0); + callout_reset(&V_nd6_timer_ch, hz, nd6_timer, curvnet); + nd6_dad_init(); if (IS_DEFAULT_VNET(curvnet)) { lle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/nd6.h Tue Mar 22 15:43:47 2016 (r297192) @@ -355,9 +355,6 @@ VNET_DECLARE(struct rwlock, nd6_lock); #define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) -VNET_DECLARE(struct callout, nd6_timer_ch); -#define V_nd6_timer_ch VNET(nd6_timer_ch) - /* nd6_rtr.c */ VNET_DECLARE(int, nd6_defifindex); VNET_DECLARE(int, ip6_desync_factor); /* seconds */ From owner-svn-src-head@freebsd.org Tue Mar 22 15:55:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 292A1AD9348; Tue, 22 Mar 2016 15:55:19 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D529867; Tue, 22 Mar 2016 15:55:18 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MFtIlH068665; Tue, 22 Mar 2016 15:55:18 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MFtHgt068663; Tue, 22 Mar 2016 15:55:17 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201603221555.u2MFtHgt068663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 22 Mar 2016 15:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297193 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:55:19 -0000 Author: jtl Date: Tue Mar 22 15:55:17 2016 New Revision: 297193 URL: https://svnweb.freebsd.org/changeset/base/297193 Log: to_flags is currently a 64-bit integer; however, we only use 7 bits. Furthermore, there is no reason this needs to be a 64-bit integer for the forseeable future. Also, there is an inconsistency between to_flags and the mask in tcp_addoptions(). Before r195654, to_flags was a u_long and the mask in tcp_addoptions() was a u_int. r195654 changed to_flags to be a u_int64_t but left the mask in tcp_addoptions() as a u_int, meaning that these variables will only be the same width on platforms with 64-bit integers. Convert both to_flags and the mask in tcp_addoptions() to be explicitly 32-bit variables. This may save a few cycles on 32-bit platforms, and avoids unnecessarily mixing types. Differential Revision: https://reviews.freebsd.org/D5584 Reviewed by: hiren MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Mar 22 15:43:47 2016 (r297192) +++ head/sys/netinet/tcp_output.c Tue Mar 22 15:55:17 2016 (r297193) @@ -1652,7 +1652,7 @@ tcp_setpersist(struct tcpcb *tp) int tcp_addoptions(struct tcpopt *to, u_char *optp) { - u_int mask, optlen = 0; + u_int32_t mask, optlen = 0; for (mask = 1; mask < TOF_MAXOPT; mask <<= 1) { if ((to->to_flags & mask) != mask) Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Mar 22 15:43:47 2016 (r297192) +++ head/sys/netinet/tcp_var.h Tue Mar 22 15:55:17 2016 (r297193) @@ -364,7 +364,7 @@ struct tcpcb { * options in tcp_addoptions. */ struct tcpopt { - u_int64_t to_flags; /* which options are present */ + u_int32_t to_flags; /* which options are present */ #define TOF_MSS 0x0001 /* maximum segment size */ #define TOF_SCALE 0x0002 /* window scaling */ #define TOF_SACKPERM 0x0004 /* SACK permitted */ From owner-svn-src-head@freebsd.org Tue Mar 22 15:55:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C25AD93DB for ; Tue, 22 Mar 2016 15:55:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD816321 for ; Tue, 22 Mar 2016 15:55:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8f753345-f046-11e5-9036-c33267960ba8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 22 Mar 2016 15:55:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2MFtffc011794; Tue, 22 Mar 2016 09:55:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458662141.1091.16.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 22 Mar 2016 09:55:41 -0600 In-Reply-To: <201603221346.u2MDk1XH029623@repo.freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:55:45 -0000 On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Mar 22 13:46:01 2016 > New Revision: 297190 > URL: https://svnweb.freebsd.org/changeset/base/297190 > > Log: > Wait for root mount tokens before showing the root mount prompt. > This restores the pre-r290196 behaviour, eliminating the need to manually > press '.' a couple of times to get USB to finish probing. > > Note that there's still something wrong with the console (character > echoing doesn't quite work), and there's also a reported problem with > BHyVe, but those two don't seem related to the problem above. Just a datapoint on the echoing... it works fine on a serial console, it's been years since I've seen glitches at the mountroot prompt. So the problem may be in vt or kbdmux. -- Ian From owner-svn-src-head@freebsd.org Tue Mar 22 16:00:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E20EAD9519; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 396208AF; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 32BC616DB; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9E93015E1E; Tue, 22 Mar 2016 16:00:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 46HUozmbrG9Z; Tue, 22 Mar 2016 16:00:43 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 387CE15E18 To: Nikolai Lifanov References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <56F16C2A.40201@FreeBSD.org> Date: Tue, 22 Mar 2016 09:00:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56F1685A.6070005@mail.lifanov.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 16:00:47 -0000 On 3/22/16 8:44 AM, Nikolai Lifanov wrote: > On 03/22/16 11:26, Bryan Drewery wrote: >> On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>> Hi! >>> >>> I can't install world with a read-only /usr/obj anymore: >>> https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >>> >>> It looks related to r296921 but I don't fully understand our build >>> system to be sure of that. >>> >>> What do you think? >>> >> >> Definitely, but I don't think it would have worked before "r284345 | s= jg >> | 2015-06-13" anyhow. >> >> The better fix here involves a lot of rework to the LIB32 build. I >> might be able to come up with a hack to fix read-only /usr/obj here >> until the major LIB32 work can be done. >> >=20 > Install with read-only obj worked for me before this change. >=20 With LIB32 enabled, on head? I don't see how after "r235122 | jlh | 2012-05-07" made the change I restored. --=20 Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Tue Mar 22 18:56:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 533C5AD949C; Tue, 22 Mar 2016 18:56:24 +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 24B141C58; Tue, 22 Mar 2016 18:56:24 +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 u2MIuNXe023505; Tue, 22 Mar 2016 18:56:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MIuNmG023504; Tue, 22 Mar 2016 18:56:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603221856.u2MIuNmG023504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 22 Mar 2016 18:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297194 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 18:56:24 -0000 Author: np Date: Tue Mar 22 18:56:23 2016 New Revision: 297194 URL: https://svnweb.freebsd.org/changeset/base/297194 Log: cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything to the descriptor ring no matter what path the frame takes within the driver's tx. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Mar 22 15:55:17 2016 (r297193) +++ head/sys/dev/cxgbe/t4_sge.c Tue Mar 22 18:56:23 2016 (r297194) @@ -2343,8 +2343,8 @@ eth_tx(struct mp_ring *r, u_int cidx, u_ } else { total++; remaining--; - n = write_txpkt_wr(txq, (void *)wr, m0, available); ETHER_BPF_MTAP(ifp, m0); + n = write_txpkt_wr(txq, (void *)wr, m0, available); } MPASS(n >= 1 && n <= available && n <= SGE_MAX_WR_NDESC); From owner-svn-src-head@freebsd.org Tue Mar 22 19:39:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 522CAAD9F1E; Tue, 22 Mar 2016 19:39:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2355211CC; Tue, 22 Mar 2016 19:39:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MJdo3M036017; Tue, 22 Mar 2016 19:39:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MJdowE036016; Tue, 22 Mar 2016 19:39:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603221939.u2MJdowE036016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 19:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297196 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 19:39:51 -0000 Author: bdrewery Date: Tue Mar 22 19:39:50 2016 New Revision: 297196 URL: https://svnweb.freebsd.org/changeset/base/297196 Log: Spell out 'system calls'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 19:29:55 2016 (r297195) +++ head/share/man/man4/filemon.4 Tue Mar 22 19:39:50 2016 (r297196) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2016 +.Dd March 22, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -51,7 +51,7 @@ calls. .Pp .Nm is not intended to be a security auditing tool. -Many syscalls are not tracked and binaries of foreign ABI will not be fully +Many system calls are not tracked and binaries of foreign ABI will not be fully audited. It is intended for auditing of processes for the purpose of determining its dependencies in an efficient and easily parsable format. From owner-svn-src-head@freebsd.org Tue Mar 22 22:07:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF85EAD9E70; Tue, 22 Mar 2016 22:07:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4261B35; Tue, 22 Mar 2016 22:07:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MM7EPA080837; Tue, 22 Mar 2016 22:07:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MM7Edv080836; Tue, 22 Mar 2016 22:07:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603222207.u2MM7Edv080836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Mar 2016 22:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297198 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:07:15 -0000 Author: adrian Date: Tue Mar 22 22:07:14 2016 New Revision: 297198 URL: https://svnweb.freebsd.org/changeset/base/297198 Log: [net80211] add missing static declarations. Submitted by: Sascha Wildner Obtained from: dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Mar 22 21:02:04 2016 (r297197) +++ head/sys/net80211/ieee80211_hwmp.c Tue Mar 22 22:07:14 2016 (r297198) @@ -260,7 +260,7 @@ ieee80211_hwmp_init(void) } SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_SECOND, ieee80211_hwmp_init, NULL); -void +static void hwmp_vattach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs; @@ -279,7 +279,7 @@ hwmp_vattach(struct ieee80211vap *vap) vap->iv_hwmp = hs; } -void +static void hwmp_vdetach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; @@ -289,7 +289,7 @@ hwmp_vdetach(struct ieee80211vap *vap) vap->iv_hwmp = NULL; } -int +static int hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg) { enum ieee80211_state nstate = vap->iv_state; From owner-svn-src-head@freebsd.org Tue Mar 22 22:25:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A1EAD9081; Tue, 22 Mar 2016 22:25:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABDF0272; Tue, 22 Mar 2016 22:25:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MMPCMr086682; Tue, 22 Mar 2016 22:25:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMP8Q7086648; Tue, 22 Mar 2016 22:25:08 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603222225.u2MMP8Q7086648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 22 Mar 2016 22:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297199 - in head/sys: arm/at91 arm/cavium/cns11xx arm/mv arm/xscale/pxa dev/bhnd dev/bhnd/bhndb dev/gpio dev/iicbus dev/le dev/siba isa mips/atheros mips/beri mips/mips mips/rt305x pc9... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:25:13 -0000 Author: jhibbits Date: Tue Mar 22 22:25:08 2016 New Revision: 297199 URL: https://svnweb.freebsd.org/changeset/base/297199 Log: Fix the resource_list_print_type() calls to use uintmax_t. Missed a bunch from r297000. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_pinctrl.c head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/mv/mv_localbus.c head/sys/arm/xscale/pxa/pxa_obio.c head/sys/arm/xscale/pxa/pxa_smi.c head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/gpio/gpiobus.c head/sys/dev/iicbus/iicbus.c head/sys/dev/le/lebuffer_sbus.c head/sys/dev/siba/siba.c head/sys/isa/isa_common.c head/sys/mips/atheros/apb.c head/sys/mips/beri/beri_simplebus.c head/sys/mips/mips/nexus.c head/sys/mips/rt305x/obio.c head/sys/pc98/pc98/canbus.c head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/pseries/vdevice.c head/sys/powerpc/psim/iobus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c head/sys/x86/x86/nexus.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/at91/at91.c Tue Mar 22 22:25:08 2016 (r297199) @@ -281,9 +281,9 @@ at91_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/at91/at91_pinctrl.c Tue Mar 22 22:25:08 2016 (r297199) @@ -330,8 +330,8 @@ pinctrl_print_res(struct pinctrl_devinfo int rv; rv = 0; - rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/cavium/cns11xx/econa.c Tue Mar 22 22:25:08 2016 (r297199) @@ -526,9 +526,9 @@ econa_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/mv/mv_localbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -323,8 +323,8 @@ localbus_print_child(device_t dev, devic rv = 0; rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); rv += bus_print_child_footer(dev, child); return (rv); Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/xscale/pxa/pxa_obio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -159,9 +159,9 @@ pxa_print_child(device_t dev, device_t c retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&od->od_resources, "at mem", - SYS_RES_MEMORY, "0x%08lx"); + SYS_RES_MEMORY, "0x%08jx"); retval += resource_list_print_type(&od->od_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_smi.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/xscale/pxa/pxa_smi.c Tue Mar 22 22:25:08 2016 (r297199) @@ -144,9 +144,9 @@ pxa_smi_print_child(device_t dev, device retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&smid->smid_resources, "at mem", - SYS_RES_MEMORY, "%#lx"); + SYS_RES_MEMORY, "%#jx"); retval += resource_list_print_type(&smid->smid_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/bhnd/bhnd.c Tue Mar 22 22:25:08 2016 (r297199) @@ -451,7 +451,7 @@ bhnd_generic_print_child(device_t dev, d rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) { retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); } retval += printf(" at core %u", bhnd_get_core_index(child)); @@ -499,7 +499,7 @@ bhnd_generic_probe_nomatch(device_t dev, rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); printf(" at core %u (no driver attached)\n", bhnd_get_core_index(child)); Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Mar 22 22:25:08 2016 (r297199) @@ -143,9 +143,9 @@ bhndb_print_child(device_t dev, device_t rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) { retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); } retval += bus_print_child_domain(dev, child); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/gpio/gpiobus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -390,7 +390,7 @@ gpiobus_probe_nomatch(device_t dev, devi device_printf(dev, " at pins %s", pins); else device_printf(dev, " at pin %s", pins); - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); printf("\n"); } @@ -412,7 +412,7 @@ gpiobus_print_child(device_t dev, device gpiobus_print_pins(devi, pins, sizeof(pins)); retval += printf("%s", pins); } - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); return (retval); Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/iicbus/iicbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -149,7 +149,7 @@ iicbus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); if (devi->addr != 0) retval += printf(" at addr %#x", devi->addr); - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); return (retval); Modified: head/sys/dev/le/lebuffer_sbus.c ============================================================================== --- head/sys/dev/le/lebuffer_sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/le/lebuffer_sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -297,7 +297,7 @@ lebuffer_print_res(struct lebuffer_devin rv = 0; rv += resource_list_print_type(&ldi->ldi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ldi->ldi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&ldi->ldi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/dev/siba/siba.c ============================================================================== --- head/sys/dev/siba/siba.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/siba/siba.c Tue Mar 22 22:25:08 2016 (r297199) @@ -597,8 +597,8 @@ siba_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/isa/isa_common.c Tue Mar 22 22:25:08 2016 (r297199) @@ -629,10 +629,10 @@ isa_print_all_resources(device_t dev) if (STAILQ_FIRST(rl) || device_get_flags(dev)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); + retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); #ifdef ISAPNP Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/atheros/apb.c Tue Mar 22 22:25:08 2016 (r297199) @@ -491,8 +491,8 @@ apb_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/beri/beri_simplebus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -239,8 +239,8 @@ simplebus_print_child(device_t dev, devi rv = 0; rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if ((ip = simplebus_get_interrupt_parent(child)) != NULL) rv += printf(" (%s)", device_get_nameunit(ip)); rv += bus_print_child_footer(dev, child); Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/mips/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -231,8 +231,8 @@ nexus_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/rt305x/obio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -587,8 +587,8 @@ obio_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/pc98/pc98/canbus.c ============================================================================== --- head/sys/pc98/pc98/canbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/pc98/pc98/canbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -433,9 +433,9 @@ print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return retval; } Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/macgpio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -236,7 +236,7 @@ macgpio_print_child(device_t dev, device printf(" addr 0x%02x", dinfo->gpio_num); /* should not happen */ resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); retval += bus_print_child_footer(dev, child); return (retval); @@ -258,7 +258,7 @@ macgpio_probe_nomatch(device_t dev, devi if (dinfo->gpio_num >= 0) printf(" gpio %d",dinfo->gpio_num); resource_list_print_type(&dinfo->mdi_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/macio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -447,8 +447,8 @@ macio_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); @@ -470,8 +470,8 @@ macio_probe_nomatch(device_t dev, device if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/uninorth.c Tue Mar 22 22:25:08 2016 (r297199) @@ -425,8 +425,8 @@ unin_chip_print_child(device_t dev, devi retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); @@ -447,8 +447,8 @@ unin_chip_probe_nomatch(device_t dev, de if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/ps3/ps3bus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -480,9 +480,9 @@ ps3bus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&dinfo->resources, "mem", - SYS_RES_MEMORY, "%#lx"); + SYS_RES_MEMORY, "%#jx"); retval += resource_list_print_type(&dinfo->resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/pseries/vdevice.c Tue Mar 22 22:25:08 2016 (r297199) @@ -180,7 +180,7 @@ vdevice_print_child(device_t dev, device retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/psim/iobus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -253,7 +253,7 @@ iobus_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); retval += printf(" offset 0x%x", dinfo->id_reg[1]); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/central/central.c Tue Mar 22 22:25:08 2016 (r297199) @@ -295,5 +295,5 @@ central_print_res(struct central_devinfo { return (resource_list_print_type(&cdi->cdi_rl, "mem", SYS_RES_MEMORY, - "%#lx")); + "%#jx")); } Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/ebus/ebus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -721,8 +721,8 @@ ebus_print_res(struct ebus_devinfo *edi) retval = 0; retval += resource_list_print_type(&edi->edi_rl, "addr", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); retval += resource_list_print_type(&edi->edi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (retval); } Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/fhc/fhc.c Tue Mar 22 22:25:08 2016 (r297199) @@ -529,7 +529,7 @@ fhc_print_res(struct fhc_devinfo *fdi) rv = 0; rv += resource_list_print_type(&fdi->fdi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&fdi->fdi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&fdi->fdi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sbus/dma_sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -409,7 +409,7 @@ dma_print_res(struct dma_devinfo *ddi) rv = 0; rv += resource_list_print_type(&ddi->ddi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ddi->ddi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&ddi->ddi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sbus/sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -929,8 +929,8 @@ sbus_print_res(struct sbus_devinfo *sdi) rv = 0; rv += resource_list_print_type(&sdi->sdi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&sdi->sdi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sparc64/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -605,8 +605,8 @@ nexus_print_res(struct nexus_devinfo *nd rv = 0; rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sparc64/upa.c Tue Mar 22 22:25:08 2016 (r297199) @@ -588,8 +588,8 @@ upa_print_res(struct upa_devinfo *udi) rv = 0; rv += resource_list_print_type(&udi->udi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&udi->udi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/x86/x86/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -301,9 +301,9 @@ nexus_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return retval; } From owner-svn-src-head@freebsd.org Tue Mar 22 22:41:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA577ADA590; Tue, 22 Mar 2016 22:41:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6682FDDD; Tue, 22 Mar 2016 22:41:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MMf382090025; Tue, 22 Mar 2016 22:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMf3ag090024; Tue, 22 Mar 2016 22:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMf3ag090024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297200 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:04 -0000 Author: bdrewery Date: Tue Mar 22 22:41:03 2016 New Revision: 297200 URL: https://svnweb.freebsd.org/changeset/base/297200 Log: Follow-up r297156: Close the log in filemon_dtr rather than in the last reference. If the tracer has decided to the close the log then it should be fully written, not getting more entries, when close(2) returns. This was a regression in r297156 in that it allowed a traced process to continue a traced syscall and add more entries to the log while the tracer had already closed its fd or exited. This was only really part of the daemonized process case which is abnormal. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Tue Mar 22 22:25:08 2016 (r297199) +++ head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:03 2016 (r297200) @@ -109,14 +109,11 @@ filemon_acquire(struct filemon *filemon) } /* - * Release a reference and on the last one write the footer and free the - * filemon. + * Release a reference and free on the last one. */ static void filemon_release(struct filemon *filemon) { - size_t len; - struct timeval now; if (refcount_release(&filemon->refcnt) == 0) return; @@ -127,18 +124,6 @@ filemon_release(struct filemon *filemon) */ sx_assert(&filemon->lock, SA_UNLOCKED); - if (filemon->fp != NULL) { - getmicrotime(&now); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), - "# Stop %ju.%06ju\n# Bye bye\n", - (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); - - filemon_output(filemon, filemon->msgbufr, len); - fdrop(filemon->fp, curthread); - } - sx_destroy(&filemon->lock); free(filemon, M_FILEMON); } @@ -260,6 +245,37 @@ filemon_untrack_processes(struct filemon "attached procs still.", __func__, filemon)); } +/* + * Close out the log. + */ +static void +filemon_close_log(struct filemon *filemon) +{ + struct file *fp; + struct timeval now; + size_t len; + + sx_assert(&filemon->lock, SA_XLOCKED); + if (filemon->fp == NULL) + return; + + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), + "# Stop %ju.%06ju\n# Bye bye\n", + (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); + + filemon_output(filemon, filemon->msgbufr, len); + fp = filemon->fp; + filemon->fp = NULL; + + sx_xunlock(&filemon->lock); + fdrop(fp, curthread); + sx_xlock(&filemon->lock); + + return; +} /* The devfs file is being closed. Untrace all processes. */ static void @@ -272,11 +288,10 @@ filemon_dtr(void *data) sx_xlock(&filemon->lock); /* - * Detach the filemon. The actual closing of it may not - * occur until syscalls in other threads with references complete. - * The filemon cannot be inherited after this though. + * Detach the filemon. It cannot be inherited after this. */ filemon_untrack_processes(filemon); + filemon_close_log(filemon); filemon_drop(filemon); } From owner-svn-src-head@freebsd.org Tue Mar 22 22:41:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D542AADA5AF; Tue, 22 Mar 2016 22:41:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFACDE2E; Tue, 22 Mar 2016 22:41:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MMf7e8090073; Tue, 22 Mar 2016 22:41:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMf7ub090070; Tue, 22 Mar 2016 22:41:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMf7ub090070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:08 -0000 Author: bdrewery Date: Tue Mar 22 22:41:07 2016 New Revision: 297201 URL: https://svnweb.freebsd.org/changeset/base/297201 Log: Return any log write failure encountered when closing the filemon fd. Discussed with: sjg, markj Reviewed by: sjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (r297200) +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (r297201) @@ -161,6 +161,12 @@ No process having the specified process The process ID specified is already being traced and was not the current process. .El +.Pp +The +.Fn close +system call on the filemon file descriptor may fail with the errors from +.Xr write 2 +if any error is encountered while writing the log. .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:03 2016 (r297200) +++ head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:07 2016 (r297201) @@ -92,6 +92,7 @@ struct filemon { char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ + int error; /* Log write error, returned on close(2). */ u_int refcnt; /* Pointer reference count. */ u_int proccnt; /* Process count. */ }; @@ -277,7 +278,10 @@ filemon_close_log(struct filemon *filemo return; } -/* The devfs file is being closed. Untrace all processes. */ +/* + * The devfs file is being closed. Untrace all processes. It is possible + * filemon_close/close(2) was not called. + */ static void filemon_dtr(void *data) { @@ -422,12 +426,28 @@ filemon_open(struct cdev *dev, int oflag return (error); } +/* Called on close of last devfs file handle, before filemon_dtr(). */ static int filemon_close(struct cdev *dev __unused, int flag __unused, int fmt __unused, struct thread *td __unused) { + struct filemon *filemon; + int error; - return (0); + if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) + return (error); + + sx_xlock(&filemon->lock); + filemon_close_log(filemon); + error = filemon->error; + sx_xunlock(&filemon->lock); + /* + * Processes are still being traced but won't log anything + * now. After this call returns filemon_dtr() is called which + * will detach processes. + */ + + return (error); } static void Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:03 2016 (r297200) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:07 2016 (r297201) @@ -46,6 +46,7 @@ filemon_output(struct filemon *filemon, { struct uio auio; struct iovec aiov; + int error; if (filemon->fp == NULL) return; @@ -63,7 +64,9 @@ filemon_output(struct filemon *filemon, if (filemon->fp->f_type == DTYPE_VNODE) bwillwrite(); - fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); + error = fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); + if (error != 0) + filemon->error = error; } static int From owner-svn-src-head@freebsd.org Tue Mar 22 22:41:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28474ADA5CE; Tue, 22 Mar 2016 22:41:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C64CAE54; Tue, 22 Mar 2016 22:41:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MMfAbt090120; Tue, 22 Mar 2016 22:41:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMfArH090119; Tue, 22 Mar 2016 22:41:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMfArH090119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297202 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:12 -0000 Author: bdrewery Date: Tue Mar 22 22:41:10 2016 New Revision: 297202 URL: https://svnweb.freebsd.org/changeset/base/297202 Log: Remove unused done argument to copyinstr(9). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:07 2016 (r297201) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:10 2016 (r297202) @@ -73,14 +73,13 @@ static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "C %d %s\n", @@ -124,7 +123,6 @@ filemon_event_process_exec(void *arg __u static void _filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { - size_t done; size_t len; struct file *fp; struct filemon *filemon; @@ -137,7 +135,7 @@ _filemon_wrapper_openat(struct thread *t fp = NULL; copyinstr(upath, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* @@ -216,16 +214,15 @@ static int filemon_wrapper_rename(struct thread *td, struct rename_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->from, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); copyinstr(uap->to, filemon->fname2, - sizeof(filemon->fname2), &done); + sizeof(filemon->fname2), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", @@ -326,14 +323,13 @@ static int filemon_wrapper_unlink(struct thread *td, struct unlink_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "D %d %s\n", From owner-svn-src-head@freebsd.org Tue Mar 22 22:41:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D1DADA5DD; Tue, 22 Mar 2016 22:41:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75232EB8; Tue, 22 Mar 2016 22:41:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MMfEWW090166; Tue, 22 Mar 2016 22:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMfEGF090164; Tue, 22 Mar 2016 22:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMfEGF090164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297203 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:15 -0000 Author: bdrewery Date: Tue Mar 22 22:41:14 2016 New Revision: 297203 URL: https://svnweb.freebsd.org/changeset/base/297203 Log: Handle copyin failures. Skip the log entry as there is nothing good to write out. Don't fail the syscall though since it already succeeded. There's no reason filemon's tracing failure should fail the already-succeeded syscall. Record the error for later to return from close(2) on the filemon devfs file descriptor. Discussed with: markj, sjg, kib (briefly with kib) Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:10 2016 (r297202) +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:14 2016 (r297203) @@ -167,6 +167,15 @@ The system call on the filemon file descriptor may fail with the errors from .Xr write 2 if any error is encountered while writing the log. +It may also fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +An invalid address was used for a traced system call argument, resulting in +no log entry for the system call. +.It Bq Er ENAMETOOLONG +An argument for a traced system call was too long, resulting in +no log entry for the system call. +.El .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:10 2016 (r297202) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:14 2016 (r297203) @@ -72,21 +72,24 @@ filemon_output(struct filemon *filemon, static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "C %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -123,6 +126,7 @@ filemon_event_process_exec(void *arg __u static void _filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { + int error; size_t len; struct file *fp; struct filemon *filemon; @@ -134,8 +138,11 @@ _filemon_wrapper_openat(struct thread *t freepath = NULL; fp = NULL; - copyinstr(upath, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(upath, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* @@ -180,7 +187,7 @@ _filemon_wrapper_openat(struct thread *t curproc->p_pid, atpath, atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); if (fp != NULL) fdrop(fp, td); @@ -213,23 +220,26 @@ filemon_wrapper_openat(struct thread *td static int filemon_wrapper_rename(struct thread *td, struct rename_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->from, filemon->fname1, - sizeof(filemon->fname1), NULL); - copyinstr(uap->to, filemon->fname2, - sizeof(filemon->fname2), NULL); + if (((error = copyinstr(uap->from, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) || + ((error = copyinstr(uap->to, filemon->fname2, + sizeof(filemon->fname2), NULL)) != 0)) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -242,19 +252,23 @@ _filemon_wrapper_link(struct thread *td, { struct filemon *filemon; size_t len; + int error; if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(upath1, filemon->fname1, - sizeof(filemon->fname1), NULL); - copyinstr(upath2, filemon->fname2, - sizeof(filemon->fname2), NULL); + if (((error = copyinstr(upath1, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) || + ((error = copyinstr(upath2, filemon->fname2, + sizeof(filemon->fname2), NULL)) != 0)) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -322,21 +336,24 @@ filemon_event_process_exit(void *arg __u static int filemon_wrapper_unlink(struct thread *td, struct unlink_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "D %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } From owner-svn-src-head@freebsd.org Tue Mar 22 23:59:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 234E899A1B8; Tue, 22 Mar 2016 23:59:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) (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 E90B11FEF; Tue, 22 Mar 2016 23:59:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f170.google.com with SMTP id m7so212627229obh.3; Tue, 22 Mar 2016 16:59:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=5ZoLTavnlhOlvvlonz3U6ePT93zpiMPSrEA2Za4CjFk=; b=NzQHO7037wjPW4NzX3kQHMU/MCQQvmIBArEsCxfrYtpgZBG0uuzXUhvS3OXj/wozOp DhhI9pdSWVdGSO9qyMSxPj/t9rhnz81FSYOekhTng8Ir646dPNiuL3r2epumnvlu4RnB upsDG4Al0TR8UPabVAwNuCYj0giVvegG0xwcpNa2ZWf6y96iTRWhMaSkzXWIPQe3m+pn CMePiQQ4WzPlIQoBso23uFm48uzhUJcEf1A7p41OUW83avgkLJRa7XVBJfO8RXsaVrfQ rv3OifKy7+GKBapYFFZshX9RPiyroDsP+oOfMGXZM7JpBQ4YSXQwrG6OKYoGRVUG5WEm OaOA== X-Gm-Message-State: AD7BkJL6kFt8UbmrdeeU4Zjg2Km4EUVfrCK8c8ukaFwxsMZfuMoHaY2eL1QiUPbguZnc8g== X-Received: by 10.182.85.132 with SMTP id h4mr21440482obz.51.1458691184850; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com. [209.85.218.41]) by smtp.gmail.com with ESMTPSA id du1sm14266912oeb.9.2016.03.22.16.59.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 16:59:44 -0700 (PDT) Received: by mail-oi0-f41.google.com with SMTP id i17so28664521oib.1; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.222.5 with SMTP id v5mr22065130oig.82.1458691184279; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) In-Reply-To: <201603221555.u2MFtHgt068663@repo.freebsd.org> References: <201603221555.u2MFtHgt068663@repo.freebsd.org> Date: Tue, 22 Mar 2016 16:59:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297193 - head/sys/netinet From: Conrad Meyer To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 23:59:52 -0000 On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: > Author: jtl > Date: Tue Mar 22 15:55:17 2016 > New Revision: 297193 > URL: https://svnweb.freebsd.org/changeset/base/297193 > > ... > > MFC after: 2 weeks This change seems like it would be ineligible for a MFC due to changing the ABI of struct tcpopt. Best, Conrad > > Modified: > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Tue Mar 22 15:43:47 2016 (r297192) > +++ head/sys/netinet/tcp_output.c Tue Mar 22 15:55:17 2016 (r297193) > @@ -1652,7 +1652,7 @@ tcp_setpersist(struct tcpcb *tp) > int > tcp_addoptions(struct tcpopt *to, u_char *optp) > { > - u_int mask, optlen = 0; > + u_int32_t mask, optlen = 0; > > for (mask = 1; mask < TOF_MAXOPT; mask <<= 1) { > if ((to->to_flags & mask) != mask) > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Tue Mar 22 15:43:47 2016 (r297192) > +++ head/sys/netinet/tcp_var.h Tue Mar 22 15:55:17 2016 (r297193) > @@ -364,7 +364,7 @@ struct tcpcb { > * options in tcp_addoptions. > */ > struct tcpopt { > - u_int64_t to_flags; /* which options are present */ > + u_int32_t to_flags; /* which options are present */ > #define TOF_MSS 0x0001 /* maximum segment size */ > #define TOF_SCALE 0x0002 /* window scaling */ > #define TOF_SACKPERM 0x0004 /* SACK permitted */ > From owner-svn-src-head@freebsd.org Wed Mar 23 00:41:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EACA99AC9C; Wed, 23 Mar 2016 00:41:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) (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 10289165A; Wed, 23 Mar 2016 00:41:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f51.google.com with SMTP id w20so600883oia.2; Tue, 22 Mar 2016 17:41:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=tU+bF8/c9s+Ygo7Qe35ufII1Vq2h/T+eveS2b9HrmoA=; b=l1U7hE265vXBM436dtrnu5j5no/SCTaPIU1DbI9pDgNf9iDXhjIUiou4ev3f0h2y3K QnN9T7fOEx/A72h8zDDMooRs6UFapsWxuhXZ9a6d2GOsjLndQkqkywaENwqTYjKAKJRh b62R1hqof2uHqbjJdVR9nYlXmDJ74kTjCqU1/GLZNxaGAd/JGTuNUg04uTuuxo7qfvlW E5Etkcv6i6C5l16E9BH3B+vDOZPRxEVJhqQItoGq7cahbrW4k/kQ9mDjy37dQ6uKZoC+ hEnf1/c4P/6eXzZKvieg+EuzxMG4+/0DQvlzWWexUktHAuikbh/ZA0/AVrnh7RcxocWr CaLQ== X-Gm-Message-State: AD7BkJIqKHwFi/sLjsn0RhqMABLghPYaRn4APOuvC4J6G6aAG9hzAtMcd/tTg+zh96Hslg== X-Received: by 10.202.200.206 with SMTP id y197mr24261oif.92.1458693691267; Tue, 22 Mar 2016 17:41:31 -0700 (PDT) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id yn3sm14541542obc.27.2016.03.22.17.41.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 17:41:31 -0700 (PDT) Received: by mail-oi0-f54.google.com with SMTP id d205so681158oia.0; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.13.138 with SMTP id 10mr32247ots.134.1458693690774; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) In-Reply-To: <201603222241.u2MMf7ub090070@repo.freebsd.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 17:41:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Conrad Meyer To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 00:41:38 -0000 On Tue, Mar 22, 2016 at 3:41 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Mar 22 22:41:07 2016 > New Revision: 297201 > ... > --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (r297200) > +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (r297201) > @@ -161,6 +161,12 @@ No process having the specified process > The process ID specified is already being traced and was not the current > process. > .El > +.Pp > +The > +.Fn close > +system call on the filemon file descriptor may fail with the errors from > +.Xr write 2 > +if any error is encountered while writing the log. > .Sh FILES > .Bl -tag -width ".Pa /dev/filemon" > .It Pa /dev/filemon Shouldn't this be documented in the close(2) manual page instead? (I believe it is generally true for many kinds of fd where errors can occur between write and close.) I thought close.2 would have a blurb like this and I see it doesn't in recent CURRENT. Best, Conrad From owner-svn-src-head@freebsd.org Wed Mar 23 01:14:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4573A923CA; Wed, 23 Mar 2016 01:14:05 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 35A18147A; Wed, 23 Mar 2016 01:14:04 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:3JWEJBNZBZpNHRc+cA4l6mtUPXoX/o7sNwtQ0KIMzox0KPj8rarrMEGX3/hxlliBBdydsKIUzbOL+PqxEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35Txjr35ocybSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBITzeewcQKRfFjluZ2E84uXlrxTORxCDoHwGXTNFvABPBl3/7Rr5FrL4uSj+u+81jDOfNMb1Sb0xcSml4LpmTAfoziwOYW1quFrLg9B92foI6CmqoAZyltbZ X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CqBACD7PFW/61jaINehAeBALpmgXAhhWwCggQTAQEBAQEBAQFjJ4ItghUBAQQjVhACAQgUBAICDRkCAlcCBIg6DrAOkH0BAQEBAQEBAQEBAQEBAQEBAQEBARIEfIUigXuCSYc8glYFl1iFcZccjwUCIgE/hAEgiTZ+AQEB X-IronPort-AV: E=Sophos;i="5.24,380,1454994000"; d="scan'208";a="273995410" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 22 Mar 2016 21:13:57 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 06C3015F565; Tue, 22 Mar 2016 21:13:58 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dXMefi-6gDey; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 7E95915F56E; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id u87sTlQ2M-GM; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 60EFC15F565; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) Date: Tue, 22 Mar 2016 21:13:57 -0400 (EDT) From: Rick Macklem To: Ian Lepore Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <1458662141.1091.16.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.11] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF44 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r297190 - head/sys/kern Thread-Index: +Q+X9l7iPk2WzcX8yhQkV+AJ60qT/Q== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:14:05 -0000 Ian Lepore wrote: > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Tue Mar 22 13:46:01 2016 > > New Revision: 297190 > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > Log: > > Wait for root mount tokens before showing the root mount prompt. > > This restores the pre-r290196 behaviour, eliminating the need to manually > > press '.' a couple of times to get USB to finish probing. > > > > Note that there's still something wrong with the console (character > > echoing doesn't quite work), and there's also a reported problem with > > BHyVe, but those two don't seem related to the problem above. > > Just a datapoint on the echoing... it works fine on a serial console, > it's been years since I've seen glitches at the mountroot prompt. So > the problem may be in vt or kbdmux. > When I had a console character echo problem (not serial), changing the clock source to RTC fixed it. rick > -- Ian > > > From owner-svn-src-head@freebsd.org Wed Mar 23 01:28:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50A1BA926BE for ; Wed, 23 Mar 2016 01:28:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1885119BC for ; Wed, 23 Mar 2016 01:28:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id m184so8685744iof.1 for ; Tue, 22 Mar 2016 18:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=n5KeFm+vsD4LQMsbEHLBF65JydSXDPkfdcAQLAWSQJE=; b=i6XCE6X6Upplt7lVigLJgsupM9kPCyo9xX2gsDSk+Q/wNhmCNs/sGOPr4mGwaRdStF IrAFW5l8GvAZQn9S6elNi7AxwiedrrM/lS1vEWMhgJzpIic6NeJTXq5wiHLmhwsXwime 9jSHhiuIVAQ15YaXmKDG4L5Ql2lRq0sgNouDsafyLoEGkpY00SD6ohAtD5+NsbbsCYud H3nNZdvlZaSekCczZzT47VSC6ERzIDcSorl0xC7fgxdQygbAFOadWTS0D2UfeE69viBL FcRrJje0fzTdWI67A2Z9j48IbHegj3tu+JOj7VRe99JH8AlDnhMStqU2vh6A/4xDJvz4 atgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=n5KeFm+vsD4LQMsbEHLBF65JydSXDPkfdcAQLAWSQJE=; b=m+xn+ZwKVgkYmTBShmYNExd2jy5RCOONTQKcTlTMk7sMjQW3iWYH4NntdQijadfIXR UdZuNX8N3hrIfQIAMImUXFeNqXnJgBgsPl25r2cQE4q7gny1JQeqNWtRdk/skek2aq3y Su/UlHJnPx8fPyN55VulbNL0B0qtx8F9UQXwd/OrpWgD1DHQjB6k8DhGVNj+bifSByMX /y6PzkPsk6UwFDuk5YzoTY7yzqQEC71IAsgRSTQL09tm8YFTROeuG8mA++BTG4lJJJg+ xZA6EzIuXXfr2AGj4Kw0yVU/VmvIw+muVc/Mpw4DqvG4R9D/Ekl4BihxhVK145qpBdVe VCSw== X-Gm-Message-State: AD7BkJJEJz5vm57ZDZufLPSi4FsZP232iM8Xcui23VUwOEldCAt1ufJkG1IEAXJ1T8FPlMhq85i4aBViK3JX8w== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr596036ioo.73.1458696488256; Tue, 22 Mar 2016 18:28:08 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Tue, 22 Mar 2016 18:28:08 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> Date: Tue, 22 Mar 2016 19:28:08 -0600 X-Google-Sender-Auth: WVf5Dq1-ZkI4ZA3MJJURU2tbZWI Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Rick Macklem Cc: Ian Lepore , Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:28:09 -0000 On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem wrote: > Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Tue Mar 22 13:46:01 2016 > > > New Revision: 297190 > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > Log: > > > Wait for root mount tokens before showing the root mount prompt. > > > This restores the pre-r290196 behaviour, eliminating the need to > manually > > > press '.' a couple of times to get USB to finish probing. > > > > > > Note that there's still something wrong with the console (character > > > echoing doesn't quite work), and there's also a reported problem with > > > BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > > When I had a console character echo problem (not serial), changing the > clock source to RTC fixed it. > I fixed this for the UART code a while ago in r260890. Maybe a similar fix is needed here? Basically, is the data being consumed by the interrupt handler before we can poll-read it... Warner From owner-svn-src-head@freebsd.org Wed Mar 23 01:32:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F08A9287A; Wed, 23 Mar 2016 01:32:01 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0101.outbound.protection.outlook.com [157.56.111.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B314D1CFC; Wed, 23 Mar 2016 01:31:59 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gvGxzxEhoHHHRxiU5mHk3jzItK92a4A7xT154v7Zsn4=; b=P0NTYAqcCOD+sr1arhm7T4Sg9SQL8d2I78KYRusxfnyI1ew4TSnuPYM5lAS7gbzLFKuN+zjwPMJCBX4trT+xCBEmb9ZAysF/+fG+2rGlxhTlV3e5duRDU43tZMy68YvqsXW+b4RYL6g2w2fruyUfD+L1tAV8FVNGDGZTqz7uDUo= Received: from BY2PR05CA034.namprd05.prod.outlook.com (10.141.250.24) by BLUPR0501MB2116.namprd05.prod.outlook.com (10.164.23.146) with Microsoft SMTP Server (TLS) id 15.1.434.16; Wed, 23 Mar 2016 01:31:52 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:145) by BY2PR05CA034.outlook.office365.com (2a01:111:e400:2c5f::24) with Microsoft SMTP Server (TLS) id 15.1.443.12 via Frontend Transport; Wed, 23 Mar 2016 01:31:52 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) with Microsoft SMTP Server (TLS) id 15.1.443.6 via Frontend Transport; Wed, 23 Mar 2016 01:31:52 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 22 Mar 2016 18:31:47 -0700 Received: from [172.29.38.114] ([172.29.38.114]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2N1VjA49502; Tue, 22 Mar 2016 18:31:46 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Tue, 22 Mar 2016 21:31:45 -0400 Subject: Re: svn commit: r297193 - head/sys/netinet From: "Jonathan T. Looney" Sender: Jonathan Looney To: "cem@FreeBSD.org" CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <5E92CFCC-DA54-4379-87FD-6EB183E6AFAB@juniper.net> Thread-Topic: svn commit: r297193 - head/sys/netinet References: <201603221555.u2MFtHgt068663@repo.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(199003)(377454003)(24454002)(81166005)(76176999)(82746002)(83506001)(2950100001)(87936001)(189998001)(110136002)(77096005)(6806005)(4001350100001)(1096002)(230700001)(1220700001)(11100500001)(19580405001)(19580395003)(15975445007)(47776003)(586003)(86362001)(50466002)(450100001)(5820100001)(50986999)(2906002)(2501003)(16796002)(4326007)(23676002)(2351001)(105596002)(83716003)(92566002)(54356999)(36756003)(33656002)(106466001)(42262002)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0501MB2116; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD006; 1:TmEf9/wnd39IXmOnit/61Zkg8+Z03BikPiCCXJKHPE7K0RtAozvAYtch8Uaq02QiPRhn7qMmwtJv8iyxfkt1RaXJLqvumxKjpfPEcp6eehq1vXdPtdDFlH7CPxT7pPHP/l1uD9aS0dni2wCFqvUi5AllfBiNVmiyDiohcvWNLStEsu8ANxxPhFXtfiuUJN7fjyQRE8AMGsspuVx4EgeUNw22rgycVvzDtsqMpS1+Yhczfreh5nqz0gxcX5lKlymOlzciKKoIcexjIxDwevQeBVTuQ8cfbEW8ukEnxd+sLeCEk3EoPeL6+29xEUp5qhviLagKFSMd+khxMGovsYNDWRL2LMQkLbF4VYd84kpr/VRYxMt8mhmvlKvS7WsruaFPa4on5UERRrf5I7PhLQ7kIx0OS4zbH/0vWt81MUJi589+8D9WhHX0kB5ra+yvUnQvehavJgE2Bw9DPn8RnE9n1M5K8yxOvqM1igTsvssVPYH/gq1bnehuYszelSnRctry X-MS-Office365-Filtering-Correlation-Id: 46788032-8042-49c3-1226-08d352bae97f X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 2:8SnaFn1T0LX6ZnIy4VYF6cgE0oCbcjsvZrsEpsZqilNgZElwp2HfJYRjQCecduuOw6X/2qOPi0J0vt7N0dVYVGrCVDT0FmEf/QxQatn26dDb9X0G0HeEQr2DV2zksb8TDY6UKCQpALM0P8f9xml88l4aE5FCOjO5AhAnU+PdcwPooG1Iym5r+FkDbpG3sMeL; 3:Lv6eHLRrgXVZhokc34quqmLK0e6Xn2bjzhii4rvkD9NSJJFum63sHEbpICR/PcLe4YnhjJ8lJqJxU16k9ZPePyrEUZPIJBvl415SmKoKTWr6nDFbafPpdUwaEcfsjs0WfRfpJtTQxOLc2lZliFHdUI6xLCziMtQJbGWDiqPDRdCnmzdtFKoe5dI5GGodyHrcqM29D+mSy2w1W/kBozATYr6qRCoyzc9awZ5xfUUaYLc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB2116; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 25:Dz8lcWbvkxPche2vnPs0bY4T2/wKtkmH1NY1iKEeV9s/8bbWOfVp7Bqw+cq+HhjaL8fB1RVd5VoRYQ7jyS6pvqCeXrnX/FCMQWhAxXopfzRgpe5sEPguzBggT0z/hkUKf7MoPN3w6myt4py0S5OOcLgA9HDhdkY3FrQSC/qU4NT63VbXeDPLIkIjVF/ra/h/lw2TiYLw6h916KdNrZtBQaNDkdIh58/j2rFXZJQTcoVQkGwQy2h72reV4g6ebzjg+XKPH6s31uRpgPX9KqhQPVBXS0c2RUgMGnztBDOm9sLdkFxBX+A33Waky8hVYeAGbgQMaGfzCnL6vZjCnxq0tOtgpwqA7r7IbaqIRNj6B8Hoi2068bz/Gk1Hv+ccSU0/VmTcFKxkvYNS2fK3gIgRuQAVaKjnB+AIVe8dj32pl/po86XFhxfDWFh4xJEphLWtGOiyVHuS8dPg6mW01ZQJXxMxRHP231mcW6AcNPioA6TnGy+V4KruhL+379XpmnUYPLWesYHuk5gVdyHx3gj4I3C2SgaJReT0jhOCClF2P4K/MEMt9rcQgMyWGnHhx+zeYWNszvJsvGDEVk0jmJpi0A== X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 20:3Oq2/sez2Ij3qBXzA98eg8Tad/ECjVzFrvKH9WIsVz69NB6MLipJ/iAHeVu8gcdojEN7l2bnbIfgMpM4sBlxrzj9A24c45A7q5rB/6ubnXHhWKPuH7P4SGh1InxILvGSRaq/bAHyXbkTIyw0Haq1JAO1btS0zMYyX39srzHbtorTL/9jQJGp1agw6e8TpEKL2I4wTbN4kR3FzJiAVo59fLgOFINgKXlx1z3KwcouPJrbOiqy85TYg78fQZFNo4xNh0zRy8dKfzhUCnm9n1iPj3GEYzIal2QxxYOQatz9u4NcJg5kXHlN2ghStVgICqb7AbxckI58YnhRQuHmrk09zUB/v86Ota6vL2w55DBoiLRGv7bvUPcN/bYN4d9rMkns23SPWC7NIBNofOAFVB0uIufOONba9Vr8agcDe3bD47YRcFupyk8zDVSjsTS/QcVCHbds7Hzc5ojiaKmfSGaGzPbJuPFi/K9e+Z7e9ZUXXVuGb9DGK4D9zEuxxLH/099E X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13018025)(13015025)(13024025)(13017025)(13023025)(5005006)(10201501046)(3002001); SRVR:BLUPR0501MB2116; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB2116; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 4:FOYJkafMj4eYBdYL4+d4rTXwWJbheuhZ6yPcD0SToWbb+BIkW2pDyHsn0RXkp3saqBEQsKFqJEhr36oWcvOp7JAE1NdyfyetMzll1aN8Pr7XoDf6HrPBnTph5VXCDCcSPOPd6zLtK4nqlhbva8gmUCuo1O81HqaOfejIRGXYLTnWPoMrcWGK2D0hV9CEdIknN/im39wTxTw/loEjF8HlctoXd6Bs7tu9bCRjZp60VFNBLVbtUs+lHMxv8qWgmF7b9uldiZxpBoP9NDGFm/Co2CIh1WFvsAZHYMRdAbjURLijW95XHqdS8sR4KjmS9hBJN196A29tF4vxskhIrDmyJg+SYUU5S2vj7RWP73I0bC/pyrtHAvOuBvWfrei2uHD6c6g7M9UqEJDukFtFM1CD9HqaztRkPDgvUvBv8/J1zopIoDlodqQ9ch+9Oq/TGDMxqQtEA2fRn89ybMga4cuB2w== X-Forefront-PRVS: 08902E536D X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA1MDFNQjIxMTY7MjM6aEpPbHBob3NQSk5iaEtlS3kvU2JTREFD?= =?utf-8?B?eGluQVBnbGJwSHIwVm9MNHFyRktUUWhDLzdXdHhyQSt4L2Yyalc4YnN1UUpu?= =?utf-8?B?ZENhaUMzVFJYVk4vRXZ1bEhsRjNoU1gxTm93WlYxY0pob1VldThOaUQybUVF?= =?utf-8?B?RjJ5L08ySDdkYlFEdUhEelpkNFhwTzl4emN5VG1JcHZMZzA2TjJRMEtNRk5n?= =?utf-8?B?ZkQxYVRxYnFma01YNFBiVFkrU3k2dEZyWGJWS2ZCdkV2N2t3MWY0YlFCOUVr?= =?utf-8?B?aUxnYkZPU0pqMlFqQ1N2NlQ4dkRObFM0MnJYdW5naTlFcGZVR002TDBBSktv?= =?utf-8?B?bGRTRzFrRnNSc0NGdG9qRzE3ZkkvUldyWWJVeFo4ajdOSjh6bE9MNTdBd0ty?= =?utf-8?B?MVdPcG9aaFp1MjEySForY2dpc3UwbUt5ZmZreGdDTzJIT2hIUmFnSjRTNmdn?= =?utf-8?B?b3N1NVpuMmExbysyVWV6T1RTdERUai9vYitWWnBFRTBpWWU0N29DcVp0MlMr?= =?utf-8?B?UlFpbzVWOGhjUURIMXc5Qzk2elZUOGpjWjNmM0ozMVBrL2RTQ1dBcHR4bGY5?= =?utf-8?B?cGpYdVJxdGlnMUVGNVM2czFybkNnUjR0dnFFcEROK2FZWkpOUmJyeEJsc1Mv?= =?utf-8?B?eldUZmg4OWlod2J4K0tleEV2SnM3L1N5MEEzNWhBVER4dGJId0lqVUdkanFx?= =?utf-8?B?c1k5Z09PREpMekNjTXA4UUhaYldrUTBDNDBYaStvcWQybkJ6TzZVeUJCbzk5?= =?utf-8?B?SlF5TUJlK2EzZjAySXhIUnRtdVBjODhPd1AwcFpSb0NQWitnTDNJd05xOTNi?= =?utf-8?B?MUNkZ25xcjZqRXV1enZ1RDNjVWRkSER0UGRWTjE5eVNiTSt5MzZVVW5lUDUr?= =?utf-8?B?clVBKzNQU0NxeEt2Y0E4Y2pPOEo5ZWprYXZNc3dWSHAxVTBoWTR1eHFrdkRo?= =?utf-8?B?NUJxMnI4Vmc0dUVKaG9hdlRXVFMxTzhVd01neHoxU1B5cXVZdmJUc1p4SnEv?= =?utf-8?B?aXU1ajZUOWE0dUcvRStoYS94RGdZbUdiMHpwcUREOXZuekVBZ1ZpMUxSTFhV?= =?utf-8?B?NnVRdVlad25YOFF4RTlVT2FCZTJmcGdVWFRTdUVWcmFVK3RiUXFKeE9URGt4?= =?utf-8?B?dFM4d0dkREFvejZwaWxVdy84QmZXTVJOaGVrR2FJVitTNm0xTE5uNkphRU5Y?= =?utf-8?B?U3NEVlM5UDIzdmZhMkN0cytNejJEMkwwRUk0aHVoazFJYUxlWFppNW9FQllv?= =?utf-8?B?eVcxbEpuTU5WS01MRDE3SXFlL1d4REVVQ3hVbVFoQUp2SC9CMWVBLzBiUVlv?= =?utf-8?B?WGxHQlhDRmduSG5ON3o5OE5wem5HT2xKa2t4aXJFeGNvaVBocWFDY1RVVWZC?= =?utf-8?B?eWVkQ3h1M2I3U0w1QnVIbjkySG1ZQS9LN2ZIUC9qV3hhd3J4N1RtT1NncG05?= =?utf-8?B?bnlXdFRCYVRXeDF1VEZEUzF3WU1CdTl3UVFnWTd5djR2VVA2WEJOM1R6MXNX?= =?utf-8?B?M2cweU1UMlFTR3RsNENrZ3Q1NTRyVytHZjJiQmRRVjlUdWI0by9qSGdycVNP?= =?utf-8?B?RHNzcDA3NjA4ZldLMnlUWitta1FGcW1PNXNEVmhadElybUpLaWZqN1hZb2ty?= =?utf-8?Q?4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 5:YwR3qkC/GtRbI8LGylQuQ9sDVUcvVPRAkAbBFhTiOB9SRj7uIITitB1q4sHo6Eul5X6O2IHff/FY7tMvKliJenwA0xf25ZLOIQiA5mXf0OF8yS8OepXwysKYLAPCK6PZ0ceuFzJ2GnAkz+e5+h56Eg==; 24:CWt+cyRgCCF1kJG3CbbUUY/LoSsFcjrzjI5t/9wGWLtdraWjDZSRHCvAJpZW/fFdE5Mkse9uhV5botzi6EZ3rGzgpeOos7qTriB/klwlmuo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2016 01:31:52.0597 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB2116 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:32:01 -0000 On 3/22/16, 7:59 PM, "Conrad Meyer" wrote: >On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: >> Author: jtl >> Date: Tue Mar 22 15:55:17 2016 >> New Revision: 297193 >> URL: https://svnweb.freebsd.org/changeset/base/297193 >> >> ... >> >> MFC after: 2 weeks > >This change seems like it would be ineligible for a MFC due to >changing the ABI of struct tcpopt. Conrad, Thanks for the second set of eyes! However, I don't think struct tcpopt is part of the ABI. As far as I know, it is only used for communication within the kernel. Do you have an example of where it is used as part of the ABI? In the end, I don't really care. I had just planned to do the MFC to be a "good citizen". Jonathan From owner-svn-src-head@freebsd.org Wed Mar 23 01:33:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 476DBA928E6; Wed, 23 Mar 2016 01:33:53 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1A31EB2; Wed, 23 Mar 2016 01:33:52 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 39D387E88D; Wed, 23 Mar 2016 12:26:40 +1100 (EST) Subject: Re: svn commit: r297193 - head/sys/netinet To: cem@freebsd.org, "Jonathan T. Looney" References: <201603221555.u2MFtHgt068663@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Lawrence Stewart X-Enigmail-Draft-Status: N1110 Message-ID: <56F1F02F.2090900@freebsd.org> Date: Wed, 23 Mar 2016 12:23:59 +1100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:33:53 -0000 On 03/23/16 10:59, Conrad Meyer wrote: > On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: >> Author: jtl >> Date: Tue Mar 22 15:55:17 2016 >> New Revision: 297193 >> URL: https://svnweb.freebsd.org/changeset/base/297193 >> >> ... >> >> MFC after: 2 weeks > > This change seems like it would be ineligible for a MFC due to > changing the ABI of struct tcpopt. Off the top of my head I can't think of why you would consider struct tcpopt to be part of the ABI. Can you point to any concrete examples demonstrating that it is either explicitly or in a defacto sense? Cheers, Lawrence From owner-svn-src-head@freebsd.org Wed Mar 23 01:50:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C30A92D23 for ; Wed, 23 Mar 2016 01:50:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76CD160F for ; Wed, 23 Mar 2016 01:50:33 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a411e973-f099-11e5-b278-7d22021d92d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 23 Mar 2016 01:50:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2N1oPpT012672; Tue, 22 Mar 2016 19:50:25 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458697825.1091.28.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Warner Losh , Rick Macklem Cc: Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Tue, 22 Mar 2016 19:50:25 -0600 In-Reply-To: References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:50:34 -0000 On Tue, 2016-03-22 at 19:28 -0600, Warner Losh wrote: > On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem > wrote: > > > Ian Lepore wrote: > > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > > Author: trasz > > > > Date: Tue Mar 22 13:46:01 2016 > > > > New Revision: 297190 > > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > > > Log: > > > > Wait for root mount tokens before showing the root mount > > > > prompt. > > > > This restores the pre-r290196 behaviour, eliminating the need > > > > to > > manually > > > > press '.' a couple of times to get USB to finish probing. > > > > > > > > Note that there's still something wrong with the console > > > > (character > > > > echoing doesn't quite work), and there's also a reported > > > > problem with > > > > BHyVe, but those two don't seem related to the problem above. > > > > > > Just a datapoint on the echoing... it works fine on a serial > > > console, > > > it's been years since I've seen glitches at the mountroot prompt. > > > So > > > the problem may be in vt or kbdmux. > > > > > When I had a console character echo problem (not serial), changing > > the > > clock source to RTC fixed it. > > > > I fixed this for the UART code a while ago in r260890. Maybe a > similar fix > is needed here? Basically, is the data being consumed by the > interrupt > handler before we can poll-read it... > > Warner Your cngrab fixes were only for uart? Or was it some other fix? -- Ian From owner-svn-src-head@freebsd.org Wed Mar 23 01:54:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA1F2A92E84 for ; Wed, 23 Mar 2016 01:54:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 713DC1A3A for ; Wed, 23 Mar 2016 01:54:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id o5so9615329iod.2 for ; Tue, 22 Mar 2016 18:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=3fcuf+vRglK20oRDuA7veT7yg6PxRyy4X+1/h3zEWLQ=; b=X1JFMfWvJUz84PZxZjHhMkThnFf9fATPRN/s9dc/SWuzotKjjxgp0Y1LWaNpgeIGjv XuMcELQGulDYu7mtYv9/iiJH6ig5TO0ZTC/VHNRby3uGY0A6iyeyUoSKMj+vZhk39Bve XiNT16paBMl7qyBXj2Di185hURyexe6PM6vPmzLs4eAGpARZfPW6imlT5p/agxjIMY5q QhoWt810jl7nfEJTSKMOnNzX7zQLRkNRIxex3EWqcYkYIgabNxXTmc/WCOT9AZNWbFsg clrP68dXpvfHtqfmL8FMQG2YfAlFdPfWtKlXJ5o+xhWU57ICt/l8WytI2xJmeEjIgc6J /VFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=3fcuf+vRglK20oRDuA7veT7yg6PxRyy4X+1/h3zEWLQ=; b=iwJuZJsVC6hneiiKTuK0OT4SMqs4Q2E7Lh6fR6sF23qJqv+rHx4Q5I8sLGJmcdF6KH 6aW+nIb6UPu2FV8gbsbSwMMp1st+wN8mA0qu2kRrLyE/aHDa3uv9DuFrX1n/5B3ku4RV 02ZMuFOM7PXUcWzb8uzDp35IOxmR9PAXdw4+AdAEkz+O+XE6tIMojvim2p/1D0xSHYqE L4qZr9SM3DTgrKkN1jA+eFqWWPpoRTVB+fd2fQHckHy/FrGwDmNdx2wZjxg8xWDfJtGK e2GIXqUx3vBew+2EkwhiSEoVvXy91n1/vaFfeWvWMr21vqwRfLeGDXC7W7mkSpmk8zXy GNjw== X-Gm-Message-State: AD7BkJKV2un+Mn7rhuERhX9pgqMtVuBbKK12rF1a+iFyqB3bmu44On28F87vrWHDY8YXZXEpz3f1HNk1//7idQ== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr672020ioo.73.1458698067805; Tue, 22 Mar 2016 18:54:27 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Tue, 22 Mar 2016 18:54:27 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1458697825.1091.28.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> <1458697825.1091.28.camel@freebsd.org> Date: Tue, 22 Mar 2016 19:54:27 -0600 X-Google-Sender-Auth: pRqxojS9dSuTTfIwkBEDGcHD-Uo Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Ian Lepore Cc: Rick Macklem , Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:54:28 -0000 On Tue, Mar 22, 2016 at 7:50 PM, Ian Lepore wrote: > On Tue, 2016-03-22 at 19:28 -0600, Warner Losh wrote: > > On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem > > wrote: > > > > > Ian Lepore wrote: > > > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > > > Author: trasz > > > > > Date: Tue Mar 22 13:46:01 2016 > > > > > New Revision: 297190 > > > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > > > > > Log: > > > > > Wait for root mount tokens before showing the root mount > > > > > prompt. > > > > > This restores the pre-r290196 behaviour, eliminating the need > > > > > to > > > manually > > > > > press '.' a couple of times to get USB to finish probing. > > > > > > > > > > Note that there's still something wrong with the console > > > > > (character > > > > > echoing doesn't quite work), and there's also a reported > > > > > problem with > > > > > BHyVe, but those two don't seem related to the problem above. > > > > > > > > Just a datapoint on the echoing... it works fine on a serial > > > > console, > > > > it's been years since I've seen glitches at the mountroot prompt. > > > > So > > > > the problem may be in vt or kbdmux. > > > > > > > When I had a console character echo problem (not serial), changing > > > the > > > clock source to RTC fixed it. > > > > > > > I fixed this for the UART code a while ago in r260890. Maybe a > > similar fix > > is needed here? Basically, is the data being consumed by the > > interrupt > > handler before we can poll-read it... > > > > Warner > > Your cngrab fixes were only for uart? Or was it some other fix? > Yes, I only fixed uart. But the cngrab interface is generic. I didn't have issues with the console code at the time, but there's been two elephants of change in that code since then, including a rewrite. Perhaps some of that change broke what was working at the time and needs to be fixed. Perhaps it was working only by accident, like the UARTs were for years before I made the fix (well, working on and off... something broke them a bit before I made the change). mountroot> is so little used that things can break there and be broken for years before people notice. Warner From owner-svn-src-head@freebsd.org Wed Mar 23 02:11:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1FE8AC9141; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D1CE51157; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C97AA10ED; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8116E18866; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id YsCZDSKSH6cJ; Wed, 23 Mar 2016 02:11:21 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0E51F18863 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Tue, 22 Mar 2016 19:11:05 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> To: "cem@FreeBSD.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 02:11:29 -0000 > On Mar 22, 2016, at 17:41, Conrad Meyer wrote: >=20 >> On Tue, Mar 22, 2016 at 3:41 PM, Bryan Drewery wro= te: >> Author: bdrewery >> Date: Tue Mar 22 22:41:07 2016 >> New Revision: 297201 >> ... >> --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (= r297200) >> +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (= r297201) >> @@ -161,6 +161,12 @@ No process having the specified process >> The process ID specified is already being traced and was not the current >> process. >> .El >> +.Pp >> +The >> +.Fn close >> +system call on the filemon file descriptor may fail with the errors from= >> +.Xr write 2 >> +if any error is encountered while writing the log. >> .Sh FILES >> .Bl -tag -width ".Pa /dev/filemon" >> .It Pa /dev/filemon >=20 > Shouldn't this be documented in the close(2) manual page instead? (I > believe it is generally true for many kinds of fd where errors can > occur between write and close.) I thought close.2 would have a blurb > like this and I see it doesn't in recent CURRENT. >=20 >=20 The manpage for close(2) does document some errors, one being ENOSPC. The c= lose(2) behavior of returning write(2), really VOP_WRITE(9), errors though i= s specific to filemon since all of the writes are hidden and this is the onl= y place to return an error. I have a review open to resolve a similar issue= in alq(9) as well since all of the writes are asynchronous and there's no A= PI to retrieve any error from. Bryan= From owner-svn-src-head@freebsd.org Wed Mar 23 02:46:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AFBFAC981A; Wed, 23 Mar 2016 02:46:28 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com [IPv6:2607:f8b0:4003:c01::232]) (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 324D81D67; Wed, 23 Mar 2016 02:46:28 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ob0-x232.google.com with SMTP id fp4so1828611obb.2; Tue, 22 Mar 2016 19:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=hxfpoXkFn8iKwxdp6I3zjcci8SardQXTsbRAHUrW2FM=; b=yT1ctm3A2iKnWebQz79KWVKdbSapy1avNM93Y31PD8u6yd6j5fJhXP3TNscUVez0St FecAtKZyRv8io8KgNJ/GJ7OJ7SKiBGhxQkTziRgs3z1OakpYsVs0k2rN4CSC+vGPOlmn yC3v0gI7+Rp5ylGvDvpPYDXI7Tkz4pN5XP/J0cbrnmqY53Y+urK7Gp0Qf8SOzQUpetOj 5O3o7VmLpDyCigM4kwRndcsdwZoXvyhDUKd67APIvF/q0mBdZLRREpnTmgn4yk98z7Ix QhDGCUOaElvaKX6+Hjh/SZ6mrSj21CCgt42Oe8/zRdWi0pQX93qdEaLPnMVu5D4Bc7hK qoyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=hxfpoXkFn8iKwxdp6I3zjcci8SardQXTsbRAHUrW2FM=; b=JRG/HXQyB7UaI7AaBQbTClYcdEdh7w79XL5vdkr6/8uVzvAOH0dIL4NZpAFSPASioB X7edUm0bfj2cnCKWYPUHEN8q6g+9HB1P3Z21kjy+YRMN0/8FFhq2euhvzFTgnHmULBaY JulD1fOgSa9G9oUaH0QA3qZTpoSK8qDBYigQu7d5gkzDe5hiEud3DcKCBGDUqc/ZUysV CP9Etenwdr/LvM8FiBoOcFAOdgBWeTkaw4bjIUOnKwQNPU2Yn1sjQtj/q3oibP354daL pVCF38JLYgLh2nkB4GBVwuidL72EK6E30QrI/EYgpsYiPAL4Jq3Eae+2cEU7EYCzycHp YHeA== X-Gm-Message-State: AD7BkJJ8XmEScCXvAB7ly/6MVZ1O9G+Yln2J3H2vOzy+LaAGgrFODB/eWNV8t7THKDWb77hn+CPAIjJxoP+RFQ== MIME-Version: 1.0 X-Received: by 10.182.138.7 with SMTP id qm7mr211130obb.58.1458701187478; Tue, 22 Mar 2016 19:46:27 -0700 (PDT) Received: by 10.157.40.69 with HTTP; Tue, 22 Mar 2016 19:46:27 -0700 (PDT) In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 21:46:27 -0500 Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Benjamin Kaduk To: Bryan Drewery Cc: "cem@FreeBSD.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 02:46:28 -0000 On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: > > > > The manpage for close(2) does document some errors, one being ENOSPC. The > close(2) behavior of returning write(2), really VOP_WRITE(9), errors though > is specific to filemon since all of the writes are hidden and this is the > only place to return an error. I have a review open to resolve a similar > issue in alq(9) as well since all of the writes are asynchronous and > there's no API to retrieve any error from. > filemon is not unique in this regard; the AFS filesystem buffers writes locally and in some cases errors writing to the remote server can be delayed until close(). Of course, very few softwares actually check the return value of close, so this can cause trouble sometimes... -Ben From owner-svn-src-head@freebsd.org Wed Mar 23 03:41:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 538879D94EE; Wed, 23 Mar 2016 03:41:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22682156D; Wed, 23 Mar 2016 03:41:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f178.google.com with SMTP id xj3so2526510obb.0; Tue, 22 Mar 2016 20:41:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=49ZuljV8eHw3pWAZOup24CEO6Lbbhlrhm8aoRVrcwfw=; b=k1eFWGlsW8VRzC6QZdvgIi1iX05CnVvs6QyWjKwNS6NaVmaiBrVOqqi3VnPCWAv/+Y 51ECFURBdlqDiebJhWpeicEWlEgoasvGIsPbKilo7AZFyuAv6ZfOEUYMqTmlhrPNtWUZ 3hmDyFYOdmEesZaRcFptdwbzvF5dX9baBV5TF7xFE8l8WMGMBJUvMBf+xbDzW+SxEOMJ B94YJv/1Esc4e2CcC5xCMCG702EUkvQ83RCDwJdqW/VlMAFPsme3obDltNmEOQaQCyo1 9X92SjghZAmcNcuGJ7SCw7ww8doVTj37m0XGAxYWgrRsH8GVBLwi3tUJ4XMpwVhKQrkR sJ2Q== X-Gm-Message-State: AD7BkJJF5GjpY//K8CeH8rIS2KB2Qez23pGuauTwIu7Uq8t2rwQJQJbcMnT7bH6EWmQAWA== X-Received: by 10.182.96.99 with SMTP id dr3mr222034obb.79.1458703109919; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com. [209.85.214.170]) by smtp.gmail.com with ESMTPSA id 66sm153823otc.37.2016.03.22.20.18.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Received: by mail-ob0-f170.google.com with SMTP id ts10so2239308obc.1; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.58.97 with SMTP id p1mr224549obq.33.1458703109436; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 20:18:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Conrad Meyer To: Benjamin Kaduk Cc: Bryan Drewery , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 03:41:26 -0000 On Tue, Mar 22, 2016 at 7:46 PM, Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: >> >> The manpage for close(2) does document some errors, one being ENOSPC. The >> close(2) behavior of returning write(2), really VOP_WRITE(9), errors though >> is specific to filemon since all of the writes are hidden and this is the >> only place to return an error. >> ... > > filemon is not unique in this regard; the AFS filesystem buffers writes > locally and in some cases errors writing to the remote server can be delayed > until close(). Right. filemon is not the only case. Another example would be TCP socket fds, e.g., when the connection is RST after write(2) queues data on the outgoing sockbuf but before it is transmitted. Best, Conrad From owner-svn-src-head@freebsd.org Wed Mar 23 04:18:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7285B9D9CBC; Wed, 23 Mar 2016 04:18:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4360F12D2; Wed, 23 Mar 2016 04:18:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2N4IviJ094045; Wed, 23 Mar 2016 04:18:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2N4Iv5Q094043; Wed, 23 Mar 2016 04:18:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603230418.u2N4Iv5Q094043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 23 Mar 2016 04:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297205 - in head: include usr.sbin/uathload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 04:18:58 -0000 Author: imp Date: Wed Mar 23 04:18:57 2016 New Revision: 297205 URL: https://svnweb.freebsd.org/changeset/base/297205 Log: Implement suggestion by jhb@ to have _PATH_FIRMWARE instead of hard coding it to be "/usr/share/firmware". Modified: head/include/paths.h head/usr.sbin/uathload/uathload.c Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Wed Mar 23 00:53:31 2016 (r297204) +++ head/include/paths.h Wed Mar 23 04:18:57 2016 (r297205) @@ -56,6 +56,7 @@ #define _PATH_DRUM "/dev/drum" #define _PATH_ESDB "/usr/share/i18n/esdb" #define _PATH_ETC "/etc" +#define _PATH_FIRMWARE "/usr/share/firmware" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_FWMEM "/dev/fwmem" #define _PATH_GBDE "/sbin/gbde" Modified: head/usr.sbin/uathload/uathload.c ============================================================================== --- head/usr.sbin/uathload/uathload.c Wed Mar 23 00:53:31 2016 (r297204) +++ head/usr.sbin/uathload/uathload.c Wed Mar 23 04:18:57 2016 (r297205) @@ -143,7 +143,7 @@ main(int argc, char *argv[]) if (argc == 1) fwname = argv[0]; else - fwname = "/usr/share/firmware/ar5523.bin"; + fwname = _PATH_FIRMWARE "/ar5523.bin"; fw = open(fwname, O_RDONLY, 0); if (fw < 0) err(-1, "open(%s)", fwname); From owner-svn-src-head@freebsd.org Wed Mar 23 04:59:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A246CAB4471; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 82A851137; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 7B8691AC1; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 329F018B02; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id yXlpEt__4dEF; Wed, 23 Mar 2016 04:59:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 855E118AFF Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Tue, 22 Mar 2016 21:59:05 -0700 Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> To: "cem@FreeBSD.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 04:59:30 -0000 > On Mar 22, 2016, at 20:18, Conrad Meyer wrote: >=20 >> On Tue, Mar 22, 2016 at 7:46 PM, Benjamin Kaduk wrote= : >>> On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wr= ote: >>>=20 >>> The manpage for close(2) does document some errors, one being ENOSPC. T= he >>> close(2) behavior of returning write(2), really VOP_WRITE(9), errors tho= ugh >>> is specific to filemon since all of the writes are hidden and this is th= e >>> only place to return an error. >>> ... >>=20 >> filemon is not unique in this regard; the AFS filesystem buffers writes >> locally and in some cases errors writing to the remote server can be dela= yed >> until close(). >=20 > Right. filemon is not the only case. Another example would be TCP > socket fds, e.g., when the connection is RST after write(2) queues > data on the outgoing sockbuf but before it is transmitted. >=20 I'm really not saying it's the only case. I'm saying close(2) returning a do= zen write(2) errors is not normal and is documented here because it is expec= ted here. Anyone could write a module or FS that returns some random error o= n close(2). That doesn't mean it should be documented directly in close(2). = Consider the next commit here also returns EFAULT and ENAMELEN, which defin= itely are special case. There are only 2 filemon consumers, script(1) and b= make. For bmake there is a patch in testing to utilize the close(2) error, s= ince it's currently ignored. For script(1) I need to fix it still. If there are errors that are common and missing from close(2), please do doc= ument them. As Benjamin referenced, most people never fathom that it can ev= en fail. I know that NFS errors are not widely documented too. Bryan= From owner-svn-src-head@freebsd.org Wed Mar 23 06:20:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B2CDAD76A2; Wed, 23 Mar 2016 06:20:27 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5448F1CBE; Wed, 23 Mar 2016 06:20:26 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-238-157.lns20.per1.internode.on.net [121.45.238.157]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u2N6KF0s083054 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 22 Mar 2016 23:20:18 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon To: Bryan Drewery , "cem@FreeBSD.org" References: <201603222241.u2MMf7ub090070@repo.freebsd.org> <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Julian Elischer Message-ID: <56F23599.2020200@freebsd.org> Date: Wed, 23 Mar 2016 14:20:09 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 06:20:27 -0000 On 23/03/2016 12:59 PM, Bryan Drewery wrote: (close man page stuff deleted) > As Benjamin referenced, most people never fathom that it can even fail. > > Bryan > from the human/mammal operator manuals.. die(animal) [...] Errors: EMEDICAL - The creature failed to die, the operation will be retried automatically at some slightly later time. ... see also: born(), hatch(), taxes() From owner-svn-src-head@freebsd.org Wed Mar 23 07:58:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A34DAD8D34; Wed, 23 Mar 2016 07:58:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1369113A1; Wed, 23 Mar 2016 07:58:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2N7wgae064876 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 23 Mar 2016 09:58:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2N7wgae064876 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2N7wgLf064875; Wed, 23 Mar 2016 09:58:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Mar 2016 09:58:42 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160323075842.GX1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> <1866602.Bp7VFd5f42@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1866602.Bp7VFd5f42@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 07:58:48 -0000 On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: > On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > > > - for (x = 0; x < delay; x += 5) { > > > + for (x = 0; x < delay; x++) { > > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > > APIC_DELSTAT_IDLE) > > > return (1); > > > - DELAY(5); > > > + DELAY(1); > > > } > > > return (0); > > > } > > > > Ideally we would structure the loop differently. I think it is more > > efficient WRT latency to only block execution by ia32_pause(), and > > compare the the getbinuptime() results to calculate spent time, on each > > loop step. > > Yes. I've thought about using the TSC directly to do that, but folks are > worried about the TSC being unstable due to vcpus in a VM migrating > across physical CPUs. DELAY() does seem to DTRT in that case assuming the > hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to > essentially duplicate DELAY() (really delay_tc()) inline. If TSC has the behaviour you described, i.e. suddenly jumping random steps on single CPU, from the point of view of kernel, then the system is seriosly misbehaving. The timekeeping stuff would be badly broken regardless of the ipi_wait(). I do not see why should we worry about that in ipi_wait(). I proposed slightly different thing, i.e. using timekeep code to indirect to TSC if configured so. Below is the proof of concept patch, use of nanouptime() may be too naive, and binuptime() would cause tiny bit less overhead, but I do not want to think about arithmetic. diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 7e5087b..fdc12a4 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ static int native_lapic_ipi_wait(int delay) { - int x; + struct timespec end, x; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ if (x2apic_mode) return (1); - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != - APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); + if (delay != -1) { + KASSERT(delay > 0, ("wrong delay %d", delay)); + x.tv_sec = delay / 1000000; + x.tv_nsec = (delay % 1000000) * 1000; + nanouptime(&end); + timespecadd(&end, &x); } - - for (x = 0; x < delay; x++) { + for (;;) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(1); + ia32_pause(); + if (delay != -1) { + nanouptime(&x); + if (timespeccmp(&x, &end, >)) + break; + } } return (0); } From owner-svn-src-head@freebsd.org Wed Mar 23 09:58:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C8199AEE8; Wed, 23 Mar 2016 09:58:53 +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 DDB8C1EBA; Wed, 23 Mar 2016 09:58:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2N9wqRW097248; Wed, 23 Mar 2016 09:58:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2N9wqpF097247; Wed, 23 Mar 2016 09:58:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603230958.u2N9wqpF097247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Mar 2016 09:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297206 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 09:58:53 -0000 Author: kib Date: Wed Mar 23 09:58:51 2016 New Revision: 297206 URL: https://svnweb.freebsd.org/changeset/base/297206 Log: Fix locking mistake in softdep_waitidle(). The surrounding code expects that the loop is always exited with the SU lock owned, even on error. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Mar 23 04:18:57 2016 (r297205) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Mar 23 09:58:51 2016 (r297206) @@ -1937,9 +1937,9 @@ softdep_waitidle(struct mount *mp, int f vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, MNT_WAIT, td); VOP_UNLOCK(devvp, 0); + ACQUIRE_LOCK(ump); if (error != 0) break; - ACQUIRE_LOCK(ump); } ump->softdep_req = 0; if (i == SU_WAITIDLE_RETRIES && error == 0 && ump->softdep_deps != 0) { From owner-svn-src-head@freebsd.org Wed Mar 23 12:13:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6434FADA344; Wed, 23 Mar 2016 12:13:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 407471C3C; Wed, 23 Mar 2016 12:13:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NCDrPD040805; Wed, 23 Mar 2016 12:13:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NCDr1t040802; Wed, 23 Mar 2016 12:13:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603231213.u2NCDr1t040802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 23 Mar 2016 12:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297207 - in head: etc/autofs usr.bin/showmount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 12:13:54 -0000 Author: trasz Date: Wed Mar 23 12:13:53 2016 New Revision: 297207 URL: https://svnweb.freebsd.org/changeset/base/297207 Log: Make the autofs(5) -hosts map more robust, primarily to make it correctly handle NFS shares containing whitespace. This also adds the -E parameter to showmount(8). Reviewed by: emaste@, jhibbits@, wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5649 Modified: head/etc/autofs/special_hosts head/usr.bin/showmount/showmount.8 head/usr.bin/showmount/showmount.c Modified: head/etc/autofs/special_hosts ============================================================================== --- head/etc/autofs/special_hosts Wed Mar 23 09:58:51 2016 (r297206) +++ head/etc/autofs/special_hosts Wed Mar 23 12:13:53 2016 (r297207) @@ -10,8 +10,8 @@ if [ $# -eq 0 ]; then exit 0 fi -out=`showmount -e "$1"` +out=`showmount -E "$1"` [ $? -eq 0 ] || exit 1 echo "$out" | awk -v host="$1" \ - 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }' + '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }' Modified: head/usr.bin/showmount/showmount.8 ============================================================================== --- head/usr.bin/showmount/showmount.8 Wed Mar 23 09:58:51 2016 (r297206) +++ head/usr.bin/showmount/showmount.8 Wed Mar 23 12:13:53 2016 (r297207) @@ -31,7 +31,7 @@ .\" @(#)showmount.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd August 16, 2014 +.Dd March 20, 2016 .Dt SHOWMOUNT 8 .Os .Sh NAME @@ -40,6 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl a | d +.Op Fl E .Op Fl e .Op Fl 1 .Op Fl 3 @@ -73,6 +74,12 @@ List all mount points in the form: .Ed .It Fl d List directory paths of mount points instead of hosts. +.It Fl E +Show the +.Ar host Ns 's +exports list in a script-friendly format. +Client addresses and the header are not shown, and special +characters are escaped. .It Fl e Show the .Ar host Ns 's Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Wed Mar 23 09:58:51 2016 (r297206) +++ head/usr.bin/showmount/showmount.c Wed Mar 23 12:13:53 2016 (r297207) @@ -61,13 +61,15 @@ static const char rcsid[] = #include #include #include +#include /* Constant defs */ #define ALL 1 #define DIRS 2 -#define DODUMP 0x1 -#define DOEXPORTS 0x2 +#define DODUMP 0x1 +#define DOEXPORTS 0x2 +#define DOPARSABLEEXPORTS 0x4 struct mountlist { struct mountlist *ml_left; @@ -108,13 +110,14 @@ int tcp_callrpc(const char *host, int pr int main(int argc, char **argv) { + char strvised[MNTPATHLEN * 4 + 1]; register struct exportslist *exp; register struct grouplist *grp; register int rpcs = 0, mntvers = 3; const char *host; - int ch, estat; + int ch, estat, nbytes; - while ((ch = getopt(argc, argv, "ade13")) != -1) + while ((ch = getopt(argc, argv, "adEe13")) != -1) switch (ch) { case 'a': if (type == 0) { @@ -130,6 +133,9 @@ main(int argc, char **argv) } else usage(); break; + case 'E': + rpcs |= DOPARSABLEEXPORTS; + break; case 'e': rpcs |= DOEXPORTS; break; @@ -146,6 +152,13 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if ((rpcs & DOPARSABLEEXPORTS) != 0) { + if ((rpcs & DOEXPORTS) != 0) + errx(1, "-E cannot be used with -e"); + if ((rpcs & DODUMP) != 0) + errx(1, "-E cannot be used with -a or -d"); + } + if (argc > 0) host = *argv; else @@ -161,7 +174,7 @@ main(int argc, char **argv) clnt_perrno(estat); errx(1, "can't do mountdump rpc"); } - if (rpcs & DOEXPORTS) + if (rpcs & (DOEXPORTS | DOPARSABLEEXPORTS)) if ((estat = tcp_callrpc(host, MOUNTPROG, mntvers, MOUNTPROC_EXPORT, (xdrproc_t)xdr_void, (char *)0, (xdrproc_t)xdr_exportslist, (char *)&exportslist)) != 0) { @@ -202,6 +215,17 @@ main(int argc, char **argv) exp = exp->ex_next; } } + if (rpcs & DOPARSABLEEXPORTS) { + exp = exportslist; + while (exp) { + nbytes = strsnvis(strvised, sizeof(strvised), + exp->ex_dirp, VIS_GLOB | VIS_NL, "\"'$"); + if (nbytes == -1) + err(1, "strsnvis"); + printf("%s\n", strvised); + exp = exp->ex_next; + } + } exit(0); } From owner-svn-src-head@freebsd.org Wed Mar 23 12:57:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05ABEADAEA9; Wed, 23 Mar 2016 12:57:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F05716DA; Wed, 23 Mar 2016 12:57:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id l68so22861446wml.1; Wed, 23 Mar 2016 05:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7Dh/vojc0P5TTbWHBKYN6/zq/k3Is0lEBbznFyYEK0s=; b=SepmRobL/mUZwmozf3J7T7wJW2Mq2AnBe4TpN9+NTTp+tR+9JzL/BcI3GuvVW5J2A1 3S+J8fu+DHdRJ7kY54Q6dZIr4lVJ7l116zPp40PQWRl/A77N5DDPdv9bE7hEuISITYSI RzQC7s3Vx3O43/o+wJb4nNjiHRBp0CxBGxySLNIBWBE2ghr0BtclEUZgTubg3aNuoG5k rE2BMGzI0ystiNS0aLofmNuTdtTfUgm+bfaQC/KqcbNO4pB+GN/tJSq8TUNRZftuXng0 1O4utmrZwK4KqdXuMUevteuYR4soKVDHvZ14pJ3IXQNL6nAu6pzObqKG8pACX6AhwUgU imfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=7Dh/vojc0P5TTbWHBKYN6/zq/k3Is0lEBbznFyYEK0s=; b=fuJrJSGX9iL8CUA6NyMR4Y+IYTGUDxMW5Vj8RFa0gRgVOkgIrJIV12b0RPxyp8SQa3 mZ1xkFMJZwLXcizRFiNXvNPh+zL+6D5gjzzGZIhFNqvdo/YovfWU7oV0MRyShxrvh99k yD/caUKVyD4Te0eMlWQGSEoI6Szhlajgm+DsOPkhTCc8Y3CaODHGWWjPT/Yp1QLWzwfH pNaY1zfRHQxphMmz5FlStSBFH6FJTN5+H3BPyjDMnONm5MFrlI9TcztreA4kr6KTL2r6 3dc/Vj5kCuWShHw4FhAhDjq0KocXqfz+3DCoObsv09uNvgxpeWPjIFKcnRCFKGnWMIRc cmkQ== X-Gm-Message-State: AD7BkJKkCBQ/v/m1Hw/MrlSWSLvFjUGRlGNoFbYmKozmi3u2vBjRFiiHexpTfdnCV9E6lA== X-Received: by 10.28.130.6 with SMTP id e6mr3862502wmd.71.1458737819567; Wed, 23 Mar 2016 05:56:59 -0700 (PDT) Received: from brick.home (evp105.neoplus.adsl.tpnet.pl. [83.20.213.105]) by smtp.gmail.com with ESMTPSA id h7sm22114571wmf.9.2016.03.23.05.56.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 05:56:58 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 23 Mar 2016 13:56:54 +0100 From: Edward Tomasz Napierala To: Rick Macklem Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160323125654.GA1881@brick.home> Mail-Followup-To: Rick Macklem , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 12:57:09 -0000 On 0322T2113, Rick Macklem wrote: > Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Tue Mar 22 13:46:01 2016 > > > New Revision: 297190 > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > Log: > > > Wait for root mount tokens before showing the root mount prompt. > > > This restores the pre-r290196 behaviour, eliminating the need to manually > > > press '.' a couple of times to get USB to finish probing. > > > > > > Note that there's still something wrong with the console (character > > > echoing doesn't quite work), and there's also a reported problem with > > > BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > > When I had a console character echo problem (not serial), changing the > clock source to RTC fixed it. Just for the record, doing "set kern.eventtimer.timer=RTC" in loader(8) prompt didn't change anything wrt character echo. I've submitted a PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208239 From owner-svn-src-head@freebsd.org Wed Mar 23 13:12:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E709CADB300; Wed, 23 Mar 2016 13:12:59 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE34D1251; Wed, 23 Mar 2016 13:12:59 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aiian-0009jL-Ug; Wed, 23 Mar 2016 14:12:58 +0100 Subject: Re: svn commit: r297190 - head/sys/kern To: Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56F29654.8030806@dumbbell.fr> Date: Wed, 23 Mar 2016 14:12:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1458662141.1091.16.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:13:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL Content-Type: multipart/mixed; boundary="AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56F29654.8030806@dumbbell.fr> Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> In-Reply-To: <1458662141.1091.16.camel@freebsd.org> --AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 22/03/2016 16:55, Ian Lepore wrote: > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Tue Mar 22 13:46:01 2016 >> New Revision: 297190 >> URL: https://svnweb.freebsd.org/changeset/base/297190 >> >> Log: >> Wait for root mount tokens before showing the root mount prompt. >> This restores the pre-r290196 behaviour, eliminating the need to man= ually >> press '.' a couple of times to get USB to finish probing. >> =20 >> Note that there's still something wrong with the console (character >> echoing doesn't quite work), and there's also a reported problem wit= h >> BHyVe, but those two don't seem related to the problem above. >=20 > Just a datapoint on the echoing... it works fine on a serial console, > it's been years since I've seen glitches at the mountroot prompt. So > the problem may be in vt or kbdmux. I confirm this is a known issue with vt(4): it uses a callout to refresh the screen, but for reasons unknown to me, the callout is not called anymore on mountroot prompt. I tried to debug this but failed. Since then, I didn't have time to work on this again. So maybe callouts are disabled in this situation. If there is a way to detect that, then vt(4) can go back to a "synchronous mode" where it refreshes the screen after each typed character, like it does when ddb is active. I will repeat this in the bug report. --=20 Jean-S=E9bastien P=E9dron --AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk-- --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJW8pZUXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMAHwP/RqsOpvumSYEqUIiSSQTIu5w pRmrdg77PhVHRDk627QbA/IEP3o4hrkSZUEwDcEkzDsIu1cNY8vrJVOwPtQmhH3T XFl+s8SbByJLDv65l3RRGh4bRdEbi2otojG1xN40rRfQKEq7S3pt+94olg9eFr+k 8NiQiIueqmt7KVtjowrRwMRxV4lnfqUmo9IDsu9VxOZIp2wsNh3wvZ64zcSDq5nu gV4edAyLdjikQDrc9SB5tbZYcUx26is4hYWY/UyHyNiuuLGw65zL1wYXuWkjC0Uf z+wZhzBl4wCNUmaJ0zlOh91+QveGdnIzipQGJaEqeee2l8IUNthwpexnHBcRGSrD FZerOFYNv0cvR624k1d0u9e9e41oxLejYruiut5vN6s7xIzPRWHD0HQgtrEW9Odd UyW9tD1+4NMtItbCYQKXNvDyYfgadDF50qKUwUFC52Z49o5Bf1w2HMtaIHwmWKjZ mbIrQweuDfew3DiEoFEJG773WvzX2OnZFJqjUbfLVQFMpYkNWQVJgRwXDxSQvQcz VVRU7lPGgDx4rLT3gqo49oThqigJOZXFljYXTBRcPlzQnNsyHPPHCkYd7GaKQnK9 UaKbLuRNJI2a02G3mENGVhDaqPVbYbkNW2Eu7XJc+N+yl4vS5is6SN0koJfEqRpx Drd85vptITNp6pqq6oh5 =NZuA -----END PGP SIGNATURE----- --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL-- From owner-svn-src-head@freebsd.org Wed Mar 23 13:28:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0741EADB601; Wed, 23 Mar 2016 13:28:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B32041A6F; Wed, 23 Mar 2016 13:28:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NDS40X061945; Wed, 23 Mar 2016 13:28:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NDS4uk061939; Wed, 23 Mar 2016 13:28:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603231328.u2NDS4uk061939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 23 Mar 2016 13:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297208 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:28:06 -0000 Author: tuexen Date: Wed Mar 23 13:28:04 2016 New Revision: 297208 URL: https://svnweb.freebsd.org/changeset/base/297208 Log: Add const to several constants. Thanks to Nicholas Nethercote for providing the patch via https://bugzilla.mozilla.org/show_bug.cgi?id=1255655 MFC after: 1 week Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_cc_functions.c Wed Mar 23 13:28:04 2016 (r297208) @@ -1526,13 +1526,13 @@ sctp_rtt_rtcc_calculated(struct sctp_tcb struct sctp_hs_raise_drop { int32_t cwnd; - int32_t increase; - int32_t drop_percent; + int8_t increase; + int8_t drop_percent; }; #define SCTP_HS_TABLE_SIZE 73 -struct sctp_hs_raise_drop sctp_cwnd_adjust[SCTP_HS_TABLE_SIZE] = { +static const struct sctp_hs_raise_drop sctp_cwnd_adjust[SCTP_HS_TABLE_SIZE] = { {38, 1, 50}, /* 0 */ {118, 2, 44}, /* 1 */ {221, 3, 41}, /* 2 */ @@ -1632,7 +1632,7 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s } } net->last_hs_used = indx; - incr = ((sctp_cwnd_adjust[indx].increase) << 10); + incr = (((int32_t) sctp_cwnd_adjust[indx].increase) << 10); net->cwnd += incr; } sctp_enforce_cwnd_limit(&stcb->asoc, net); @@ -1658,7 +1658,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s } else { /* drop by the proper amount */ net->ssthresh = net->cwnd - (int)((net->cwnd / 100) * - sctp_cwnd_adjust[net->last_hs_used].drop_percent); + (int32_t) sctp_cwnd_adjust[net->last_hs_used].drop_percent); net->cwnd = net->ssthresh; /* now where are we */ indx = net->last_hs_used; @@ -2323,7 +2323,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str } } -struct sctp_cc_functions sctp_cc_functions[] = { +const struct sctp_cc_functions sctp_cc_functions[] = { { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_indata.c Wed Mar 23 13:28:04 2016 (r297208) @@ -1948,7 +1948,7 @@ finish_express_del: return (1); } -int8_t sctp_map_lookup_tab[256] = { +static const int8_t sctp_map_lookup_tab[256] = { 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_output.c Wed Mar 23 13:28:04 2016 (r297208) @@ -67,7 +67,7 @@ struct sack_track { struct sctp_gap_ack_block gaps[SCTP_MAX_GAPS_INARRAY]; }; -struct sack_track sack_array[256] = { +const struct sack_track sack_array[256] = { {0, 0, 0, 0, /* 0x00 */ {{0, 0}, {0, 0}, @@ -10414,7 +10414,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in struct sctp_sack_chunk *sack; struct sctp_nr_sack_chunk *nr_sack; struct sctp_gap_ack_block *gap_descriptor; - struct sack_track *selector; + const struct sack_track *selector; int mergeable = 0; int offset; caddr_t limit; Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_ss_functions.c Wed Mar 23 13:28:04 2016 (r297208) @@ -822,7 +822,7 @@ default_again: return (strq); } -struct sctp_ss_functions sctp_ss_functions[] = { +const struct sctp_ss_functions sctp_ss_functions[] = { /* SCTP_SS_DEFAULT */ { .sctp_ss_init = sctp_ss_default_init, Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_usrreq.c Wed Mar 23 13:28:04 2016 (r297208) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); -extern struct sctp_cc_functions sctp_cc_functions[]; -extern struct sctp_ss_functions sctp_ss_functions[]; +extern const struct sctp_cc_functions sctp_cc_functions[]; +extern const struct sctp_ss_functions sctp_ss_functions[]; void sctp_init(void) @@ -5862,7 +5862,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); out_of_it: SCTP_TCB_UNLOCK(stcb); } else { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctputil.c Wed Mar 23 13:28:04 2016 (r297208) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #define KTR_SCTP KTR_SUBSYS #endif -extern struct sctp_cc_functions sctp_cc_functions[]; -extern struct sctp_ss_functions sctp_ss_functions[]; +extern const struct sctp_cc_functions sctp_cc_functions[]; +extern const struct sctp_ss_functions sctp_ss_functions[]; void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) From owner-svn-src-head@freebsd.org Wed Mar 23 13:29:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E84ADB722; Wed, 23 Mar 2016 13:29:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4AB1CEC; Wed, 23 Mar 2016 13:29:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NDTqTE062091; Wed, 23 Mar 2016 13:29:52 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NDTq0b062090; Wed, 23 Mar 2016 13:29:52 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603231329.u2NDTq0b062090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 23 Mar 2016 13:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297209 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:29:53 -0000 Author: wma Date: Wed Mar 23 13:29:52 2016 New Revision: 297209 URL: https://svnweb.freebsd.org/changeset/base/297209 Log: ARM64 copyinout improvements The first of set of patches. Use wider load/stores when aligned buffer is being copied. In a simple test: dd if=/dev/zero of=/dev/null bs=1M count=1024 the performance jumped from 410MB/s up to 3.6GB/s. TODO: - better handling of unaligned buffers (WiP) - implement similar mechanism to bzero Submitted by: Dominik Ermel Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib, andrew, emaste Differential Revision: https://reviews.freebsd.org/D5664 Modified: head/sys/arm64/arm64/copyinout.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Wed Mar 23 13:28:04 2016 (r297208) +++ head/sys/arm64/arm64/copyinout.S Wed Mar 23 13:29:52 2016 (r297209) @@ -51,24 +51,17 @@ END(copyio_fault) * int copyout(const void *kaddr, void *udaddr, size_t len) */ ENTRY(copyout) - cbz x2, 2f /* If len == 0 then skip loop */ + cbz x2, 1f add x3, x1, x2 ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb - adr x6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - -1: ldrb w4, [x0], #1 /* Load from kaddr */ - strb w4, [x1], #1 /* Store in uaddr */ - sub x2, x2, #1 /* len-- */ - cbnz x2, 1b - - SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + b copycommon -2: mov x0, xzr /* return 0 */ +1: mov x0, xzr /* return 0 */ ret + END(copyout) /* @@ -77,24 +70,17 @@ END(copyout) * int copyin(const void *uaddr, void *kdaddr, size_t len) */ ENTRY(copyin) - cbz x2, 2f /* If len == 0 then skip loop */ + cbz x2, 1f add x3, x0, x2 ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb - adr x6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - -1: ldrb w4, [x0], #1 /* Load from uaddr */ - strb w4, [x1], #1 /* Store in kaddr */ - sub x2, x2, #1 /* len-- */ - cbnz x2, 1b - - SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + b copycommon -2: mov x0, xzr /* return 0 */ +1: mov x0, xzr /* return 0 */ ret + END(copyin) /* @@ -130,3 +116,101 @@ ENTRY(copyinstr) csel w0, wzr, w1, eq /* If so return success, else failure */ ret END(copyinstr) + +/* + * Local helper + * + * x0 - src pointer + * x1 - dst pointer + * x2 - size + * lr - the return address, so jump here instead of calling + * + * This function is optimized to minimize concurrent memory accesses. In + * present form it is suited for cores with a single memory prefetching + * unit. + * ARM64TODO: + * Consider using separate functions for each ARM64 core. Adding memory + * access interleaving might increase a total throughput on A57 or A72. + */ + .text + .align 4 + .local copycommon + .type copycommon,@function + +copycommon: + adr x6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + + + /* Check alignment */ + orr x3, x0, x1 + ands x3, x3, 0x07 + b.eq aligned + + /* Unaligned is byte by byte copy */ +byte_by_byte: + ldrb w3, [x0], #0x01 + strb w3, [x1], #0x01 + subs x2, x2, #0x01 + b.ne byte_by_byte + b ending + +aligned: + cmp x2, #0x10 + b.lt lead_out + cmp x2, #0x40 + b.lt by_dwords_start + + /* Block copy */ + lsr x15, x2, #0x06 +by_blocks: + ldp x3, x4, [x0], #0x10 + ldp x5, x6, [x0], #0x10 + ldp x7, x8, [x0], #0x10 + ldp x9, x10, [x0], #0x10 + stp x3, x4, [x1], #0x10 + stp x5, x6, [x1], #0x10 + stp x7, x8, [x1], #0x10 + stp x9, x10, [x1], #0x10 + + subs x15, x15, #0x01 + b.ne by_blocks + + and x2, x2, #0x3f + +by_dwords_start: + lsr x15, x2, #0x04 + cbz x15, lead_out +by_dwords: + ldp x3, x4, [x0], #0x10 + stp x3, x4, [x1], #0x10 + subs x15, x15, #0x01 + b.ne by_dwords + + /* Less than 16 bytes to copy */ +lead_out: + tbz x2, #0x03, last_word + ldr x3, [x0], #0x08 + str x3, [x1], #0x08 + +last_word: + tbz x2, #0x02, last_hword + ldr w3, [x0], #0x04 + str w3, [x1], #0x04 + +last_hword: + tbz x2, #0x01, last_byte + ldrh w3, [x0], #0x02 + strh w3, [x1], #0x02 + +last_byte: + tbz x2, #0x00, ending + ldrb w3, [x0] + strb w3, [x1] + +ending: + SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + + mov x0, xzr /* return 0 */ + ret + .size copycommon, . - copycommon From owner-svn-src-head@freebsd.org Wed Mar 23 16:37:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0226EADBCDB; Wed, 23 Mar 2016 16:37:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0FA1A69; Wed, 23 Mar 2016 16:37:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NGb89j020737; Wed, 23 Mar 2016 16:37:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NGb8VN020736; Wed, 23 Mar 2016 16:37:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603231637.u2NGb8VN020736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 23 Mar 2016 16:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297210 - head/sbin/casperd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 16:37:10 -0000 Author: bdrewery Date: Wed Mar 23 16:37:08 2016 New Revision: 297210 URL: https://svnweb.freebsd.org/changeset/base/297210 Log: Remove disconnected casperd, missed in r296047. Reported by: bz Deleted: head/sbin/casperd/ From owner-svn-src-head@freebsd.org Wed Mar 23 17:15:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A41CDADB6B0; Wed, 23 Mar 2016 17:15:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA931F13; Wed, 23 Mar 2016 17:15:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2NHFC9s009174 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 23 Mar 2016 19:15:12 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2NHFC9s009174 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2NHFCtY009173; Wed, 23 Mar 2016 19:15:12 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Mar 2016 19:15:12 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160323171512.GA1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160323075842.GX1741@kib.kiev.ua> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 17:15:24 -0000 On Wed, Mar 23, 2016 at 09:58:42AM +0200, Konstantin Belousov wrote: > If TSC has the behaviour you described, i.e. suddenly jumping random > steps on single CPU, from the point of view of kernel, then the system > is seriosly misbehaving. The timekeeping stuff would be badly broken > regardless of the ipi_wait(). I do not see why should we worry about > that in ipi_wait(). > > I proposed slightly different thing, i.e. using timekeep code to indirect > to TSC if configured so. Below is the proof of concept patch, use of > nanouptime() may be too naive, and binuptime() would cause tiny bit less > overhead, but I do not want to think about arithmetic. > > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 7e5087b..fdc12a4 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); > * private to the MD code. The public interface for the rest of the > * kernel is defined in mp_machdep.c. > */ > + > +/* > + * Wait delay microseconds for IPI to be sent. If delay is -1, we > + * wait forever. > + */ > static int > native_lapic_ipi_wait(int delay) > { > - int x; > + struct timespec end, x; > > /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ > if (x2apic_mode) > return (1); > > - /* > - * Wait delay microseconds for IPI to be sent. If delay is > - * -1, we wait forever. > - */ > - if (delay == -1) { > - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != > - APIC_DELSTAT_IDLE) > - ia32_pause(); > - return (1); > + if (delay != -1) { > + KASSERT(delay > 0, ("wrong delay %d", delay)); > + x.tv_sec = delay / 1000000; > + x.tv_nsec = (delay % 1000000) * 1000; > + nanouptime(&end); > + timespecadd(&end, &x); > } > - > - for (x = 0; x < delay; x++) { > + for (;;) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(1); > + ia32_pause(); > + if (delay != -1) { > + nanouptime(&x); > + if (timespeccmp(&x, &end, >)) > + break; > + } > } > return (0); > } Of course this cannot work if timecounter takes any locks, even spinlock. Only TSC or similar lock-less mechanisms are allowed there. Meh. From owner-svn-src-head@freebsd.org Wed Mar 23 17:45:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8804DADBA68; Wed, 23 Mar 2016 17:45:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 0BF251C60; Wed, 23 Mar 2016 17:45:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id l68so206295314wml.0; Wed, 23 Mar 2016 10:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6uFOavILUJvxuEPFn4X46tbhd7gONc5qEsRuBNHLAPI=; b=CfXauBmub/Ooz+GOQlrcmqnZRCGgenFliw5s3F7qwyJA/kYG6BmwGaUvgBfXcdTRq8 ZT0DiavT7Go/H2xo0aGwXZSWxf+MbDcOvpl53BVraDcz6SSU3oPE3kMmV7sxxG/RCSfN lxXXx7XAcEjTIYztjmgSAmlshS3jOLU2+izaS2uisp9LYQp/IuiYrGqdnm7oMcs4fjfB Jzt2ozO7qJ9i1MLMmn4ckMbh4Y6INrHiLlPblcIVfBB3meDkL0UxEIWQLr0e5WkWTHlK cqw+3JgOVuePlx49ZC8a+pFdtFHwpRvb2Xzvl5N3a4pN93pKPaQs0rWjxIQ0QuWzqiHg l2/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6uFOavILUJvxuEPFn4X46tbhd7gONc5qEsRuBNHLAPI=; b=g4jkShcZO0z6ueZaKqQKqMdP47HT9WwzNbCHQe+QSddEbWFztLw8JmYu6W2I9//3aP gcZnocAyFw9YwJ+NIxM4+xLiPH/TTDgiwqMkc5+ci6lCgQ/1b2hrN2uEx4PD7zeF5lSe HE9HV0k1FhqiRWrPlM741UzoTaiTAQ3UYfeCDwff93rZQ7r4s+BNyPrCmTTg47Ida+E6 aOaYYC7CbPEj85LJ2QeWNcOKcwgA6rb97rIH1DjuG5A3TcKjY8+u+2EGMBxdsavB9hQK uswDjQgdzOXLlH5GIQ83Vma1BxgcTP3ScY2D+A56kCAH4CIRwGpvhsQOz5sNosXNw8M/ nviQ== X-Gm-Message-State: AD7BkJLS10NkrIuvTFITZkz32w597dbFoFGA0Qyh0GviDE3a+OWXZPLEiTv4+9fGoJClgA== X-Received: by 10.194.5.36 with SMTP id p4mr4777770wjp.167.1458755145550; Wed, 23 Mar 2016 10:45:45 -0700 (PDT) Received: from brick.home (esq247.neoplus.adsl.tpnet.pl. [83.20.136.247]) by smtp.gmail.com with ESMTPSA id y72sm4003173wmh.21.2016.03.23.10.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 10:45:44 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 23 Mar 2016 18:45:37 +0100 From: Edward Tomasz Napierala To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160323174537.GA1826@brick.home> Mail-Followup-To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F29654.8030806@dumbbell.fr> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 17:45:47 -0000 On 0323T1412, Jean-Sébastien Pédron wrote: > On 22/03/2016 16:55, Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > >> Author: trasz > >> Date: Tue Mar 22 13:46:01 2016 > >> New Revision: 297190 > >> URL: https://svnweb.freebsd.org/changeset/base/297190 > >> > >> Log: > >> Wait for root mount tokens before showing the root mount prompt. > >> This restores the pre-r290196 behaviour, eliminating the need to manually > >> press '.' a couple of times to get USB to finish probing. > >> > >> Note that there's still something wrong with the console (character > >> echoing doesn't quite work), and there's also a reported problem with > >> BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > I confirm this is a known issue with vt(4): it uses a callout to refresh > the screen, but for reasons unknown to me, the callout is not called > anymore on mountroot prompt. I tried to debug this but failed. Since > then, I didn't have time to work on this again. > > So maybe callouts are disabled in this situation. If there is a way to > detect that, then vt(4) can go back to a "synchronous mode" where it > refreshes the screen after each typed character, like it does when ddb > is active. Looks like that's the case: for some reason the callouts don't work. This trivial hack is a (mostly) working workaround: Index: svn/head/sys/kern/kern_cons.c =================================================================== --- svn/head/sys/kern/kern_cons.c (revision 297210) +++ svn/head/sys/kern/kern_cons.c (working copy) @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) lp = cp; end = cp + size - 1; for (;;) { + pause("meh", 1); c = cngetc() & 0177; switch (c) { case '\n': From owner-svn-src-head@freebsd.org Wed Mar 23 19:17:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495C6ADBBEE; Wed, 23 Mar 2016 19:17:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 160C116D2; Wed, 23 Mar 2016 19:17:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NJHCwY068551; Wed, 23 Mar 2016 19:17:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJHCQ4068550; Wed, 23 Mar 2016 19:17:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603231917.u2NJHCQ4068550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 23 Mar 2016 19:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297212 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:17:13 -0000 Author: dim Date: Wed Mar 23 19:17:12 2016 New Revision: 297212 URL: https://svnweb.freebsd.org/changeset/base/297212 Log: For C++, expose long long types and functions (lldiv_t, llabs, lldiv, etc) in stdlib.h. These will be needed for newer versions of libc++, which uses them for defining overloaded versions of abs() and div(). MFC after: 1 week Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Mar 23 18:21:26 2016 (r297211) +++ head/include/stdlib.h Wed Mar 23 19:17:12 2016 (r297212) @@ -125,7 +125,7 @@ size_t wcstombs(char * __restrict, cons * * (The only other extension made by C99 in thie header is _Exit().) */ -#if __ISO_C_VISIBLE >= 1999 +#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus) #ifdef __LONG_LONG_SUPPORTED /* LONGLONG */ typedef struct { From owner-svn-src-head@freebsd.org Wed Mar 23 19:21:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E12ADBDA5; Wed, 23 Mar 2016 19:21:22 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C7F19FE; Wed, 23 Mar 2016 19:21:22 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NJLLrq068752; Wed, 23 Mar 2016 19:21:21 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJLLgf068751; Wed, 23 Mar 2016 19:21:21 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231921.u2NJLLgf068751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297213 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:21:23 -0000 Author: jmcneill Date: Wed Mar 23 19:21:21 2016 New Revision: 297213 URL: https://svnweb.freebsd.org/changeset/base/297213 Log: Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving platform specific drivers a chance to override the generic driver. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5701 Modified: head/sys/dev/extres/clk/clk_bus.c Modified: head/sys/dev/extres/clk/clk_bus.c ============================================================================== --- head/sys/dev/extres/clk/clk_bus.c Wed Mar 23 19:17:12 2016 (r297212) +++ head/sys/dev/extres/clk/clk_bus.c Wed Mar 23 19:21:21 2016 (r297213) @@ -54,7 +54,7 @@ ofw_clkbus_probe(device_t dev) device_set_desc(dev, "OFW clocks bus"); - return (0); + return (BUS_PROBE_GENERIC); } static int From owner-svn-src-head@freebsd.org Wed Mar 23 19:24:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70EF9ADBF44; Wed, 23 Mar 2016 19:24:11 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25E9A1D4D; Wed, 23 Mar 2016 19:24:11 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NJOAkK071604; Wed, 23 Mar 2016 19:24:10 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJOAow071602; Wed, 23 Mar 2016 19:24:10 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231924.u2NJOAow071602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297214 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:24:11 -0000 Author: jmcneill Date: Wed Mar 23 19:24:09 2016 New Revision: 297214 URL: https://svnweb.freebsd.org/changeset/base/297214 Log: clk_parse_ofw_out_names is supposed to return a list of indices when the clock-indices property is present, so change the "uint32_t *indices" parameter to "uint32_t **indices" to allow this. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5702 Modified: head/sys/dev/extres/clk/clk.c head/sys/dev/extres/clk/clk.h Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Wed Mar 23 19:21:21 2016 (r297213) +++ head/sys/dev/extres/clk/clk.c Wed Mar 23 19:24:09 2016 (r297214) @@ -1272,12 +1272,12 @@ clk_get_by_ofw_name(device_t dev, const */ int clk_parse_ofw_out_names(device_t dev, phandle_t node, const char ***out_names, - uint32_t *indices) + uint32_t **indices) { int name_items, rv; *out_names = NULL; - indices = NULL; + *indices = NULL; if (!OF_hasprop(node, "clock-output-names")) return (0); rv = ofw_bus_string_list_to_array(node, "clock-output-names", @@ -1294,7 +1294,7 @@ clk_parse_ofw_out_names(device_t dev, ph device_printf(dev, " Size of 'clock-output-names' and " "'clock-indices' differs\n"); free(*out_names, M_OFWPROP); - free(indices, M_OFWPROP); + free(*indices, M_OFWPROP); return (0); } return (name_items); Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Wed Mar 23 19:21:21 2016 (r297213) +++ head/sys/dev/extres/clk/clk.h Wed Mar 23 19:24:09 2016 (r297214) @@ -132,7 +132,7 @@ const char *clk_get_name(clk_t clk); int clk_get_by_ofw_index(device_t dev, int idx, clk_t *clk); int clk_get_by_ofw_name(device_t dev, const char *name, clk_t *clk); int clk_parse_ofw_out_names(device_t dev, phandle_t node, - const char ***out_names, uint32_t *indices); + const char ***out_names, uint32_t **indices); int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name); #endif From owner-svn-src-head@freebsd.org Wed Mar 23 19:26:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDAC899A2A8; Wed, 23 Mar 2016 19:26:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83F3B1D9E; Wed, 23 Mar 2016 19:26:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NJQrXu073464; Wed, 23 Mar 2016 19:26:53 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJQro3073463; Wed, 23 Mar 2016 19:26:53 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231926.u2NJQro3073463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297215 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:26:54 -0000 Author: jmcneill Date: Wed Mar 23 19:26:53 2016 New Revision: 297215 URL: https://svnweb.freebsd.org/changeset/base/297215 Log: Fix support for fixed factor clocks. - Use a different device description for fixed and fixed factor clocks. - Fix a bug where the "clock-div" property was stored in the "mult" field of the clock definition. - Get the fixed factor parent clock by index instead of by name, as a clock-names property is not required to be present here. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5703 Modified: head/sys/dev/extres/clk/clk_fixed.c Modified: head/sys/dev/extres/clk/clk_fixed.c ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.c Wed Mar 23 19:24:09 2016 (r297214) +++ head/sys/dev/extres/clk/clk_fixed.c Wed Mar 23 19:26:53 2016 (r297215) @@ -150,12 +150,19 @@ struct clk_fixed_softc { static int clk_fixed_probe(device_t dev) { + intptr_t clk_type; - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (clk_type) { + case CLK_TYPE_FIXED: device_set_desc(dev, "Fixed clock"); return (BUS_PROBE_DEFAULT); + case CLK_TYPE_FIXED_FACTOR: + device_set_desc(dev, "Fixed factor clock"); + return (BUS_PROBE_DEFAULT); + default: + return (ENXIO); } - return (ENXIO); } static int @@ -184,11 +191,11 @@ clk_fixed_init_fixed_factor(struct clk_f rv = OF_getencprop(node, "clock-mult", &def->mult, sizeof(def->mult)); if (rv <= 0) return (ENXIO); - rv = OF_getencprop(node, "clock-div", &def->mult, sizeof(def->div)); + rv = OF_getencprop(node, "clock-div", &def->div, sizeof(def->div)); if (rv <= 0) return (ENXIO); /* Get name of parent clock */ - rv = clk_get_by_ofw_name(sc->dev, "clocks", &parent); + rv = clk_get_by_ofw_index(sc->dev, 0, &parent); if (rv != 0) return (ENXIO); def->clkdef.parent_names = malloc(sizeof(char *), M_OFWPROP, M_WAITOK); From owner-svn-src-head@freebsd.org Wed Mar 23 20:30:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9590FADACFF; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 75E291C54; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6D2C71497; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E523E1A3F4; Wed, 23 Mar 2016 20:30:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3VcqQORv5of7; Wed, 23 Mar 2016 20:30:40 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E7DBA1A3EF To: Nikolai Lifanov References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56F2FCDC.3070300@FreeBSD.org> Date: Wed, 23 Mar 2016 13:30:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F16C2A.40201@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 20:30:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi Content-Type: multipart/mixed; boundary="nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7" From: Bryan Drewery To: Nikolai Lifanov Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" Message-ID: <56F2FCDC.3070300@FreeBSD.org> Subject: Re: svn commit: r296921 - head/share/mk References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> In-Reply-To: <56F16C2A.40201@FreeBSD.org> --nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/22/2016 9:00 AM, Bryan Drewery wrote: > On 3/22/16 8:44 AM, Nikolai Lifanov wrote: >> On 03/22/16 11:26, Bryan Drewery wrote: >>> On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>>> Hi! >>>> >>>> I can't install world with a read-only /usr/obj anymore: >>>> https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >>>> >>>> It looks related to r296921 but I don't fully understand our build >>>> system to be sure of that. >>>> >>>> What do you think? >>>> >>> >>> Definitely, but I don't think it would have worked before "r284345 | = sjg >>> | 2015-06-13" anyhow. >>> >>> The better fix here involves a lot of rework to the LIB32 build. I >>> might be able to come up with a hack to fix read-only /usr/obj here >>> until the major LIB32 work can be done. >>> >> >> Install with read-only obj worked for me before this change. >> >=20 > With LIB32 enabled, on head? I don't see how after "r235122 | jlh | > 2012-05-07" made the change I restored. >=20 >=20 FYI I am working on resolving this by making the lib32 build use a proper --sysroot. It should be done in the next few days. --=20 Regards, Bryan Drewery --nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7-- --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJW8vzvAAoJEDXXcbtuRpfPCTUH/3NOCJFl6ckoxzQA82sp1SQ+ 5cY+eMn2LuGAzfuI7JOy162zNuMLlfgi9U3CEKHCuZzK3OITVNBX8htNkMZolO3n T6NgrlDgvLNMiueHeOZ6QxJPdKDSohMZDDtygT79gJIQfgghLZOg54cNPrRjANTq ThIyFMF+Jz/y98I2D1LQZ5LBl0oqzGoSLzwoITLMzxtKzPZB2q2V4HGLBQ2kdwfV W7VAP+KPvrwTAD34QjcybG4zPXpLENmRKLp7vzG4xIKdRIx6OLYmysk8iYnQncSD y/oSiSyfulSzcZbtKF2clihVnce11Rpp/jne1zSdsZ9BugPn0/3dnF0SEArHNlE= =CD53 -----END PGP SIGNATURE----- --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi-- From owner-svn-src-head@freebsd.org Wed Mar 23 21:22:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 652F8ADB6A0; Wed, 23 Mar 2016 21:22:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F7012DA; Wed, 23 Mar 2016 21:22:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 35368B93A; Wed, 23 Mar 2016 17:22:02 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Date: Wed, 23 Mar 2016 14:21:59 -0700 Message-ID: <2922763.uITxoCVqGR@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160323075842.GX1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 23 Mar 2016 17:22:02 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 21:22:03 -0000 On Wednesday, March 23, 2016 09:58:42 AM Konstantin Belousov wrote: > On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: > > On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > > > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > > > > > - for (x = 0; x < delay; x += 5) { > > > > + for (x = 0; x < delay; x++) { > > > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > > > APIC_DELSTAT_IDLE) > > > > return (1); > > > > - DELAY(5); > > > > + DELAY(1); > > > > } > > > > return (0); > > > > } > > > > > > Ideally we would structure the loop differently. I think it is more > > > efficient WRT latency to only block execution by ia32_pause(), and > > > compare the the getbinuptime() results to calculate spent time, on each > > > loop step. > > > > Yes. I've thought about using the TSC directly to do that, but folks are > > worried about the TSC being unstable due to vcpus in a VM migrating > > across physical CPUs. DELAY() does seem to DTRT in that case assuming the > > hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to > > essentially duplicate DELAY() (really delay_tc()) inline. > > If TSC has the behaviour you described, i.e. suddenly jumping random > steps on single CPU, from the point of view of kernel, then the system > is seriosly misbehaving. The timekeeping stuff would be badly broken > regardless of the ipi_wait(). I do not see why should we worry about > that in ipi_wait(). > > I proposed slightly different thing, i.e. using timekeep code to indirect > to TSC if configured so. Below is the proof of concept patch, use of > nanouptime() may be too naive, and binuptime() would cause tiny bit less > overhead, but I do not want to think about arithmetic. As you noted, the issue is if a timecounter needs locks (e.g. i8254) though outside of that I think the patch is great. :-/ Of course, if the TSC isn't advertised as invariant, DELAY() is talking to the timecounter directly as well. However, I think we probably can use the TSC. The only specific note I got from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, thinking about this more I have a different theory to explain how the TSC can be out of whack on different vCPUs even if the hardware TSC is in sync in the physical CPUs underneath. One of the things present in the VCMS on Intel CPUs using VT-x is a TSC adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to alter the offset between the TSC in the guest and the "real" TSC value in the physical CPU itself. One way a hypervisor might use this is to try to "pause" the TSC during a VM-exit by taking TSC timestamps at the start and end of a VM-exit and adding that delta to the TSC offset just before each VM-entry. However, if you have two vCPUs, one of which is running in the guest and one of which is handling a VM-exit in the hypervisor, the TSC on the first vCPU will run while the effective TSC of the second vCPU is paused. When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", but it will lag the first vCPU by however long it took to handle its VM-exit. It wouldn't surprise me if KVM was doing this. bhyve does not do this to my knowledge (so the TSC is actually still usable as a timecounter under bhyve for some value of "usable"). However, even with this TSC pausing/unpausing, the TSC would still increase monotonically on a single vCPU. For the purposes of DELAY() (and other spin loops on a pinned thread such as in lapic_ipi_wait()), that is all you need. > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 7e5087b..fdc12a4 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); > * private to the MD code. The public interface for the rest of the > * kernel is defined in mp_machdep.c. > */ > + > +/* > + * Wait delay microseconds for IPI to be sent. If delay is -1, we > + * wait forever. > + */ > static int > native_lapic_ipi_wait(int delay) > { > - int x; > + struct timespec end, x; > > /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ > if (x2apic_mode) > return (1); > > - /* > - * Wait delay microseconds for IPI to be sent. If delay is > - * -1, we wait forever. > - */ > - if (delay == -1) { > - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != > - APIC_DELSTAT_IDLE) > - ia32_pause(); > - return (1); > + if (delay != -1) { > + KASSERT(delay > 0, ("wrong delay %d", delay)); > + x.tv_sec = delay / 1000000; > + x.tv_nsec = (delay % 1000000) * 1000; > + nanouptime(&end); > + timespecadd(&end, &x); > } > - > - for (x = 0; x < delay; x++) { > + for (;;) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(1); > + ia32_pause(); > + if (delay != -1) { > + nanouptime(&x); > + if (timespeccmp(&x, &end, >)) > + break; > + } > } > return (0); > } -- John Baldwin From owner-svn-src-head@freebsd.org Wed Mar 23 22:07:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0B6ADB9A2; Wed, 23 Mar 2016 22:07:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221421BA4; Wed, 23 Mar 2016 22:07:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NM7DP9021701; Wed, 23 Mar 2016 22:07:13 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NM7D2D021700; Wed, 23 Mar 2016 22:07:13 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201603232207.u2NM7D2D021700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Wed, 23 Mar 2016 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297217 - head/usr.sbin/bluetooth/bthidd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 22:07:14 -0000 Author: emax Date: Wed Mar 23 22:07:13 2016 New Revision: 297217 URL: https://svnweb.freebsd.org/changeset/base/297217 Log: fix incorrect usage of hid_set_data() which causes crash in bthidd(8) on amd64 WITH_SSP builds Submitted by: rakuco Reviewed by: rakuco Tested by: rakuco MFC after: 1 week Modified: head/usr.sbin/bluetooth/bthidd/kbd.c Modified: head/usr.sbin/bluetooth/bthidd/kbd.c ============================================================================== --- head/usr.sbin/bluetooth/bthidd/kbd.c Wed Mar 23 20:21:51 2016 (r297216) +++ head/usr.sbin/bluetooth/bthidd/kbd.c Wed Mar 23 22:07:13 2016 (r297217) @@ -514,7 +514,7 @@ int32_t kbd_status_changed(bthid_session_p s, uint8_t *data, int32_t len) { vkbd_status_t st; - uint8_t leds, report_id; + uint8_t found, report_id; hid_device_p hid_device; hid_data_t d; hid_item_t h; @@ -523,15 +523,21 @@ kbd_status_changed(bthid_session_p s, ui assert(len == sizeof(vkbd_status_t)); memcpy(&st, data, sizeof(st)); - leds = 0; + found = 0; report_id = NO_REPORT_ID; hid_device = get_hid_device(&s->bdaddr); assert(hid_device != NULL); + data[0] = 0xa2; /* DATA output (HID output report) */ + data[1] = 0x00; + data[2] = 0x00; + for (d = hid_start_parse(hid_device->desc, 1 << hid_output, -1); hid_get_item(d, &h) > 0; ) { if (HID_PAGE(h.usage) == HUP_LEDS) { + found++; + if (report_id == NO_REPORT_ID) report_id = h.report_ID; else if (h.report_ID != report_id) @@ -544,17 +550,17 @@ kbd_status_changed(bthid_session_p s, ui switch(HID_USAGE(h.usage)) { case 0x01: /* Num Lock LED */ if (st.leds & LED_NUM) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; case 0x02: /* Caps Lock LED */ if (st.leds & LED_CAP) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; case 0x03: /* Scroll Lock LED */ if (st.leds & LED_SCR) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; /* XXX add other LEDs ? */ @@ -563,18 +569,8 @@ kbd_status_changed(bthid_session_p s, ui } hid_end_parse(d); - data[0] = 0xa2; /* DATA output (HID output report) */ - - if (report_id != NO_REPORT_ID) { - data[1] = report_id; - data[2] = leds; - len = 3; - } else { - data[1] = leds; - len = 2; - } - - write(s->intr, data, len); + if (found) + write(s->intr, data, (report_id != NO_REPORT_ID) ? 3 : 2); return (0); } From owner-svn-src-head@freebsd.org Wed Mar 23 22:12:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0C22ADBB69; Wed, 23 Mar 2016 22:12:02 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9F71E5F; Wed, 23 Mar 2016 22:12:01 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:zBDqqBdVE7V6+ncjhi1ZP4/nlGMj4u6mDksu8pMizoh2WeGdxc69Yx7h7PlgxGXEQZ/co6odzbGG4+a5BydZvM/JmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviq9uKPU4R2WP1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S42X2MUmx9JBUDm5R3nXd+luCn5uOBm1AGVOMT3SfY/XjH0vIlxTxq9siYMNHYc+WrUjsF1xPZBpRuqpBhyxqbJZ46IOf5mfuXWdIVJFiJ6Qs9NWnkZUcuHZIwVAr9EZL4Aog== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CqBACFE/NW/61jaINehQAGumaBcIJdgzACgXwSAQEBAQEBAQFjJ4ItghUBAQQjVhACAQgOCgICDRkCAlcCBBOIJ7BIkF8BAQEBAQEEAQEBAQEBGnyFIoF7gkmEIQODGIJWBZdaiGOUK48FAicHNIIDGYFlIC6IUTx+AQEB X-IronPort-AV: E=Sophos;i="5.24,383,1454994000"; d="scan'208";a="272429468" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 23 Mar 2016 18:10:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 3432F15F565; Wed, 23 Mar 2016 18:10:52 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ekpG3fxf7Tu0; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id A2EE315F56D; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fmI5z1v2c3Y5; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 83E9F15F565; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) Date: Wed, 23 Mar 2016 18:10:51 -0400 (EDT) From: Rick Macklem To: Benjamin Kaduk Cc: Bryan Drewery , "cem@FreeBSD.org" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF44 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon Thread-Index: ZvfjEWNaByXm3PRvzdvBLAHJp7wxMQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 22:12:03 -0000 Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: > > > > > > > > > The manpage for close(2) does document some errors, one being ENOSPC. The > > close(2) behavior of returning write(2), really VOP_WRITE(9), errors though > > is specific to filemon since all of the writes are hidden and this is the > > only place to return an error. I have a review open to resolve a similar > > issue in alq(9) as well since all of the writes are asynchronous and > > there's no API to retrieve any error from. > > > > filemon is not unique in this regard; the AFS filesystem buffers writes > locally and in some cases errors writing to the remote server can be > delayed until close(). Of course, very few softwares actually check the > return value of close, so this can cause trouble sometimes... > Sorry, but I can't resist a little ancient history... When NFS first showed up in the mid-1980s, the clients would flush writes upon close() in order to detect write errors (usually ENOSPC) and return them to the app. (typically a user trying to save their text edit when the server was out of space or the user was out of quota). At least this way, the editor could tell the user that their text file wasn't saved. Somehow, the flush writes upon close to detect this morphed into "close to open consistency", which was an AFS concept and not an NFS one (which most NFS clients only implement approximately, given attribute caching and modify time precision, but that's another story;-). rick > -Ben > From owner-svn-src-head@freebsd.org Wed Mar 23 23:42:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63230ADBC03; Wed, 23 Mar 2016 23:42:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED01E1FD1; Wed, 23 Mar 2016 23:42:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7546F3C461A; Thu, 24 Mar 2016 10:22:31 +1100 (AEDT) Date: Thu, 24 Mar 2016 10:22:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem cc: Benjamin Kaduk , Bryan Drewery , "cem@FreeBSD.org" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon In-Reply-To: <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> Message-ID: <20160324092330.X2963@besplex.bde.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=uVdQFnm1dlgYBY5sB3MA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 23:42:58 -0000 On Wed, 23 Mar 2016, Rick Macklem wrote: > Benjamin Kaduk wrote: >> On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: >>> >>> The manpage for close(2) does document some errors, one being ENOSPC. The >>> close(2) behavior of returning write(2), really VOP_WRITE(9), errors though >>> is specific to filemon since all of the writes are hidden and this is the >>> only place to return an error. I have a review open to resolve a similar >>> issue in alq(9) as well since all of the writes are asynchronous and >>> there's no API to retrieve any error from. >> >> filemon is not unique in this regard; the AFS filesystem buffers writes >> locally and in some cases errors writing to the remote server can be >> delayed until close(). Of course, very few softwares actually check the >> return value of close, so this can cause trouble sometimes... >> > Sorry, but I can't resist a little ancient history... > When NFS first showed up in the mid-1980s, the clients would flush writes > upon close() in order to detect write errors (usually ENOSPC) and return > them to the app. (typically a user trying to save their text edit when the > server was out of space or the user was out of quota). At least this way, > the editor could tell the user that their text file wasn't saved. I remember a long usenet thread which I didn't really understand at the time (around 1990?) about close() returning EDQUOT. FreeBSD actually documents close() returning ENOSPC. This error is almost never checked for of course. FreeBSD doesn't documented EDQUOT, at least in old versions. close() can also return EINTR, and FreeBSD documents this too. This error is almost never checked for of course. It is even harder to handle completely. In at least old versions of POSIX, the state of the fd when close returns EINTR is unspecifed. FreeBSD now documents that the fd is deallocated after all errors in close() except EBADF. > Somehow, the flush writes upon close to detect this morphed into "close > to open consistency", which was an AFS concept and not an NFS one > (which most NFS clients only implement approximately, given attribute > caching and modify time precision, but that's another story;-). I'm still getting better performance in all cases tested with the no- commit-on-close "optimization" turned off. But I only tested cases with the fs mounted with noasync on both the client and server. It makes sense that the optimization is negative in this case -- the commit-on-close doesn't really commit, since it is still async. So doesn't cause much delay. It moves doing the write RPCs earlier, which is better for throughput though worse for latency. It then gains without any losses (except perhaps weakening the approximation to "ctoc") by preventing the client discarding its cached data. Bruce From owner-svn-src-head@freebsd.org Thu Mar 24 00:24:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11845ADB7C8; Thu, 24 Mar 2016 00:24:09 +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 AB81613AC; Thu, 24 Mar 2016 00:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O0O72L064091; Thu, 24 Mar 2016 00:24:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O0O7v1064087; Thu, 24 Mar 2016 00:24:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603240024.u2O0O7v1064087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 24 Mar 2016 00:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297218 - in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:24:09 -0000 Author: jhb Date: Thu Mar 24 00:24:07 2016 New Revision: 297218 URL: https://svnweb.freebsd.org/changeset/base/297218 Log: Enable interrupts on the BSP once all PICs are initialized. This moves the enabling of interrupts slightly earlier (the old location was still before devices were enumerated and probed) and does it in the interrupt code (rather than in the device configuration code). This also avoids tripping over an assertion on the first TLB shootdown with earlier AP startup. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5710 Modified: head/sys/amd64/amd64/autoconf.c head/sys/i386/i386/autoconf.c head/sys/x86/x86/intr_machdep.c Modified: head/sys/amd64/amd64/autoconf.c ============================================================================== --- head/sys/amd64/amd64/autoconf.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/amd64/amd64/autoconf.c Thu Mar 24 00:24:07 2016 (r297218) @@ -100,13 +100,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); Modified: head/sys/i386/i386/autoconf.c ============================================================================== --- head/sys/i386/i386/autoconf.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/i386/i386/autoconf.c Thu Mar 24 00:24:07 2016 (r297218) @@ -101,13 +101,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/x86/x86/intr_machdep.c Thu Mar 24 00:24:07 2016 (r297218) @@ -393,6 +393,21 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +static void +intr_init_final(void *dummy __unused) +{ + + /* + * Enable interrupts on the BSP after all of the interrupt + * controllers are initialized. Device interrupts are still + * disabled in the interrupt controllers until interrupt + * handlers are registered. Interrupts are enabled on each AP + * after their first context switch. + */ + enable_intr(); +} +SYSINIT(intr_init_final, SI_SUB_INTR, SI_ORDER_ANY, intr_init_final, NULL); + #ifndef DEV_ATPIC /* Initialize the two 8259A's to a known-good shutdown state. */ void From owner-svn-src-head@freebsd.org Thu Mar 24 00:27:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB9F5ADB83A; Thu, 24 Mar 2016 00:27:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5ACAB15A5; Thu, 24 Mar 2016 00:27:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B9B37422985; Thu, 24 Mar 2016 11:27:06 +1100 (AEDT) Date: Thu, 24 Mar 2016 11:27:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <2922763.uITxoCVqGR@ralph.baldwin.cx> Message-ID: <20160324102240.X2963@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=BaS1Tkpnyz1ueFPKBtYA:9 a=g936YpHNJkSuVAMZ:21 a=7QmkHJjgjrBwUjWY:21 a=KxlK8HL--qr84h5v:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:27:10 -0000 On Wed, 23 Mar 2016, John Baldwin wrote: > On Wednesday, March 23, 2016 09:58:42 AM Konstantin Belousov wrote: >> On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: >>> On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: >>>> On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: >>>>> >>>>> - for (x = 0; x < delay; x += 5) { >>>>> + for (x = 0; x < delay; x++) { >>>>> if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == >>>>> APIC_DELSTAT_IDLE) >>>>> return (1); >>>>> - DELAY(5); >>>>> + DELAY(1); >>>>> } >>>>> return (0); >>>>> } >>>> >>>> Ideally we would structure the loop differently. I think it is more >>>> efficient WRT latency to only block execution by ia32_pause(), and >>>> compare the the getbinuptime() results to calculate spent time, on each >>>> loop step. >>> >>> Yes. I've thought about using the TSC directly to do that, but folks are >>> worried about the TSC being unstable due to vcpus in a VM migrating >>> across physical CPUs. DELAY() does seem to DTRT in that case assuming the >>> hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to >>> essentially duplicate DELAY() (really delay_tc()) inline. >> >> If TSC has the behaviour you described, i.e. suddenly jumping random >> steps on single CPU, from the point of view of kernel, then the system >> is seriosly misbehaving. The timekeeping stuff would be badly broken >> regardless of the ipi_wait(). I do not see why should we worry about >> that in ipi_wait(). >> >> I proposed slightly different thing, i.e. using timekeep code to indirect >> to TSC if configured so. Below is the proof of concept patch, use of >> nanouptime() may be too naive, and binuptime() would cause tiny bit less >> overhead, but I do not want to think about arithmetic. > > As you noted, the issue is if a timecounter needs locks (e.g. i8254) though > outside of that I think the patch is great. :-/ Of course, if the TSC > isn't advertised as invariant, DELAY() is talking to the timecounter > directly as well. The i8254 locks work better in practice than in theory. Timecounter code is called from very low levels (fast interrupt handlers) and must work from there. And the i8254 timecounter does work in fast interrupt handlers. The above loop is slightly (?) lower level, so must be more careful. DELAY() talkes directly to the i8254 if the TSC is not invariant and the timecounter uses the i8254. Then the timecounter is slow and otherwise unusable for DELAY() since it would deadlock in ddb, so the old i8254 DELAY() which is faster and more careful is used. The same (fudged recursive) locking would work here. But you don't want to use the i8254 or any other slow timecounter hardware or software. They all have a large latency of ~1 usec minimum. > However, I think we probably can use the TSC. The only specific note I got > from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. > That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, It also doesn't need to be invariant provided it is usually monotonic and doesn't jump ahead by a lot. Or you can just use a calibrated loop. The calibration gets complicated if the CPU is throttled or otherwise has a variable frequency. One case is a loop with ia32_pause() in it. The pause length can be calibrated for most cases and is probably longer than the rest of the loop, but it is hard to be sure if the CPU didn't change it without telling you. Long loops can easiliy recalibrate themself by checking an external timer not very often, but that doesn't work for short loops (ones shorter than the timer access time). > thinking about this more I have a different theory to explain how the TSC > can be out of whack on different vCPUs even if the hardware TSC is in sync > in the physical CPUs underneath. > > One of the things present in the VCMS on Intel CPUs using VT-x is a TSC > adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to > alter the offset between the TSC in the guest and the "real" TSC value in the > physical CPU itself. One way a hypervisor might use this is to try to > "pause" the TSC during a VM-exit by taking TSC timestamps at the start and > end of a VM-exit and adding that delta to the TSC offset just before each > VM-entry. However, if you have two vCPUs, one of which is running in the > guest and one of which is handling a VM-exit in the hypervisor, the TSC on > the first vCPU will run while the effective TSC of the second vCPU is paused. > When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", > but it will lag the first vCPU by however long it took to handle its VM-exit. > > It wouldn't surprise me if KVM was doing this. bhyve does not do this to my > knowledge (so the TSC is actually still usable as a timecounter under bhyve > for some value of "usable"). However, even with this TSC pausing/unpausing, > the TSC would still increase monotonically on a single vCPU. For the purposes > of DELAY() (and other spin loops on a pinned thread such as in > lapic_ipi_wait()), that is all you need. Is monotonic really enough? Suppose you want to wait at least 1 usec. Then you can't trust the timer if it does a combination of jumps that add up to a significant fraction of 1 usec. To minimise latency, I would try a tight loop with occasional checks. E.g., 10-1000 lapic reads separated by ia32_pauses()'s, then check the time. It isn't clear how to minimise power use for loops like this. I couldn't find anything better than mwait for cooling in loops in ddb i/o. Bruce From owner-svn-src-head@freebsd.org Thu Mar 24 00:40:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32EB9ADB9C5; Thu, 24 Mar 2016 00:40:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8E561A71; Thu, 24 Mar 2016 00:40:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O0egjh067272; Thu, 24 Mar 2016 00:40:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O0efoO067270; Thu, 24 Mar 2016 00:40:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240040.u2O0efoO067270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 00:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297219 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:40:43 -0000 Author: sephe Date: Thu Mar 24 00:40:41 2016 New Revision: 297219 URL: https://svnweb.freebsd.org/changeset/base/297219 Log: hyperv/vmbus: use a better retry method in hv_vmbus_post_message() Most often, hv_vmbus_post_message() doesn't fail. However, it fails intermittently when GPADLs of large shared memory is to be established with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf is created, for which lots of messages will be flooded to the host. The host side tries to throttle the message rate by returning HV_STATUS_INSUFFICIENT_BUFFERS. Before this commit, we do several retries for failed messages, but the delay between each retry is pretty/too low, which will cause sporadic message posting failure. We now use large delay (>=1ms) between each retry to fix the message posting failure. Submitted by: Dexuan Cui Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5715 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Thu Mar 24 00:24:07 2016 (r297218) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Thu Mar 24 00:40:41 2016 (r297219) @@ -364,31 +364,35 @@ hv_vmbus_on_events(int cpu) /** * Send a msg on the vmbus's message connection */ -int hv_vmbus_post_message(void *buffer, size_t bufferLen) { - int ret = 0; +int hv_vmbus_post_message(void *buffer, size_t bufferLen) +{ hv_vmbus_connection_id connId; - unsigned retries = 0; - - /* NetScaler delays from previous code were consolidated here */ - static int delayAmount[] = {100, 100, 100, 500, 500, 5000, 5000, 5000}; - - /* for(each entry in delayAmount) try to post message, - * delay a little bit before retrying + sbintime_t time = SBT_1MS; + int retries; + int ret; + + connId.as_uint32_t = 0; + connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; + + /* + * We retry to cope with transient failures caused by host side's + * insufficient resources. 20 times should suffice in practice. */ - for (retries = 0; - retries < sizeof(delayAmount)/sizeof(delayAmount[0]); retries++) { - connId.as_uint32_t = 0; - connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; - ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, bufferLen); - if (ret != HV_STATUS_INSUFFICIENT_BUFFERS) - break; - /* TODO: KYS We should use a blocking wait call */ - DELAY(delayAmount[retries]); + for (retries = 0; retries < 20; retries++) { + ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, + bufferLen); + if (ret == HV_STATUS_SUCCESS) + return (0); + + pause_sbt("pstmsg", time, 0, C_HARDCLOCK); + if (time < SBT_1S * 2) + time *= 2; } - KASSERT(ret == 0, ("Error VMBUS: Message Post Failed\n")); + KASSERT(ret == HV_STATUS_SUCCESS, + ("Error VMBUS: Message Post Failed, ret=%d\n", ret)); - return (ret); + return (EAGAIN); } /** Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 00:24:07 2016 (r297218) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 00:40:41 2016 (r297219) @@ -70,6 +70,7 @@ typedef uint16_t hv_vmbus_status; * You did not supply enough message buffers to send a message. */ +#define HV_STATUS_SUCCESS ((uint16_t)0) #define HV_STATUS_INSUFFICIENT_BUFFERS ((uint16_t)0x0013) typedef void (*hv_vmbus_channel_callback)(void *context); From owner-svn-src-head@freebsd.org Thu Mar 24 01:12:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 237CBADB39B; Thu, 24 Mar 2016 01:12:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2DD19AF; Thu, 24 Mar 2016 01:12:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O1CTsH079003; Thu, 24 Mar 2016 01:12:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O1CSJa078999; Thu, 24 Mar 2016 01:12:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240112.u2O1CSJa078999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 01:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297220 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 01:12:30 -0000 Author: sephe Date: Thu Mar 24 01:12:28 2016 New Revision: 297220 URL: https://svnweb.freebsd.org/changeset/base/297220 Log: hyperv/utils: Allow hint to disable individual utility Reviewed by: kib, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5714 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Mar 24 01:12:28 2016 (r297220) @@ -94,6 +94,10 @@ static int hv_heartbeat_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvheartbeat", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Heartbeat Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Mar 24 01:12:28 2016 (r297220) @@ -863,6 +863,10 @@ static int hv_kvp_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvkvp", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V KVP Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Mar 24 01:12:28 2016 (r297220) @@ -116,6 +116,10 @@ static int hv_shutdown_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvshutdown", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Shutdown Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Mar 24 01:12:28 2016 (r297220) @@ -171,6 +171,10 @@ static int hv_timesync_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvtimesync", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Time Synch Service"); return BUS_PROBE_DEFAULT; From owner-svn-src-head@freebsd.org Thu Mar 24 02:15:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 421B9ADBF4C; Thu, 24 Mar 2016 02:15:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF4181EAA; Thu, 24 Mar 2016 02:15:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O2FOMN096917; Thu, 24 Mar 2016 02:15:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O2FOac096915; Thu, 24 Mar 2016 02:15:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240215.u2O2FOac096915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 02:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297221 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 02:15:25 -0000 Author: sephe Date: Thu Mar 24 02:15:23 2016 New Revision: 297221 URL: https://svnweb.freebsd.org/changeset/base/297221 Log: hyperv/vmbus: Create per-cpu fast taskqueue for msg handling Using one taskqueue does not work, since the EOM MSR must be written on the msg's owner CPU. Noticed by: Jun Su Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Mar 24 01:12:28 2016 (r297220) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Mar 24 02:15:23 2016 (r297221) @@ -204,7 +204,8 @@ hv_vmbus_isr(struct trapframe *frame) msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - taskqueue_enqueue(taskqueue_fast, &hv_vmbus_g_context.hv_msg_task[cpu]); + taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], + &hv_vmbus_g_context.hv_msg_task[cpu]); } return (FILTER_HANDLED); @@ -531,9 +532,17 @@ vmbus_bus_init(void) "hvevent%d", j); /* - * Setup tasks to handle msg + * Setup per-cpu tasks and taskqueues to handle msg. */ - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, vmbus_msg_swintr, (void *)(long)j); + hv_vmbus_g_context.hv_msg_tq[j] = taskqueue_create_fast( + "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_msg_tq[j]); + CPU_SETOF(j, &cpu_mask); + taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], + 1, PI_NET, &cpu_mask, "hvmsg%d", j); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, + vmbus_msg_swintr, (void *)(long)j); + /* * Prepare the per cpu msg and event pages to be called on each cpu. */ Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 01:12:28 2016 (r297220) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 02:15:23 2016 (r297221) @@ -205,6 +205,7 @@ typedef struct { * event and msg handling. */ struct taskqueue *hv_event_queue[MAXCPU]; + struct taskqueue *hv_msg_tq[MAXCPU]; struct task hv_msg_task[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel From owner-svn-src-head@freebsd.org Thu Mar 24 03:08:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B19ADBBFB; Thu, 24 Mar 2016 03:08:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E9A11610; Thu, 24 Mar 2016 03:08:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O38dJk012583; Thu, 24 Mar 2016 03:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O38dnq012582; Thu, 24 Mar 2016 03:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603240308.u2O38dnq012582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 03:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297222 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 03:08:40 -0000 Author: bdrewery Date: Thu Mar 24 03:08:39 2016 New Revision: 297222 URL: https://svnweb.freebsd.org/changeset/base/297222 Log: Fix M_RTABLE memory leak from r274118 (11/2014). Replace free(M_RTABLE) with rn_detachhead() to match rn_inithead(). This would trigger when reloading NFS exports and was similar to problems with pf reload [1]. PR: 194078 [1] Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Mar 24 02:15:23 2016 (r297221) +++ head/sys/kern/vfs_export.c Thu Mar 24 03:08:39 2016 (r297222) @@ -259,7 +259,7 @@ vfs_free_addrlist_af(struct radix_node_h (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, &rnh->rh); RADIX_NODE_HEAD_UNLOCK(rnh); RADIX_NODE_HEAD_DESTROY(rnh); - free(rnh, M_RTABLE); + rn_detachhead((void **)prnh); prnh = NULL; } From owner-svn-src-head@freebsd.org Thu Mar 24 04:40:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF80ADC053; Thu, 24 Mar 2016 04:40:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 961CA1B5E; Thu, 24 Mar 2016 04:40:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O4e7f2042134; Thu, 24 Mar 2016 04:40:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O4e7uB042133; Thu, 24 Mar 2016 04:40:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603240440.u2O4e7uB042133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 04:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297223 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 04:40:08 -0000 Author: bdrewery Date: Thu Mar 24 04:40:07 2016 New Revision: 297223 URL: https://svnweb.freebsd.org/changeset/base/297223 Log: Pass the expected struct radix_node_head * to vfs_free_netcred. No functional change. struct radix_node_head's first element is rh so this was already referring to the same address. It was likely an unintended s/rnh/&rnh->rh/ change from r294706 as all other rnh_walktree() callers pass the expected struct radix_node_head * rather than obscurely passing the address of their first element. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Mar 24 03:08:39 2016 (r297222) +++ head/sys/kern/vfs_export.c Thu Mar 24 04:40:07 2016 (r297223) @@ -256,7 +256,7 @@ vfs_free_addrlist_af(struct radix_node_h rnh = *prnh; RADIX_NODE_HEAD_LOCK(rnh); - (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, &rnh->rh); + (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, rnh); RADIX_NODE_HEAD_UNLOCK(rnh); RADIX_NODE_HEAD_DESTROY(rnh); rn_detachhead((void **)prnh); From owner-svn-src-head@freebsd.org Thu Mar 24 07:54:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918B9ADC465; Thu, 24 Mar 2016 07:54:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7D61507; Thu, 24 Mar 2016 07:54:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O7svKW006939; Thu, 24 Mar 2016 07:54:57 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O7suvM006925; Thu, 24 Mar 2016 07:54:56 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603240754.u2O7suvM006925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 24 Mar 2016 07:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297225 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 07:54:58 -0000 Author: gnn Date: Thu Mar 24 07:54:56 2016 New Revision: 297225 URL: https://svnweb.freebsd.org/changeset/base/297225 Log: FreeBSD previously provided route caching for TCP (and UDP). Re-add route caching for TCP, with some improvements. In particular, invalidate the route cache if a new route is added, which might be a better match. The cache is automatically invalidated if the old route is deleted. Submitted by: Mike Karels Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4306 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route.c Thu Mar 24 07:54:56 2016 (r297225) @@ -201,6 +201,16 @@ rt_tables_get_rnh(int table, int fam) return (*rt_tables_get_rnh_ptr(table, fam)); } +rt_gen_t +rt_tables_get_gen(int table, int fam) +{ + struct rib_head *rnh; + + rnh = *rt_tables_get_rnh_ptr(table, fam); + return (rnh->rnh_gen); +} + + /* * route initialization must occur before ip6_init2(), which happenas at * SI_ORDER_MIDDLE. @@ -1754,6 +1764,7 @@ rtrequest1_fib(int req, struct rt_addrin *ret_nrt = rt; RT_ADDREF(rt); } + rnh->rnh_gen++; /* Routing table updated */ RT_UNLOCK(rt); break; case RTM_CHANGE: Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route.h Thu Mar 24 07:54:56 2016 (r297225) @@ -98,6 +98,14 @@ struct rt_metrics { /* lle state is exported in rmx_state rt_metrics field */ #define rmx_state rmx_weight +/* + * Keep a generation count of routing table, incremented on route addition, + * so we can invalidate caches. This is accessed without a lock, as precision + * is not required. + */ +typedef volatile u_int rt_gen_t; /* tree generation (for adds) */ +#define RT_GEN(fibnum, af) rt_tables_get_gen(fibnum, af) + #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ #ifdef _KERNEL @@ -398,6 +406,20 @@ struct rt_addrinfo { } \ } while (0) +/* + * Validate a cached route based on a supplied cookie. If there is an + * out-of-date cache, simply free it. Update the generation number + * for the new allocation + */ +#define RT_VALIDATE(ro, cookiep, fibnum) do { \ + rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ + if (*(cookiep) != cookie && (ro)->ro_rt != NULL) { \ + RTFREE((ro)->ro_rt); \ + (ro)->ro_rt = NULL; \ + *(cookiep) = cookie; \ + } \ +} while (0) + struct ifmultiaddr; struct rib_head; @@ -415,6 +437,7 @@ int rt_setgate(struct rtentry *, struct void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); struct rib_head *rt_table_init(int); void rt_table_destroy(struct rib_head *); +rt_gen_t rt_tables_get_gen(int table, int fam); int rtsock_addrmsg(int, struct ifaddr *, int); int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route_var.h Thu Mar 24 07:54:56 2016 (r297225) @@ -41,7 +41,7 @@ struct rib_head { rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ rn_close_t *rnh_close; /*do something when the last ref drops*/ - u_int rnh_gen; /* generation counter */ + rt_gen_t rnh_gen; /* generation counter */ int rnh_multipath; /* multipath capable ? */ struct radix_node rnh_nodes[3]; /* empty tree for common case */ struct rwlock rib_lock; /* config/data path lock */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/in_pcb.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1298,6 +1298,11 @@ in_pcbfree(struct inpcb *inp) if (inp->inp_moptions != NULL) inp_freemoptions(inp->inp_moptions); #endif + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } + inp->inp_vflag = 0; inp->inp_flags2 |= INP_FREED; crfree(inp->inp_cred); @@ -2225,6 +2230,23 @@ in_pcbremlists(struct inpcb *inp) } /* + * Check for alternatives when higher level complains + * about service problems. For now, invalidate cached + * routing information. If the route was created dynamically + * (by a redirect), time to try a default gateway again. + */ +void +in_losing(struct inpcb *inp) +{ + + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } + return; +} + +/* * A set label operation has occurred at the socket layer, propagate the * label change into the in_pcb for the socket. */ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/in_pcb.h Thu Mar 24 07:54:56 2016 (r297225) @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef _KERNEL #include @@ -238,8 +239,14 @@ struct inpcb { #define inp_zero_size offsetof(struct inpcb, inp_gencnt) inp_gen_t inp_gencnt; /* (c) generation count */ struct llentry *inp_lle; /* cached L2 information */ - struct rtentry *inp_rt; /* cached L3 information */ struct rwlock inp_lock; + rt_gen_t inp_rt_cookie; /* generation for route entry */ + union { /* cached L3 information */ + struct route inpu_route; + struct route_in6 inpu_route6; + } inp_rtu; +#define inp_route inp_rtu.inpu_route +#define inp_route6 inp_rtu.inpu_route6 }; #define inp_fport inp_inc.inc_fport #define inp_lport inp_inc.inc_lport @@ -722,6 +729,7 @@ void in_pcbrehash_mbuf(struct inpcb *, s int in_pcbrele(struct inpcb *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); +void in_losing(struct inpcb *); void in_pcbsetsolabel(struct socket *so); int in_getpeeraddr(struct socket *so, struct sockaddr **nam); int in_getsockaddr(struct socket *so, struct sockaddr **nam); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/ip_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -282,17 +282,36 @@ ip_output(struct mbuf *m, struct mbuf *o gw = dst = (struct sockaddr_in *)&ro->ro_dst; fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); rte = ro->ro_rt; - /* - * The address family should also be checked in case of sharing - * the cache with IPv6. - */ - if (rte == NULL || dst->sin_family != AF_INET) { + if (rte == NULL) { bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; } again: + /* + * Validate route against routing table additions; + * a better/more specific route might have been added. + */ + if (inp) + RT_VALIDATE(ro, &inp->inp_rt_cookie, fibnum); + /* + * If there is a cached route, + * check that it is to the same destination + * and is still up. If not, free it and try again. + * The address family should also be checked in case of sharing the + * cache with IPv6. + * Also check whether routing cache needs invalidation. + */ + rte = ro->ro_rt; + if (rte && ((rte->rt_flags & RTF_UP) == 0 || + rte->rt_ifp == NULL || + !RT_LINK_IS_UP(rte->rt_ifp) || + dst->sin_family != AF_INET || + dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { + RTFREE(rte); + rte = ro->ro_rt = (struct rtentry *)NULL; + } ia = NULL; have_ia_ref = 0; /* Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1379,9 +1379,6 @@ send: #endif #ifdef INET { - struct route ro; - - bzero(&ro, sizeof(ro)); ip->ip_len = htons(m->m_pkthdr.len); #ifdef INET6 if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO) @@ -1412,13 +1409,12 @@ send: tcp_pcap_add(th, m, &(tp->t_outpkts)); #endif - error = ip_output(m, tp->t_inpcb->inp_options, &ro, + error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, tp->t_inpcb); - if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_mtu; - RO_RTFREE(&ro); + if (error == EMSGSIZE && tp->t_inpcb->inp_route.ro_rt != NULL) + mtu = tp->t_inpcb->inp_route.ro_rt->rt_mtu; } #endif /* INET */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_subr.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1632,6 +1632,10 @@ tcp_notify(struct inpcb *inp, int error) if (tp->t_state == TCPS_ESTABLISHED && (error == EHOSTUNREACH || error == ENETUNREACH || error == EHOSTDOWN)) { + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } return (inp); } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 && tp->t_softerror) { @@ -1926,11 +1930,11 @@ tcp_ctlinput(int cmd, struct sockaddr *s else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip) notify = tcp_drop_syn_sent; - /* - * Redirects don't need to be handled up here. - */ - else if (PRC_IS_REDIRECT(cmd)) + else if (PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); return; + } /* * Hostdead is ugly because it goes linearly through all PCBs. * XXX: We never get this from ICMP, otherwise it makes an Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_timer.c Thu Mar 24 07:54:56 2016 (r297225) @@ -786,7 +786,9 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) in6_losing(tp->t_inpcb); + else #endif + in_losing(tp->t_inpcb); tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); tp->t_srtt = 0; } Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 07:54:56 2016 (r297225) @@ -740,6 +740,11 @@ udp_notify(struct inpcb *inp, int errno) * or a write lock, but a read lock is sufficient. */ INP_LOCK_ASSERT(inp); + if ((errno == EHOSTUNREACH || errno == ENETUNREACH || + errno == EHOSTDOWN) && inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } inp->inp_socket->so_error = errno; sorwakeup(inp->inp_socket); @@ -761,11 +766,11 @@ udp_common_ctlinput(int cmd, struct sock if (sa->sa_family != AF_INET || faddr.s_addr == INADDR_ANY) return; - /* - * Redirects don't need to be handled up here. - */ - if (PRC_IS_REDIRECT(cmd)) + if (PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); return; + } /* * Hostdead is ugly because it goes linearly through all PCBs. @@ -1116,7 +1121,7 @@ udp_output(struct inpcb *inp, struct mbu int error = 0; int ipflags; u_short fport, lport; - int unlock_udbinfo; + int unlock_udbinfo, unlock_inp; u_char tos; uint8_t pr; uint16_t cscov = 0; @@ -1137,7 +1142,15 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; - INP_RLOCK(inp); + sin = (struct sockaddr_in *)addr; + if (sin == NULL || + (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { + INP_WLOCK(inp); + unlock_inp = UH_WLOCKED; + } else { + INP_RLOCK(inp); + unlock_inp = UH_RLOCKED; + } tos = inp->inp_ip_tos; if (control != NULL) { /* @@ -1145,7 +1158,10 @@ udp_output(struct inpcb *inp, struct mbu * stored in a single mbuf. */ if (control->m_next) { - INP_RUNLOCK(inp); + if (unlock_inp == UH_WLOCKED) + INP_WUNLOCK(inp); + else + INP_RUNLOCK(inp); m_freem(control); m_freem(m); return (EINVAL); @@ -1220,7 +1236,10 @@ udp_output(struct inpcb *inp, struct mbu m_freem(control); } if (error) { - INP_RUNLOCK(inp); + if (unlock_inp == UH_WLOCKED) + INP_WUNLOCK(inp); + else + INP_RUNLOCK(inp); m_freem(m); return (error); } @@ -1246,8 +1265,6 @@ udp_output(struct inpcb *inp, struct mbu sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { - INP_RUNLOCK(inp); - INP_WLOCK(inp); INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; } else if ((sin != NULL && ( @@ -1514,9 +1531,10 @@ udp_output(struct inpcb *inp, struct mbu else if (unlock_udbinfo == UH_RLOCKED) INP_HASH_RUNLOCK(pcbinfo); UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); - error = ip_output(m, inp->inp_options, NULL, ipflags, + error = ip_output(m, inp->inp_options, + (unlock_inp == UH_WLOCKED ? &inp->inp_route : NULL), ipflags, inp->inp_moptions, inp); - if (unlock_udbinfo == UH_WLOCKED) + if (unlock_inp == UH_WLOCKED) INP_WUNLOCK(inp); else INP_RUNLOCK(inp); Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/in6_pcb.c Thu Mar 24 07:54:56 2016 (r297225) @@ -827,9 +827,10 @@ void in6_losing(struct inpcb *in6p) { - /* - * We don't store route pointers in the routing table anymore - */ + if (in6p->inp_route6.ro_rt) { + RTFREE(in6p->inp_route6.ro_rt); + in6p->inp_route6.ro_rt = (struct rtentry *)NULL; + } return; } @@ -840,9 +841,11 @@ in6_losing(struct inpcb *in6p) struct inpcb * in6_rtchange(struct inpcb *inp, int errno) { - /* - * We don't store route pointers in the routing table anymore - */ + + if (inp->inp_route6.ro_rt) { + RTFREE(inp->inp_route6.ro_rt); + inp->inp_route6.ro_rt = (struct rtentry *)NULL; + } return inp; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/ip6_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -546,7 +546,18 @@ again: /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); - if (ro->ro_rt && fwd_tag == NULL) { + /* + * Validate route against routing table additions; + * a better/more specific route might have been added. + * Make sure address family is set in route. + */ + if (inp) { + ro->ro_dst.sin6_family = AF_INET6; + RT_VALIDATE((struct route *)ro, &inp->inp_rt_cookie, fibnum); + } + if (ro->ro_rt && fwd_tag == NULL && (ro->ro_rt->rt_flags & RTF_UP) && + ro->ro_dst.sin6_family == AF_INET6 && + IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, &ip6->ip6_dst)) { rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; } else { @@ -939,7 +950,8 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } - error = nd6_output_ifp(ifp, origifp, m, dst, NULL); + error = nd6_output_ifp(ifp, origifp, m, dst, + (struct route *)ro); goto done; } @@ -1038,7 +1050,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } - error = nd6_output_ifp(ifp, origifp, m, dst, NULL); + error = nd6_output_ifp(ifp, origifp, m, dst, + (struct route *)ro); } else m_freem(m); } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/udp6_usrreq.c Thu Mar 24 07:54:56 2016 (r297225) @@ -876,8 +876,8 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, - NULL, inp); + error = ip6_output(m, optp, &inp->inp_route6, flags, + inp->in6p_moptions, NULL, inp); break; case AF_INET: error = EAFNOSUPPORT; From owner-svn-src-head@freebsd.org Thu Mar 24 08:25:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE965ADA397; Thu, 24 Mar 2016 08:25:06 +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 9F4A515B2; Thu, 24 Mar 2016 08:25:06 +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 u2O8P55J015876; Thu, 24 Mar 2016 08:25:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O8P5jD015875; Thu, 24 Mar 2016 08:25:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201603240825.u2O8P5jD015875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Mar 2016 08:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297226 - head/libexec/dma/dmagent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 08:25:06 -0000 Author: bapt Date: Thu Mar 24 08:25:05 2016 New Revision: 297226 URL: https://svnweb.freebsd.org/changeset/base/297226 Log: Install a usable mailer.conf for dragonfly mailer agent if sendmail is disabled Modified: head/libexec/dma/dmagent/Makefile Modified: head/libexec/dma/dmagent/Makefile ============================================================================== --- head/libexec/dma/dmagent/Makefile Thu Mar 24 07:54:56 2016 (r297225) +++ head/libexec/dma/dmagent/Makefile Thu Mar 24 08:25:05 2016 (r297226) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIBADD= ssl crypto PROG= dma @@ -22,6 +24,11 @@ YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf FILESDIR= ${SHAREDIR}/examples/dma +.if ${MK_SENDMAIL} == no +CONFGROUPS= CONFS MAILER +MAILERDIR= /etc/mail +MAILER= mailer.conf +.endif BINMODE= 2555 From owner-svn-src-head@freebsd.org Thu Mar 24 08:26:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E319DADA3E3; Thu, 24 Mar 2016 08:26:07 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA62171E; Thu, 24 Mar 2016 08:26:07 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O8Q6UN015960; Thu, 24 Mar 2016 08:26:06 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O8Q6Zq015958; Thu, 24 Mar 2016 08:26:06 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603240826.u2O8Q6Zq015958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 24 Mar 2016 08:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297227 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 08:26:08 -0000 Author: gnn Date: Thu Mar 24 08:26:06 2016 New Revision: 297227 URL: https://svnweb.freebsd.org/changeset/base/297227 Log: Move mbuf provider under SDT to indicate that it is FreeBSD specific and not a stable interface. Reviewed by: markj MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D5716 Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Mar 24 08:25:05 2016 (r297226) +++ head/sys/kern/uipc_mbuf.c Thu Mar 24 08:26:06 2016 (r297227) @@ -49,48 +49,46 @@ __FBSDID("$FreeBSD$"); #include #include -SDT_PROVIDER_DEFINE(mbuf); - -SDT_PROBE_DEFINE5_XLATE(mbuf, , , m__init, +SDT_PROBE_DEFINE5_XLATE(sdt, , , m__init, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint16_t", "uint16_t", "uint32_t", "uint32_t", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__gethdr, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__gethdr, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__get, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__get, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__getcl, +SDT_PROBE_DEFINE4_XLATE(sdt, , , m__getcl, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "uint32_t", "uint32_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__clget, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__clget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__cljget, +SDT_PROBE_DEFINE4_XLATE(sdt, , , m__cljget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint32_t", "uint32_t", "void*", "void*"); -SDT_PROBE_DEFINE(mbuf, , , m__cljset); +SDT_PROBE_DEFINE(sdt, , , m__cljset); -SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__free, +SDT_PROBE_DEFINE1_XLATE(sdt, , , m__free, "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__freem, +SDT_PROBE_DEFINE1_XLATE(sdt, , , m__freem, "struct mbuf *", "mbufinfo_t *"); #include Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Mar 24 08:25:05 2016 (r297226) +++ head/sys/sys/mbuf.h Thu Mar 24 08:26:06 2016 (r297227) @@ -48,27 +48,25 @@ #include #define MBUF_PROBE1(probe, arg0) \ - SDT_PROBE1(mbuf, , , probe, arg0) + SDT_PROBE1(sdt, , , probe, arg0) #define MBUF_PROBE2(probe, arg0, arg1) \ - SDT_PROBE2(mbuf, , , probe, arg0, arg1) + SDT_PROBE2(sdt, , , probe, arg0, arg1) #define MBUF_PROBE3(probe, arg0, arg1, arg2) \ - SDT_PROBE3(mbuf, , , probe, arg0, arg1, arg2) + SDT_PROBE3(sdt, , , probe, arg0, arg1, arg2) #define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ - SDT_PROBE4(mbuf, , , probe, arg0, arg1, arg2, arg3) + SDT_PROBE4(sdt, , , probe, arg0, arg1, arg2, arg3) #define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ - SDT_PROBE5(mbuf, , , probe, arg0, arg1, arg2, arg3, arg4) + SDT_PROBE5(sdt, , , probe, arg0, arg1, arg2, arg3, arg4) -SDT_PROVIDER_DECLARE(mbuf); - -SDT_PROBE_DECLARE(mbuf, , , m__init); -SDT_PROBE_DECLARE(mbuf, , , m__gethdr); -SDT_PROBE_DECLARE(mbuf, , , m__get); -SDT_PROBE_DECLARE(mbuf, , , m__getcl); -SDT_PROBE_DECLARE(mbuf, , , m__clget); -SDT_PROBE_DECLARE(mbuf, , , m__cljget); -SDT_PROBE_DECLARE(mbuf, , , m__cljset); -SDT_PROBE_DECLARE(mbuf, , , m__free); -SDT_PROBE_DECLARE(mbuf, , , m__freem); +SDT_PROBE_DECLARE(sdt, , , m__init); +SDT_PROBE_DECLARE(sdt, , , m__gethdr); +SDT_PROBE_DECLARE(sdt, , , m__get); +SDT_PROBE_DECLARE(sdt, , , m__getcl); +SDT_PROBE_DECLARE(sdt, , , m__clget); +SDT_PROBE_DECLARE(sdt, , , m__cljget); +SDT_PROBE_DECLARE(sdt, , , m__cljset); +SDT_PROBE_DECLARE(sdt, , , m__free); +SDT_PROBE_DECLARE(sdt, , , m__freem); #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Thu Mar 24 09:09:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F4B4ADAE7A; Thu, 24 Mar 2016 09:09:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 195ED176D; Thu, 24 Mar 2016 09:09:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2O99J5b061993 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Mar 2016 11:09:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2O99J5b061993 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2O99HCB061992; Thu, 24 Mar 2016 11:09:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2016 11:09:17 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160324090917.GC1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2922763.uITxoCVqGR@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:09:26 -0000 On Wed, Mar 23, 2016 at 02:21:59PM -0700, John Baldwin wrote: > As you noted, the issue is if a timecounter needs locks (e.g. i8254) though > outside of that I think the patch is great. :-/ Of course, if the TSC > isn't advertised as invariant, DELAY() is talking to the timecounter > directly as well. > > However, I think we probably can use the TSC. The only specific note I got > from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. > That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, > thinking about this more I have a different theory to explain how the TSC > can be out of whack on different vCPUs even if the hardware TSC is in sync > in the physical CPUs underneath. In fact, if we can use TSC with the only requirement of being monotonic, I do not see why do we need TSC at all. We can return to pre-r278325 loop, but calibrate the number of loop iterations for known delay in 1us, once on boot. Do you agree with this ? > > One of the things present in the VCMS on Intel CPUs using VT-x is a TSC > adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to > alter the offset between the TSC in the guest and the "real" TSC value in the > physical CPU itself. One way a hypervisor might use this is to try to > "pause" the TSC during a VM-exit by taking TSC timestamps at the start and > end of a VM-exit and adding that delta to the TSC offset just before each > VM-entry. However, if you have two vCPUs, one of which is running in the > guest and one of which is handling a VM-exit in the hypervisor, the TSC on > the first vCPU will run while the effective TSC of the second vCPU is paused. > When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", > but it will lag the first vCPU by however long it took to handle its VM-exit. > > It wouldn't surprise me if KVM was doing this. bhyve does not do this to my > knowledge (so the TSC is actually still usable as a timecounter under bhyve > for some value of "usable"). However, even with this TSC pausing/unpausing, > the TSC would still increase monotonically on a single vCPU. For the purposes > of DELAY() (and other spin loops on a pinned thread such as in > lapic_ipi_wait()), that is all you need. BTW, Intel exported this mechanism to the non-VT environment as well, on recent chips. So I would be not too surprised if SMM handlers start 'compensate' for some long delays in near future. From owner-svn-src-head@freebsd.org Thu Mar 24 09:32:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 978F0AD8950; Thu, 24 Mar 2016 09:32:56 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59E8E1C0B; Thu, 24 Mar 2016 09:32:56 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aj1dO-0003Ex-Sl; Thu, 24 Mar 2016 10:32:55 +0100 Subject: Re: svn commit: r297190 - head/sys/kern To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56F3B441.6030602@dumbbell.fr> Date: Thu, 24 Mar 2016 10:32:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20160323174537.GA1826@brick.home> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:32:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9 Content-Type: multipart/mixed; boundary="rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56F3B441.6030602@dumbbell.fr> Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> In-Reply-To: <20160323174537.GA1826@brick.home> --rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 23/03/2016 18:45, Edward Tomasz Napierala wrote: >> So maybe callouts are disabled in this situation. If there is a way to= >> detect that, then vt(4) can go back to a "synchronous mode" where it >> refreshes the screen after each typed character, like it does when ddb= >> is active. >=20 > Looks like that's the case: for some reason the callouts don't work. > This trivial hack is a (mostly) working workaround: >=20 > Index: svn/head/sys/kern/kern_cons.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- svn/head/sys/kern/kern_cons.c (revision 297210) > +++ svn/head/sys/kern/kern_cons.c (working copy) > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > lp =3D cp; > end =3D cp + size - 1; > for (;;) { > + pause("meh", 1); Could you please explain how this works to me? Does calling pause() here give a chance to interrupt handlers or other threads of running? --=20 Jean-S=E9bastien P=E9dron --rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd-- --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJW87RBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMXEUQAJHPmYsvDwx3ty7gUT2lLsut 7CPy+m3DZM+uwnIl0RAA/ovJK7+p9a1U/Jul9CRLYXfWhdDD70ap3GcnmTYIH3SO Ik4HhveBOc6X1FmIo2pbTk2E5/300fDIVu/848vlILF8SKD0nMl0yWZ1x3RA/Oju q1uOR8tu8HYN2lTNT3rKdzS4pwcQzWhgGevAYy9nEjZhwwA2G2mGjH8HTYoNwtBO 4iVmSUuMc5XvWHa07zp7NSP9CH4GMEyzH3FDaB0VcPAxjbYhMfz2YaIFZPMgl1pi t74jYBL+ELIvt6T/oyhHHtxVmRj3cKYi1my5Li3NiXoBCE6g3BL53mYN674VLjr2 uuquDXt5o0lhBF15TWtRDka9vJaQYsNzUW639N0aFc1siIKtQ/phFoA/iWI6ue/k GdMnFDYBT7F0ZjbZqaIk7ejANwP4so/4NsUyIKzNDefVSZpePdoA559oP5xs+iRQ txVrNUmH49dRJJz4qKIMP0iw/P5yUHRBsf7/hvl6CtIDH/Z7jz3/WfdwPEXKDmY7 kQosSGyzv3gDb1JaGBweRQs3ffsQ2mJ2yA7wftKw7zZ0Ggqmt5obcjn4wlG9RbdJ QqJFj2cMvQiTo06pJw7nMjML7Cpo6zQjdM9W2trSruFiDh8w8NQ5aWYsvkWuzrIY M3W1166d9yD8ie6A/28U =pQXE -----END PGP SIGNATURE----- --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9-- From owner-svn-src-head@freebsd.org Thu Mar 24 09:35:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC58EAD8A28; Thu, 24 Mar 2016 09:35:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D33B1DD6; Thu, 24 Mar 2016 09:35:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O9ZTI0037139; Thu, 24 Mar 2016 09:35:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9ZTND037138; Thu, 24 Mar 2016 09:35:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603240935.u2O9ZTND037138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Mar 2016 09:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297229 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:35:30 -0000 Author: hselasky Date: Thu Mar 24 09:35:29 2016 New Revision: 297229 URL: https://svnweb.freebsd.org/changeset/base/297229 Log: Add more UHCI PCI IDs. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Thu Mar 24 09:22:58 2016 (r297228) +++ head/sys/dev/usb/controller/uhci_pci.c Thu Mar 24 09:35:29 2016 (r297229) @@ -161,6 +161,12 @@ uhci_pci_match(device_t self) case 0x24de8086: return ("Intel 82801EB (ICH5) USB controller USB-D"); + case 0x25a98086: + return ("Intel 6300ESB USB controller USB-A"); + + case 0x25aa8086: + return ("Intel 6300ESB USB controller USB-B"); + case 0x26588086: return ("Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A"); From owner-svn-src-head@freebsd.org Thu Mar 24 09:55:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D462EAD8F29; Thu, 24 Mar 2016 09:55:12 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5617170B; Thu, 24 Mar 2016 09:55:12 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O9tBtU043108; Thu, 24 Mar 2016 09:55:11 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9tBVT043100; Thu, 24 Mar 2016 09:55:11 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201603240955.u2O9tBVT043100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 24 Mar 2016 09:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297230 - in head/sys: arm/arm arm/include kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:55:12 -0000 Author: skra Date: Thu Mar 24 09:55:11 2016 New Revision: 297230 URL: https://svnweb.freebsd.org/changeset/base/297230 Log: Generalize IPI support for ARM intrng and use it for interrupt controller IPI provider. New struct intr_ipi is defined which keeps all info about an IPI: its name, counter, send and dispatch methods. Generic intr_ipi_setup(), intr_ipi_send() and intr_ipi_dispatch() functions are implemented. An IPI provider must implement two functions: (1) an intr_ipi_send_t function which is able to send an IPI, (2) a setup function which initializes itself for an IPI and calls intr_ipi_setup() with appropriate arguments. Differential Revision: https://reviews.freebsd.org/D5700 Modified: head/sys/arm/arm/gic.c head/sys/arm/arm/machdep_intr.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/intr.h head/sys/arm/include/smp.h head/sys/kern/pic_if.m head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/gic.c Thu Mar 24 09:55:11 2016 (r297230) @@ -121,6 +121,11 @@ __FBSDID("$FreeBSD$"); static u_int gic_irq_cpu; static int arm_gic_intr(void *); static int arm_gic_bind(device_t dev, struct intr_irqsrc *isrc); + +#ifdef SMP +u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; +#define ISRC_IPI(isrc) sgi_to_ipi[isrc->isrc_data - GIC_FIRST_SGI] +#endif #endif struct arm_gic_softc { @@ -562,7 +567,7 @@ dispatch_irq: #ifdef SMP /* Call EOI for all IPI before dispatch. */ gic_c_write_4(sc, GICC_EOIR, irq_active_reg); - intr_ipi_dispatch(isrc, tf); + intr_ipi_dispatch(ISRC_IPI(isrc), tf); goto next_irq; #else device_printf(sc->gic_dev, "SGI %u on UP system detected\n", @@ -918,6 +923,20 @@ arm_gic_ipi_send(device_t dev, struct in gic_d_write_4(sc, GICD_SGIR(0), val | irq); } + +static int +arm_gic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc *isrc) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + u_int irq; + int error; + + error = gic_map_nspc(sc, isrc, &irq); + if (error != 0) + return (error); + sgi_to_ipi[irq - GIC_FIRST_SGI] = ipi; + return (0); +} #endif #else static int @@ -1146,6 +1165,7 @@ static device_method_t arm_gic_methods[] DEVMETHOD(pic_bind, arm_gic_bind), DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), + DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), #endif #endif { 0, 0 } Modified: head/sys/arm/arm/machdep_intr.c ============================================================================== --- head/sys/arm/arm/machdep_intr.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/machdep_intr.c Thu Mar 24 09:55:11 2016 (r297230) @@ -64,8 +64,19 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" #ifdef SMP -static struct intr_irqsrc ipi_sources[INTR_IPI_COUNT]; -static u_int ipi_next_num; +#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) + +struct intr_ipi { + intr_ipi_handler_t * ii_handler; + void * ii_handler_arg; + intr_ipi_send_t * ii_send; + void * ii_send_arg; + char ii_name[INTR_IPI_NAMELEN]; + u_long * ii_count; +}; + +static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; +u_int ipi_next_num; #endif #endif @@ -134,10 +145,7 @@ arm_irq_memory_barrier(uintptr_t irq) #ifdef ARM_INTRNG #ifdef SMP -/* - * Lookup IPI source. - */ -static struct intr_irqsrc * +static inline struct intr_ipi * intr_ipi_lookup(u_int ipi) { @@ -147,112 +155,97 @@ intr_ipi_lookup(u_int ipi) return (&ipi_sources[ipi]); } -/* - * interrupt controller dispatch function for IPIs. It should - * be called straight from the interrupt controller, when associated - * interrupt source is learned. Or from anybody who has an interrupt - * source mapped. - */ void -intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) +intr_ipi_dispatch(u_int ipi, struct trapframe *tf) { void *arg; + struct intr_ipi *ii; - KASSERT(isrc != NULL, ("%s: no source", __func__)); + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); - intr_ipi_increment_count(isrc->isrc_count, PCPU_GET(cpuid)); + intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); /* * Supply ipi filter with trapframe argument * if none is registered. */ - arg = isrc->isrc_arg != NULL ? isrc->isrc_arg : tf; - isrc->isrc_ipifilter(arg); + arg = ii->ii_handler_arg != NULL ? ii->ii_handler_arg : tf; + ii->ii_handler(arg); } -/* - * Map IPI into interrupt controller. - * - * Not SMP coherent. - */ -static int -ipi_map(struct intr_irqsrc *isrc, u_int ipi) +void +intr_ipi_send(cpuset_t cpus, u_int ipi) { - boolean_t is_percpu; - int error; + struct intr_ipi *ii; - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + ii->ii_send(ii->ii_send_arg, cpus); +} - isrc->isrc_type = INTR_ISRCT_NAMESPACE; - isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; - isrc->isrc_nspc_num = ipi_next_num; +void +intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *h_arg, intr_ipi_send_t *send, void *s_arg) +{ + struct intr_ipi *ii; + + ii = intr_ipi_lookup(ipi); - error = PIC_REGISTER(intr_irq_root_dev, isrc, &is_percpu); - if (error == 0) { - isrc->isrc_dev = intr_irq_root_dev; - ipi_next_num++; - } - return (error); + KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); + KASSERT(send != NULL, ("%s: ipi %u no sender", __func__, ipi)); + KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); + + ii->ii_handler = hand; + ii->ii_handler_arg = h_arg; + ii->ii_send = send; + ii->ii_send_arg = s_arg; + strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); + ii->ii_count = intr_ipi_setup_counters(name); } /* - * Setup IPI handler to interrupt source. - * - * Note that there could be more ways how to send and receive IPIs - * on a platform like fast interrupts for example. In that case, - * one can call this function with ASIF_NOALLOC flag set and then - * call intr_ipi_dispatch() when appropriate. - * - * Not SMP coherent. + * Send IPI thru interrupt controller. */ -int -intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags) +static void +pic_ipi_send(void *arg, cpuset_t cpus) { - struct intr_irqsrc *isrc; - int error; - - if (filter == NULL) - return(EINVAL); - - isrc = intr_ipi_lookup(ipi); - if (isrc->isrc_ipifilter != NULL) - return (EEXIST); - - if ((flags & AISHF_NOALLOC) == 0) { - error = ipi_map(isrc, ipi); - if (error != 0) - return (error); - } - - isrc->isrc_ipifilter = filter; - isrc->isrc_arg = arg; - isrc->isrc_handlers = 1; - isrc->isrc_count = intr_ipi_setup_counters(name); - isrc->isrc_index = 0; /* it should not be used in IPI case */ - if (isrc->isrc_dev != NULL) { - PIC_ENABLE_INTR(isrc->isrc_dev, isrc); - PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); - } - return (0); + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + PIC_IPI_SEND(intr_irq_root_dev, arg, cpus); } /* - * Send IPI thru interrupt controller. + * Setup IPI handler on interrupt controller. + * + * Not SMP coherent. */ -void -pic_ipi_send(cpuset_t cpus, u_int ipi) +int +intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *arg) { + int error; struct intr_irqsrc *isrc; - isrc = intr_ipi_lookup(ipi); - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - PIC_IPI_SEND(intr_irq_root_dev, isrc, cpus); + + isrc = intr_isrc_alloc(INTR_ISRCT_NAMESPACE, 0); + isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; + isrc->isrc_nspc_num = ipi_next_num; + + error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, isrc); + if (error != 0) + return (error); + + ipi_next_num++; + + isrc->isrc_dev = intr_irq_root_dev; + isrc->isrc_handlers = 1; + intr_ipi_setup(ipi, name, hand, arg, pic_ipi_send, isrc); + return (0); } #endif #endif Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/mp_machdep.c Thu Mar 24 09:55:11 2016 (r297230) @@ -429,12 +429,11 @@ release_aps(void *dummy __unused) return; #ifdef ARM_INTRNG - intr_ipi_set_handler(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL, 0); - intr_ipi_set_handler(IPI_AST, "ast", ipi_ast, NULL, 0); - intr_ipi_set_handler(IPI_STOP, "stop", ipi_stop, NULL, 0); - intr_ipi_set_handler(IPI_PREEMPT, "preempt", ipi_preempt, NULL, 0); - intr_ipi_set_handler(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL, 0); - + intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); #else #ifdef IPI_IRQ_START start = IPI_IRQ_START; @@ -502,7 +501,11 @@ ipi_all_but_self(u_int ipi) other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(other_cpus, ipi); +#else pic_ipi_send(other_cpus, ipi); +#endif } void @@ -514,7 +517,11 @@ ipi_cpu(int cpu, u_int ipi) CPU_SET(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, cpu, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(cpus, ipi); +#else pic_ipi_send(cpus, ipi); +#endif } void @@ -522,6 +529,9 @@ ipi_selected(cpuset_t cpus, u_int ipi) { CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(cpus, ipi); +#else pic_ipi_send(cpus, ipi); +#endif } - Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/include/intr.h Thu Mar 24 09:55:11 2016 (r297230) @@ -52,14 +52,17 @@ #include #ifdef SMP -void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); +typedef void intr_ipi_send_t(void *, cpuset_t); +typedef void intr_ipi_handler_t(void *); -#define AISHF_NOALLOC 0x0001 +void intr_ipi_dispatch(u_int, struct trapframe *); +void intr_ipi_send(cpuset_t, u_int); -int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags); -#endif +void intr_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *, + intr_ipi_send_t *, void *); +int intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *); +#endif #else /* ARM_INTRNG */ /* XXX move to std.* files? */ Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/include/smp.h Thu Mar 24 09:55:11 2016 (r297230) @@ -37,8 +37,8 @@ void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); /* PIC interface */ -void pic_ipi_send(cpuset_t cpus, u_int ipi); #ifndef ARM_INTRNG +void pic_ipi_send(cpuset_t cpus, u_int ipi); void pic_ipi_clear(int ipi); int pic_ipi_read(int arg); #endif Modified: head/sys/kern/pic_if.m ============================================================================== --- head/sys/kern/pic_if.m Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/kern/pic_if.m Thu Mar 24 09:55:11 2016 (r297230) @@ -60,6 +60,13 @@ CODE { { return; } + + static int + dflt_pic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc *isrc) + { + + return (EOPNOTSUPP); + } }; METHOD int register { @@ -122,3 +129,9 @@ METHOD void ipi_send { struct intr_irqsrc *isrc; cpuset_t cpus; } DEFAULT null_pic_ipi_send; + +METHOD int ipi_setup { + device_t dev; + u_int ipi; + struct intr_irqsrc *isrc; +} DEFAULT dflt_pic_ipi_setup; Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/kern/subr_intr.c Thu Mar 24 09:55:11 2016 (r297230) @@ -311,8 +311,8 @@ intr_irq_dispatch(struct intr_irqsrc *is /* * Allocate interrupt source. */ -static struct intr_irqsrc * -isrc_alloc(u_int type, u_int extsize) +struct intr_irqsrc * +intr_isrc_alloc(u_int type, u_int extsize) { struct intr_irqsrc *isrc; @@ -329,8 +329,8 @@ isrc_alloc(u_int type, u_int extsize) /* * Free interrupt source. */ -static void -isrc_free(struct intr_irqsrc *isrc) +void +intr_isrc_free(struct intr_irqsrc *isrc) { free(isrc, M_INTRNG); @@ -462,20 +462,20 @@ intr_namespace_map_irq(device_t dev, uin struct intr_irqsrc *isrc, *new_isrc; int error; - new_isrc = isrc_alloc(INTR_ISRCT_NAMESPACE, 0); + new_isrc = intr_isrc_alloc(INTR_ISRCT_NAMESPACE, 0); mtx_lock(&isrc_table_lock); isrc = isrc_namespace_lookup(dev, type, num); if (isrc != NULL) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (isrc->isrc_irq); /* already mapped */ } error = isrc_alloc_irq_locked(new_isrc); if (error != 0) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (IRQ_INVALID); /* no space left */ } @@ -526,20 +526,20 @@ intr_fdt_map_irq(phandle_t node, pcell_t xref = (intptr_t)node; /* It's so simple for now. */ cellsize = ncells * sizeof(*cells); - new_isrc = isrc_alloc(INTR_ISRCT_FDT, cellsize); + new_isrc = intr_isrc_alloc(INTR_ISRCT_FDT, cellsize); mtx_lock(&isrc_table_lock); isrc = isrc_fdt_lookup(xref, cells, ncells); if (isrc != NULL) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (isrc->isrc_irq); /* already mapped */ } error = isrc_alloc_irq_locked(new_isrc); if (error != 0) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (IRQ_INVALID); /* no space left */ } Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/sys/intr.h Thu Mar 24 09:55:11 2016 (r297230) @@ -50,8 +50,6 @@ typedef int intr_irq_filter_t(void *arg) #define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) -typedef void intr_ipi_filter_t(void *arg); - enum intr_isrc_type { INTR_ISRCT_NAMESPACE, INTR_ISRCT_FDT @@ -81,15 +79,17 @@ struct intr_irqsrc { struct intr_event * isrc_event; #ifdef INTR_SOLO intr_irq_filter_t * isrc_filter; -#endif - intr_ipi_filter_t * isrc_ipifilter; void * isrc_arg; +#endif #ifdef FDT u_int isrc_ncells; pcell_t isrc_cells[]; /* leave it last */ #endif }; +struct intr_irqsrc *intr_isrc_alloc(u_int type, u_int extsize); +void intr_isrc_free(struct intr_irqsrc *isrc); + void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...) __printflike(2, 3); From owner-svn-src-head@freebsd.org Thu Mar 24 09:56:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF563AD8F8C; Thu, 24 Mar 2016 09:56:54 +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 A9E3C198E; Thu, 24 Mar 2016 09:56:54 +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 u2O9urSj043205; Thu, 24 Mar 2016 09:56:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9urkv043203; Thu, 24 Mar 2016 09:56:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603240956.u2O9urkv043203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Mar 2016 09:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297231 - in head/sys/dev/drm2: i915 ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:56:54 -0000 Author: kib Date: Thu Mar 24 09:56:53 2016 New Revision: 297231 URL: https://svnweb.freebsd.org/changeset/base/297231 Log: Handle the driver KPI change from r292373. Ensure that managed device pagers fault routines always return with a result page, be it the proper and valid result page, or initially passed freshly allocated placeholder. Do not free the passed in page until we are able to provide the replacement, and do not assign NULL to *mres. Reported and tested by: dumbbell Reviewed by: royger (who also verified that Xen code is safe) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Mar 24 09:55:11 2016 (r297230) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Mar 24 09:56:53 2016 (r297231) @@ -1481,7 +1481,7 @@ i915_gem_pager_fault(vm_object_t vm_obj, struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); struct drm_device *dev = obj->base.dev; drm_i915_private_t *dev_priv = dev->dev_private; - vm_page_t page, oldpage; + vm_page_t page; int ret = 0; #ifdef FREEBSD_WIP bool write = (prot & VM_PROT_WRITE) != 0; @@ -1504,13 +1504,10 @@ i915_gem_pager_fault(vm_object_t vm_obj, * progress. */ if (*mres != NULL) { - oldpage = *mres; - vm_page_lock(oldpage); - vm_page_remove(oldpage); - vm_page_unlock(oldpage); - *mres = NULL; - } else - oldpage = NULL; + vm_page_lock(*mres); + vm_page_remove(*mres); + vm_page_unlock(*mres); + } VM_OBJECT_WUNLOCK(vm_obj); retry: ret = 0; @@ -1590,7 +1587,6 @@ retry: } page->valid = VM_PAGE_BITS_ALL; have_page: - *mres = page; vm_page_xbusy(page); CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, @@ -1603,11 +1599,13 @@ have_page: i915_gem_object_unpin(obj); } DRM_UNLOCK(dev); - if (oldpage != NULL) { - vm_page_lock(oldpage); - vm_page_free(oldpage); - vm_page_unlock(oldpage); + if (*mres != NULL) { + KASSERT(*mres != page, ("loosing %p %p", *mres, page)); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); } + *mres = page; vm_object_pip_wakeup(vm_obj); return (VM_PAGER_OK); Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Mar 24 09:55:11 2016 (r297230) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Mar 24 09:56:53 2016 (r297231) @@ -106,21 +106,18 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o struct ttm_buffer_object *bo = vm_obj->handle; struct ttm_bo_device *bdev = bo->bdev; struct ttm_tt *ttm = NULL; - vm_page_t m, m1, oldm; + vm_page_t m, m1; int ret; int retval = VM_PAGER_OK; struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; vm_object_pip_add(vm_obj, 1); - oldm = *mres; - if (oldm != NULL) { - vm_page_lock(oldm); - vm_page_remove(oldm); - vm_page_unlock(oldm); - *mres = NULL; - } else - oldm = NULL; + if (*mres != NULL) { + vm_page_lock(*mres); + vm_page_remove(*mres); + vm_page_unlock(*mres); + } retry: VM_OBJECT_WUNLOCK(vm_obj); m = NULL; @@ -261,14 +258,14 @@ reserve: bo, m, m1, (uintmax_t)offset)); } m->valid = VM_PAGE_BITS_ALL; - *mres = m; vm_page_xbusy(m); - - if (oldm != NULL) { - vm_page_lock(oldm); - vm_page_free(oldm); - vm_page_unlock(oldm); + if (*mres != NULL) { + KASSERT(*mres != m, ("loosing %p %p", *mres, m)); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); } + *mres = m; out_io_unlock1: ttm_mem_io_unlock(man); From owner-svn-src-head@freebsd.org Thu Mar 24 10:10:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EEEBADB26A; Thu, 24 Mar 2016 10:10: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 6F24B1F1E; Thu, 24 Mar 2016 10:10: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 u2OAAfXC046297; Thu, 24 Mar 2016 10:10:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OAAfer046296; Thu, 24 Mar 2016 10:10:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603241010.u2OAAfer046296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 24 Mar 2016 10:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297232 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 10:10:42 -0000 Author: mav Date: Thu Mar 24 10:10:41 2016 New Revision: 297232 URL: https://svnweb.freebsd.org/changeset/base/297232 Log: Unify ignoring EEXIST from zvol_create_minor(). This fixes creation of zvol devices for snapshots during zfs receive, that previously failed with "ZFS WARNING: Unable to create ZVOL" message. This solution is not perfect, but IMHO better then it was before. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 24 09:56:53 2016 (r297231) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 24 10:10:41 2016 (r297232) @@ -2854,7 +2854,8 @@ zvol_create_snapshots(objset_t *os, cons break; } - if ((error = zvol_create_minor(sname)) != 0) { + error = zvol_create_minor(sname); + if (error != 0 && error != EEXIST) { printf("ZFS WARNING: Unable to create ZVOL %s (error=%d).\n", sname, error); break; From owner-svn-src-head@freebsd.org Thu Mar 24 11:05:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5704DADB517; Thu, 24 Mar 2016 11:05:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8A911A2; Thu, 24 Mar 2016 11:05:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id DFBA425D389C; Thu, 24 Mar 2016 11:05:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id DF2B7C79A3C; Thu, 24 Mar 2016 11:05:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id pr00V-kviMEq; Thu, 24 Mar 2016 11:05:25 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id EA0F2C79A38; Thu, 24 Mar 2016 11:05:24 +0000 (UTC) Date: Thu, 24 Mar 2016 11:05:24 +0000 (UTC) From: "Bjoern A. Zeeb" To: "George V. Neville-Neil" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 In-Reply-To: <201603240754.u2O7suvM006925@repo.freebsd.org> Message-ID: References: <201603240754.u2O7suvM006925@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 11:05:31 -0000 On Thu, 24 Mar 2016, George V. Neville-Neil wrote: > Author: gnn > Date: Thu Mar 24 07:54:56 2016 > New Revision: 297225 > URL: https://svnweb.freebsd.org/changeset/base/297225 > > Log: > FreeBSD previously provided route caching for TCP (and UDP). Re-add > route caching for TCP, with some improvements. In particular, invalidate > the route cache if a new route is added, which might be a better match. > The cache is automatically invalidated if the old route is deleted. > > Submitted by: Mike Karels > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D4306 I'll try to fix at least the compiler errors for you now ... For everything else we'll see how to go from here. I guess this commit will at least unbreak the tie ;-) -- Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@freebsd.org Thu Mar 24 11:40:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 643A7ADC13C; Thu, 24 Mar 2016 11:40:12 +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 1C4A11317; Thu, 24 Mar 2016 11:40:12 +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 u2OBeB0L074931; Thu, 24 Mar 2016 11:40:11 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OBeArJ074927; Thu, 24 Mar 2016 11:40:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603241140.u2OBeArJ074927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 24 Mar 2016 11:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297234 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 11:40:12 -0000 Author: bz Date: Thu Mar 24 11:40:10 2016 New Revision: 297234 URL: https://svnweb.freebsd.org/changeset/base/297234 Log: Fix compile errors after r297225: - properly V_irtualise variable access unbreaking VIMAGE kernels. - remove the volatile from the function return type to make architecture using gcc happy [-Wreturn-type] "type qualifiers ignored on function return type" I am not entirely happy with this solution putting the u_int there but it will do for now. Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/net/route.c Thu Mar 24 11:40:10 2016 (r297234) @@ -201,7 +201,7 @@ rt_tables_get_rnh(int table, int fam) return (*rt_tables_get_rnh_ptr(table, fam)); } -rt_gen_t +u_int rt_tables_get_gen(int table, int fam) { struct rib_head *rnh; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/net/route.h Thu Mar 24 11:40:10 2016 (r297234) @@ -437,7 +437,7 @@ int rt_setgate(struct rtentry *, struct void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); struct rib_head *rt_table_init(int); void rt_table_destroy(struct rib_head *); -rt_gen_t rt_tables_get_gen(int table, int fam); +u_int rt_tables_get_gen(int table, int fam); int rtsock_addrmsg(int, struct ifaddr *, int); int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/netinet/tcp_subr.c Thu Mar 24 11:40:10 2016 (r297234) @@ -1932,7 +1932,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s notify = tcp_drop_syn_sent; else if (PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); + in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); return; } /* Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 11:40:10 2016 (r297234) @@ -768,7 +768,7 @@ udp_common_ctlinput(int cmd, struct sock if (PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); + in_pcbnotifyall(&V_udbinfo, faddr, EHOSTDOWN, udp_notify); return; } From owner-svn-src-head@freebsd.org Thu Mar 24 13:28:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 853A2ADB664; Thu, 24 Mar 2016 13:28:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 577651434; Thu, 24 Mar 2016 13:28:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2ODSXJq008961; Thu, 24 Mar 2016 13:28:33 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ODSXMs008960; Thu, 24 Mar 2016 13:28:33 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603241328.u2ODSXMs008960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 24 Mar 2016 13:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297235 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:28:34 -0000 Author: wma Date: Thu Mar 24 13:28:33 2016 New Revision: 297235 URL: https://svnweb.freebsd.org/changeset/base/297235 Log: arm64: Fixing user space boudary checking in copyinout.S Big buffer size could cause integer overflow and as a result attempt to copy beyond VM_USERMAX_ADDRESS. Fixing copyinstr boundary checking where compared value has been overwritten by accident when setting fault handler. Submitted by: Dominik Ermel Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5719 Modified: head/sys/arm64/arm64/copyinout.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Thu Mar 24 11:40:10 2016 (r297234) +++ head/sys/arm64/arm64/copyinout.S Thu Mar 24 13:28:33 2016 (r297235) @@ -52,7 +52,8 @@ END(copyio_fault) */ ENTRY(copyout) cbz x2, 1f - add x3, x1, x2 + adds x3, x1, x2 + b.cs copyio_fault_nopcb ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb @@ -71,7 +72,8 @@ END(copyout) */ ENTRY(copyin) cbz x2, 1f - add x3, x0, x2 + adds x3, x0, x2 + b.cs copyio_fault_nopcb ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb @@ -92,11 +94,11 @@ ENTRY(copyinstr) mov x5, xzr /* count = 0 */ mov w4, #1 /* If zero return faulure */ cbz x2, 3f /* If len == 0 then skip loop */ - ldr x7, =VM_MAXUSER_ADDRESS adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + ldr x7, =VM_MAXUSER_ADDRESS 1: cmp x0, x7 b.cs copyio_fault ldrb w4, [x0], #1 /* Load from uaddr */ From owner-svn-src-head@freebsd.org Thu Mar 24 13:33:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC1CADB880; Thu, 24 Mar 2016 13:33:03 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1761D1A44; Thu, 24 Mar 2016 13:33:02 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from softbank126141005095.bbtec.net ([126.141.5.95]:63433 helo=[192.168.3.4]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86_1) (envelope-from ) id 1aj5Ng-00046y-C6; Thu, 24 Mar 2016 09:32:56 -0400 From: "George Neville-Neil" To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297234 - in head/sys: net netinet Date: Thu, 24 Mar 2016 22:32:56 +0900 Message-ID: <1EF0E3FB-E14A-4283-B9EC-6F62BD740A07@neville-neil.com> In-Reply-To: <201603241140.u2OBeArJ074927@repo.freebsd.org> References: <201603241140.u2OBeArJ074927@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.9.4r5234) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:33:03 -0000 Thanks, George On 24 Mar 2016, at 20:40, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Mar 24 11:40:10 2016 > New Revision: 297234 > URL: https://svnweb.freebsd.org/changeset/base/297234 > > Log: > Fix compile errors after r297225: > > - properly V_irtualise variable access unbreaking VIMAGE kernels. > - remove the volatile from the function return type to make > architecture > using gcc happy [-Wreturn-type] > "type qualifiers ignored on function return type" > I am not entirely happy with this solution putting the u_int there > but it will do for now. > > Modified: > head/sys/net/route.c > head/sys/net/route.h > head/sys/netinet/tcp_subr.c > head/sys/netinet/udp_usrreq.c > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/net/route.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -201,7 +201,7 @@ rt_tables_get_rnh(int table, int fam) > return (*rt_tables_get_rnh_ptr(table, fam)); > } > > -rt_gen_t > +u_int > rt_tables_get_gen(int table, int fam) > { > struct rib_head *rnh; > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/net/route.h Thu Mar 24 11:40:10 2016 (r297234) > @@ -437,7 +437,7 @@ int rt_setgate(struct rtentry *, struct > void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct > sockaddr *); > struct rib_head *rt_table_init(int); > void rt_table_destroy(struct rib_head *); > -rt_gen_t rt_tables_get_gen(int table, int fam); > +u_int rt_tables_get_gen(int table, int fam); > > int rtsock_addrmsg(int, struct ifaddr *, int); > int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, > int); > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/netinet/tcp_subr.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -1932,7 +1932,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s > notify = tcp_drop_syn_sent; > else if (PRC_IS_REDIRECT(cmd)) { > /* signal EHOSTDOWN, as it flushes the cached route */ > - in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); > + in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); > return; > } > /* > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -768,7 +768,7 @@ udp_common_ctlinput(int cmd, struct sock > > if (PRC_IS_REDIRECT(cmd)) { > /* signal EHOSTDOWN, as it flushes the cached route */ > - in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); > + in_pcbnotifyall(&V_udbinfo, faddr, EHOSTDOWN, udp_notify); > return; > } From owner-svn-src-head@freebsd.org Thu Mar 24 13:34:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B362CADBA4C; Thu, 24 Mar 2016 13:34:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8994E1C8A; Thu, 24 Mar 2016 13:34:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2ODYdHZ011949; Thu, 24 Mar 2016 13:34:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ODYdq1011945; Thu, 24 Mar 2016 13:34:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603241334.u2ODYdq1011945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Mar 2016 13:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297236 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:34:40 -0000 Author: trasz Date: Thu Mar 24 13:34:39 2016 New Revision: 297236 URL: https://svnweb.freebsd.org/changeset/base/297236 Log: Speed up lookups in autofs(5) by using red-black trees instead of linear searches. Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5627 Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs.c Thu Mar 24 13:34:39 2016 (r297236) @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -149,6 +150,15 @@ TUNABLE_INT("vfs.autofs.interruptible", SYSCTL_INT(_vfs_autofs, OID_AUTO, interruptible, CTLFLAG_RWTUN, &autofs_interruptible, 1, "Allow requests to be interrupted by signal"); +static int +autofs_node_cmp(const struct autofs_node *a, const struct autofs_node *b) +{ + + return (strcmp(a->an_name, b->an_name)); +} + +RB_GENERATE(autofs_node_tree, autofs_node, an_link, autofs_node_cmp); + int autofs_init(struct vfsconf *vfsp) { Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs.h Thu Mar 24 13:34:39 2016 (r297236) @@ -65,11 +65,12 @@ extern int autofs_mount_on_stat; #define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED) struct autofs_node { - TAILQ_ENTRY(autofs_node) an_next; + RB_ENTRY(autofs_node) an_link; char *an_name; int an_fileno; struct autofs_node *an_parent; - TAILQ_HEAD(, autofs_node) an_children; + RB_HEAD(autofs_node_tree, + autofs_node) an_children; struct autofs_mount *an_mount; struct vnode *an_vnode; struct sx an_vnode_lock; @@ -136,4 +137,6 @@ void autofs_node_delete(struct autofs_no int autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, struct vnode **vpp); +RB_PROTOTYPE(autofs_node_tree, autofs_node, an_link, autofs_node_cmp); + #endif /* !AUTOFS_H */ Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs_vfsops.c Thu Mar 24 13:34:39 2016 (r297236) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -158,10 +159,10 @@ autofs_unmount(struct mount *mp, int mnt /* * Not terribly efficient, but at least not recursive. */ - while (!TAILQ_EMPTY(&->am_root->an_children)) { - anp = TAILQ_FIRST(&->am_root->an_children); - while (!TAILQ_EMPTY(&anp->an_children)) - anp = TAILQ_FIRST(&anp->an_children); + while (!RB_EMPTY(&->am_root->an_children)) { + anp = RB_MIN(autofs_node_tree, &->am_root->an_children); + while (!RB_EMPTY(&anp->an_children)) + anp = RB_MIN(autofs_node_tree, &anp->an_children); autofs_node_delete(anp); } autofs_node_delete(amp->am_root); Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs_vnops.c Thu Mar 24 13:34:39 2016 (r297236) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -450,7 +451,7 @@ autofs_readdir(struct vop_readdir_args * * Write out the directory entries for subdirectories. */ AUTOFS_SLOCK(amp); - TAILQ_FOREACH(child, &anp->an_children, an_next) { + RB_FOREACH(child, autofs_node_tree, &anp->an_children) { /* * Check the offset to skip entries returned by previous * calls to getdents(). @@ -575,8 +576,8 @@ autofs_node_new(struct autofs_node *pare anp->an_parent = parent; anp->an_mount = amp; if (parent != NULL) - TAILQ_INSERT_TAIL(&parent->an_children, anp, an_next); - TAILQ_INIT(&anp->an_children); + RB_INSERT(autofs_node_tree, &parent->an_children, anp); + RB_INIT(&anp->an_children); *anpp = anp; return (0); @@ -586,27 +587,28 @@ int autofs_node_find(struct autofs_node *parent, const char *name, int namelen, struct autofs_node **anpp) { - struct autofs_node *anp; + struct autofs_node *anp, find; + int error; AUTOFS_ASSERT_LOCKED(parent->an_mount); - TAILQ_FOREACH(anp, &parent->an_children, an_next) { - if (namelen >= 0) { - if (strlen(anp->an_name) != namelen) - continue; - if (strncmp(anp->an_name, name, namelen) != 0) - continue; - } else { - if (strcmp(anp->an_name, name) != 0) - continue; - } + if (namelen >= 0) + find.an_name = strndup(name, namelen, M_AUTOFS); + else + find.an_name = strdup(name, M_AUTOFS); + anp = RB_FIND(autofs_node_tree, &parent->an_children, &find); + if (anp != NULL) { + error = 0; if (anpp != NULL) *anpp = anp; - return (0); + } else { + error = ENOENT; } - return (ENOENT); + free(find.an_name, M_AUTOFS); + + return (error); } void @@ -615,13 +617,13 @@ autofs_node_delete(struct autofs_node *a struct autofs_node *parent; AUTOFS_ASSERT_XLOCKED(anp->an_mount); - KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children")); + KASSERT(RB_EMPTY(&anp->an_children), ("have children")); callout_drain(&anp->an_callout); parent = anp->an_parent; if (parent != NULL) - TAILQ_REMOVE(&parent->an_children, anp, an_next); + RB_REMOVE(autofs_node_tree, &parent->an_children, anp); sx_destroy(&anp->an_vnode_lock); free(anp->an_name, M_AUTOFS); uma_zfree(autofs_node_zone, anp); From owner-svn-src-head@freebsd.org Thu Mar 24 13:42:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F33FADBFA9; Thu, 24 Mar 2016 13:42:29 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 352A713A6; Thu, 24 Mar 2016 13:42:29 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id p65so66300697wmp.0; Thu, 24 Mar 2016 06:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mGSY9UetTYHWoVOkb2DV0FTj8rQHD/3qCJ84/2QgkPA=; b=oGF7nrOy8CqYZ4v/3MReMfugfH+KNsjYGRj6r2MZfEadzAo2IcZaiFJtX7hz88U/dL PPry2uUomioxBvLPkE0VjXoKWqV0mV+XBD+M79wKR3AD6QVCF/1F6CTClMKlFXFIPBta 0LDQReJphYMGEYy/lJxe68fnqv0J01jQtEUKns6qTyCxFbBKuaog7ppKAocI4K+aBPCO ky71O8BFHOH6qC528vL/D2zugJxpE97toOyrkw4149Nx1fWQdZ86ymEEW9YrQ6yE39wy YfAlL0pgw7PZJNNt0EN6TQZquGPmzRbVvcAs3s6pHw30XPOojveF44po9q3iTFmDq0qV 50/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mGSY9UetTYHWoVOkb2DV0FTj8rQHD/3qCJ84/2QgkPA=; b=gpihYGWRkXT0xx4qWz6go2VU2ye7KEDInVao1mu92daEA7sTSZHShXVB/wG7KvUiyI 4NXnvxIM0JAi2966wv2M/+q4RclIbx11ae+KZl4Trt6DGJ2VS1RHBHlRFCspcqsjlIVE SfUtM9QvMCFA5jhzNyiM1PkRHpd4FOx4FkO2niP+oKpX97EBzRDfm3otkWH7U4Fqr0UN i/WNcpzev+6s4+KMGhFnBEgNNIi5ZLpMVnvi6965QQsEIJZ9xYsA2rfUQVjUOmSLcPwU fZkD2nWEpzK+YiEOx2MTmjjEmfIG8Axigsq/2lEBqSix7iUJJ7cvdKtJCl1Q+ivfYIf8 BdSQ== X-Gm-Message-State: AD7BkJLB6hCmNjpjBsPhF5K8YiLrVYKGB+UhZMmuUi2fjYp1EvKmYP+R6Wvpu8igFV94YQ== X-Received: by 10.28.10.149 with SMTP id 143mr31487094wmk.38.1458826946403; Thu, 24 Mar 2016 06:42:26 -0700 (PDT) Received: from brick.home (esq247.neoplus.adsl.tpnet.pl. [83.20.136.247]) by smtp.gmail.com with ESMTPSA id c144sm27056945wmd.12.2016.03.24.06.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 06:42:25 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 14:42:22 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324134222.GA1442@brick.home> Mail-Followup-To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F3B441.6030602@dumbbell.fr> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:42:29 -0000 On 0324T1032, Jean-Sébastien Pédron wrote: > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >> So maybe callouts are disabled in this situation. If there is a way to > >> detect that, then vt(4) can go back to a "synchronous mode" where it > >> refreshes the screen after each typed character, like it does when ddb > >> is active. > > > > Looks like that's the case: for some reason the callouts don't work. > > This trivial hack is a (mostly) working workaround: > > > > Index: svn/head/sys/kern/kern_cons.c > > =================================================================== > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > > lp = cp; > > end = cp + size - 1; > > for (;;) { > > + pause("meh", 1); > > Could you please explain how this works to me? Does calling pause() here > give a chance to interrupt handlers or other threads of running? It looks like it allows the callout to run. I've did an experiment and added a simple callout that printed something each second; during the root mount prompt it doesn't get run unless you type '.', which calls pause(9). And, for the record, https://reviews.freebsd.org/D5724 doesn't fix the problem. From owner-svn-src-head@freebsd.org Thu Mar 24 14:09:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57439ADC6A3; Thu, 24 Mar 2016 14:09:56 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E816C1769; Thu, 24 Mar 2016 14:09:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id q73so32857550lfe.2; Thu, 24 Mar 2016 07:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-transfer-encoding; bh=sswt9InUg1qbzmeIIy7rv8eX7/8hqUXrYU9zDOPki2A=; b=dJRVTRqVMioDsbj7fxpntp8UKL4kLKIM8GWRsJj8g4CZ6K37ajbpDMY7FtylUt0dKV lLNDps3Z+hA3ZT+laPbK/iNomIwxGZywmj84gVu9IEyVkUbqQ2lrkRiXmazYrp6kZnie oR6fvSDubI/Bo2a/dcMN1/etT+QjBsnfUHTzyxjKjwy4T8f9mMfjQ/pQmSeobTQ7Mi++ FNkkrkVkvtliJ7vPeRYKyjCEQ0IH0qhyN/LsKqUHujS95c6qyNVhDztV5fD3wvZvGKI5 N2xI805X72X80uUisSrcbY9PPRmlnb7EhWfxLpEKw+GM/HV4ASYS4m80ldYuY23lgOIh Sktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-transfer-encoding; bh=sswt9InUg1qbzmeIIy7rv8eX7/8hqUXrYU9zDOPki2A=; b=WKOckZbLP0hzSD8+2CqKwZ2233jY8scHnCP+dYTT1qub0ITSVdbZBTGjUsF2ZM8rkw 7z8AD6HOWvLSYeq3vyCFG1NNbfZbotCUuGwbuZhPPwhNk8IGy7HgVDmak4PEs7Xc3koC nhqKfPODkn7bphN3YZxMzyCh2ZVGzTQPSe8XaJ+8ROMuHDfnUSxxUNzUoHyo34YXWWc+ V9bW9PIY+jQhmLnn2ySm5xFfcj0AQiGxLS8a7aJdqNzeqpjQKmEfVGYSuxgUdhzCADMi APbSoVBTnFkFxWwMb69NfRKB701xvb/40kmUB6UGLdWxYAABacMzTYrOyeNrkf2F88Tz CsAA== X-Gm-Message-State: AD7BkJK67cy2574AgqPBkHMTB5KLWYHZj35GsEJLPEr5y1yPKBiJrbrWaNLWSaoldxsxxg== X-Received: by 10.25.167.144 with SMTP id q138mr3559762lfe.17.1458828593961; Thu, 24 Mar 2016 07:09:53 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.googlemail.com with ESMTPSA id s75sm1260223lfs.21.2016.03.24.07.09.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2016 07:09:53 -0700 (PDT) Message-ID: <56F3F52F.9040705@gmail.com> Date: Thu, 24 Mar 2016 16:09:51 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> In-Reply-To: <20160324134222.GA1442@brick.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:09:56 -0000 On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > On 0324T1032, Jean-Sébastien Pédron wrote: >> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: >>>> So maybe callouts are disabled in this situation. If there is a way to >>>> detect that, then vt(4) can go back to a "synchronous mode" where it >>>> refreshes the screen after each typed character, like it does when ddb >>>> is active. >>> >>> Looks like that's the case: for some reason the callouts don't work. >>> This trivial hack is a (mostly) working workaround: >>> >>> Index: svn/head/sys/kern/kern_cons.c >>> =================================================================== >>> --- svn/head/sys/kern/kern_cons.c (revision 297210) >>> +++ svn/head/sys/kern/kern_cons.c (working copy) >>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) >>> lp = cp; >>> end = cp + size - 1; >>> for (;;) { >>> + pause("meh", 1); >> >> Could you please explain how this works to me? Does calling pause() here >> give a chance to interrupt handlers or other threads of running? > > It looks like it allows the callout to run. I've did an experiment > and added a simple callout that printed something each second; during > the root mount prompt it doesn't get run unless you type '.', which > calls pause(9). Kernel threads run with absolute priorities, so if somehow this threads happen to have higher or equal priority then callout thread, or the kernel is built without PREEMPTION, then the last may never be executed until this thread get to sleep or at least call sched_yield(). -- Alexander Motin From owner-svn-src-head@freebsd.org Thu Mar 24 14:20:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F16CADC98D; Thu, 24 Mar 2016 14:20:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0DF1ED7; Thu, 24 Mar 2016 14:20:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OEKXVH025029; Thu, 24 Mar 2016 14:20:33 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OEKXQn025027; Thu, 24 Mar 2016 14:20:33 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201603241420.u2OEKXQn025027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 24 Mar 2016 14:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297237 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:20:34 -0000 Author: sbruno Date: Thu Mar 24 14:20:33 2016 New Revision: 297237 URL: https://svnweb.freebsd.org/changeset/base/297237 Log: Add 4k enabled cam quirks for Samsung SM863 Series SSDs Submitted by: Jason (j@nitrology.com) MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5711 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Mar 24 13:34:39 2016 (r297236) +++ head/sys/cam/ata/ata_da.c Thu Mar 24 14:20:33 2016 (r297237) @@ -490,6 +490,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung SM863 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7KM*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Mar 24 13:34:39 2016 (r297236) +++ head/sys/cam/scsi/scsi_da.c Thu Mar 24 14:20:33 2016 (r297237) @@ -1162,6 +1162,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Samsung SM863 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7KM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-head@freebsd.org Thu Mar 24 14:57:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE7F7ADB486; Thu, 24 Mar 2016 14:57:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8B618EF; Thu, 24 Mar 2016 14:57:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id EB4E4D41065; Fri, 25 Mar 2016 01:57:33 +1100 (AEDT) Date: Fri, 25 Mar 2016 01:57:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160324090917.GC1741@kib.kiev.ua> Message-ID: <20160325010649.H898@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=SegB75Dqn_6hNEofXd0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:57:38 -0000 On Thu, 24 Mar 2016, Konstantin Belousov wrote: > On Wed, Mar 23, 2016 at 02:21:59PM -0700, John Baldwin wrote: >> As you noted, the issue is if a timecounter needs locks (e.g. i8254) though >> outside of that I think the patch is great. :-/ Of course, if the TSC >> isn't advertised as invariant, DELAY() is talking to the timecounter >> directly as well. >> >> However, I think we probably can use the TSC. The only specific note I got >> from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. >> That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, >> thinking about this more I have a different theory to explain how the TSC >> can be out of whack on different vCPUs even if the hardware TSC is in sync >> in the physical CPUs underneath. > In fact, if we can use TSC with the only requirement of being monotonic, > I do not see why do we need TSC at all. We can return to pre-r278325 > loop, but calibrate the number of loop iterations for known delay in > 1us, once on boot. Do you agree with this ? As a comment in the previous version says, the old method is highly bogus since it is sensitive to CPU clock speed. My systems allow speed variations of about 4000:800 = 5:1 for one CPU and about 50:1 for different CPUs. So the old method gave a variation of up to 50:1. This can be reduced to only 5:1 using the boot-time calibration. Old versions of DELAY() had similar problems. E.g., in FreeBSD-7: X if (tsc_freq != 0 && !tsc_is_broken) { X uint64_t start, end, now; X X sched_pin(); X start = rdtsc(); X end = start + (tsc_freq * n) / 1000000; X do { X cpu_spinwait(); X now = rdtsc(); X } while (now < end || (now > start && end < start)); X sched_unpin(); X return; X } This only works if the TSC is invariant. tsc_freq_changed() updates tsc_freq, but it is too hard to do this atomically, so the above is broken when it is called while the frequency is being updated (and this can be arranged by single stepping through the update code). The bug might break at least the keyboard i/o used to do the single stepping, depending on whether the DELAY()s in it are really needed and on how much these DELAYS()s are lengthened or shortened. This loop doesn't need to use the TSC, but can use a simple calibrated loop since the delay only needs to be right to within a few usec of a factor of 2 or so, or any longer time (so that it doesn't matter if the thread is preempted many quanta). The calibration just needs to be updated whenever the CPU execution rate changes. Newer CPUs give complications like the CPU execution rate being independent of the (TSC) CPU frequency. An invariant TSC gives an invariant CPU frequency, but the execution rate may change in lots of ways for lots of reasons. The cputicker has similar problems with non-invariant CPUs. It recalibrates, but there are races and other bugs in the recalibration. These bugs are small compared with counting ticks at old rate(s) as being at the current rate. Bruce From owner-svn-src-head@freebsd.org Thu Mar 24 15:01:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5F3ADB51C; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08F8A1C07; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id u125so16422313wmg.1; Thu, 24 Mar 2016 08:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=HR0gp2IrEC2hhY+TKIthGMBQIP8Jn++17tvpUxWWRcQzOETwPCcsxGffJnp0TJfPuN PRnQwQi6kUY/qEGH3/c7j6GGA8B2/IKYqhHEkG3IAVkyYenVTiOJgvTX3/0lmsqOY1gT pmqvwX6NiD4I39Kf0qEwEpF/O8zpFD3k8+A/ZqFaUtMKdCZBsKGcFs3ZsgkHMQhOEVRj gC0fgLh360nhE7LvE254pkmvwnZbBZ5TmNtFZydcMgW3ljrd0gQGHhC5XXoKW73Qpcj2 zEwlscqwJ3aqSSdQnpebagxdS/Upqoj50gTQwDRNFXQV2qV/QSF2XpTXXK2mZPzlU0SP aNTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=GoQtbgtirewHfzKx7KpBSzhvkUeQz2mvRrnKrMTko7Y+GaokIbDTKXPMWCUzKN8yTK 3HdutVDNknkYQ41DJdALWPzyBmzydxv4nj0pQtVbdCNyCSbkFZsssKFF7i68the70uSi V84kTBykSK1NBtJch0KpeX2kMaVTPHuLJGypiZJuBUUcB/rVAbX9Vb7vSvuk5C7gmI6l MkLrt5pXIe2RFbiDqKD+2umB8QNMeWyvEUkuqkShJqDUHj8uH3zo6JMUDLLZdiWlYcDi mnPxDXftpdWU+jvs/qZ4vMzMJ+H5Y54pIPIWiSJT04QXnvjhnE+j9DCAR25kcb9I87J1 xnpw== X-Gm-Message-State: AD7BkJKvZmUryIguhXTHCVScrNDrvmz7OVfY+91YgI1dz8iHNzMP8gnWWgOhjX7RNwftnw== X-Received: by 10.194.222.234 with SMTP id qp10mr10315461wjc.138.1458831715245; Thu, 24 Mar 2016 08:01:55 -0700 (PDT) Received: from brick.home (etj156.neoplus.adsl.tpnet.pl. [83.20.155.156]) by smtp.gmail.com with ESMTPSA id u14sm27393399wmu.8.2016.03.24.08.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 08:01:54 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 16:01:51 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324150151.GA1277@brick.home> Mail-Followup-To: Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F3F52F.9040705@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 15:01:58 -0000 On 0324T1609, Alexander Motin wrote: > On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > > On 0324T1032, Jean-Sébastien Pédron wrote: > >> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >>>> So maybe callouts are disabled in this situation. If there is a way to > >>>> detect that, then vt(4) can go back to a "synchronous mode" where it > >>>> refreshes the screen after each typed character, like it does when ddb > >>>> is active. > >>> > >>> Looks like that's the case: for some reason the callouts don't work. > >>> This trivial hack is a (mostly) working workaround: > >>> > >>> Index: svn/head/sys/kern/kern_cons.c > >>> =================================================================== > >>> --- svn/head/sys/kern/kern_cons.c (revision 297210) > >>> +++ svn/head/sys/kern/kern_cons.c (working copy) > >>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > >>> lp = cp; > >>> end = cp + size - 1; > >>> for (;;) { > >>> + pause("meh", 1); > >> > >> Could you please explain how this works to me? Does calling pause() here > >> give a chance to interrupt handlers or other threads of running? > > > > It looks like it allows the callout to run. I've did an experiment > > and added a simple callout that printed something each second; during > > the root mount prompt it doesn't get run unless you type '.', which > > calls pause(9). > > Kernel threads run with absolute priorities, so if somehow this threads > happen to have higher or equal priority then callout thread, or the > kernel is built without PREEMPTION, then the last may never be executed > until this thread get to sleep or at least call sched_yield(). The callout's td_priority seems to be 40; the thread running the prompt is 84, so it's lower. I've just noticed another curious thing, though: when you press ScrLk, the screen gets immediately refreshed; also, pressing arrows works just the way it should. In other words, the refresh is broken except for the ScrlLk mode, where it works as it should. From owner-svn-src-head@freebsd.org Thu Mar 24 15:46:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09776ADC675 for ; Thu, 24 Mar 2016 15:46:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0FFB16D5 for ; Thu, 24 Mar 2016 15:46:58 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 95dd158d-f1d7-11e5-827e-7d17a39bef25 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Mar 2016 15:46:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2OFkofq016707; Thu, 24 Mar 2016 09:46:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458834410.1091.54.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Edward Tomasz =?iso-8859-2?Q?Napiera=B3a?= , Alexander Motin Cc: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Mar 2016 09:46:50 -0600 In-Reply-To: <20160324150151.GA1277@brick.home> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 15:46:59 -0000 On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera³a wrote: > On 0324T1609, Alexander Motin wrote: > > On 24.03.16 15:42, Edward Tomasz Napiera³a wrote: > > > On 0324T1032, Jean-Sébastien Pédron wrote: > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > is a way to > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > where it > > > > > > refreshes the screen after each typed character, like it > > > > > > does when ddb > > > > > > is active. > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > don't work. > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.c > > > > > ============================================================= > > > > > ====== > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > visible) > > > > > lp = cp; > > > > > end = cp + size - 1; > > > > > for (;;) { > > > > > + pause("meh", 1); > > > > > > > > Could you please explain how this works to me? Does calling > > > > pause() here > > > > give a chance to interrupt handlers or other threads of > > > > running? > > > > > > It looks like it allows the callout to run. I've did an > > > experiment > > > and added a simple callout that printed something each second; > > > during > > > the root mount prompt it doesn't get run unless you type '.', > > > which > > > calls pause(9). > > > > Kernel threads run with absolute priorities, so if somehow this > > threads > > happen to have higher or equal priority then callout thread, or the > > kernel is built without PREEMPTION, then the last may never be > > executed > > until this thread get to sleep or at least call sched_yield(). > > The callout's td_priority seems to be 40; the thread running the > prompt > is 84, so it's lower. > > I've just noticed another curious thing, though: when you press > ScrLk, > the screen gets immediately refreshed; also, pressing arrows works > just > the way it should. In other words, the refresh is broken except for > the ScrlLk mode, where it works as it should. Since cngets() is used only by the mountroot prompt and the geli pw entry, pausing/yielding within the input loop seems like a good idea. It would allow for things like plugging in a usb device and having it actually appear without having to enter a '.' several times. It would be nice if the pause were done with pause_sbt() and a shorter timeout, maybe a millisecond or even 100uS. Otherwise things like pasting text at that prompt in a serial console is likely to drop chars. Hmmm... speaking of the geli pw prompt... what's the locking situation there? Will there be any problems calling pause() from that context? -- Ian From owner-svn-src-head@freebsd.org Thu Mar 24 16:15:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC7A6ADCD89 for ; Thu, 24 Mar 2016 16:15:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFEE01BBE for ; Thu, 24 Mar 2016 16:15:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id m184so89756788iof.1 for ; Thu, 24 Mar 2016 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=l4OxAXzrL2ogzMuVZyIIObqphoEdIrPQ4X/hIiJC48M=; b=QzJMmHc9xaY0Ca4RAzfPdqsCamyLKkZydXP0dXB7I2nXmaMiteutdBJxu3cQPTDL4b zKvXYmTNFkLF3JeIZekpAQAbm2uvlguUiUHQfhUMz5CCufeQ8m6qyWEKQG/B6Tb1kHVi 66Epf5CWfV9LRzlHT/s2QA5Z3fbYKToaktVi1nBVVzu5usRgoMYMTy66F35hc8fEtoRR bUScxRl1pRPVLhEWA+Y9jNzMztab8w1BKLat+xWbRmJSvfASLofi66nPvYk/OUBsSiyr Tk/0rd5GWjiZ019sA2VsFQzEYr/5IOITkphmKsYTaCwtRWvowvhiGWPOCZcj8D/guJkP QoAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=l4OxAXzrL2ogzMuVZyIIObqphoEdIrPQ4X/hIiJC48M=; b=lS/rTvTcPyt7JFX0XW1FXBdAEdbyYWyLOluM/v8gueysS28+6VHrVTzAYTAg4M3zBF UGDunlCRTQTX2/4k2ob1+ZVRUlc6CDd28AUmXw+63LFebCZ0L1oGBMdWb+DnTIoW/+/f YIGjuJj2rddGkSDmFGIrOiQPF0eeeL/a1/ukSdTlloR7IuyARPOIbuB06KQ51vWxLH2q FDwbhO6a8CcRaTyQ+0mv5Gz9Gc9CR3azBVNlHuD3X16eyKbda/ZiqYJbER30VODjtggD DjitTWMTT9EXGvverVD/ZisWsHuS4oXW/EP/exxURRAlGqlUxuTK0qjvckzjC7YoffDQ 0Knw== X-Gm-Message-State: AD7BkJKxgGEipY92QIpFlx6zoe7jQv02RVK+ZR8yHgNQ186AFpzWyURRKCX86tfwNP5HJ06w45BH7OTVsmdoAQ== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr9488694ioo.73.1458836154785; Thu, 24 Mar 2016 09:15:54 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Thu, 24 Mar 2016 09:15:54 -0700 (PDT) X-Originating-IP: [69.53.245.20] In-Reply-To: <1458834410.1091.54.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> Date: Thu, 24 Mar 2016 10:15:54 -0600 X-Google-Sender-Auth: 0ruP_cq6E2T_3qy2ZKi03-rPdbQ Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Ian Lepore Cc: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , Alexander Motin , =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 16:15:56 -0000 On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: > On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera=C5=82a wrote: > > On 0324T1609, Alexander Motin wrote: > > > On 24.03.16 15:42, Edward Tomasz Napiera=C5=82a wrote: > > > > On 0324T1032, Jean-S=C3=A9bastien P=C3=A9dron wrote: > > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > > is a way to > > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > > where it > > > > > > > refreshes the screen after each typed character, like it > > > > > > > does when ddb > > > > > > > is active. > > > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > > don't work. > > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.c > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > =3D=3D=3D=3D=3D=3D > > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > > visible) > > > > > > lp =3D cp; > > > > > > end =3D cp + size - 1; > > > > > > for (;;) { > > > > > > + pause("meh", 1); > > > > > > > > > > Could you please explain how this works to me? Does calling > > > > > pause() here > > > > > give a chance to interrupt handlers or other threads of > > > > > running? > > > > > > > > It looks like it allows the callout to run. I've did an > > > > experiment > > > > and added a simple callout that printed something each second; > > > > during > > > > the root mount prompt it doesn't get run unless you type '.', > > > > which > > > > calls pause(9). > > > > > > Kernel threads run with absolute priorities, so if somehow this > > > threads > > > happen to have higher or equal priority then callout thread, or the > > > kernel is built without PREEMPTION, then the last may never be > > > executed > > > until this thread get to sleep or at least call sched_yield(). > > > > The callout's td_priority seems to be 40; the thread running the > > prompt > > is 84, so it's lower. > > > > I've just noticed another curious thing, though: when you press > > ScrLk, > > the screen gets immediately refreshed; also, pressing arrows works > > just > > the way it should. In other words, the refresh is broken except for > > the ScrlLk mode, where it works as it should. > > Since cngets() is used only by the mountroot prompt and the geli pw > entry, pausing/yielding within the input loop seems like a good idea. > It would allow for things like plugging in a usb device and having it > actually appear without having to enter a '.' several times. > > It would be nice if the pause were done with pause_sbt() and a shorter > timeout, maybe a millisecond or even 100uS. Otherwise things like > pasting text at that prompt in a serial console is likely to drop > chars. > > Hmmm... speaking of the geli pw prompt... what's the locking situation > there? Will there be any problems calling pause() from that context? > PVM isn't an ideal priority to wait at. PWAIT would be better. However, if the only reason to call pause is run the scheduler after each character, perhaps a better solution would be to call kern_yield() instead? We could do that instead of cpu_waitspin() inside of cngetc, but that would break the debugger's use of it.... Warner From owner-svn-src-head@freebsd.org Thu Mar 24 16:25:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C35ADCFDE; Thu, 24 Mar 2016 16:25:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE84312C1; Thu, 24 Mar 2016 16:24:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2OGOmmG065542 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Mar 2016 18:24:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2OGOmmG065542 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2OGOlDq065541; Thu, 24 Mar 2016 18:24:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2016 18:24:47 +0200 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160324162447.GD1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160325010649.H898@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 16:25:00 -0000 On Fri, Mar 25, 2016 at 01:57:32AM +1100, Bruce Evans wrote: > > In fact, if we can use TSC with the only requirement of being monotonic, > > I do not see why do we need TSC at all. We can return to pre-r278325 > > loop, but calibrate the number of loop iterations for known delay in > > 1us, once on boot. Do you agree with this ? > > As a comment in the previous version says, the old method is highly > bogus since it is sensitive to CPU clock speed. We do not care if we time-out in the 5usec or 50usec. We can even wait for 1 second. The only thing that must be avoided is infinite wait to prevent a situation when CPU spins with disabled interrupts infinitely. > > My systems allow speed variations of about 4000:800 = 5:1 for one CPU and > about 50:1 for different CPUs. So the old method gave a variation of up > to 50:1. This can be reduced to only 5:1 using the boot-time calibration. What do you mean by 'for different CPUs' ? I understand that modern ESS can give us CPU frequency between 800-4200MHz, which is what you mean by 'for one CPU'. We definitely do not care if 5usec timeout becomes 25usecs, since we practically never time-out there at all. As I understand the original report, the LAPIC becomes ready for next IPI command much faster than 1usec, but not that fast to report readiness on the next register read. The timeout is more practical for APs startup, where microcode must initialize and test core, which does take time, and sometimes other issues do prevent APs from starting. But this happens during early boot, when ESS and trottling cannot happen, so initial calibration is more or less accurate. > > Old versions of DELAY() had similar problems. E.g., in FreeBSD-7: > > X if (tsc_freq != 0 && !tsc_is_broken) { > X uint64_t start, end, now; > X > X sched_pin(); > X start = rdtsc(); > X end = start + (tsc_freq * n) / 1000000; > X do { > X cpu_spinwait(); > X now = rdtsc(); > X } while (now < end || (now > start && end < start)); > X sched_unpin(); > X return; > X } > > This only works if the TSC is invariant. tsc_freq_changed() updates > tsc_freq, but it is too hard to do this atomically, so the above is > broken when it is called while the frequency is being updated (and > this can be arranged by single stepping through the update code). > The bug might break at least the keyboard i/o used to do the single > stepping, depending on whether the DELAY()s in it are really needed > and on how much these DELAYS()s are lengthened or shortened. > > This loop doesn't need to use the TSC, but can use a simple calibrated > loop since the delay only needs to be right to within a few usec of > a factor of 2 or so, or any longer time (so that it doesn't matter if > the thread is preempted many quanta). The calibration just needs to > be updated whenever the CPU execution rate changes. I do not see why would we need to re-calibrate for ipi_wait(), the possible inaccuracy is not important. > > Newer CPUs give complications like the CPU execution rate being independent > of the (TSC) CPU frequency. An invariant TSC gives an invariant CPU > frequency, but the execution rate may change in lots of ways for lots > of reasons. > > The cputicker has similar problems with non-invariant CPUs. It > recalibrates, but there are races and other bugs in the recalibration. > These bugs are small compared with counting ticks at old rate(s) as > being at the current rate. Yes, but I do not believe any of the listed problems are relevant for the wait for LAPIC readiness. From owner-svn-src-head@freebsd.org Thu Mar 24 17:34:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31851ADCF78; Thu, 24 Mar 2016 17:34:05 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 BA1F51621; Thu, 24 Mar 2016 17:34:04 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id l68so76486072wml.1; Thu, 24 Mar 2016 10:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=APgaStEf8Xi/R1c5bMdA501hLR901axiIFnqn5xUa5w=; b=RmvxKXjWhWsPjtlQdqhG2MDlSXMZS37PGIXvzViQRN0UDZ+sKvRFmo+JhJ9Sn8aQWc tLvvf+bfpeF2YrFEJ1wxlcaMIHhavwh3/vItQ2VsaSnxfu4WPvEWXaG08ZYHCbyO0ke8 /XXusi+HjvlZ2XbXLrPStFHRkgqTLFgWBidGOLVTHD5Evbxo/HIEf3OiVromOYr5ahlJ Wx6MeYNnki6dVTqaLx8BQVdANyubnPueQ5ADLR3uHkGc9fMPbwwnndBjPQLmn0HYBKp/ ADGDlxbzc7IUlW0wuupcGIGoDIZCwwckpLWsgP9jJXK899kHEcVu93QjZzrBi6Xx7rmB g/QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=APgaStEf8Xi/R1c5bMdA501hLR901axiIFnqn5xUa5w=; b=PS1XeBKINmAyM2bJkfgj3SmanB/poJ5cfFwXUnagQqI6oAyvthKsXLxUVe54y88afq y4hmot4QbPXU2KpyDjx4/wBS1+j59kd+3F4FbADZjZoJvDwXNgjbFqUouqMVdR1VFREt IEUneah2udgMy7vkf/Z6OKWyp0EF85W1kJUTyfIpLQtQvsG5NM/prPuM+Ld1Rnwdy7sy OdyU3yXcqVGaQZf/7bZ9EZOogXHUNUDw+HbthNxFsTuoDvXJprsfn00CYUayqEpKD8za lSIGafSzMneYQjVhCFZc/izqiPO1+plnHAdtC2L2zHim6KfcCkBjiweQnEf5MsI6CqNb PUTQ== X-Gm-Message-State: AD7BkJLr3q5eNypZgVxK7koY4h8SNgeUcYCnfkcFA8wzqzyA10i9QIk9mpy/33xKU0aBHg== X-Received: by 10.194.174.231 with SMTP id bv7mr11178887wjc.17.1458840842986; Thu, 24 Mar 2016 10:34:02 -0700 (PDT) Received: from brick.home (etj156.neoplus.adsl.tpnet.pl. [83.20.155.156]) by smtp.gmail.com with ESMTPSA id j18sm28119917wmd.2.2016.03.24.10.34.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 10:34:02 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 18:33:59 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Warner Losh Cc: Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324173359.GA1238@brick.home> Mail-Followup-To: Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 17:34:05 -0000 On 0324T1015, Warner Losh wrote: > On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: > > > On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz NapieraÅ‚a wrote: > > > On 0324T1609, Alexander Motin wrote: > > > > On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > > > > > On 0324T1032, Jean-Sébastien Pédron wrote: > > > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > > > is a way to > > > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > > > where it > > > > > > > > refreshes the screen after each typed character, like it > > > > > > > > does when ddb > > > > > > > > is active. > > > > > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > > > don't work. > > > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.c > > > > > > > ============================================================= > > > > > > > ====== > > > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > > > visible) > > > > > > > lp = cp; > > > > > > > end = cp + size - 1; > > > > > > > for (;;) { > > > > > > > + pause("meh", 1); > > > > > > > > > > > > Could you please explain how this works to me? Does calling > > > > > > pause() here > > > > > > give a chance to interrupt handlers or other threads of > > > > > > running? > > > > > > > > > > It looks like it allows the callout to run. I've did an > > > > > experiment > > > > > and added a simple callout that printed something each second; > > > > > during > > > > > the root mount prompt it doesn't get run unless you type '.', > > > > > which > > > > > calls pause(9). > > > > > > > > Kernel threads run with absolute priorities, so if somehow this > > > > threads > > > > happen to have higher or equal priority then callout thread, or the > > > > kernel is built without PREEMPTION, then the last may never be > > > > executed > > > > until this thread get to sleep or at least call sched_yield(). > > > > > > The callout's td_priority seems to be 40; the thread running the > > > prompt > > > is 84, so it's lower. > > > > > > I've just noticed another curious thing, though: when you press > > > ScrLk, > > > the screen gets immediately refreshed; also, pressing arrows works > > > just > > > the way it should. In other words, the refresh is broken except for > > > the ScrlLk mode, where it works as it should. > > > > Since cngets() is used only by the mountroot prompt and the geli pw > > entry, pausing/yielding within the input loop seems like a good idea. > > It would allow for things like plugging in a usb device and having it > > actually appear without having to enter a '.' several times. > > > > It would be nice if the pause were done with pause_sbt() and a shorter > > timeout, maybe a millisecond or even 100uS. Otherwise things like > > pasting text at that prompt in a serial console is likely to drop > > chars. > > > > Hmmm... speaking of the geli pw prompt... what's the locking situation > > there? Will there be any problems calling pause() from that context? > > > > PVM isn't an ideal priority to wait at. PWAIT would be better. However, > if the only reason to call pause is run the scheduler after each character, > perhaps a better solution would be to call kern_yield() instead? We could > do that instead of cpu_waitspin() inside of cngetc, but that would break > the debugger's use of it.... I think we should first try to figure out why this doesn't work in the first place. Basically, even though the interrupts are running, scheduler seems to be ok, and the thread that's calling this has a lower priority than the callouts thread, it can't be preempted. This doesn't seem to be caused by vt(4); with syscons the callouts don't get called either (it just doesn't break the echo in this case). To demonstrate the problem you can add add a callout that calls printf each second and then does an infinite loop. From owner-svn-src-head@freebsd.org Thu Mar 24 18:47:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7056CADCFD4; Thu, 24 Mar 2016 18:47:21 +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 3ACB416ED; Thu, 24 Mar 2016 18:47:21 +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 u2OIlKrT009110; Thu, 24 Mar 2016 18:47:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OIlJMn009101; Thu, 24 Mar 2016 18:47:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603241847.u2OIlJMn009101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Mar 2016 18:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297238 - in head/lib/libc: aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 18:47:21 -0000 Author: emaste Date: Thu Mar 24 18:47:19 2016 New Revision: 297238 URL: https://svnweb.freebsd.org/changeset/base/297238 Log: libc: stop exporting curbrk and minbrk in the private namespace They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728 Modified: head/lib/libc/aarch64/Symbol.map head/lib/libc/amd64/Symbol.map head/lib/libc/arm/Symbol.map head/lib/libc/i386/Symbol.map head/lib/libc/mips/Symbol.map head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc64/Symbol.map head/lib/libc/riscv/Symbol.map head/lib/libc/sparc64/Symbol.map Modified: head/lib/libc/aarch64/Symbol.map ============================================================================== --- head/lib/libc/aarch64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/aarch64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -36,7 +36,5 @@ FBSD_1.0 { FBSDprivate_1.0 { _set_tp; _end; - curbrk; - minbrk; __makecontext; }; Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/amd64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -63,8 +63,6 @@ FBSDprivate_1.0 { __signalcontext; signalcontext; __siglongjmp; - .curbrk; - .minbrk; _brk; _end; __sys_vfork; Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/arm/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -60,8 +60,6 @@ FBSDprivate_1.0 { _vfork; _brk; _end; - curbrk; - minbrk; _sbrk; /* softfloat */ Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/i386/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -64,6 +64,4 @@ FBSDprivate_1.0 { _vfork; _end; _brk; - .curbrk; - .minbrk; }; Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/mips/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -52,8 +52,6 @@ FBSDprivate_1.0 { __sys_vfork; _vfork; _end; - __curbrk; - minbrk; _brk; _sbrk; Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/powerpc/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -56,7 +56,5 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - .curbrk; - .minbrk; .cerror; }; Modified: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- head/lib/libc/powerpc64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/powerpc64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -52,7 +52,5 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - _curbrk; - _minbrk; _cerror; }; Modified: head/lib/libc/riscv/Symbol.map ============================================================================== --- head/lib/libc/riscv/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/riscv/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -36,7 +36,5 @@ FBSD_1.0 { FBSDprivate_1.0 { _set_tp; _end; - curbrk; - minbrk; __makecontext; }; Modified: head/lib/libc/sparc64/Symbol.map ============================================================================== --- head/lib/libc/sparc64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/sparc64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -80,8 +80,6 @@ FBSDprivate_1.0 { signalcontext; __signalcontext; __siglongjmp; - .curbrk; - .minbrk; __sys_brk; _brk; .cerror; From owner-svn-src-head@freebsd.org Thu Mar 24 20:06:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5BBADCBFD; Thu, 24 Mar 2016 20:06:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68AF214CC; Thu, 24 Mar 2016 20:06:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OK6qOd033831; Thu, 24 Mar 2016 20:06:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OK6q1w033829; Thu, 24 Mar 2016 20:06:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603242006.u2OK6q1w033829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 24 Mar 2016 20:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297241 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:06:53 -0000 Author: glebius Date: Thu Mar 24 20:06:52 2016 New Revision: 297241 URL: https://svnweb.freebsd.org/changeset/base/297241 Log: Space and style(9) corrections for recent mbuf changes. Modified: head/sys/kern/kern_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Mar 24 20:00:07 2016 (r297240) +++ head/sys/kern/kern_mbuf.c Thu Mar 24 20:06:52 2016 (r297241) @@ -747,7 +747,7 @@ m_cljget(struct mbuf *m, int how, int si { uma_zone_t zone; void *retval; - + if (m != NULL) { KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", __func__, m)); @@ -939,8 +939,8 @@ m_extadd(struct mbuf *mb, caddr_t buf, u void m_freem(struct mbuf *mb) { - MBUF_PROBE1(m__freem, mb); + MBUF_PROBE1(m__freem, mb); while (mb != NULL) mb = m_free(mb); } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Mar 24 20:00:07 2016 (r297240) +++ head/sys/sys/mbuf.h Thu Mar 24 20:06:52 2016 (r297241) @@ -51,11 +51,11 @@ SDT_PROBE1(sdt, , , probe, arg0) #define MBUF_PROBE2(probe, arg0, arg1) \ SDT_PROBE2(sdt, , , probe, arg0, arg1) -#define MBUF_PROBE3(probe, arg0, arg1, arg2) \ +#define MBUF_PROBE3(probe, arg0, arg1, arg2) \ SDT_PROBE3(sdt, , , probe, arg0, arg1, arg2) -#define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ +#define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ SDT_PROBE4(sdt, , , probe, arg0, arg1, arg2, arg3) -#define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ +#define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE5(sdt, , , probe, arg0, arg1, arg2, arg3, arg4) SDT_PROBE_DECLARE(sdt, , , m__init); @@ -690,7 +690,7 @@ m_getzone(int size) static __inline int m_init(struct mbuf *m, int how, short type, int flags) { - int error = 0; + int error; m->m_next = NULL; m->m_nextpkt = NULL; @@ -700,6 +700,8 @@ m_init(struct mbuf *m, int how, short ty m->m_type = type; if (flags & M_PKTHDR) error = m_pkthdr_init(m, how); + else + error = 0; MBUF_PROBE5(m__init, m, how, type, flags, error); return (error); From owner-svn-src-head@freebsd.org Thu Mar 24 20:13:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9EFADCDC3; Thu, 24 Mar 2016 20:13:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6178919F4; Thu, 24 Mar 2016 20:13:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OKDHMe036704; Thu, 24 Mar 2016 20:13:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OKDH9B036702; Thu, 24 Mar 2016 20:13:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603242013.u2OKDH9B036702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Mar 2016 20:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297242 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:13:18 -0000 Author: emaste Date: Thu Mar 24 20:13:17 2016 New Revision: 297242 URL: https://svnweb.freebsd.org/changeset/base/297242 Log: elfcopy: overhaul of LMA handling Merge ELF Tool Chain r3434: Previously, elfcopy defines: VMA: section virtual address LMA: PHDR(p_vaddr) While binutils(libbfd) defines: VMA: section virtual address and PHDR(p_vaddr). LMA: PHDR(p_paddr) For elfcopy, p_paddr is considered not meaningful and is always set to the same value as p_vaddr. elfcopy was implemented that way because I thought p_paddr is not used/meaningful according to the ELF ABI. However it turned out p_paddr is at least used in some ELF files, e.g. the FreeBSD kernel. This change made elfcopy treat p_paddr as LMA, same as libbfd. (However, some VMA/LMA related command line option still need tweaking to make them compatible with binutils objcopy. This will be improved later) Ticket: #524 And typo fixes in r3435 and r3436. This fixes the Xen kernel build. Submitted by: kaiw Tested by: royger Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/segments.c Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Thu Mar 24 20:06:52 2016 (r297241) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Thu Mar 24 20:13:17 2016 (r297242) @@ -139,7 +139,8 @@ struct section { /* Internal data structure for segments. */ struct segment { - uint64_t addr; /* load addr */ + uint64_t vaddr; /* virtual addr (VMA) */ + uint64_t paddr; /* physical addr (LMA) */ uint64_t off; /* file offset */ uint64_t fsz; /* file size */ uint64_t msz; /* memory size */ Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Thu Mar 24 20:06:52 2016 (r297241) +++ head/contrib/elftoolchain/elfcopy/segments.c Thu Mar 24 20:13:17 2016 (r297242) @@ -72,12 +72,12 @@ add_to_inseg_list(struct elfcopy *ecp, s */ loadable = 0; STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { - if (s->off < seg->off || (s->vma < seg->addr && !s->pseudo)) + if (s->off < seg->off || (s->vma < seg->vaddr && !s->pseudo)) continue; if (s->off + s->sz > seg->off + seg->fsz && s->type != SHT_NOBITS) continue; - if (s->vma + s->sz > seg->addr + seg->msz) + if (s->vma + s->sz > seg->vaddr + seg->msz) continue; insert_to_inseg_list(seg, s); @@ -85,7 +85,12 @@ add_to_inseg_list(struct elfcopy *ecp, s s->seg = seg; else if (seg->type == PT_TLS) s->seg_tls = seg; - s->lma = seg->addr + (s->off - seg->off); + if (s->pseudo) + s->vma = seg->vaddr + (s->off - seg->off); + if (seg->paddr > 0) + s->lma = seg->paddr + (s->off - seg->off); + else + s->lma = 0; loadable = 1; } @@ -98,7 +103,7 @@ adjust_addr(struct elfcopy *ecp) struct section *s, *s0; struct segment *seg; struct sec_action *sac; - uint64_t dl, lma, start, end; + uint64_t dl, vma, lma, start, end; int found, i; /* @@ -110,59 +115,52 @@ adjust_addr(struct elfcopy *ecp) if (!s->loadable) continue; + /* Apply global VMA adjustment. */ + if (ecp->change_addr != 0) + s->vma += ecp->change_addr; + /* Apply global LMA adjustment. */ - if (ecp->change_addr != 0 && s->seg != NULL) + if (ecp->change_addr != 0 && s->seg != NULL && + s->seg->paddr > 0) s->lma += ecp->change_addr; - - if (!s->pseudo) { - /* Apply global VMA adjustment. */ - if (ecp->change_addr != 0) - s->vma += ecp->change_addr; - - /* Apply section VMA adjustment. */ - sac = lookup_sec_act(ecp, s->name, 0); - if (sac == NULL) - continue; - if (sac->setvma) - s->vma = sac->vma; - if (sac->vma_adjust != 0) - s->vma += sac->vma_adjust; - } } /* - * Apply sections LMA change in the second iteration. + * Apply sections VMA change in the second iteration. */ TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { - /* - * Only loadable section that's inside a segment can have - * LMA adjusted. - */ - if (!s->loadable || s->seg == NULL) + if (!s->loadable) continue; /* - * Check if there is a LMA change request for this + * Check if there is a VMA change request for this * section. */ sac = lookup_sec_act(ecp, s->name, 0); if (sac == NULL) continue; - if (!sac->setlma && sac->lma_adjust == 0) + vma = s->vma; + if (sac->setvma) + vma = sac->vma; + if (sac->vma_adjust != 0) + vma += sac->vma_adjust; + if (vma == s->vma) continue; - lma = s->lma; - if (sac->setlma) - lma = sac->lma; - if (sac->lma_adjust != 0) - lma += sac->lma_adjust; - if (lma == s->lma) + + /* + * No need to make segment adjustment if the section doesn't + * belong to any segment. + */ + if (s->seg == NULL) { + s->vma = vma; continue; + } /* - * Check if the LMA change is viable. + * Check if the VMA change is viable. * - * 1. Check if the new LMA is properly aligned accroding to + * 1. Check if the new VMA is properly aligned accroding to * section alignment. * * 2. Compute the new extent of segment that contains this @@ -170,37 +168,36 @@ adjust_addr(struct elfcopy *ecp) * segments. */ #ifdef DEBUG - printf("LMA for section %s: %#jx\n", s->name, lma); + printf("VMA for section %s: %#jx\n", s->name, vma); #endif - if (lma % s->align != 0) - errx(EXIT_FAILURE, "The load address %#jx for " + if (vma % s->align != 0) + errx(EXIT_FAILURE, "The VMA %#jx for " "section %s is not aligned to %ju", - (uintmax_t) lma, s->name, (uintmax_t) s->align); + (uintmax_t) vma, s->name, (uintmax_t) s->align); - if (lma < s->lma) { + if (vma < s->vma) { /* Move section to lower address. */ - if (lma < s->lma - s->seg->addr) + if (vma < s->vma - s->seg->vaddr) errx(EXIT_FAILURE, "Not enough space to move " - "section %s load address to %#jx", s->name, - (uintmax_t) lma); - start = lma - (s->lma - s->seg->addr); + "section %s VMA to %#jx", s->name, + (uintmax_t) vma); + start = vma - (s->vma - s->seg->vaddr); if (s == s->seg->v_sec[s->seg->nsec - 1]) end = start + s->seg->msz; else - end = s->seg->addr + s->seg->msz; - + end = s->seg->vaddr + s->seg->msz; } else { /* Move section to upper address. */ if (s == s->seg->v_sec[0]) - start = lma; + start = vma; else - start = s->seg->addr; - end = lma + (s->seg->addr + s->seg->msz - s->lma); + start = s->seg->vaddr; + end = vma + (s->seg->vaddr + s->seg->msz - s->vma); if (end < start) errx(EXIT_FAILURE, "Not enough space to move " - "section %s load address to %#jx", s->name, - (uintmax_t) lma); + "section %s VMA to %#jx", s->name, + (uintmax_t) vma); } #ifdef DEBUG @@ -211,34 +208,34 @@ adjust_addr(struct elfcopy *ecp) STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { if (seg == s->seg || seg->type != PT_LOAD) continue; - if (start > seg->addr + seg->msz) + if (start > seg->vaddr + seg->msz) continue; - if (end < seg->addr) + if (end < seg->vaddr) continue; errx(EXIT_FAILURE, "The extent of segment containing " "section %s overlaps with segment(%#jx,%#jx)", - s->name, (uintmax_t) seg->addr, - (uintmax_t) (seg->addr + seg->msz)); + s->name, (uintmax_t) seg->vaddr, + (uintmax_t) (seg->vaddr + seg->msz)); } /* - * Update section LMA and file offset. + * Update section VMA and file offset. */ - if (lma < s->lma) { + if (vma < s->vma) { /* - * To move a section to lower load address, we decrease - * the load addresses of the section and all the - * sections that are before it, and we increase the - * file offsets of all the sections that are after it. + * To move a section to lower VMA, we decrease + * the VMA of the section and all the sections that + * are before it, and we increase the file offsets + * of all the sections that are after it. */ - dl = s->lma - lma; + dl = s->vma - vma; for (i = 0; i < s->seg->nsec; i++) { s0 = s->seg->v_sec[i]; - s0->lma -= dl; + s0->vma -= dl; #ifdef DEBUG - printf("section %s LMA set to %#jx\n", - s0->name, (uintmax_t) s0->lma); + printf("section %s VMA set to %#jx\n", + s0->name, (uintmax_t) s0->vma); #endif if (s0 == s) break; @@ -253,13 +250,13 @@ adjust_addr(struct elfcopy *ecp) } } else { /* - * To move a section to upper load address, we increase - * the load addresses of the section and all the - * sections that are after it, and we increase the - * their file offsets too unless the section in question + * To move a section to upper VMA, we increase + * the VMA of the section and all the sections that + * are after it, and we increase the their file + * offsets too unless the section in question * is the first in its containing segment. */ - dl = lma - s->lma; + dl = vma - s->vma; for (i = 0; i < s->seg->nsec; i++) if (s->seg->v_sec[i] == s) break; @@ -269,9 +266,9 @@ adjust_addr(struct elfcopy *ecp) s->name); for (; i < s->seg->nsec; i++) { s0 = s->seg->v_sec[i]; - s0->lma += dl; + s0->vma += dl; #ifdef DEBUG - printf("section %s LMA set to %#jx\n", + printf("section %s VMA set to %#jx\n", s0->name, (uintmax_t) s0->lma); #endif if (s != s->seg->v_sec[0]) { @@ -292,9 +289,8 @@ adjust_addr(struct elfcopy *ecp) if (ecp->pad_to != 0) { /* - * Find the section with highest load address. + * Find the section with highest VMA. */ - s = NULL; STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { if (seg->type != PT_LOAD) @@ -308,26 +304,113 @@ adjust_addr(struct elfcopy *ecp) s = seg->v_sec[i]; else { s0 = seg->v_sec[i]; - if (s0->lma > s->lma) + if (s0->vma > s->vma) s = s0; } } if (s == NULL) - goto issue_warn; + goto adjust_lma; /* No need to pad if the pad_to address is lower. */ - if (ecp->pad_to <= s->lma + s->sz) - goto issue_warn; + if (ecp->pad_to <= s->vma + s->sz) + goto adjust_lma; - s->pad_sz = ecp->pad_to - (s->lma + s->sz); + s->pad_sz = ecp->pad_to - (s->vma + s->sz); #ifdef DEBUG - printf("pad section %s load to address %#jx by %#jx\n", s->name, + printf("pad section %s VMA to address %#jx by %#jx\n", s->name, (uintmax_t) ecp->pad_to, (uintmax_t) s->pad_sz); #endif } -issue_warn: + +adjust_lma: + + /* + * Apply sections LMA change in the third iteration. + */ + TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { + + /* + * Only loadable section that's inside a segment can have + * LMA adjusted. Also, if LMA of the containing segment is + * set to 0, it probably means we should ignore the LMA. + */ + if (!s->loadable || s->seg == NULL || s->seg->paddr == 0) + continue; + + /* + * Check if there is a LMA change request for this + * section. + */ + sac = lookup_sec_act(ecp, s->name, 0); + if (sac == NULL) + continue; + if (!sac->setlma && sac->lma_adjust == 0) + continue; + lma = s->lma; + if (sac->setlma) + lma = sac->lma; + if (sac->lma_adjust != 0) + lma += sac->lma_adjust; + if (lma == s->lma) + continue; + +#ifdef DEBUG + printf("LMA for section %s: %#jx\n", s->name, lma); +#endif + + /* Check alignment. */ + if (lma % s->align != 0) + errx(EXIT_FAILURE, "The LMA %#jx for " + "section %s is not aligned to %ju", + (uintmax_t) lma, s->name, (uintmax_t) s->align); + + /* + * Update section LMA. + */ + + if (lma < s->lma) { + /* + * To move a section to lower LMA, we decrease + * the LMA of the section and all the sections that + * are before it. + */ + dl = s->lma - lma; + for (i = 0; i < s->seg->nsec; i++) { + s0 = s->seg->v_sec[i]; + s0->lma -= dl; +#ifdef DEBUG + printf("section %s LMA set to %#jx\n", + s0->name, (uintmax_t) s0->lma); +#endif + if (s0 == s) + break; + } + } else { + /* + * To move a section to upper LMA, we increase + * the LMA of the section and all the sections that + * are after it. + */ + dl = lma - s->lma; + for (i = 0; i < s->seg->nsec; i++) + if (s->seg->v_sec[i] == s) + break; + if (i >= s->seg->nsec) + errx(EXIT_FAILURE, "Internal: section `%s' not" + " found in its containing segement", + s->name); + for (; i < s->seg->nsec; i++) { + s0 = s->seg->v_sec[i]; + s0->lma += dl; +#ifdef DEBUG + printf("section %s LMA set to %#jx\n", + s0->name, (uintmax_t) s0->lma); +#endif + } + } + } /* * Issue a warning if there are VMA/LMA adjust requests for @@ -408,7 +491,8 @@ setup_phdr(struct elfcopy *ecp) elf_errmsg(-1)); if ((seg = calloc(1, sizeof(*seg))) == NULL) err(EXIT_FAILURE, "calloc failed"); - seg->addr = iphdr.p_vaddr; + seg->vaddr = iphdr.p_vaddr; + seg->paddr = iphdr.p_paddr; seg->off = iphdr.p_offset; seg->fsz = iphdr.p_filesz; seg->msz = iphdr.p_memsz; @@ -429,20 +513,30 @@ copy_phdr(struct elfcopy *ecp) if (seg->type == PT_PHDR) { if (!TAILQ_EMPTY(&ecp->v_sec)) { s = TAILQ_FIRST(&ecp->v_sec); - if (s->pseudo) - seg->addr = s->lma + + if (s->pseudo) { + seg->vaddr = s->vma + + gelf_fsize(ecp->eout, ELF_T_EHDR, + 1, EV_CURRENT); + seg->paddr = s->lma + gelf_fsize(ecp->eout, ELF_T_EHDR, 1, EV_CURRENT); + } } seg->fsz = seg->msz = gelf_fsize(ecp->eout, ELF_T_PHDR, ecp->ophnum, EV_CURRENT); continue; } + if (seg->nsec > 0) { + s = seg->v_sec[0]; + seg->vaddr = s->vma; + seg->paddr = s->lma; + } + seg->fsz = seg->msz = 0; for (i = 0; i < seg->nsec; i++) { s = seg->v_sec[i]; - seg->msz = s->vma + s->sz - seg->addr; + seg->msz = s->vma + s->sz - seg->vaddr; if (s->type != SHT_NOBITS) seg->fsz = s->off + s->sz - seg->off; } @@ -481,8 +575,8 @@ copy_phdr(struct elfcopy *ecp) elf_errmsg(-1)); ophdr.p_type = iphdr.p_type; - ophdr.p_vaddr = seg->addr; - ophdr.p_paddr = seg->addr; + ophdr.p_vaddr = seg->vaddr; + ophdr.p_paddr = seg->paddr; ophdr.p_flags = iphdr.p_flags; ophdr.p_align = iphdr.p_align; ophdr.p_offset = seg->off; From owner-svn-src-head@freebsd.org Thu Mar 24 20:31:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6388ADC24A; Thu, 24 Mar 2016 20:31:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D0C731578; Thu, 24 Mar 2016 20:31:18 +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 u2OKVH4n020476 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 24 Mar 2016 13:31:17 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2OKVHbg020475; Thu, 24 Mar 2016 13:31:17 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 24 Mar 2016 13:31:17 -0700 From: Gleb Smirnoff To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 Message-ID: <20160324203117.GY2616@FreeBSD.org> References: <201603240754.u2O7suvM006925@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603240754.u2O7suvM006925@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:31:19 -0000 On Thu, Mar 24, 2016 at 07:54:56AM +0000, George V. Neville-Neil wrote: G> Author: gnn G> Date: Thu Mar 24 07:54:56 2016 G> New Revision: 297225 G> URL: https://svnweb.freebsd.org/changeset/base/297225 G> G> Log: G> FreeBSD previously provided route caching for TCP (and UDP). Re-add G> route caching for TCP, with some improvements. In particular, invalidate G> the route cache if a new route is added, which might be a better match. G> The cache is automatically invalidated if the old route is deleted. G> G> Submitted by: Mike Karels G> Reviewed by: gnn G> Differential Revision: https://reviews.freebsd.org/D4306 I'm quite surprised to see this checked in, taking into account that the D4306 has strong disagreement from melifaro@. So, now we got two aids for poor routing: TCP route caching & flowtable. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Mar 24 20:41:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D43CADC570; Thu, 24 Mar 2016 20:41:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 93C8219C7; Thu, 24 Mar 2016 20:41:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 7AA6A1046751; Fri, 25 Mar 2016 07:13:55 +1100 (AEDT) Date: Fri, 25 Mar 2016 07:13:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160324162447.GD1741@kib.kiev.ua> Message-ID: <20160325060901.N2059@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=pSMYnccoPzmXhUY583wA:9 a=CRsKXjYTLzKNZZZd:21 a=pQtDixh8YMq7q-8r:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:41:05 -0000 On Thu, 24 Mar 2016, Konstantin Belousov wrote: > On Fri, Mar 25, 2016 at 01:57:32AM +1100, Bruce Evans wrote: >>> In fact, if we can use TSC with the only requirement of being monotonic, >>> I do not see why do we need TSC at all. We can return to pre-r278325 >>> loop, but calibrate the number of loop iterations for known delay in >>> 1us, once on boot. Do you agree with this ? >> >> As a comment in the previous version says, the old method is highly >> bogus since it is sensitive to CPU clock speed. > We do not care if we time-out in the 5usec or 50usec. We can even wait > for 1 second. The only thing that must be avoided is infinite wait to > prevent a situation when CPU spins with disabled interrupts infinitely. That's good then. Howver, 1 second is really too long. Related timeouts in kern_mutex.c and subr_smp.c are quite broken since they use either a hard-coded timeout or a miscalibrated DELAY(): kern_mutex.c: X while (!_mtx_obtain_lock(m, tid)) { X X /* Give interrupts a chance while we spin. */ X spinlock_exit(); X while (m->mtx_lock != MTX_UNOWNED) { X if (i++ < 10000000) { X cpu_spinwait(); X continue; X } This does less for small i. But small i is up to 10 million. On slow systems this might take many seconds. Perhaps not as many as 60. X if (i < 60000000 || kdb_active || panicstr != NULL) X DELAY(1); X else X _mtx_lock_spin_failed(m); X cpu_spinwait(); This is supposed to give a timeout of 50 seconds longer than the timeout for small i. But DELAY(1) is not very accurate. In old x86 kernels where DELAY(1) always uses the i8254, DELAY(1) took about 5 usec on most systems (it takes 30+ usec on i486, but i486 doesn't support SMP so this code is not used then; DELAY(1) is still very inaccurate elsehwere). So this often gave a timeout of ~300 seconds. Even 60 is too long to wait. I use the following fixes: - reduce 10 million to 1 million - reduce 50 seconds to 10 seconds plus the timeout for small i - change DELAY(1) to DELAY(100) and scale the limit to match. X } X spinlock_enter(); X } subr_smp.c: Y while (!CPU_SUBSET(cpus, &map)) { Y /* spin */ Y cpu_spinwait(); Y i++; Y if (i == 100000000) { Y printf("timeout stopping cpus\n"); Y break; Y } Y } This uses 100 million with no DELAY() to calibrate it. FreeBSD-7 uses only 100 thousand here. This doesn't scale. My version uses a variable timeout with default of 10 million or 100 million. I just remembered that I am getting lots of these timeouts when entering ddb on a Haswell CPU with certain kernels between FreeBSD-7 and -current. ddb tends to deadlock soon after. This might be just the small timeout. I had forgotten that I changed it. >> My systems allow speed variations of about 4000:800 = 5:1 for one CPU and >> about 50:1 for different CPUs. So the old method gave a variation of up >> to 50:1. This can be reduced to only 5:1 using the boot-time calibration. > What do you mean by 'for different CPUs' ? I understand that modern ESS > can give us CPU frequency between 800-4200MHz, which is what you mean > by 'for one CPU'. We definitely do not care if 5usec timeout becomes > 25usecs, since we practically never time-out there at all. Yes, I actually get 4400:800 on i4790K. The ratio is even larger than that with a hard-coded limit because old CPUs are much slower than i4790K. I sometimes run a 367 MHz (P2 class) CPU. It is several times slower than a new CPU at the same clock frequency, and any throttling would make it even slower. 50 times slower means that a reasonable emergency timeout of 60 seconds becomes 3000 seconds. Local users would get tired of waiting and reset, and remote users might have to wait. I see that largest lapic wait parameter is only 50000 usec. 100 times longer than that wouldn't be too bad. Timeouts in subr_smp.c are already very long. Actually there is a problem with the hard-coded 100 million iteration timeout there. That has unknown length which is unrelated to the low-level length. It needs to be much longer to give the other CPUs time to stop. > As I understand the original report, the LAPIC becomes ready for next IPI > command much faster than 1usec, but not that fast to report readiness on > the next register read. > > The timeout is more practical for APs startup, where microcode must > initialize and test core, which does take time, and sometimes other > issues do prevent APs from starting. But this happens during early boot, > when ESS and trottling cannot happen, so initial calibration is more or > less accurate. There is another thread about early DELAY() using the i8254 not working to calibrate the TSC. That might be just because DELAY() is interrupted. DELAY() never bothered to disable interrupts. Its early use for calibrating the TSC depends on interrupts mostly not happening then. (My version is a bit more careful, but it still doesn't disable interrupts. It establishes error bounds provided interrupts are shorter than the i8254 wrap period.) If the i8254 is virtual, then even disabling interrupts on the target wouldn't help, since the disabling would only be virtual. Bruce From owner-svn-src-head@freebsd.org Thu Mar 24 20:52:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59536ADC838; Thu, 24 Mar 2016 20:52:37 +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 16625101E; Thu, 24 Mar 2016 20:52:37 +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 u2OKqaLs048853; Thu, 24 Mar 2016 20:52:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OKqZTZ048849; Thu, 24 Mar 2016 20:52:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603242052.u2OKqZTZ048849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 24 Mar 2016 20:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297243 - in head: share/man/man4 sys/amd64/conf sys/dev/wbwd sys/i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:52:37 -0000 Author: mav Date: Thu Mar 24 20:52:35 2016 New Revision: 297243 URL: https://svnweb.freebsd.org/changeset/base/297243 Log: Polish wbwd(4) driver and add more supported chips. MFC after: 1 month Modified: head/share/man/man4/wbwd.4 head/sys/amd64/conf/GENERIC.hints head/sys/dev/wbwd/wbwd.c head/sys/i386/conf/GENERIC.hints Modified: head/share/man/man4/wbwd.4 ============================================================================== --- head/share/man/man4/wbwd.4 Thu Mar 24 20:13:17 2016 (r297242) +++ head/share/man/man4/wbwd.4 Thu Mar 24 20:52:35 2016 (r297243) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2012 +.Dd March 24, 2016 .Dt WBWD 4 .Os .Sh NAME .Nm wbwd -.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Nd device driver for Winbond/Nuvoton Super I/O chips watchdog timer .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: @@ -50,18 +50,51 @@ The driver provides .Xr watchdog 4 support for the watchdog interrupt timer present on at least the following -Winbond Super I/O chips: -.Pp +Super I/O chips: .Bl -bullet -compact .It -83627HF/F/HG/G Rev. G +Winbond 83627HF/F/HG/G +.It +Winbond 83627S +.It +Winbond 83697HF +.It +Winbond 83697UG +.It +Winbond 83637HF +.It +Winbond 83627THF +.It +Winbond 83687THF +.It +Winbond 83627EHF +.It +Winbond 83627DHG .It -83627HF/F/HG/G Rev. J +Winbond 83627UHG .It -83627HF/F/HG/G Rev. UD-A +Winbond 83667HG .It -83627DHG IC ver. 5 +Winbond 83627DHG-P +.It +Winbond 83667HG-B +.It +Nuvoton NCT6775 +.It +Nuvoton NCT6776 +.It +Nuvoton NCT6102 +.It +Nuvoton NCT6779 +.It +Nuvoton NCT6791 +.It +Nuvoton NCT6792 .El +.Pp +Driver may be forced to attach to unknown chips by adding to +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" .Sh SYSCTL VARIABLES The .Nm Modified: head/sys/amd64/conf/GENERIC.hints ============================================================================== --- head/sys/amd64/conf/GENERIC.hints Thu Mar 24 20:13:17 2016 (r297242) +++ head/sys/amd64/conf/GENERIC.hints Thu Mar 24 20:52:35 2016 (r297243) @@ -30,6 +30,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Thu Mar 24 20:13:17 2016 (r297242) +++ head/sys/dev/wbwd/wbwd.c Thu Mar 24 20:52:35 2016 (r297243) @@ -91,8 +91,11 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF7_FORCE 0x20 /* 1: force timeout (self-clear) */ #define WB_LDN8_CRF7_TS 0x10 /* 0: counting, 1: fired */ #define WB_LDN8_CRF7_IRQS 0x0f /* irq source for watchdog, 2 == SMI */ -#define WB_LDN8_CRF7_CLEAR_MASK \ - (WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_KEYB|WB_LDN8_CRF7_TS|WB_LDN8_CRF7_IRQS) + +enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf, + w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, + w83627dhg_p, w83667hg_b, nct6775, nct6776, nct6779, nct6791, + nct6792, nct6102 }; struct wb_softc { device_t dev; @@ -103,6 +106,10 @@ struct wb_softc { eventhandler_tag ev_tag; int (*ext_cfg_enter_f)(struct wb_softc *, u_short); void (*ext_cfg_exit_f)(struct wb_softc *, u_short); + enum chips chip; + uint8_t ctl_reg; + uint8_t time_reg; + uint8_t csr_reg; int debug_verbose; /* @@ -144,46 +151,104 @@ struct winbond_superio_cfg { }; struct winbond_vendor_device_id { - uint16_t vendor_id; uint8_t device_id; - uint8_t device_rev; + enum chips chip; const char * descr; } wb_devs[] = { { - .vendor_id = 0x5ca3, .device_id = 0x52, - .device_rev = 0x17, - .descr = "Winbond 83627HF/F/HG/G Rev. G", + .chip = w83627hf, + .descr = "Winbond 83627HF/F/HG/G", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x3a, - .descr = "Winbond 83627HF/F/HG/G Rev. J", + .device_id = 0x59, + .chip = w83627s, + .descr = "Winbond 83627S", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x41, - .descr = "Winbond 83627HF/F/HG/G Rev. UD-A", + .device_id = 0x60, + .chip = w83697hf, + .descr = "Winbond 83697HF", + }, + { + .device_id = 0x68, + .chip = w83697ug, + .descr = "Winbond 83697UG", + }, + { + .device_id = 0x70, + .chip = w83637hf, + .descr = "Winbond 83637HF", + }, + { + .device_id = 0x82, + .chip = w83627thf, + .descr = "Winbond 83627THF", + }, + { + .device_id = 0x85, + .chip = w83687thf, + .descr = "Winbond 83687THF", + }, + { + .device_id = 0x88, + .chip = w83627ehf, + .descr = "Winbond 83627EHF", }, { - .vendor_id = 0x5ca3, .device_id = 0xa0, - .device_rev = 0x25, - .descr = "Winbond 83627DHG IC ver. 5", + .chip = w83627dhg, + .descr = "Winbond 83627DHG", + }, + { + .device_id = 0xa2, + .chip = w83627uhg, + .descr = "Winbond 83627UHG", + }, + { + .device_id = 0xa5, + .chip = w83667hg, + .descr = "Winbond 83667HG", }, { - .vendor_id = 0x5ca3, .device_id = 0xb0, - .device_rev = 0x73, - .descr = "Winbond 83627DHG-P", + .chip = w83627dhg_p, + .descr = "Winbond 83627DHG-P", + }, + { + .device_id = 0xb3, + .chip = w83667hg_b, + .descr = "Winbond 83667HG-B", + }, + { + .device_id = 0xb4, + .chip = nct6775, + .descr = "Nuvoton NCT6775", }, { - .vendor_id = 0x5ca3, .device_id = 0xc3, - .device_rev = 0x33, - .descr = "Nuvoton WPCM450RA0BX", + .chip = nct6776, + .descr = "Nuvoton NCT6776", + }, + { + .device_id = 0xc4, + .chip = nct6102, + .descr = "Nuvoton NCT6102", + }, + { + .device_id = 0xc5, + .chip = nct6779, + .descr = "Nuvoton NCT6779", + }, + { + .device_id = 0xc8, + .chip = nct6791, + .descr = "Nuvoton NCT6791", + }, + { + .device_id = 0xc9, + .chip = nct6792, + .descr = "Nuvoton NCT6792", }, }; @@ -231,6 +296,22 @@ read_efdr_1(struct wb_softc *sc, u_short return (inb(baseport + 1)); } +static void +write_reg(struct wb_softc *sc, uint8_t reg, uint8_t value) +{ + + write_efir_1(sc, 0, reg); + write_efdr_1(sc, 0, value); +} + +static uint8_t +read_reg(struct wb_softc *sc, uint8_t reg) +{ + + write_efir_1(sc, 0, reg); + return (read_efdr_1(sc, 0)); +} + /* * Return the watchdog related registers as we last read them. This will * usually not give the current timeout or state on whether the watchdog @@ -248,9 +329,9 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&sb, NULL, 64, req); sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); - sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); - sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); - sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->ctl_reg, sc->reg_1); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->time_reg, sc->reg_timeout); + sbuf_printf(&sb, "CR%02X 0x%02x", sc->csr_reg, sc->reg_2); error = sbuf_finish(&sb); sbuf_delete(&sb); @@ -269,23 +350,17 @@ sysctl_wb_debug_current(SYSCTL_HANDLER_A sc = arg1; - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); + + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + (*sc->ext_cfg_exit_f)(sc, 0); return (sysctl_wb_debug(oidp, arg1, arg2, req)); } @@ -326,10 +401,6 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ } #endif - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); @@ -343,16 +414,14 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ #endif /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Force watchdog to fire. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); sc->reg_2 |= WB_LDN8_CRF7_FORCE; + write_reg(sc, sc->csr_reg, sc->reg_2); - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); return (0); } @@ -414,30 +483,36 @@ static int wb_set_watchdog(struct wb_softc *sc, unsigned int timeout) { + if (timeout != 0) { + /* + * In case an override is set, let it override. It may lead + * to strange results as we do not check the input of the sysctl. + */ + if (sc->timeout_override > 0) + timeout = sc->timeout_override; + + /* Make sure we support the requested timeout. */ + if (timeout > 255 * 60) + return (EINVAL); + } + if (sc->debug_verbose) wb_print_state(sc, "Before watchdog counter (re)load"); - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Disable and validate or arm/reset watchdog. */ if (timeout == 0) { /* Disable watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, 0x00); + write_reg(sc, sc->time_reg, 0x00); + sc->reg_timeout = read_reg(sc, sc->time_reg); + (*sc->ext_cfg_exit_f)(sc, 0); /* Re-check. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - if (sc->reg_timeout != 0x00) { device_printf(sc->dev, "Failed to disable watchdog: " "0x%02x.\n", sc->reg_timeout); @@ -445,20 +520,8 @@ wb_set_watchdog(struct wb_softc *sc, uns } } else { - /* - * In case an override is set, let it override. It may lead - * to strange results as we do not check the input of the sysctl. - */ - if (sc->timeout_override > 0) - timeout = sc->timeout_override; - - /* Make sure we support the requested timeout. */ - if (timeout > 255 * 60) - return (EINVAL); - /* Read current scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); if (timeout > 255) { /* Set scaling factor to 60s. */ @@ -473,21 +536,18 @@ wb_set_watchdog(struct wb_softc *sc, uns } /* In case we fired before we need to clear to fire again. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); if (sc->reg_2 & WB_LDN8_CRF7_TS) { sc->reg_2 &= ~WB_LDN8_CRF7_TS; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + write_reg(sc, sc->csr_reg, sc->reg_2); } /* Write back scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + write_reg(sc, sc->ctl_reg, sc->reg_1); /* Set timer and arm/reset the watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, sc->reg_timeout); + write_reg(sc, sc->time_reg, sc->reg_timeout); + (*sc->ext_cfg_exit_f)(sc, 0); } if (sc->debug_verbose) @@ -556,6 +616,7 @@ wb_probe_enable(device_t dev, int probe) struct wb_softc *sc; int error, found, i, j; uint8_t dev_id, dev_rev, cr26; + char buf[128]; if (dev == NULL) sc = NULL; @@ -566,6 +627,7 @@ wb_probe_enable(device_t dev, int probe) } error = ENXIO; + found = 0; for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { if (sc != NULL) { @@ -578,7 +640,6 @@ wb_probe_enable(device_t dev, int probe) sc->bsh = rman_get_bushandle(sc->portres); } - found = 0; error = (*probe_addrs[i].ext_cfg_enter_f)(sc, probe_addrs[i].efer); if (error != 0) goto cleanup; @@ -591,6 +652,9 @@ wb_probe_enable(device_t dev, int probe) write_efir_1(sc, probe_addrs[i].efer, WB_CR26); cr26 = read_efdr_1(sc, probe_addrs[i].efer); + if (dev_id == 0xff && dev_rev == 0xff) + goto cleanup; + /* HEFRAS of 0 means EFER at 0x2e, 1 means EFER at 0x4e. */ if (((cr26 & 0x40) == 0x00 && probe_addrs[i].efer != 0x2e) || ((cr26 & 0x40) == 0x40 && probe_addrs[i].efer != 0x4e)) { @@ -602,36 +666,30 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } - if (dev_id == 0xff && dev_rev == 0xff) - goto cleanup; - for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { - if (wb_devs[j].device_id == dev_id && - wb_devs[j].device_rev == dev_rev) { - if (probe && dev != NULL) - device_set_desc(dev, wb_devs[j].descr); - found++; + if (wb_devs[j].device_id == dev_id) { + found = 1; break; } } - if (!found) { - if (probe && dev != NULL) { - device_set_desc(dev, "Unknown Winbond/Nuvoton model"); - device_printf(dev, "DevID 0x%02x DevRev 0x%02x, " - "please report this.\n", dev_id, dev_rev); - } - found++; + if (probe && dev != NULL) { + snprintf(buf, sizeof(buf), + "%s (0x%02x/0x%02x) Watchdog Timer", + found ? wb_devs[j].descr : + "Unknown Winbond/Nuvoton", dev_id, dev_rev); + device_set_desc_copy(dev, buf); + } + + /* If this is hinted attach, try to guess the model. */ + if (dev != NULL && !found) { + found = 1; + j = 0; } - if (probe && found && bootverbose && dev != NULL) - device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" - " CR26 0x%02x (probing)\n", device_get_desc(dev), - probe_addrs[i].efer, dev_id, dev_rev, cr26); cleanup: if (probe || !found) { (*probe_addrs[i].ext_cfg_exit_f)(sc, probe_addrs[i].efer); - if (sc != NULL) (void) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); @@ -646,9 +704,21 @@ cleanup: if (sc != NULL) { sc->ext_cfg_enter_f = probe_addrs[i].ext_cfg_enter_f; sc->ext_cfg_exit_f = probe_addrs[i].ext_cfg_exit_f; + sc->chip = wb_devs[j].chip; + sc->ctl_reg = 0xf5; + sc->time_reg = 0xf6; + sc->csr_reg = 0xf7; + if (sc->chip == w83697hf || + sc->chip == w83697ug) { + sc->ctl_reg = 0xf3; + sc->time_reg = 0xf4; + } else if (sc->chip == nct6102) { + sc->ctl_reg = 0xf0; + sc->time_reg = 0xf1; + sc->csr_reg = 0xf2; + } } - error = BUS_PROBE_DEFAULT; - break; + return (BUS_PROBE_SPECIFIC); } else error = ENXIO; } @@ -659,15 +729,10 @@ cleanup: static void wb_identify(driver_t *driver, device_t parent) { - device_t dev; - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) { - if (wb_probe_enable(dev, 1) != BUS_PROBE_DEFAULT) { - if (bootverbose) - device_printf(dev, "can not find compatible Winbond chip.\n"); - } else - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); - return; + if (device_find_child(parent, driver->name, 0) == NULL) { + if (wb_probe_enable(NULL, 1) <= 0) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } } @@ -690,6 +755,7 @@ wb_attach(device_t dev) struct sysctl_oid *soid; unsigned long timeout; int error; + uint8_t t; error = wb_probe_enable(dev, 0); if (error > 0) @@ -700,37 +766,95 @@ wb_attach(device_t dev) ("%s: successfull probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); - /* Make sure LDN8 is enabled (Do we need to? Also affects GPIO). */ - write_efir_1(sc, 0, WB_LDN8_CR30); - write_efdr_1(sc, 0, WB_LDN8_CR30_ACTIVE); + /* Make sure WDT is enabled. */ + write_reg(sc, WB_LDN8_CR30, + read_reg(sc, WB_LDN8_CR30) | WB_LDN8_CR30_ACTIVE); + + switch (sc->chip) { + case w83627hf: + case w83627s: + t = read_reg(sc, 0x2B) & ~0x10; + write_reg(sc, 0x2B, t); /* set GPIO24 to WDT0 */ + break; + case w83697hf: + /* Set pin 119 to WDTO# mode (= CR29, WDT0) */ + t = read_reg(sc, 0x29) & ~0x60; + t |= 0x20; + write_reg(sc, 0x29, t); + break; + case w83697ug: + /* Set pin 118 to WDTO# mode */ + t = read_reg(sc, 0x2b) & ~0x04; + write_reg(sc, 0x2b, t); + break; + case w83627thf: + t = (read_reg(sc, 0x2B) & ~0x08) | 0x04; + write_reg(sc, 0x2B, t); /* set GPIO3 to WDT0 */ + break; + case w83627dhg: + case w83627dhg_p: + t = read_reg(sc, 0x2D) & ~0x01; /* PIN77 -> WDT0# */ + write_reg(sc, 0x2D, t); /* set GPIO5 to WDT0 */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + case w83637hf: + break; + case w83687thf: + t = read_reg(sc, 0x2C) & ~0x80; /* PIN47 -> WDT0# */ + write_reg(sc, 0x2C, t); + break; + case w83627ehf: + case w83627uhg: + case w83667hg: + case w83667hg_b: + case nct6775: + case nct6776: + case nct6779: + case nct6791: + case nct6792: + case nct6102: + /* + * These chips have a fixed WDTO# output pin (W83627UHG), + * or support more than one WDTO# output pin. + * Don't touch its configuration, and hope the BIOS + * does the right thing. + */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + default: + break; + } /* Read the current watchdog configuration. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); /* Print current state if bootverbose or watchdog already enabled. */ if (bootverbose || (sc->reg_timeout > 0x00)) wb_print_state(sc, "Before watchdog attach"); + sc->reg_1 &= ~WB_LDN8_CRF5_KEYB_P20; + sc->reg_1 |= WB_LDN8_CRF5_KBRST; + write_reg(sc, sc->ctl_reg, sc->reg_1); + /* - * Clear a previous watchdog timeout event (if (still) set). - * Disable all all interrupt reset sources (defaults). + * Clear a previous watchdog timeout event (if still set). + * Disable timer reset on mouse interrupts. Leave reset on keyboard, + * since one of my boards is getting stuck in reboot without it. */ - sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); - sc->reg_1 |= WB_LDN8_CRF5_KBRST; - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + sc->reg_2 &= ~(WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_TS); + write_reg(sc, sc->csr_reg, sc->reg_2); - sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); /* Read global timeout override tunable, Add per device sysctls. */ if (TUNABLE_ULONG_FETCH("hw.wbwd.timeout_override", &timeout)) { Modified: head/sys/i386/conf/GENERIC.hints ============================================================================== --- head/sys/i386/conf/GENERIC.hints Thu Mar 24 20:13:17 2016 (r297242) +++ head/sys/i386/conf/GENERIC.hints Thu Mar 24 20:52:35 2016 (r297243) @@ -38,6 +38,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" From owner-svn-src-head@freebsd.org Thu Mar 24 20:55:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF515ADC99B; Thu, 24 Mar 2016 20:55:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C94C1298; Thu, 24 Mar 2016 20:55:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OKtNc2049132; Thu, 24 Mar 2016 20:55:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OKtNCc049131; Thu, 24 Mar 2016 20:55:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603242055.u2OKtNCc049131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 24 Mar 2016 20:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297244 - head/contrib/llvm/include/llvm/Support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:55:24 -0000 Author: dim Date: Thu Mar 24 20:55:23 2016 New Revision: 297244 URL: https://svnweb.freebsd.org/changeset/base/297244 Log: Pull in r264335 from upstream llvm trunk: Add to ThreadPool.h, since std::atomic is used Summary: Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of headers is such that it gets an error about std::atomic<> use in ThreadPool.h, since this header is not included explicitly. See also: https://llvm.org/bugs/show_bug.cgi?id=27058 Fix this by including . Patch by Bryan Drewery. Reviewers: chandlerc, joker.eph Subscribers: bdrewery, llvm-commits Differential Revision: http://reviews.llvm.org/D18460 Modified: head/contrib/llvm/include/llvm/Support/ThreadPool.h Modified: head/contrib/llvm/include/llvm/Support/ThreadPool.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/ThreadPool.h Thu Mar 24 20:52:35 2016 (r297243) +++ head/contrib/llvm/include/llvm/Support/ThreadPool.h Thu Mar 24 20:55:23 2016 (r297244) @@ -33,6 +33,7 @@ #pragma warning(pop) #endif +#include #include #include #include From owner-svn-src-head@freebsd.org Thu Mar 24 21:41:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A9CADC58A; Thu, 24 Mar 2016 21:41:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF361A21; Thu, 24 Mar 2016 21:41:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id B7239780DEC; Fri, 25 Mar 2016 08:09:08 +1100 (AEDT) Date: Fri, 25 Mar 2016 08:09:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= cc: Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297190 - head/sys/kern In-Reply-To: <20160324173359.GA1238@brick.home> Message-ID: <20160325071420.K2059@besplex.bde.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> <20160324173359.GA1238@brick.home> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=uEpLrR0XjW6-bNLhkycA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:41:23 -0000 On Thu, 24 Mar 2016, Edward Tomasz [utf-8] Napiera=C5~Ba wrote: > On 0324T1015, Warner Losh wrote: >> On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: >> >>> On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera=C5=82a wrote: >>>> On 0324T1609, Alexander Motin wrote: >>>>> On 24.03.16 15:42, Edward Tomasz Napiera=C5=82a wrote: >>>>>> On 0324T1032, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>>>>>> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: >>>>>>>>> So maybe callouts are disabled in this situation. If there >>>>>>>>> is a way to >>>>>>>>> detect that, then vt(4) can go back to a "synchronous mode" >>>>>>>>> where it >>>>>>>>> refreshes the screen after each typed character, like it >>>>>>>>> does when ddb >>>>>>>>> is active. >>>>>>>> >>>>>>>> Looks like that's the case: for some reason the callouts >>>>>>>> don't work. >>>>>>>> This trivial hack is a (mostly) working workaround: >>>>>>>> >>>>>>>> Index: svn/head/sys/kern/kern_cons.c >>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>>> =3D=3D=3D=3D=3D=3D >>>>>>>> --- svn/head/sys/kern/kern_cons.c (revision 297210) >>>>>>>> +++ svn/head/sys/kern/kern_cons.c (working copy) >>>>>>>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int >>>>>>>> visible) >>>>>>>> lp =3D cp; >>>>>>>> end =3D cp + size - 1; >>>>>>>> for (;;) { >>>>>>>> + pause("meh", 1); >>>>>>> >>>>>>> Could you please explain how this works to me? Does calling >>>>>>> pause() here >>>>>>> give a chance to interrupt handlers or other threads of >>>>>>> running? >>>>>> >>>>>> It looks like it allows the callout to run. I've did an >>>>>> experiment >>>>>> and added a simple callout that printed something each second; >>>>>> during >>>>>> the root mount prompt it doesn't get run unless you type '.', >>>>>> which >>>>>> calls pause(9). >>>>> >>>>> Kernel threads run with absolute priorities, so if somehow this >>>>> threads >>>>> happen to have higher or equal priority then callout thread, or the >>>>> kernel is built without PREEMPTION, then the last may never be >>>>> executed >>>>> until this thread get to sleep or at least call sched_yield(). >>>> >>>> The callout's td_priority seems to be 40; the thread running the >>>> prompt >>>> is 84, so it's lower. >>>> >>>> I've just noticed another curious thing, though: when you press >>>> ScrLk, >>>> the screen gets immediately refreshed; also, pressing arrows works >>>> just >>>> the way it should. In other words, the refresh is broken except for >>>> the ScrlLk mode, where it works as it should. >>> >>> Since cngets() is used only by the mountroot prompt and the geli pw >>> entry, pausing/yielding within the input loop seems like a good idea. >>> It would allow for things like plugging in a usb device and having it >>> actually appear without having to enter a '.' several times. >>> >>> It would be nice if the pause were done with pause_sbt() and a shorter >>> timeout, maybe a millisecond or even 100uS. Otherwise things like >>> pasting text at that prompt in a serial console is likely to drop >>> chars. >>> >>> Hmmm... speaking of the geli pw prompt... what's the locking situation >>> there? Will there be any problems calling pause() from that context? >> >> PVM isn't an ideal priority to wait at. PWAIT would be better. However, >> if the only reason to call pause is run the scheduler after each charact= er, >> perhaps a better solution would be to call kern_yield() instead? We coul= d >> do that instead of cpu_waitspin() inside of cngetc, but that would break >> the debugger's use of it.... Console drivers can't block or depend on timeouts. Perhaps cngets() can, because it is only called in simple contexts, but the simple contexts make it especially easy for it to work using the same synchronous i/o that is needed in more complicated contexts. > I think we should first try to figure out why this doesn't work in the fi= rst > place. > > Basically, even though the interrupts are running, scheduler seems to be = ok, > and the thread that's calling this has a lower priority than the callouts > thread, it can't be preempted. This doesn't seem to be caused by vt(4); > with syscons the callouts don't get called either (it just doesn't break > the echo in this case). To demonstrate the problem you can add add > a callout that calls printf each second and then does an infinite loop. cngets() is even correctly wrapped by cngrab()/cnungrab(). This is suppose= d to put the console driver in a special synchronous mode for the duration of the grabbing. (Console drivers still need to be reentrant, so that they can do i/o when the grabbed section is reentered for ddb or another non-maskable trap.) syscons and vt have similar too-simple grab handlers which start with a screen switch in the !cold case. This should refresh the screen and/or switch it to special low-level console screen(s). Screen switching in ddb is noticeably more broken for vt than for syscons. Indeed, it just doesn't work in vt (except for the initial switch to vty0). This might be related. Bruce From owner-svn-src-head@freebsd.org Thu Mar 24 21:47:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB5F2ADC6D1; Thu, 24 Mar 2016 21:47:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623141E71; Thu, 24 Mar 2016 21:47:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLlHP3064607; Thu, 24 Mar 2016 21:47:17 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLlFNo064585; Thu, 24 Mar 2016 21:47:15 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603242147.u2OLlFNo064585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 24 Mar 2016 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297247 - in head: lib/libsysdecode sys/compat/cloudabi sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:47:18 -0000 Author: ed Date: Thu Mar 24 21:47:15 2016 New Revision: 297247 URL: https://svnweb.freebsd.org/changeset/base/297247 Log: Replace the CloudABI system call table by a machine generated version. The type definitions and constants that were used by COMPAT_CLOUDABI64 are a literal copy of some headers stored inside of CloudABI's C library, cloudlibc. What is annoying is that we can't make use of cloudlibc's system call list, as the format is completely different and doesn't provide enough information. It had to be synced in manually. We recently decided to solve this (and some other problems) by moving the ABI definitions into a separate file: https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt This file is processed by a pile of Python scripts to generate the header files like before, documentation (markdown), but in our case more importantly: a FreeBSD system call table. This change discards the old files in sys/contrib/cloudabi and replaces them by the latest copies, which requires some minor changes here and there. Because cloudabi.txt also enforces consistent names of the system call arguments, we have to patch up a small number of system call implementations to use the new argument names. The new header files can also be included directly in FreeBSD kernel space without needing any includes/defines, so we can now remove cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the sources to include the definitions directly from sys/contrib/cloudabi instead. Added: head/sys/contrib/cloudabi/cloudabi64_types.h (contents, props changed) head/sys/contrib/cloudabi/cloudabi_types_common.h (contents, props changed) head/sys/contrib/cloudabi/syscalls.master Deleted: head/sys/compat/cloudabi/cloudabi_syscalldefs.h head/sys/compat/cloudabi64/cloudabi64_syscalldefs.h head/sys/compat/cloudabi64/syscalls.master head/sys/contrib/cloudabi/syscalldefs_md.h head/sys/contrib/cloudabi/syscalldefs_mi.h Modified: head/lib/libsysdecode/errno.c head/sys/compat/cloudabi/cloudabi_clock.c head/sys/compat/cloudabi/cloudabi_errno.c head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_file.c head/sys/compat/cloudabi/cloudabi_futex.c head/sys/compat/cloudabi/cloudabi_mem.c head/sys/compat/cloudabi/cloudabi_proc.c head/sys/compat/cloudabi/cloudabi_proto.h head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi/cloudabi_thread.c head/sys/compat/cloudabi/cloudabi_util.h head/sys/compat/cloudabi64/Makefile head/sys/compat/cloudabi64/cloudabi64_fd.c head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/cloudabi64_sock.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_thread.c head/sys/compat/cloudabi64/cloudabi64_util.h head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/errno.c ============================================================================== --- head/lib/libsysdecode/errno.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/lib/libsysdecode/errno.c Thu Mar 24 21:47:15 2016 (r297247) @@ -56,7 +56,7 @@ static int bsd_to_linux_errno[ELAST + 1] #endif #if defined(__aarch64__) || defined(__amd64__) -#include +#include static const int cloudabi_errno_table[] = { [CLOUDABI_E2BIG] = E2BIG, Modified: head/sys/compat/cloudabi/cloudabi_clock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_clock.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_clock.c Thu Mar 24 21:47:15 2016 (r297247) @@ -31,8 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include /* Converts a CloudABI clock ID to a FreeBSD clock ID. */ Modified: head/sys/compat/cloudabi/cloudabi_errno.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_errno.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_errno.c Thu Mar 24 21:47:15 2016 (r297247) @@ -28,7 +28,8 @@ __FBSDID("$FreeBSD$"); #include -#include +#include + #include /* Converts a FreeBSD errno to a CloudABI errno. */ Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_fd.c Thu Mar 24 21:47:15 2016 (r297247) @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include /* Translation between CloudABI and Capsicum rights. */ Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_file.c Thu Mar 24 21:47:15 2016 (r297247) @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include #include @@ -185,8 +186,8 @@ cloudabi_sys_file_link(struct thread *td return (error); } - error = kern_linkat(td, uap->fd1, uap->fd2, path1, path2, - UIO_SYSSPACE, (uap->fd1 & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ? + error = kern_linkat(td, uap->fd1.fd, uap->fd2, path1, path2, + UIO_SYSSPACE, (uap->fd1.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) ? FOLLOW : NOFOLLOW); cloudabi_freestr(path1); cloudabi_freestr(path2); @@ -248,7 +249,7 @@ cloudabi_sys_file_open(struct thread *td fflags |= O_SYNC; cap_rights_set(&rights, CAP_FSYNC); } - if ((uap->fd & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) == 0) + if ((uap->dirfd.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) == 0) fflags |= O_NOFOLLOW; if (write && (fflags & (O_APPEND | O_TRUNC)) == 0) cap_rights_set(&rights, CAP_SEEK); @@ -265,7 +266,7 @@ cloudabi_sys_file_open(struct thread *td fdrop(fp, td); return (error); } - NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, uap->fd, + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, uap->dirfd.fd, &rights, td); error = vn_open(&nd, &fflags, 0777 & ~td->td_proc->p_fd->fd_cmask, fp); cloudabi_freestr(path); @@ -657,8 +658,8 @@ cloudabi_sys_file_stat_get(struct thread return (error); error = kern_statat(td, - (uap->fd & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ? 0 : - AT_SYMLINK_NOFOLLOW, uap->fd, path, UIO_SYSSPACE, &sb, NULL); + (uap->fd.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ? 0 : + AT_SYMLINK_NOFOLLOW, uap->fd.fd, path, UIO_SYSSPACE, &sb, NULL); cloudabi_freestr(path); if (error != 0) return (error); @@ -711,8 +712,8 @@ cloudabi_sys_file_stat_put(struct thread return (error); convert_utimens_arguments(&fs, uap->flags, ts); - error = kern_utimensat(td, uap->fd, path, UIO_SYSSPACE, ts, - UIO_SYSSPACE, (uap->fd & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ? + error = kern_utimensat(td, uap->fd.fd, path, UIO_SYSSPACE, ts, + UIO_SYSSPACE, (uap->fd.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) ? 0 : AT_SYMLINK_NOFOLLOW); cloudabi_freestr(path); return (error); @@ -751,7 +752,7 @@ cloudabi_sys_file_unlink(struct thread * if (error != 0) return (error); - if (uap->flag & CLOUDABI_UNLINK_REMOVEDIR) + if (uap->flags & CLOUDABI_UNLINK_REMOVEDIR) error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE); else error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0); Modified: head/sys/compat/cloudabi/cloudabi_futex.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_futex.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_futex.c Thu Mar 24 21:47:15 2016 (r297247) @@ -37,8 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include /* Modified: head/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_mem.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_mem.c Thu Mar 24 21:47:15 2016 (r297247) @@ -30,8 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include /* Converts CloudABI's memory protection flags to FreeBSD's. */ static int Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_proc.c Thu Mar 24 21:47:15 2016 (r297247) @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include int cloudabi_sys_proc_exec(struct thread *td, Modified: head/sys/compat/cloudabi/cloudabi_proto.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proto.h Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_proto.h Thu Mar 24 21:47:15 2016 (r297247) @@ -30,5 +30,7 @@ * calls. Unfortunately, we don't have a separate system call table for * those, so rely on the system call table from COMPAT_CLOUDABI64. */ -#include + +#include + #include Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_sock.c Thu Mar 24 21:47:15 2016 (r297247) @@ -43,8 +43,9 @@ __FBSDID("$FreeBSD$"); #include +#include + #include -#include #include /* Converts FreeBSD's struct sockaddr to CloudABI's cloudabi_sockaddr_t. */ @@ -117,12 +118,12 @@ cloudabi_sys_sock_accept(struct thread * if (uap->buf == NULL) { /* Only return the new file descriptor number. */ - return (kern_accept(td, uap->s, NULL, NULL, NULL)); + return (kern_accept(td, uap->sock, NULL, NULL, NULL)); } else { /* Also return properties of the new socket descriptor. */ sal = MAX(sizeof(struct sockaddr_in), sizeof(struct sockaddr_in6)); - error = kern_accept(td, uap->s, (void *)&sa, &sal, NULL); + error = kern_accept(td, uap->sock, (void *)&sa, &sal, NULL); if (error != 0) return (error); @@ -143,7 +144,7 @@ cloudabi_sys_sock_bind(struct thread *td error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); if (error != 0) return (error); - return (kern_bindat(td, uap->fd, uap->s, (struct sockaddr *)&sun)); + return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun)); } int @@ -156,7 +157,8 @@ cloudabi_sys_sock_connect(struct thread error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); if (error != 0) return (error); - return (kern_connectat(td, uap->fd, uap->s, (struct sockaddr *)&sun)); + return (kern_connectat(td, uap->fd, uap->sock, + (struct sockaddr *)&sun)); } int @@ -164,7 +166,7 @@ cloudabi_sys_sock_listen(struct thread * struct cloudabi_sys_sock_listen_args *uap) { struct listen_args listen_args = { - .s = uap->s, + .s = uap->sock, .backlog = uap->backlog, }; @@ -176,7 +178,7 @@ cloudabi_sys_sock_shutdown(struct thread struct cloudabi_sys_sock_shutdown_args *uap) { struct shutdown_args shutdown_args = { - .s = uap->fd, + .s = uap->sock, }; switch (uap->how) { @@ -207,7 +209,7 @@ cloudabi_sys_sock_stat_get(struct thread struct socket *so; int error; - error = getsock_cap(td, uap->fd, cap_rights_init(&rights, + error = getsock_cap(td, uap->sock, cap_rights_init(&rights, CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp, NULL); if (error != 0) return (error); @@ -243,7 +245,7 @@ cloudabi_sys_sock_stat_get(struct thread /* Set ss_state. */ if ((so->so_options & SO_ACCEPTCONN) != 0) - ss.ss_state |= CLOUDABI_SOCKSTAT_ACCEPTCONN; + ss.ss_state |= CLOUDABI_SOCKSTATE_ACCEPTCONN; fdrop(fp, td); return (copyout(&ss, uap->buf, sizeof(ss))); Modified: head/sys/compat/cloudabi/cloudabi_thread.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_thread.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_thread.c Thu Mar 24 21:47:15 2016 (r297247) @@ -31,8 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include int cloudabi_sys_thread_exit(struct thread *td, Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi/cloudabi_util.h Thu Mar 24 21:47:15 2016 (r297247) @@ -30,7 +30,7 @@ #include -#include +#include struct file; struct thread; Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/Makefile Thu Mar 24 21:47:15 2016 (r297247) @@ -8,5 +8,7 @@ sysent: cloudabi64_sysent.c cloudabi64_s cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + syscalls.conf + sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + syscalls.conf Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_fd.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_fd.c Thu Mar 24 21:47:15 2016 (r297247) @@ -34,7 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include /* Copies in 64-bit iovec structures from userspace. */ Modified: head/sys/compat/cloudabi64/cloudabi64_module.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_module.c Thu Mar 24 21:47:15 2016 (r297247) @@ -36,7 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include register_t * Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Thu Mar 24 21:47:15 2016 (r297247) @@ -30,9 +30,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include /* Converts a FreeBSD signal number to a CloudABI signal number. */ @@ -248,7 +249,7 @@ cloudabi64_sys_poll(struct thread *td, s * Bandaid to support CloudABI futex constructs that are not * implemented through FreeBSD's kqueue(). */ - if (uap->nevents == 1) { + if (uap->nsubscriptions == 1) { cloudabi64_subscription_t sub; cloudabi64_event_t ev = {}; int error; @@ -291,7 +292,7 @@ cloudabi64_sys_poll(struct thread *td, s td->td_retval[0] = 1; return (copyout(&ev, uap->out, sizeof(ev))); } - } else if (uap->nevents == 2) { + } else if (uap->nsubscriptions == 2) { cloudabi64_subscription_t sub[2]; cloudabi64_event_t ev[2] = {}; int error; @@ -365,7 +366,7 @@ cloudabi64_sys_poll(struct thread *td, s } } - return (kern_kevent_anonymous(td, uap->nevents, ©ops)); + return (kern_kevent_anonymous(td, uap->nsubscriptions, ©ops)); } int Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sock.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_sock.c Thu Mar 24 21:47:15 2016 (r297247) @@ -35,9 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include -#include #include static MALLOC_DEFINE(M_SOCKET, "socket", "CloudABI socket"); @@ -82,7 +83,7 @@ cloudabi64_sys_sock_recv(struct thread * msghdr.msg_flags |= MSG_WAITALL; /* TODO(ed): Add file descriptor passing. */ - error = kern_recvit(td, uap->s, &msghdr, UIO_SYSSPACE, NULL); + error = kern_recvit(td, uap->sock, &msghdr, UIO_SYSSPACE, NULL); free(msghdr.msg_iov, M_SOCKET); if (error != 0) return (error); @@ -132,7 +133,7 @@ cloudabi64_sys_sock_send(struct thread * flags |= MSG_EOR; /* TODO(ed): Add file descriptor passing. */ - error = kern_sendit(td, uap->s, &msghdr, flags, NULL, UIO_USERSPACE); + error = kern_sendit(td, uap->sock, &msghdr, flags, NULL, UIO_USERSPACE); free(msghdr.msg_iov, M_SOCKET); if (error != 0) return (error); Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Mar 24 21:47:15 2016 (r297247) @@ -75,7 +75,7 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_fd_pread_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */ - iarg[2] = p->iovcnt; /* cloudabi64_size_t */ + uarg[2] = p->iovcnt; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -85,7 +85,7 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_fd_pwrite_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */ - iarg[2] = p->iovcnt; /* cloudabi64_size_t */ + uarg[2] = p->iovcnt; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -95,7 +95,7 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_fd_read_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */ - iarg[2] = p->iovcnt; /* cloudabi64_size_t */ + uarg[2] = p->iovcnt; /* size_t */ *n_args = 3; break; } @@ -145,7 +145,7 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_fd_write_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */ - iarg[2] = p->iovcnt; /* cloudabi64_size_t */ + uarg[2] = p->iovcnt; /* size_t */ *n_args = 3; break; } @@ -193,7 +193,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_file_open */ case 21: { struct cloudabi_sys_file_open_args *p = params; - iarg[0] = p->fd; /* cloudabi_lookup_t */ + iarg[0] = p->dirfd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->pathlen; /* size_t */ iarg[3] = p->oflags; /* cloudabi_oflags_t */ @@ -217,7 +217,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->pathlen; /* size_t */ - uarg[3] = (intptr_t) p->buf; /* void * */ + uarg[3] = (intptr_t) p->buf; /* char * */ uarg[4] = p->bufsize; /* size_t */ *n_args = 5; break; @@ -289,7 +289,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->pathlen; /* size_t */ - iarg[3] = p->flag; /* cloudabi_ulflags_t */ + iarg[3] = p->flags; /* cloudabi_ulflags_t */ *n_args = 4; break; } @@ -369,7 +369,7 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ uarg[1] = (intptr_t) p->out; /* cloudabi64_event_t * */ - iarg[2] = p->nevents; /* cloudabi64_size_t */ + uarg[2] = p->nsubscriptions; /* size_t */ *n_args = 3; break; } @@ -414,7 +414,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_accept */ case 45: { struct cloudabi_sys_sock_accept_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ *n_args = 2; break; @@ -422,7 +422,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_bind */ case 46: { struct cloudabi_sys_sock_bind_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ uarg[2] = (intptr_t) p->path; /* const char * */ uarg[3] = p->pathlen; /* size_t */ @@ -432,7 +432,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_connect */ case 47: { struct cloudabi_sys_sock_connect_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ uarg[2] = (intptr_t) p->path; /* const char * */ uarg[3] = p->pathlen; /* size_t */ @@ -442,7 +442,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_listen */ case 48: { struct cloudabi_sys_sock_listen_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->backlog; /* cloudabi_backlog_t */ *n_args = 2; break; @@ -450,7 +450,7 @@ systrace_args(int sysnum, void *params, /* cloudabi64_sys_sock_recv */ case 49: { struct cloudabi64_sys_sock_recv_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi64_recv_out_t * */ *n_args = 3; @@ -459,7 +459,7 @@ systrace_args(int sysnum, void *params, /* cloudabi64_sys_sock_send */ case 50: { struct cloudabi64_sys_sock_send_args *p = params; - iarg[0] = p->s; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi64_send_out_t * */ *n_args = 3; @@ -468,7 +468,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_shutdown */ case 51: { struct cloudabi_sys_sock_shutdown_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ *n_args = 2; break; @@ -476,7 +476,7 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_sock_stat_get */ case 52: { struct cloudabi_sys_sock_stat_get_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ + iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ iarg[2] = p->flags; /* cloudabi_ssflags_t */ *n_args = 3; @@ -514,9 +514,9 @@ systrace_args(int sysnum, void *params, struct cloudabi64_sys_poll_fd_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - iarg[2] = p->nin; /* cloudabi64_size_t */ + uarg[2] = p->nin; /* size_t */ uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ - iarg[4] = p->nout; /* cloudabi64_size_t */ + uarg[4] = p->nout; /* size_t */ uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ *n_args = 6; break; @@ -630,7 +630,7 @@ systrace_entry_setargdesc(int sysnum, in p = "const cloudabi64_iovec_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; @@ -649,7 +649,7 @@ systrace_entry_setargdesc(int sysnum, in p = "const cloudabi64_ciovec_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; @@ -668,7 +668,7 @@ systrace_entry_setargdesc(int sysnum, in p = "const cloudabi64_iovec_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; default: break; @@ -752,7 +752,7 @@ systrace_entry_setargdesc(int sysnum, in p = "const cloudabi64_ciovec_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; default: break; @@ -891,7 +891,7 @@ systrace_entry_setargdesc(int sysnum, in p = "size_t"; break; case 3: - p = "void *"; + p = "char *"; break; case 4: p = "size_t"; @@ -1171,7 +1171,7 @@ systrace_entry_setargdesc(int sysnum, in p = "cloudabi64_event_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; default: break; @@ -1406,13 +1406,13 @@ systrace_entry_setargdesc(int sysnum, in p = "const cloudabi64_subscription_t *"; break; case 2: - p = "cloudabi64_size_t"; + p = "size_t"; break; case 3: p = "cloudabi64_event_t *"; break; case 4: - p = "cloudabi64_size_t"; + p = "size_t"; break; case 5: p = "const cloudabi64_subscription_t *"; @@ -1475,17 +1475,17 @@ systrace_return_setargdesc(int sysnum, i /* cloudabi64_sys_fd_pread */ case 8: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; /* cloudabi64_sys_fd_pwrite */ case 9: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; /* cloudabi64_sys_fd_read */ case 10: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; /* cloudabi_sys_fd_replace */ case 11: @@ -1515,7 +1515,7 @@ systrace_return_setargdesc(int sysnum, i /* cloudabi64_sys_fd_write */ case 16: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; /* cloudabi_sys_file_advise */ case 17: @@ -1630,7 +1630,7 @@ systrace_return_setargdesc(int sysnum, i /* cloudabi64_sys_poll */ case 39: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; /* cloudabi_sys_proc_exec */ case 40: @@ -1677,12 +1677,12 @@ systrace_return_setargdesc(int sysnum, i /* cloudabi64_sys_sock_recv */ case 49: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "void"; break; /* cloudabi64_sys_sock_send */ case 50: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "void"; break; /* cloudabi_sys_sock_shutdown */ case 51: @@ -1714,7 +1714,7 @@ systrace_return_setargdesc(int sysnum, i /* cloudabi64_sys_poll_fd */ case 57: if (ndx == 0 || ndx == 1) - p = "cloudabi64_size_t"; + p = "size_t"; break; default: break; Modified: head/sys/compat/cloudabi64/cloudabi64_thread.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_thread.c Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_thread.c Thu Mar 24 21:47:15 2016 (r297247) @@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #include Modified: head/sys/compat/cloudabi64/cloudabi64_util.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_util.h Thu Mar 24 21:38:52 2016 (r297246) +++ head/sys/compat/cloudabi64/cloudabi64_util.h Thu Mar 24 21:47:15 2016 (r297247) @@ -31,7 +31,7 @@ #include #include -#include +#include struct image_params; struct thread; Added: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Thu Mar 24 21:47:15 2016 (r297247) @@ -0,0 +1,222 @@ +// Copyright (c) 2016 Nuxi, https://nuxi.nl/ +// +// 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. + +// This file is automatically generated. Do not edit. +// Source: https://github.com/NuxiNL/cloudabi + +#ifndef CLOUDABI64_TYPES_H +#define CLOUDABI64_TYPES_H + +#include "cloudabi_types_common.h" + +typedef struct { + _Alignas(4) cloudabi_auxtype_t a_type; + union { + _Alignas(8) uint64_t a_val; + _Alignas(8) uint64_t a_ptr; + }; +} cloudabi64_auxv_t; +_Static_assert(offsetof(cloudabi64_auxv_t, a_type) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_auxv_t, a_val) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_auxv_t, a_ptr) == 8, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_auxv_t) == 16, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; +} cloudabi64_ciovec_t; +_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + } clock; + struct { + _Alignas(8) uint64_t condvar; + } condvar; + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(8) uint64_t lock; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; +} cloudabi64_event_t; +_Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; +} cloudabi64_iovec_t; +_Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_iovec_t) == 16, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_iovec_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t ri_data; + _Alignas(8) uint64_t ri_datalen; + _Alignas(8) uint64_t ri_fds; + _Alignas(8) uint64_t ri_fdslen; + _Alignas(2) cloudabi_msgflags_t ri_flags; +} cloudabi64_recv_in_t; +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t si_data; + _Alignas(8) uint64_t si_datalen; + _Alignas(8) uint64_t si_fds; + _Alignas(8) uint64_t si_fdslen; + _Alignas(2) cloudabi_msgflags_t si_flags; +} cloudabi64_send_in_t; +_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t so_datalen; +} cloudabi64_send_out_t; +_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_subflags_t flags; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + _Alignas(4) cloudabi_clockid_t clock_id; + _Alignas(8) cloudabi_timestamp_t timeout; + _Alignas(8) cloudabi_timestamp_t precision; + _Alignas(2) cloudabi_subclockflags_t flags; + } clock; + struct { + _Alignas(8) uint64_t condvar; + _Alignas(8) uint64_t lock; + _Alignas(1) cloudabi_mflags_t condvar_scope; + _Alignas(1) cloudabi_mflags_t lock_scope; + } condvar; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_subrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(8) uint64_t lock; + _Alignas(1) cloudabi_mflags_t lock_scope; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + } proc_terminate; + }; +} cloudabi64_subscription_t; +_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_subscription_t) == 56, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_subscription_t) == 8, "Incorrect layout"); + +typedef void cloudabi64_threadentry_t(cloudabi_tid_t tid, uint64_t aux); + +typedef struct { + _Alignas(8) uint64_t ro_datalen; + _Alignas(8) uint64_t ro_fdslen; + _Alignas(2) cloudabi_sockaddr_t ro_sockname; + _Alignas(2) cloudabi_sockaddr_t ro_peername; + _Alignas(2) cloudabi_msgflags_t ro_flags; +} cloudabi64_recv_out_t; +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) uint64_t entry_point; + _Alignas(8) uint64_t stack; + _Alignas(8) uint64_t stack_size; + _Alignas(8) uint64_t argument; +} cloudabi64_threadattr_t; +_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, stack_size) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24, "Incorrect layout"); +_Static_assert(sizeof(cloudabi64_threadattr_t) == 32, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi64_threadattr_t) == 8, "Incorrect layout"); + +#endif Added: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Thu Mar 24 21:47:15 2016 (r297247) @@ -0,0 +1,457 @@ +// Copyright (c) 2016 Nuxi, https://nuxi.nl/ +// +// 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. + +// This file is automatically generated. Do not edit. +// Source: https://github.com/NuxiNL/cloudabi + +#ifndef CLOUDABI_TYPES_COMMON_H +#define CLOUDABI_TYPES_COMMON_H + +#if defined(__FreeBSD__) && defined(_KERNEL) +#include +#elif defined(__linux__) && defined(__KERNEL__) +#include +#else +#include +#include +#endif + +typedef uint8_t cloudabi_advice_t; +#define CLOUDABI_ADVICE_DONTNEED 1 +#define CLOUDABI_ADVICE_NOREUSE 2 +#define CLOUDABI_ADVICE_NORMAL 3 +#define CLOUDABI_ADVICE_RANDOM 4 +#define CLOUDABI_ADVICE_SEQUENTIAL 5 +#define CLOUDABI_ADVICE_WILLNEED 6 + +typedef uint32_t cloudabi_auxtype_t; +#define CLOUDABI_AT_ARGDATA 256 +#define CLOUDABI_AT_ARGDATALEN 257 +#define CLOUDABI_AT_CANARY 258 +#define CLOUDABI_AT_CANARYLEN 259 +#define CLOUDABI_AT_NCPUS 260 +#define CLOUDABI_AT_NULL 0 +#define CLOUDABI_AT_PAGESZ 6 +#define CLOUDABI_AT_PHDR 3 +#define CLOUDABI_AT_PHNUM 4 +#define CLOUDABI_AT_TID 261 + +typedef uint32_t cloudabi_backlog_t; + +typedef uint32_t cloudabi_clockid_t; +#define CLOUDABI_CLOCK_MONOTONIC 1 +#define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2 +#define CLOUDABI_CLOCK_REALTIME 3 +#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4 + +typedef uint32_t cloudabi_condvar_t; +#define CLOUDABI_CONDVAR_HAS_NO_WAITERS 0 + +typedef uint64_t cloudabi_device_t; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 24 21:48:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B86ADC727; Thu, 24 Mar 2016 21:48:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E9D1031; Thu, 24 Mar 2016 21:48:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLm1Nb064677; Thu, 24 Mar 2016 21:48:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLm1gl064676; Thu, 24 Mar 2016 21:48:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603242148.u2OLm1gl064676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 21:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297248 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:48:02 -0000 Author: bdrewery Date: Thu Mar 24 21:48:01 2016 New Revision: 297248 URL: https://svnweb.freebsd.org/changeset/base/297248 Log: Explicit 'make obj' for library dirs in build32 is not needed. In r138291 some directories were explicitly made to run 'make obj', but each target in 'make libraries' already runs 'make obj' for each library since r161580. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Mar 24 21:47:15 2016 (r297247) +++ head/Makefile.libcompat Thu Mar 24 21:48:01 2016 (r297248) @@ -125,9 +125,6 @@ build${libcompat}: .PHONY ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} DIRPRFX=${_dir}/ ${_t} .endfor .endfor -.for _dir in usr.bin/lex/lib - ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} DIRPRFX=${_dir}/ obj -.endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ From owner-svn-src-head@freebsd.org Thu Mar 24 21:48:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D608ADC756; Thu, 24 Mar 2016 21:48:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F9DB1185; Thu, 24 Mar 2016 21:48:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLmAC8064725; Thu, 24 Mar 2016 21:48:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLmAT7064724; Thu, 24 Mar 2016 21:48:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603242148.u2OLmAT7064724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 21:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297249 - head/lib/csu/powerpc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:48:11 -0000 Author: bdrewery Date: Thu Mar 24 21:48:10 2016 New Revision: 297249 URL: https://svnweb.freebsd.org/changeset/base/297249 Log: Don't reset CC away from full-pathed gcc. This was breaking the build when using CROSS_TOOLCHAIN=powerpc64-gcc Sponsored by: EMC / Isilon Storage Division Modified: head/lib/csu/powerpc64/Makefile Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Thu Mar 24 21:48:01 2016 (r297248) +++ head/lib/csu/powerpc64/Makefile Thu Mar 24 21:48:10 2016 (r297249) @@ -13,8 +13,11 @@ CFLAGS+= -I${.CURDIR}/../common \ # clang doesn't support -mlongcall, and testing shows a clang linked with a # clang-built csu segfaults, this must currently be compiled with gcc. Once # clang supports -mlongcall, or we get a fixed ld, this can be revisited. +.include +.if ${COMPILER_TYPE} != "gcc" CC:= gcc COMPILER_TYPE:= gcc +.endif FILES= ${OBJS} FILESMODE= ${LIBMODE} From owner-svn-src-head@freebsd.org Thu Mar 24 21:48:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7AEFADC776; Thu, 24 Mar 2016 21:48:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79F5811B8; Thu, 24 Mar 2016 21:48:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLmDw2064771; Thu, 24 Mar 2016 21:48:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLmDHf064769; Thu, 24 Mar 2016 21:48:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603242148.u2OLmDHf064769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 21:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297250 - in head: bin/csh lib/ncurses/ncurses X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:48:14 -0000 Author: bdrewery Date: Thu Mar 24 21:48:13 2016 New Revision: 297250 URL: https://svnweb.freebsd.org/changeset/base/297250 Log: CCACHE_BUILD: Don't use ccache when generating some files with CC -E. At least for ncurses this fixes a build error due to it trying to run 'ccache --version' to work around a gcc 5 bug using the fix in r287205. Sponsored by: EMC / Isilon Storage Division Modified: head/bin/csh/Makefile head/lib/ncurses/ncurses/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Thu Mar 24 21:48:10 2016 (r297249) +++ head/bin/csh/Makefile Thu Mar 24 21:48:13 2016 (r297250) @@ -140,7 +140,7 @@ tc.const.h: tc.const.c sh.char.h config. @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} @echo '#ifndef _h_tc_const' >> ${.TARGET} @echo '#define _h_tc_const' >> ${.TARGET} - ${CC} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC} -D_h_tc_const | \ + ${CC:N${CCACHE_BIN}} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC} -D_h_tc_const | \ grep 'Char STR' | \ sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ sort >> ${.TARGET} Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Thu Mar 24 21:48:10 2016 (r297249) +++ head/lib/ncurses/ncurses/Makefile Thu Mar 24 21:48:13 2016 (r297250) @@ -331,7 +331,7 @@ codes.c: MKcodes.awk ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c lib_gen.c: MKlib_gen.sh curses.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CC} -E ${CFLAGS}" \ + LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CC:N${CCACHE_BIN}} -E ${CFLAGS}" \ "${AWK}" generated < curses.h >$@ lib_keyname.c: keys.list MKkeyname.awk @@ -346,14 +346,14 @@ comp_captab.c: MKcaptab.sh MKcaptab.awk ${NCURSES_DIR}/include/Caps > comp_captab.c expanded.c: MKexpanded.sh - sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC} -E" ${CFLAGS} >expanded.c + sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c fallback.c: MKfallback.sh sh ${NCURSES_DIR}/ncurses/tinfo/MKfallback.sh > fallback.c # Generated headers nomacros.h: MKlib_gen.sh curses.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CC} -E ${CFLAGS}" \ + LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CC:N${CCACHE_BIN}} -E ${CFLAGS}" \ "${AWK}" generated < curses.h | fgrep undef > $@ init_keytry.h: keys.list make_keys From owner-svn-src-head@freebsd.org Thu Mar 24 21:48:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F72DADC785; Thu, 24 Mar 2016 21:48:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0187B12D3; Thu, 24 Mar 2016 21:48:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLmGfh064821; Thu, 24 Mar 2016 21:48:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLmGpm064820; Thu, 24 Mar 2016 21:48:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603242148.u2OLmGpm064820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 21:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297251 - head/contrib/ofed/management/infiniband-diags/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:48:18 -0000 Author: bdrewery Date: Thu Mar 24 21:48:16 2016 New Revision: 297251 URL: https://svnweb.freebsd.org/changeset/base/297251 Log: Fix off-by-one found by GCC 5.3.2. This was fixed during refactoring in the upstream infiniband-diags 1.5.3. Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Modified: head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Thu Mar 24 21:48:13 2016 (r297250) +++ head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Thu Mar 24 21:48:16 2016 (r297251) @@ -731,7 +731,7 @@ dump_topology(int listtype, int group) } fprintf(f, "\n# Spine Nodes"); - for (n = 1; n <= (SPINES_MAX_NUM+1); n++) { + for (n = 1; n <= (SPINES_MAX_NUM); n++) { if (ch->spinenode[n]) { out_switch(ch->spinenode[n], group, chname); for (port = ch->spinenode[n]->ports; port; port = port->next, i++) @@ -740,7 +740,7 @@ dump_topology(int listtype, int group) } } fprintf(f, "\n# Line Nodes"); - for (n = 1; n <= (LINES_MAX_NUM+1); n++) { + for (n = 1; n <= (LINES_MAX_NUM); n++) { if (ch->linenode[n]) { out_switch(ch->linenode[n], group, chname); for (port = ch->linenode[n]->ports; port; port = port->next, i++) From owner-svn-src-head@freebsd.org Thu Mar 24 21:48:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56754ADC84D; Thu, 24 Mar 2016 21:48:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E56E1611; Thu, 24 Mar 2016 21:48:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLmfnk064882; Thu, 24 Mar 2016 21:48:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLmfrE064881; Thu, 24 Mar 2016 21:48:41 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603242148.u2OLmfrE064881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 24 Mar 2016 21:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297252 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:48:42 -0000 Author: ed Date: Thu Mar 24 21:48:41 2016 New Revision: 297252 URL: https://svnweb.freebsd.org/changeset/base/297252 Log: Turn on $FreeBSD$ keyword expansion to the system call table. Modified: Directory Properties: head/sys/contrib/cloudabi/syscalls.master (props changed) From owner-svn-src-head@freebsd.org Thu Mar 24 21:49:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEFABADC90E; Thu, 24 Mar 2016 21:49:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB1B917D6; Thu, 24 Mar 2016 21:49:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OLnd2O064958; Thu, 24 Mar 2016 21:49:39 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OLndEw064954; Thu, 24 Mar 2016 21:49:39 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603242149.u2OLndEw064954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 24 Mar 2016 21:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297253 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 21:49:40 -0000 Author: ed Date: Thu Mar 24 21:49:39 2016 New Revision: 297253 URL: https://svnweb.freebsd.org/changeset/base/297253 Log: Regenerate system call table after r297247. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Thu Mar 24 21:48:41 2016 (r297252) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Thu Mar 24 21:49:39 2016 (r297253) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -64,19 +64,19 @@ struct cloudabi_sys_fd_dup_args { struct cloudabi64_sys_fd_pread_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)]; - char iovcnt_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t iovcnt; char iovcnt_r_[PADR_(cloudabi64_size_t)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_pwrite_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)]; - char iovcnt_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t iovcnt; char iovcnt_r_[PADR_(cloudabi64_size_t)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_read_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)]; - char iovcnt_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t iovcnt; char iovcnt_r_[PADR_(cloudabi64_size_t)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; }; struct cloudabi_sys_fd_replace_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; @@ -102,7 +102,7 @@ struct cloudabi_sys_fd_sync_args { struct cloudabi64_sys_fd_write_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)]; - char iovcnt_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t iovcnt; char iovcnt_r_[PADR_(cloudabi64_size_t)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_advise_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -130,7 +130,7 @@ struct cloudabi_sys_file_link_args { char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_open_args { - char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; + char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; @@ -146,7 +146,7 @@ struct cloudabi_sys_file_readlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; - char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_rename_args { @@ -190,7 +190,7 @@ struct cloudabi_sys_file_unlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; - char flag_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flag; char flag_r_[PADR_(cloudabi_ulflags_t)]; + char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; }; struct cloudabi_sys_lock_unlock_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; @@ -234,7 +234,7 @@ struct cloudabi_sys_mem_unmap_args { struct cloudabi64_sys_poll_args { char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nevents_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nevents; char nevents_r_[PADR_(cloudabi64_size_t)]; + char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -257,41 +257,41 @@ struct cloudabi_sys_random_get_args { char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_accept_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; }; struct cloudabi_sys_sock_bind_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_connect_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_listen_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; }; struct cloudabi64_sys_sock_recv_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_recv_in_t *)]; const cloudabi64_recv_in_t * in; char in_r_[PADR_(const cloudabi64_recv_in_t *)]; char out_l_[PADL_(cloudabi64_recv_out_t *)]; cloudabi64_recv_out_t * out; char out_r_[PADR_(cloudabi64_recv_out_t *)]; }; struct cloudabi64_sys_sock_send_args { - char s_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t s; char s_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_send_in_t *)]; const cloudabi64_send_in_t * in; char in_r_[PADR_(const cloudabi64_send_in_t *)]; char out_l_[PADL_(cloudabi64_send_out_t *)]; cloudabi64_send_out_t * out; char out_r_[PADR_(cloudabi64_send_out_t *)]; }; struct cloudabi_sys_sock_shutdown_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char how_l_[PADL_(cloudabi_sdflags_t)]; cloudabi_sdflags_t how; char how_r_[PADR_(cloudabi_sdflags_t)]; }; struct cloudabi_sys_sock_stat_get_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; char flags_l_[PADL_(cloudabi_ssflags_t)]; cloudabi_ssflags_t flags; char flags_r_[PADR_(cloudabi_ssflags_t)]; }; @@ -311,9 +311,9 @@ struct cloudabi_sys_thread_yield_args { struct cloudabi64_sys_poll_fd_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char nin_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nin; char nin_r_[PADR_(cloudabi64_size_t)]; + char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nout_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nout; char nout_r_[PADR_(cloudabi64_size_t)]; + char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; }; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Mar 24 21:48:41 2016 (r297252) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Mar 24 21:49:39 2016 (r297253) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Mar 24 21:48:41 2016 (r297252) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Mar 24 21:49:39 2016 (r297253) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Mar 24 21:48:41 2016 (r297252) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Mar 24 21:49:39 2016 (r297253) @@ -3,12 +3,12 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed */ #include #include -#include +#include #include #define AS(name) (sizeof(struct name) / sizeof(register_t)) From owner-svn-src-head@freebsd.org Thu Mar 24 23:24:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49E2AADDB0F; Thu, 24 Mar 2016 23:24:01 +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 175BE1FE0; Thu, 24 Mar 2016 23:24:01 +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 u2ONO0aM094845; Thu, 24 Mar 2016 23:24:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ONO09m094844; Thu, 24 Mar 2016 23:24:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603242324.u2ONO09m094844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 24 Mar 2016 23:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297255 - head/sys/dev/ichwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 23:24:01 -0000 Author: mav Date: Thu Mar 24 23:24:00 2016 New Revision: 297255 URL: https://svnweb.freebsd.org/changeset/base/297255 Log: Unify ichwd(4) attachment messages in dmesg. MFC after: 2 weeks Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Thu Mar 24 22:15:51 2016 (r297254) +++ head/sys/dev/ichwd/ichwd.c Thu Mar 24 23:24:00 2016 (r297255) @@ -540,9 +540,6 @@ ichwd_find_ich_lpc_bridge(struct ichwd_d if (ich == NULL) return (NULL); - ichwd_verbose_printf(ich, "found ICH%d or equivalent chipset: %s\n", - id->ich_version, id->desc); - if (id_p) *id_p = id; @@ -573,8 +570,6 @@ ichwd_identify(driver_t *driver, device_ if (dev == NULL) return; - device_set_desc_copy(dev, id_p->desc); - switch (id_p->tco_version) { case 1: break; @@ -611,10 +606,16 @@ ichwd_identify(driver_t *driver, device_ static int ichwd_probe(device_t dev) { + struct ichwd_device *id_p; /* Do not claim some ISA PnP device by accident. */ if (isa_get_logicalid(dev) != 0) return (ENXIO); + + if (ichwd_find_ich_lpc_bridge(&id_p) == NULL) + return (ENXIO); + + device_set_desc_copy(dev, id_p->desc); return (0); } @@ -677,9 +678,6 @@ ichwd_attach(device_t dev) if (ichwd_clear_noreboot(sc) != 0) goto fail; - ichwd_verbose_printf(dev, "%s (ICH%d or equivalent)\n", - id_p->desc, sc->ich_version); - /* * Determine if we are coming up after a watchdog-induced reset. Some * BIOSes may clear this bit at bootup, preventing us from reporting From owner-svn-src-head@freebsd.org Fri Mar 25 00:14:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40152ADB566; Fri, 25 Mar 2016 00:14:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F76311C9; Fri, 25 Mar 2016 00:14:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2P0EuP5009965; Fri, 25 Mar 2016 00:14:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2P0Euft009964; Fri, 25 Mar 2016 00:14:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603250014.u2P0Euft009964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 00:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297256 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 00:14:57 -0000 Author: bdrewery Date: Fri Mar 25 00:14:56 2016 New Revision: 297256 URL: https://svnweb.freebsd.org/changeset/base/297256 Log: Remove unneeded return left from refactoring. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Thu Mar 24 23:24:00 2016 (r297255) +++ head/sys/dev/filemon/filemon.c Fri Mar 25 00:14:56 2016 (r297256) @@ -274,8 +274,6 @@ filemon_close_log(struct filemon *filemo sx_xunlock(&filemon->lock); fdrop(fp, curthread); sx_xlock(&filemon->lock); - - return; } /* From owner-svn-src-head@freebsd.org Fri Mar 25 00:33:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D922EADBBEE; Fri, 25 Mar 2016 00:33:56 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A66E81D0B; Fri, 25 Mar 2016 00:33:56 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2P0Xtg6015994; Fri, 25 Mar 2016 00:33:55 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2P0XtrY015993; Fri, 25 Mar 2016 00:33:55 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603250033.u2P0XtrY015993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 25 Mar 2016 00:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297258 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 00:33:57 -0000 Author: gnn Date: Fri Mar 25 00:33:55 2016 New Revision: 297258 URL: https://svnweb.freebsd.org/changeset/base/297258 Log: Remove dependency on mbuf provider as mbuf SDTs are now in the SDT space. Sponsored by: Rubicon Communications (Netgate) Modified: head/share/dtrace/mbuf.d Modified: head/share/dtrace/mbuf.d ============================================================================== --- head/share/dtrace/mbuf.d Fri Mar 25 00:32:43 2016 (r297257) +++ head/share/dtrace/mbuf.d Fri Mar 25 00:33:55 2016 (r297258) @@ -30,7 +30,6 @@ */ #pragma D depends_on module kernel -#pragma D depends_on provider mbuf /* * mbuf flags of global significance and layer crossing. From owner-svn-src-head@freebsd.org Fri Mar 25 02:54:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 161F8ADC9C3; Fri, 25 Mar 2016 02:54:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB2C2138E; Fri, 25 Mar 2016 02:54:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2P2sENi058191; Fri, 25 Mar 2016 02:54:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2P2sDJa058189; Fri, 25 Mar 2016 02:54:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603250254.u2P2sDJa058189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 25 Mar 2016 02:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297265 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 02:54:15 -0000 Author: sephe Date: Fri Mar 25 02:54:13 2016 New Revision: 297265 URL: https://svnweb.freebsd.org/changeset/base/297265 Log: tcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries. So that callers could react accordingly. Reviewed by: gallatin (no objection) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5695 Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri Mar 25 01:02:12 2016 (r297264) +++ head/sys/netinet/tcp_lro.c Fri Mar 25 02:54:13 2016 (r297265) @@ -690,7 +690,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Try to find an empty slot. */ if (SLIST_EMPTY(&lc->lro_free)) - return (TCP_LRO_CANNOT); + return (TCP_LRO_NO_ENTRIES); /* Start a new segment chain. */ le = SLIST_FIRST(&lc->lro_free); Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Fri Mar 25 01:02:12 2016 (r297264) +++ head/sys/netinet/tcp_lro.h Fri Mar 25 02:54:13 2016 (r297265) @@ -110,6 +110,7 @@ void tcp_lro_flush_all(struct lro_ctrl * int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); void tcp_lro_queue_mbuf(struct lro_ctrl *, struct mbuf *); +#define TCP_LRO_NO_ENTRIES -2 #define TCP_LRO_CANNOT -1 #define TCP_LRO_NOT_SUPPORTED 1 From owner-svn-src-head@freebsd.org Fri Mar 25 04:16:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B32ADD8D1; Fri, 25 Mar 2016 04:16:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053A11440; Fri, 25 Mar 2016 04:16:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2P4G53I082362; Fri, 25 Mar 2016 04:16:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2P4G5Rm082361; Fri, 25 Mar 2016 04:16:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603250416.u2P4G5Rm082361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 04:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297266 - head/contrib/ofed/management/opensm/include/vendor X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 04:16:06 -0000 Author: bdrewery Date: Fri Mar 25 04:16:04 2016 New Revision: 297266 URL: https://svnweb.freebsd.org/changeset/base/297266 Log: Make GCC happy by removing empty #elif. Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/ofed/management/opensm/include/vendor/osm_vendor.h Modified: head/contrib/ofed/management/opensm/include/vendor/osm_vendor.h ============================================================================== --- head/contrib/ofed/management/opensm/include/vendor/osm_vendor.h Fri Mar 25 02:54:13 2016 (r297265) +++ head/contrib/ofed/management/opensm/include/vendor/osm_vendor.h Fri Mar 25 04:16:04 2016 (r297266) @@ -65,7 +65,7 @@ #include #elif defined( OSM_VENDOR_INTF_AL ) #include -#elif +#else #error No MAD Interface selected! #error Choose an interface in osm_config.h #endif From owner-svn-src-head@freebsd.org Fri Mar 25 06:39:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F8EADD669; Fri, 25 Mar 2016 06:39:15 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D631B1A59; Fri, 25 Mar 2016 06:39:14 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from 221x114x228x194.ap221.ftth.ucom.ne.jp ([221.114.228.194]:60176 helo=[192.168.102.200]) by vps.hungerhost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_1) (envelope-from ) id 1ajLOq-0002hd-QS; Fri, 25 Mar 2016 02:39:13 -0400 Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 To: Gleb Smirnoff , "George V. Neville-Neil" References: <201603240754.u2O7suvM006925@repo.freebsd.org> <20160324203117.GY2616@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "George V. Neville-Neil" Message-ID: <56F4DCF2.9040505@neville-neil.com> Date: Fri, 25 Mar 2016 02:38:42 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160324203117.GY2616@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 06:39:15 -0000 On 03/24/16 04:31 PM, Gleb Smirnoff wrote: > On Thu, Mar 24, 2016 at 07:54:56AM +0000, George V. Neville-Neil wrote: > G> Author: gnn > G> Date: Thu Mar 24 07:54:56 2016 > G> New Revision: 297225 > G> URL: https://svnweb.freebsd.org/changeset/base/297225 > G> > G> Log: > G> FreeBSD previously provided route caching for TCP (and UDP). Re-add > G> route caching for TCP, with some improvements. In particular, invalidate > G> the route cache if a new route is added, which might be a better match. > G> The cache is automatically invalidated if the old route is deleted. > G> > G> Submitted by: Mike Karels > G> Reviewed by: gnn > G> Differential Revision: https://reviews.freebsd.org/D4306 > > I'm quite surprised to see this checked in, taking into account that the > D4306 has strong disagreement from melifaro@. > > So, now we got two aids for poor routing: TCP route caching & flowtable. > Given that melifaro@ has not responded to emails from several folks for several weeks I pushed this in so that we could a) break the tie and b) have a place to start for improvement. The status quo was unacceptable. Best, George From owner-svn-src-head@freebsd.org Fri Mar 25 08:49:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728C1ADD7D1; Fri, 25 Mar 2016 08:49:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00EC21DAD; Fri, 25 Mar 2016 08:49:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2P8n37F010698 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 25 Mar 2016 10:49:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2P8n37F010698 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2P8n3aw010697; Fri, 25 Mar 2016 10:49:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Mar 2016 10:49:03 +0200 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160325084902.GH1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160325060901.N2059@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 08:49:10 -0000 On Fri, Mar 25, 2016 at 07:13:54AM +1100, Bruce Evans wrote: > On Thu, 24 Mar 2016, Konstantin Belousov wrote: [Skipped lock adaptive spinning text for now]. > > >> My systems allow speed variations of about 4000:800 = 5:1 for one CPU and > >> about 50:1 for different CPUs. So the old method gave a variation of up > >> to 50:1. This can be reduced to only 5:1 using the boot-time calibration. > > What do you mean by 'for different CPUs' ? I understand that modern ESS > > can give us CPU frequency between 800-4200MHz, which is what you mean > > by 'for one CPU'. We definitely do not care if 5usec timeout becomes > > 25usecs, since we practically never time-out there at all. > > Yes, I actually get 4400:800 on i4790K. > > The ratio is even larger than that with a hard-coded limit because old > CPUs are much slower than i4790K. I sometimes run a 367 MHz (P2 class) > CPU. It is several times slower than a new CPU at the same clock > frequency, and any throttling would make it even slower. > > 50 times slower means that a reasonable emergency timeout of 60 seconds > becomes 3000 seconds. Local users would get tired of waiting and reset, > and remote users might have to wait. But you do not downclock a machine booted at the 4.0Ghz datasheet clock, down to 367Mhz. For 400Mhz P2 machine, LAPIC would be calibrated at that 400Mhz rate. > There is another thread about early DELAY() using the i8254 not working > to calibrate the TSC. That might be just because DELAY() is interrupted. > DELAY() never bothered to disable interrupts. Its early use for calibrating > the TSC depends on interrupts mostly not happening then. (My version is > a bit more careful, but it still doesn't disable interrupts. It > establishes error bounds provided interrupts are shorter than the i8254 > wrap period.) If the i8254 is virtual, then even disabling interrupts > on the target wouldn't help, since the disabling would only be virtual. Yes, the DELAY() calibration is something I wanted to ask about. Could you, please, take a look at https://reviews.freebsd.org/D5738 there is a code which would benefit from better (re-)calibration. Below is the patch to implement calibration of the ipi_wait() busy loop. On my sandybridge 3.4Ghz, I get the message LAPIC: ipi_wait() us multiplier 37 (r 128652089678 tsc 3392383992) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 7e5087b..0842de5 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -162,6 +163,7 @@ int x2apic_mode; int lapic_eoi_suppression; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +static uint64_t lapic_ipi_wait_mult; SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); @@ -391,6 +393,7 @@ lvt_mode(struct lapic *la, u_int pin, uint32_t value) static void native_lapic_init(vm_paddr_t addr) { + uint64_t r; uint32_t ver; u_int regs[4]; int i, arat; @@ -484,6 +487,34 @@ native_lapic_init(vm_paddr_t addr) TUNABLE_INT_FETCH("hw.lapic_eoi_suppression", &lapic_eoi_suppression); } + +#define LOOPS 1000000 + /* + * Calibrate the busy loop waiting for IPI ack in xAPIC mode. + * lapic_ipi_wait_mult contains the number of iterations which + * approximately delay execution for 1 microsecond (the + * argument to native_lapic_ipi_wait() is in microseconds). + * + * We assume that TSC is present and already measured. + * Possible TSC frequency jumps are irrelevant to the + * calibration loop below, the CPU clock management code is + * not yet started, and we do not enter sleep states. + */ + KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, + ("TSC not initialized")); + r = rdtsc(); + for (r = 0; r < LOOPS; r++) { + (void)lapic_read_icr_lo(); + ia32_pause(); + } + r = rdtsc() - r; + lapic_ipi_wait_mult = (r * 1000000) / tsc_freq / LOOPS; + if (bootverbose) { + printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n", + (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, + (uintmax_t)tsc_freq); + } +#undef LOOPS } /* @@ -1621,31 +1652,26 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ static int native_lapic_ipi_wait(int delay) { - int x; + uint64_t i, counter; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ - if (x2apic_mode) + if (x2apic_mode || delay == -1) return (1); - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != - APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); - } - - for (x = 0; x < delay; x++) { + counter = lapic_ipi_wait_mult * delay; + for (i = 0; i < counter; i++) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(1); + ia32_pause(); } return (0); } From owner-svn-src-head@freebsd.org Fri Mar 25 14:44:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C89ADD571; Fri, 25 Mar 2016 14:44:52 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 155D71C22; Fri, 25 Mar 2016 14:44:52 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id l68so25181814wml.1; Fri, 25 Mar 2016 07:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mTta4kmTEPiJMMSqihE0ODphF2A349f2WWch11iN5s8=; b=fpMlJ0fuhcPkRfJKsZnMjYa8qOJS1N7/GfoOlBqS6Qw8itStwyagb0YbtAC7aCPFHd 8UmyLnT4ReM1tBxYrONDzRYCEjmz7AmJW5+TqOYJfczSHceGEXGhgF1JSRgJkV+3Z0YQ kDSkjG+YTE0lNTuZIUngtECB2YZd3f3WAjTZBlO/C22zOHkquK22zabr+01EIZ9ogv0g 2GcWOLjSUuXEOl3zkRHcpNHoPc1+UF/mKN/aM94bdPd2MX4MeP1u0MCX9yun7VPNIIoo phREzc6ova/BBpa1BPPI+IiEEn+agmGafrURGmueifuo7+4LfbsaCZ0KHD61NPK0371O HuDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mTta4kmTEPiJMMSqihE0ODphF2A349f2WWch11iN5s8=; b=f3D249qT1rcJCkt/nuExNtm1F0Fn6BEeELy0ByOTdtEpzvf3/JsH2rG2aERZ9Mk/ow LE9nnS5wmf8/homBhkw+CQZcYR9IQjhwTZXJU0FvxWURebaqTmk+iwC25Q+uj30mW8+Y O1K5sRnEvArHS543sqBn/hP71huTIIWzF4Ey4mxpR029VzwOF/49671uut7XH7fXxfiF vauotVgfHm0tgIcpJ/WmI21qPej1qOam8Tb3wVRMFimw18DTuDxrm1LxL6Bp4/OhBGAb 9Ki+GSLITFgdvj+dBeOqZFwojkAekaRCov7jT4NFRZA9r+9iImwrys/tNQjh8xwfzzkX iKxg== X-Gm-Message-State: AD7BkJLRd/bbhoUb5YnAnvX7NzbEBNFObWUybmpDBl1DleLYi4xMlWFE9XqVGiTCQlClIw== X-Received: by 10.194.179.227 with SMTP id dj3mr15495415wjc.50.1458917090501; Fri, 25 Mar 2016 07:44:50 -0700 (PDT) Received: from brick.home (aees151.neoplus.adsl.tpnet.pl. [79.186.122.151]) by smtp.gmail.com with ESMTPSA id c71sm3426152wmd.4.2016.03.25.07.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Mar 2016 07:44:49 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Mar 2016 15:44:45 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Bruce Evans Cc: Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160325144445.GA1549@brick.home> Mail-Followup-To: Bruce Evans , Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> <20160324173359.GA1238@brick.home> <20160325071420.K2059@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160325071420.K2059@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 14:44:52 -0000 On 0325T0809, Bruce Evans wrote: > On Thu, 24 Mar 2016, Edward Tomasz [utf-8] NapieraÅ~Ba wrote: > > > On 0324T1015, Warner Losh wrote: > >> On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: > >> > >>> On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz NapieraÅ‚a wrote: > >>>> On 0324T1609, Alexander Motin wrote: > >>>>> On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > >>>>>> On 0324T1032, Jean-Sébastien Pédron wrote: > >>>>>>> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >>>>>>>>> So maybe callouts are disabled in this situation. If there > >>>>>>>>> is a way to > >>>>>>>>> detect that, then vt(4) can go back to a "synchronous mode" > >>>>>>>>> where it > >>>>>>>>> refreshes the screen after each typed character, like it > >>>>>>>>> does when ddb > >>>>>>>>> is active. > >>>>>>>> > >>>>>>>> Looks like that's the case: for some reason the callouts > >>>>>>>> don't work. > >>>>>>>> This trivial hack is a (mostly) working workaround: > >>>>>>>> > >>>>>>>> Index: svn/head/sys/kern/kern_cons.c > >>>>>>>> ============================================================= > >>>>>>>> ====== > >>>>>>>> --- svn/head/sys/kern/kern_cons.c (revision 297210) > >>>>>>>> +++ svn/head/sys/kern/kern_cons.c (working copy) > >>>>>>>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > >>>>>>>> visible) > >>>>>>>> lp = cp; > >>>>>>>> end = cp + size - 1; > >>>>>>>> for (;;) { > >>>>>>>> + pause("meh", 1); > >>>>>>> > >>>>>>> Could you please explain how this works to me? Does calling > >>>>>>> pause() here > >>>>>>> give a chance to interrupt handlers or other threads of > >>>>>>> running? > >>>>>> > >>>>>> It looks like it allows the callout to run. I've did an > >>>>>> experiment > >>>>>> and added a simple callout that printed something each second; > >>>>>> during > >>>>>> the root mount prompt it doesn't get run unless you type '.', > >>>>>> which > >>>>>> calls pause(9). > >>>>> > >>>>> Kernel threads run with absolute priorities, so if somehow this > >>>>> threads > >>>>> happen to have higher or equal priority then callout thread, or the > >>>>> kernel is built without PREEMPTION, then the last may never be > >>>>> executed > >>>>> until this thread get to sleep or at least call sched_yield(). > >>>> > >>>> The callout's td_priority seems to be 40; the thread running the > >>>> prompt > >>>> is 84, so it's lower. > >>>> > >>>> I've just noticed another curious thing, though: when you press > >>>> ScrLk, > >>>> the screen gets immediately refreshed; also, pressing arrows works > >>>> just > >>>> the way it should. In other words, the refresh is broken except for > >>>> the ScrlLk mode, where it works as it should. > >>> > >>> Since cngets() is used only by the mountroot prompt and the geli pw > >>> entry, pausing/yielding within the input loop seems like a good idea. > >>> It would allow for things like plugging in a usb device and having it > >>> actually appear without having to enter a '.' several times. > >>> > >>> It would be nice if the pause were done with pause_sbt() and a shorter > >>> timeout, maybe a millisecond or even 100uS. Otherwise things like > >>> pasting text at that prompt in a serial console is likely to drop > >>> chars. > >>> > >>> Hmmm... speaking of the geli pw prompt... what's the locking situation > >>> there? Will there be any problems calling pause() from that context? > >> > >> PVM isn't an ideal priority to wait at. PWAIT would be better. However, > >> if the only reason to call pause is run the scheduler after each character, > >> perhaps a better solution would be to call kern_yield() instead? We could > >> do that instead of cpu_waitspin() inside of cngetc, but that would break > >> the debugger's use of it.... > > Console drivers can't block or depend on timeouts. Perhaps cngets() can, > because it is only called in simple contexts, but the simple contexts > make it especially easy for it to work using the same synchronous i/o that > is needed in more complicated contexts. Note that this particular problem doesn't seem to be caused by the console driver as such. One of the things I've tried was to add a callout that prints out something each second, and then enter an infinite loop. The assumption is, the loop in proc0 should get preempted by the callout. For some reason this doesn't happen. > > I think we should first try to figure out why this doesn't work in the first > > place. > > > > Basically, even though the interrupts are running, scheduler seems to be ok, > > and the thread that's calling this has a lower priority than the callouts > > thread, it can't be preempted. This doesn't seem to be caused by vt(4); > > with syscons the callouts don't get called either (it just doesn't break > > the echo in this case). To demonstrate the problem you can add add > > a callout that calls printf each second and then does an infinite loop. > > cngets() is even correctly wrapped by cngrab()/cnungrab(). This is supposed > to put the console driver in a special synchronous mode for the duration of > the grabbing. (Console drivers still need to be reentrant, so that they > can do i/o when the grabbed section is reentered for ddb or another > non-maskable trap.) syscons and vt have similar too-simple grab handlers > which start with a screen switch in the !cold case. This should refresh > the screen and/or switch it to special low-level console screen(s). So basically, what you're suggesting is to make cngrab() set a flag that switches vt, and its video drivers, into a mode that doesn't use any kind of callouts, right? That seems like a proper solution, but still doesn't explain the root of the problem here. > Screen switching in ddb is noticeably more broken for vt than for syscons. > Indeed, it just doesn't work in vt (except for the initial switch to vty0). > This might be related. Yeah; I remember some strange problems with keyboard state when entering/leaving ddb. From owner-svn-src-head@freebsd.org Fri Mar 25 16:01:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A04ADD81F; Fri, 25 Mar 2016 16:01:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72DC71833; Fri, 25 Mar 2016 16:01:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PG1eB8000708; Fri, 25 Mar 2016 16:01:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PG1eBh000707; Fri, 25 Mar 2016 16:01:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603251601.u2PG1eBh000707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 25 Mar 2016 16:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297268 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 16:01:41 -0000 Author: trasz Date: Fri Mar 25 16:01:40 2016 New Revision: 297268 URL: https://svnweb.freebsd.org/changeset/base/297268 Log: Fix iSCSI initiator crash that could happen with out-of-memory conditions with in-flight IO and subsequent reconnection. PR: 199117 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5673 Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Mar 25 08:26:37 2016 (r297267) +++ head/sys/dev/iscsi/iscsi.c Fri Mar 25 16:01:40 2016 (r297268) @@ -2222,6 +2222,7 @@ iscsi_action_scsiio(struct iscsi_session error = icl_pdu_append_data(request, csio->data_ptr, len, M_NOWAIT); if (error != 0) { + iscsi_outstanding_remove(is, io); icl_pdu_free(request); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { xpt_freeze_devq(ccb->ccb_h.path, 1); From owner-svn-src-head@freebsd.org Fri Mar 25 16:17:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E575FADDBA0; Fri, 25 Mar 2016 16:17:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 834871E98; Fri, 25 Mar 2016 16:17:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 82F953C39F9; Sat, 26 Mar 2016 03:17:44 +1100 (AEDT) Date: Sat, 26 Mar 2016 03:17:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160325084902.GH1741@kib.kiev.ua> Message-ID: <20160326021219.X911@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=WxBFKb53b9PC3GSH01MA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 16:17:54 -0000 On Fri, 25 Mar 2016, Konstantin Belousov wrote: > On Fri, Mar 25, 2016 at 07:13:54AM +1100, Bruce Evans wrote: >> On Thu, 24 Mar 2016, Konstantin Belousov wrote: > [Skipped lock adaptive spinning text for now]. >> >>>> My systems allow speed variations of about 4000:800 = 5:1 for one CPU and >>>> about 50:1 for different CPUs. So the old method gave a variation of up >>>> to 50:1. This can be reduced to only 5:1 using the boot-time calibration. >>> What do you mean by 'for different CPUs' ? I understand that modern ESS >>> can give us CPU frequency between 800-4200MHz, which is what you mean >>> by 'for one CPU'. We definitely do not care if 5usec timeout becomes >>> 25usecs, since we practically never time-out there at all. >> >> Yes, I actually get 4400:800 on i4790K. >> >> The ratio is even larger than that with a hard-coded limit because old >> CPUs are much slower than i4790K. I sometimes run a 367 MHz (P2 class) >> CPU. It is several times slower than a new CPU at the same clock >> frequency, and any throttling would make it even slower. >> >> 50 times slower means that a reasonable emergency timeout of 60 seconds >> becomes 3000 seconds. Local users would get tired of waiting and reset, >> and remote users might have to wait. > But you do not downclock a machine booted at the 4.0Ghz datasheet clock, > down to 367Mhz. For 400Mhz P2 machine, LAPIC would be calibrated at that > 400Mhz rate. I was considering what happens with hard-coded (uncalibrated) timeout. >> There is another thread about early DELAY() using the i8254 not working >> to calibrate the TSC. That might be just because DELAY() is interrupted. >> DELAY() never bothered to disable interrupts. Its early use for calibrating >> the TSC depends on interrupts mostly not happening then. (My version is >> a bit more careful, but it still doesn't disable interrupts. It >> establishes error bounds provided interrupts are shorter than the i8254 >> wrap period.) If the i8254 is virtual, then even disabling interrupts >> on the target wouldn't help, since the disabling would only be virtual. > > Yes, the DELAY() calibration is something I wanted to ask about. > Could you, please, take a look at > https://reviews.freebsd.org/D5738 > there is a code which would benefit from better (re-)calibration. I found that hard to read (using an old version of w3m, the UI is horrible and the comments don't have enough context; then the old version of w3m can't display files or diffs). I use the following TSC calibration code in some kernels: X static void X xdel(int t0c, uint64_t *initial_tsc, uint64_t *final_tsc, int *delta_t0c) X { X int high, low, n, next, prev; X X outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); X *initial_tsc = rdtsc(); X low = inb(TIMER_CNTR0); X high = inb(TIMER_CNTR0); X prev = (high << 8) | low; X for (n = 0; n < t0c; ) { X outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); X *final_tsc = rdtsc(); X low = inb(TIMER_CNTR0); X high = inb(TIMER_CNTR0); X next = (high << 8) | low; X if (next <= prev) X n += prev - next; X else X n += (timer0_max_count + prev) - next; X prev = next; X } X *delta_t0c = n; X } X X static uint64_t X tsc_calibrate(void) X { X uint64_t tsc_freq; X uint64_t tscval[2]; X int xdelval; X X xdel(100, &tscval[0], &tscval[1], &xdelval); X xdel(timer_freq, &tscval[0], &tscval[1], &xdelval); X tsc_freq = (tscval[1] - tscval[0]) * timer_freq / xdelval; X if (1 || bootverbose) X printf("TSC clock: %ju Hz\n", (uintmax_t)tsc_freq); X if (1 || bootverbose) X printf("raw: %ju %ju %d\n", tscval[0], tscval[1], xdelval); X return (tsc_freq); X } This uses the i8254. xdel() is a specialized version of i8254 DELAY() with getit() inline. It returns the initial and final values of the i8254 counter. It doesn't handle interrupts or any other source of large clock jitter. What it measures more precisely is the measurement overhead. This is normally 2-5 usec. With a timer frequency of about 1 MHz, a 5 usec error is about 5 ppm. Compensating for this reduces the error to below 1 ppm if there are no interrupts, tsc_calibrate() calls xdel() twice to determine the measurement overhead. It should be called one more time to warm up the cache. In other kernels, I use the following version using DELAY() which is good enough if DELAY() works and is not delayed by interrupts X diff -c2 ./x86/x86/tsc.c~ ./x86/x86/tsc.c X *** ./x86/x86/tsc.c~ Sun Feb 14 21:56:28 2016 X --- ./x86/x86/tsc.c Sun Feb 14 22:01:46 2016 X *************** X *** 240,244 **** X { X u_int regs[4]; X ! uint64_t tsc1, tsc2; X X if (cpu_high >= 6) { X --- 240,244 ---- X { X u_int regs[4]; X ! uint64_t tsc1, tsc2, tsc3; X X if (cpu_high >= 6) { X *************** X *** 306,313 **** X if (bootverbose) X printf("Calibrating TSC clock ... "); X tsc1 = rdtsc(); X ! DELAY(1000000); X tsc2 = rdtsc(); X ! tsc_freq = tsc2 - tsc1; X if (bootverbose) X printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); X --- 306,316 ---- X if (bootverbose) X printf("Calibrating TSC clock ... "); X + DELAY(1000); X tsc1 = rdtsc(); X ! DELAY(1000); X tsc2 = rdtsc(); X ! DELAY(1000000); X ! tsc3 = rdtsc(); X ! tsc_freq = tsc3 - tsc2 - (tsc2 - tsc1); X if (bootverbose) X printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); See also kern_tc.c:cpu_tick_calibrate(). This is quite accurate after fixing its bugs. It gets accuracy by timing over 16 seconds instead of 1 and by using a timecounter which is assumed to be accurate. See also tsccalib/tsccalib.c in my home directory on freefall. This is a refined version of the above. It uses the time returned by clock_gettime() as a reference. It compensates for interrupts and runs for long enough to get the specified accuracy. If you only want a low accuracy like 1 ppm, this takes 1.8 msec on freefall (this depends a lot on the speed of clock_gettime(2) -- 1.8 msec is with the fast TSC timecounter in libc). The worst case for all of these methods is if the i8254 is the only timer. Then tsccalib takes much longer to get an accurate calibration because the error reading the timer is about its access time which is very large for the i8254. The i8254 otherwise works perfectly for calibration provided its wrapping is always detected. > Below is the patch to implement calibration of the ipi_wait() busy loop. > On my sandybridge 3.4Ghz, I get the message > LAPIC: ipi_wait() us multiplier 37 (r 128652089678 tsc 3392383992) This seems OK, but it might belong closer to DELAY(). > ... > + counter = lapic_ipi_wait_mult * delay; > + for (i = 0; i < counter; i++) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(1); > + ia32_pause(); > } This part is basically DELAY() implemented as a simple loop with a callback in the loop. I don't like callbacks and prefer direct code like the above. The direct code is basically DELAY() implemented as a simple loop and cloned to add a simple check on very iteration. If an error factor of 10 or so is acceptable, then the simple loop is good enough for DELAY() too. Or DELAY() can do: while (n > 1000) recalibrate_every_millisecond_while_reducing_n(); /* * We can't reasonably get better accuracy than a factor of 1000 * for short delays, so don't try hard. A single register read * can take over 100 cycles waiting for DMA and buses, and we * don't want to disable interrupts so the general case can * reasonably be delayed by several milliseconds for interrupt * handling. We hope that the worst case in normal operation is * 1 quanta, giving an error factor of 100000 for DELAY(1). */ simple_loop(); Bruce From owner-svn-src-head@freebsd.org Fri Mar 25 17:37:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1800ADDC91; Fri, 25 Mar 2016 17:37:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC2F1CB4; Fri, 25 Mar 2016 17:37:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7909C1A0874; Sat, 26 Mar 2016 04:08:43 +1100 (AEDT) Date: Sat, 26 Mar 2016 04:08:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= cc: Bruce Evans , Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297190 - head/sys/kern In-Reply-To: <20160325144445.GA1549@brick.home> Message-ID: <20160326031834.O911@besplex.bde.org> References: <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> <20160324173359.GA1238@brick.home> <20160325071420.K2059@besplex.bde.org> <20160325144445.GA1549@brick.home> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=7fGllfOvKraRKodQD8AA:9 a=CQ_FEAJJtPbfF9RZ:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 17:37:34 -0000 On Fri, 25 Mar 2016, Edward Tomasz [utf-8] Napiera=C5~Ba wrote: > On 0325T0809, Bruce Evans wrote: >> On Thu, 24 Mar 2016, Edward Tomasz [utf-8] Napiera=C5~Ba wrote: >> >>> On 0324T1015, Warner Losh wrote: >>>> On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: >>>> >>>>> On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera=C5=82a wrote= : >>>>>> [...] >>>>>> I've just noticed another curious thing, though: when you press >>>>>> ScrLk, >>>>>> the screen gets immediately refreshed; also, pressing arrows works >>>>>> just >>>>>> the way it should. In other words, the refresh is broken except for >>>>>> the ScrlLk mode, where it works as it should. >>>>> >>>>> Since cngets() is used only by the mountroot prompt and the geli pw >>>>> entry, pausing/yielding within the input loop seems like a good idea. >>>>> It would allow for things like plugging in a usb device and having i= t >>>>> actually appear without having to enter a '.' several times. >>>>> >>>>> It would be nice if the pause were done with pause_sbt() and a shorte= r >>>>> timeout, maybe a millisecond or even 100uS. Otherwise things like >>>>> pasting text at that prompt in a serial console is likely to drop >>>>> chars. Serial consoles should work already due to their use of grab/ungrab, and this use being easier to get right for serial consoles. I still see problems with sio. It doesn't use grab/ungrab yet, although grab/ungrab were designed by me in ~1988 for my serial drivers older than sio. Note that cngetc() was broken by multiple console support in ~2000. Before that, cngetc() waited with device interrupts disabled. This prevented the interrupt handler eating the interrupts. Now it polls and is still broken since its polling loop is not wrapped by grab/ungrab. cngets() was broken before multiple consoles, but was fairly usable. You just had to type reasonably slowly so that the characters arrive in the low-level polling loop while device interrupts are disabled. >>>>> Hmmm... speaking of the geli pw prompt... what's the locking situatio= n >>>>> there? Will there be any problems calling pause() from that context? >>>> >>>> PVM isn't an ideal priority to wait at. PWAIT would be better. However= , >>>> if the only reason to call pause is run the scheduler after each chara= cter, >>>> perhaps a better solution would be to call kern_yield() instead? We co= uld >>>> do that instead of cpu_waitspin() inside of cngetc, but that would bre= ak >>>> the debugger's use of it.... >> >> Console drivers can't block or depend on timeouts. Perhaps cngets() can= , >> because it is only called in simple contexts, but the simple contexts >> make it especially easy for it to work using the same synchronous i/o th= at >> is needed in more complicated contexts. > > Note that this particular problem doesn't seem to be caused by the consol= e > driver as such. One of the things I've tried was to add a callout that > prints out something each second, and then enter an infinite loop. The > assumption is, the loop in proc0 should get preempted by the callout. > For some reason this doesn't happen. But it is a bug for (low level) console drivers to ever wait. They should assert that they don't. >>> I think we should first try to figure out why this doesn't work in the = first >>> place. >>> >>> Basically, even though the interrupts are running, scheduler seems to b= e ok, >>> and the thread that's calling this has a lower priority than the callou= ts >>> thread, it can't be preempted. This doesn't seem to be caused by vt(4)= ; >>> with syscons the callouts don't get called either (it just doesn't brea= k >>> the echo in this case). To demonstrate the problem you can add add >>> a callout that calls printf each second and then does an infinite loop. >> >> cngets() is even correctly wrapped by cngrab()/cnungrab(). This is supp= osed >> to put the console driver in a special synchronous mode for the duration= of >> the grabbing. (Console drivers still need to be reentrant, so that they >> can do i/o when the grabbed section is reentered for ddb or another >> non-maskable trap.) syscons and vt have similar too-simple grab handler= s >> which start with a screen switch in the !cold case. This should refresh >> the screen and/or switch it to special low-level console screen(s). > > So basically, what you're suggesting is to make cngrab() set a flag that > switches vt, and its video drivers, into a mode that doesn't use any kind > of callouts, right? That seems like a proper solution, but still doesn't > explain the root of the problem here. Yes. They already increment an xx_grabbed counter, but only use it to do nothing for nested grabs. (Doing nothing is too simple.) >> Screen switching in ddb is noticeably more broken for vt than for syscon= s. >> Indeed, it just doesn't work in vt (except for the initial switch to vty= 0). >> This might be related. > > Yeah; I remember some strange problems with keyboard state when > entering/leaving ddb. Both syscons and vt hang fairly quickly in -current for the ddb command 's/p,1000'. vt just hangs sooner. I think I fixed this in an old version of syscons, but I only tested the fix on systems with not as many CPUs as the one that shows the most problems. Printing after every instruction in ddb is a good way to stress its i/o, except the i/o is very slow so it takes too long to step through a few trillion instructions needed for a good test. A few trillion instructions might be enough to reach most parts of the kernel. The 'n' command is also good for stressing all paths, but not so good for seeing the instruction that deadlocks, and the repeat count doesn't work for it. In -current with both syscons and vt, 's/p,1000' usually hangs on a harmless-looking instruction nar the ithread loop. But last time I tried it hung on a known deadlock in scrn_update() (a lock cmpxchgl for the bad locking there). The trace showed interesting interleaving of scrn_update() with handlevents(), presumably running on different CPUs. An old bug in single stepping in ddb is that it loses control on every step. SMP enlarges this bug. The trace flag apparently got set on different CPUs, though I thought I fixed that. This shows that every debugger entry that prints anything should print some pcpu info. Bruce From owner-svn-src-head@freebsd.org Fri Mar 25 19:12:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A1A1ADD580; Fri, 25 Mar 2016 19:12:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D08E61DD3; Fri, 25 Mar 2016 19:12:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PJCExS062347; Fri, 25 Mar 2016 19:12:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PJCEKA062346; Fri, 25 Mar 2016 19:12:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603251912.u2PJCEKA062346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 19:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297269 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:12:15 -0000 Author: bdrewery Date: Fri Mar 25 19:12:13 2016 New Revision: 297269 URL: https://svnweb.freebsd.org/changeset/base/297269 Log: LIBRARIES_ONLY should only be defined during install32. r245561 added it to prevent extra files from being installed during the install32 phase (to prevent duplicates in the meta log with -DNO_ROOT). The flag should not be passed during build32 though since it may prevent staging of includes during the 'make includes' phase on library directories. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Mar 25 16:01:40 2016 (r297268) +++ head/Makefile.libcompat Fri Mar 25 19:12:13 2016 (r297269) @@ -79,7 +79,6 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ - -DLIBRARIES_ONLY \ -DNO_CPU_CFLAGS \ MK_CTF=no \ -DNO_LINT \ @@ -87,7 +86,8 @@ LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCO LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \ - MK_TOOLCHAIN=no ${IMAKE_INSTALL} + MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ + -DLIBRARIES_ONLY .if ${XCC:N${CCACHE_BIN}:M/*} LIBCOMPATCFLAGS+= --sysroot=${WORLDTMP} From owner-svn-src-head@freebsd.org Fri Mar 25 19:12:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93F9FADD616; Fri, 25 Mar 2016 19:12:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B48A1FAB; Fri, 25 Mar 2016 19:12:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PJCcBQ062404; Fri, 25 Mar 2016 19:12:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PJCcjv062400; Fri, 25 Mar 2016 19:12:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603251912.u2PJCcjv062400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 19:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297270 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:12:39 -0000 Author: bdrewery Date: Fri Mar 25 19:12:38 2016 New Revision: 297270 URL: https://svnweb.freebsd.org/changeset/base/297270 Log: Build libcompat (lib32) with a --sysroot pointing into its stage directory. This overrides the cross-compiler's default sysroot to use the WORLD32's sysroot for building the lib32 libraries. Previously the cross-compiler would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags were used to build using the lib32 files. This leads to multiple issues discussed later. Some extra headers are now needed to be staged since the 64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP is still used via PATH for build tools. Overriding the default target/arch is retained in the CC/CXX overrides. This allows reverting the LDSCRIPT rewriting in installworld from r296921 and r235122, thus allowing read-only objdirs to work for installing again. This removes the need for _LDSCRIPTROOT. This allows progressing the change to always use --sysroot for the build rather than only relying on the cross-compiler's default sysroot. The work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER not using a --sysroot [1]. PR: 196193 [1] Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/Makefile.libcompat head/share/mk/bsd.lib.mk head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 19:12:13 2016 (r297269) +++ head/Makefile.inc1 Fri Mar 25 19:12:38 2016 (r297270) @@ -360,7 +360,6 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB # world stage WMAKEENV= ${CROSSENV} \ - _LDSCRIPTROOT= \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Mar 25 19:12:13 2016 (r297269) +++ head/Makefile.libcompat Fri Mar 25 19:12:38 2016 (r297270) @@ -64,13 +64,17 @@ LIBCOMPAT_OBJTREE?= ${OBJTREE}${.CURDIR} LIBCOMPATTMP?= ${OBJTREE}${.CURDIR}/lib${libcompat} LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ - -isystem ${LIBCOMPATTMP}/usr/include/ \ -L${LIBCOMPATTMP}/usr/lib${libcompat} \ - -B${LIBCOMPATTMP}/usr/lib${libcompat} + --sysroot=${LIBCOMPATTMP} + +# -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for +# Clang/GCC. +LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} +# GCC requires -isystem when using a cross-compiler. +LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ - _LDSCRIPTROOT=${LIBCOMPATTMP} \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} \ LIBDIR=/usr/lib${libcompat} \ @@ -89,15 +93,16 @@ LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTA MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ -DLIBRARIES_ONLY -.if ${XCC:N${CCACHE_BIN}:M/*} -LIBCOMPATCFLAGS+= --sysroot=${WORLDTMP} -.endif - _LC_LIBDIRS.yes= lib gnu/lib _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib +_LC_INCDIRS= \ + include \ + lib/ncurses/ncursesw \ + ${_LC_LIBDIRS.yes} + # Shared logic build${libcompat}: .PHONY @echo @@ -120,8 +125,7 @@ build${libcompat}: .PHONY mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} .for _t in obj includes - ${_+_}cd ${.CURDIR}/include; ${LIBCOMPATWMAKE} DIRPRFX=include/ ${_t} -.for _dir in ${_LC_LIBDIRS.yes} +.for _dir in ${_LC_INCDIRS} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} DIRPRFX=${_dir}/ ${_t} .endfor .endfor Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Mar 25 19:12:13 2016 (r297269) +++ head/share/mk/bsd.lib.mk Fri Mar 25 19:12:38 2016 (r297270) @@ -215,26 +215,10 @@ ${SHLIB_NAME_FULL}: beforelinking .endif .if defined(SHLIB_LINK) -# ${_LDSCRIPTROOT} is needed when cross-building -# and when building 32 bits library shims. -# -# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating -# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an -# alternative directory which is called "sysroot", so during buildworld binaries -# won't be linked against the running system libraries but against the ones of -# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of -# the location where we store them: -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty -# because ld(1) will manage to find them from sysroot; -# - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path, outside of sysroot. -# Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty -# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) ${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} - sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${_SHLIBDIR}/${SHLIB_NAME},g' \ - -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${_LIBDIR},g' \ + sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \ + -e 's,@@LIBDIR@@,${_LIBDIR},g' \ ${.ALLSRC} > ${.TARGET} ${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld @@ -338,9 +322,6 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${i .if !defined(INTERNALLIB) realinstall: _libinstall .ORDER: beforeinstall _libinstall -.if target(${SHLIB_LINK:R}.ld) -_libinstall: ${SHLIB_LINK:R}.ld -.endif _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -367,7 +348,6 @@ _libinstall: ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} - rm -f ${SHLIB_LINK:R}.ld .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 25 19:12:13 2016 (r297269) +++ head/share/mk/bsd.sys.mk Fri Mar 25 19:12:38 2016 (r297270) @@ -231,7 +231,6 @@ stage_files.shlib: ${_LIBS:M*.so.*} .endif .if defined(SHLIB_LINK) && commands(${SHLIB_LINK:R}.ld) -#_LDSCRIPTROOT?= ${STAGE_OBJTOP} STAGE_AS_SETS+= ldscript STAGE_AS.ldscript+= ${SHLIB_LINK:R}.ld stage_as.ldscript: ${SHLIB_LINK:R}.ld From owner-svn-src-head@freebsd.org Fri Mar 25 19:12:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D45CADD62D; Fri, 25 Mar 2016 19:12:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49E901FB4; Fri, 25 Mar 2016 19:12:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PJCftC062463; Fri, 25 Mar 2016 19:12:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PJCfI7062462; Fri, 25 Mar 2016 19:12:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603251912.u2PJCfI7062462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 19:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297271 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:12:42 -0000 Author: bdrewery Date: Fri Mar 25 19:12:41 2016 New Revision: 297271 URL: https://svnweb.freebsd.org/changeset/base/297271 Log: Update flags for external GCC. - The -L WORLDTMP/usr/lib is not needed as GCC is already adding in -L =/usr/lib internally with --sysroot. It does not do this for header include paths though, thus passing -isystem =/usr/include is still needed. For the forced libc++ usage: - Use -isystem rather than -I for libc++ headers. - Use -std=c++11 rather than gnu++11. - Use -nostdinc++ to ensure GCC's headers don't leak in. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 19:12:38 2016 (r297270) +++ head/Makefile.inc1 Fri Mar 25 19:12:41 2016 (r297271) @@ -432,8 +432,11 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib -XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ +# GCC requires -isystem when using a cross-compiler. +XCFLAGS+= -isystem ${WORLDTMP}/usr/include +# Force using libc++ for external GCC. +XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${WORLDTMP}/../lib/libc++ # XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes # due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when # building C++ files so this can come out if passing CXXFLAGS down is fixed. From owner-svn-src-head@freebsd.org Fri Mar 25 19:12:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7C66ADD656; Fri, 25 Mar 2016 19:12:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6E91056; Fri, 25 Mar 2016 19:12:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PJCiMH062510; Fri, 25 Mar 2016 19:12:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PJCiIQ062509; Fri, 25 Mar 2016 19:12:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603251912.u2PJCiIQ062509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 19:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297272 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:12:46 -0000 Author: bdrewery Date: Fri Mar 25 19:12:44 2016 New Revision: 297272 URL: https://svnweb.freebsd.org/changeset/base/297272 Log: Fix libcompat not handling some external toolchain flags. - Use libc++ with GCC. - Use CROSS_BINUTILS_PREFIX with -B (r280980 addressed this mostly already) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Mar 25 19:12:41 2016 (r297271) +++ head/Makefile.libcompat Fri Mar 25 19:12:44 2016 (r297272) @@ -52,7 +52,8 @@ LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTF # Generic code for each type. # Set defaults based on type. libcompat= ${LIBCOMPAT:tl} -_LIBCOMPAT_MAKEVARS= _OBJTREE TMP CPUFLAGS CFLAGS WMAKEENV WMAKEFLAGS WMAKE +_LIBCOMPAT_MAKEVARS= _OBJTREE TMP CPUFLAGS CFLAGS CXXFLAGS WMAKEENV \ + WMAKEFLAGS WMAKE .for _var in ${_LIBCOMPAT_MAKEVARS} .if !empty(LIB${LIBCOMPAT}${_var}) LIBCOMPAT${_var}?= ${LIB${LIBCOMPAT}${_var}} @@ -65,7 +66,8 @@ LIBCOMPATTMP?= ${OBJTREE}${.CURDIR}/lib LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ -L${LIBCOMPATTMP}/usr/lib${libcompat} \ - --sysroot=${LIBCOMPATTMP} + --sysroot=${LIBCOMPATTMP} \ + ${BFLAGS} # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. @@ -73,6 +75,12 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/ # GCC requires -isystem when using a cross-compiler. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +# Force using libc++ for external GCC. +LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ +.endif + # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -81,7 +89,7 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L SHLIBDIR=/usr/lib${libcompat} \ DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}" LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ - CXX="${XCXX} ${LIBCOMPATCFLAGS}" \ + CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ MK_CTF=no \ From owner-svn-src-head@freebsd.org Fri Mar 25 19:13:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C448ADD6C9; Fri, 25 Mar 2016 19:13:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA8C13CA; Fri, 25 Mar 2016 19:13:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 28D0F1105; Fri, 25 Mar 2016 19:13:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B5EDA17B6A; Fri, 25 Mar 2016 19:13:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id GYyyCPqy-h6Z; Fri, 25 Mar 2016 19:13:02 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EA12E17B62 To: Nikolai Lifanov References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> <56F2FCDC.3070300@FreeBSD.org> Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <56F58DBA.2020607@FreeBSD.org> Date: Fri, 25 Mar 2016 12:12:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56F2FCDC.3070300@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gCuNoENXF0ncjUBnIafa8xkhLqgtsw2um" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:13:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gCuNoENXF0ncjUBnIafa8xkhLqgtsw2um Content-Type: multipart/mixed; boundary="ukBHfPuVmmDNk0X1PEpbJWbAQxWubjj73" From: Bryan Drewery To: Nikolai Lifanov Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" Message-ID: <56F58DBA.2020607@FreeBSD.org> Subject: Re: svn commit: r296921 - head/share/mk References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> <56F2FCDC.3070300@FreeBSD.org> In-Reply-To: <56F2FCDC.3070300@FreeBSD.org> --ukBHfPuVmmDNk0X1PEpbJWbAQxWubjj73 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/23/16 1:30 PM, Bryan Drewery wrote: > On 3/22/2016 9:00 AM, Bryan Drewery wrote: >> On 3/22/16 8:44 AM, Nikolai Lifanov wrote: >>> On 03/22/16 11:26, Bryan Drewery wrote: >>>> On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>>>> Hi! >>>>> >>>>> I can't install world with a read-only /usr/obj anymore: >>>>> https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >>>>> >>>>> It looks related to r296921 but I don't fully understand our build >>>>> system to be sure of that. >>>>> >>>>> What do you think? >>>>> >>>> >>>> Definitely, but I don't think it would have worked before "r284345 |= sjg >>>> | 2015-06-13" anyhow. >>>> >>>> The better fix here involves a lot of rework to the LIB32 build. I >>>> might be able to come up with a hack to fix read-only /usr/obj here >>>> until the major LIB32 work can be done. >>>> >>> >>> Install with read-only obj worked for me before this change. >>> >> >> With LIB32 enabled, on head? I don't see how after "r235122 | jlh | >> 2012-05-07" made the change I restored. >> >> >=20 > FYI I am working on resolving this by making the lib32 build use a > proper --sysroot. It should be done in the next few days. >=20 This should now work again after r297270. --=20 Regards, Bryan Drewery --ukBHfPuVmmDNk0X1PEpbJWbAQxWubjj73-- --gCuNoENXF0ncjUBnIafa8xkhLqgtsw2um Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJW9Y27AAoJEDXXcbtuRpfPWu4IALYINPi4j/yATLXj9GwyDSHU sa2Y0hLC2znAUb674uLe0yNrRKsLGckYAMxhDVQmCaefxzTMTenBXjwh7UbPMHPs /k9A5rb09P8vnXplUh+kSuojkEqWOh2NDFq43eOOECVtRozojCl5rlUniKgEWlR4 IblSHr95RNiT17NOV/IB2JQh1W0oS4gzXOybCNeUsOm6FhvHqMHppg+o2WLmFElN sxOdp0AQk/VjWO2R18672804Ihjyro4NHimukraWYMpatmNZOTTK7xFbLQ2Yzlol T1tlOgJaO1SSInbERqEgzwS2kr4XZFiFSkYDUeOxdIIHxvEtDmn8ILxBbT9XVk0= =s4z7 -----END PGP SIGNATURE----- --gCuNoENXF0ncjUBnIafa8xkhLqgtsw2um-- From owner-svn-src-head@freebsd.org Fri Mar 25 19:35:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5134BADDB6D; Fri, 25 Mar 2016 19:35:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013191D1A; Fri, 25 Mar 2016 19:35:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PJZUlr068534; Fri, 25 Mar 2016 19:35:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PJZTkK068531; Fri, 25 Mar 2016 19:35:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201603251935.u2PJZTkK068531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 25 Mar 2016 19:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297273 - in head/sys: ddb kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 19:35:31 -0000 Author: cem Date: Fri Mar 25 19:35:29 2016 New Revision: 297273 URL: https://svnweb.freebsd.org/changeset/base/297273 Log: Add td_swinvoltick to track last involuntary context switch Expose in DDB via "show thread." Reviewed by: markj Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ddb/db_ps.c head/sys/kern/kern_synch.c head/sys/sys/proc.h Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Fri Mar 25 19:12:44 2016 (r297272) +++ head/sys/ddb/db_ps.c Fri Mar 25 19:35:29 2016 (r297273) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -302,6 +303,7 @@ DB_SHOW_COMMAND(thread, db_show_thread) struct thread *td; struct lock_object *lock; bool comma; + int delta; /* Determine which thread to examine. */ if (have_addr) @@ -376,6 +378,16 @@ DB_SHOW_COMMAND(thread, db_show_thread) td->td_wchan); db_printf(" priority: %d\n", td->td_priority); db_printf(" container lock: %s (%p)\n", lock->lo_name, lock); + if (td->td_swvoltick != 0) { + delta = (u_int)ticks - (u_int)td->td_swvoltick; + db_printf(" last voluntary switch: %d ms ago\n", + 1000 * delta / hz); + } + if (td->td_swinvoltick != 0) { + delta = (u_int)ticks - (u_int)td->td_swinvoltick; + db_printf(" last involuntary switch: %d ms ago\n", + 1000 * delta / hz); + } } DB_SHOW_COMMAND(proc, db_show_proc) Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri Mar 25 19:12:44 2016 (r297272) +++ head/sys/kern/kern_synch.c Fri Mar 25 19:35:29 2016 (r297273) @@ -438,8 +438,10 @@ mi_switch(int flags, struct thread *newt if (flags & SW_VOL) { td->td_ru.ru_nvcsw++; td->td_swvoltick = ticks; - } else + } else { td->td_ru.ru_nivcsw++; + td->td_swinvoltick = ticks; + } #ifdef SCHED_STATS SCHED_STAT_INC(sched_switch_stats[flags & SW_TYPE_MASK]); #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Mar 25 19:12:44 2016 (r297272) +++ head/sys/sys/proc.h Fri Mar 25 19:35:29 2016 (r297273) @@ -254,6 +254,7 @@ struct thread { int td_slptick; /* (t) Time at sleep. */ int td_blktick; /* (t) Time spent blocked. */ int td_swvoltick; /* (t) Time at last SW_VOL switch. */ + int td_swinvoltick; /* (t) Time at last SW_INVOL switch. */ u_int td_cow; /* (*) Number of copy-on-write faults */ struct rusage td_ru; /* (t) rusage information. */ struct rusage_ext td_rux; /* (t) Internal rusage information. */ From owner-svn-src-head@freebsd.org Fri Mar 25 20:56:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8840DADE11D; Fri, 25 Mar 2016 20:56:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF6315DF; Fri, 25 Mar 2016 20:56:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A226E25D3899; Fri, 25 Mar 2016 20:55:58 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 67DA1C79D32; Fri, 25 Mar 2016 20:55:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 5Wg5sOw6FWfJ; Fri, 25 Mar 2016 20:55:55 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 322AFC77171; Fri, 25 Mar 2016 20:55:55 +0000 (UTC) Date: Fri, 25 Mar 2016 20:55:54 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 In-Reply-To: <20160324203117.GY2616@FreeBSD.org> Message-ID: References: <201603240754.u2O7suvM006925@repo.freebsd.org> <20160324203117.GY2616@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 20:56:02 -0000 On Thu, 24 Mar 2016, Gleb Smirnoff wrote: > On Thu, Mar 24, 2016 at 07:54:56AM +0000, George V. Neville-Neil wrote: > G> Author: gnn > G> Date: Thu Mar 24 07:54:56 2016 > G> New Revision: 297225 > G> URL: https://svnweb.freebsd.org/changeset/base/297225 > G> > G> Log: > G> FreeBSD previously provided route caching for TCP (and UDP). Re-add > G> route caching for TCP, with some improvements. In particular, invalidate > G> the route cache if a new route is added, which might be a better match. > G> The cache is automatically invalidated if the old route is deleted. > G> > G> Submitted by: Mike Karels > G> Reviewed by: gnn > G> Differential Revision: https://reviews.freebsd.org/D4306 > > I'm quite surprised to see this checked in, taking into account that the > D4306 has strong disagreement from melifaro@. > > So, now we got two aids for poor routing: TCP route caching & flowtable. I am uncertain by what you mean when you say "routing". For as forwarding is concerned, this doesn't matter. For as local connections are concerned, this is the start to scale again. You are saving 1-2 route lookups per first packet and 2-3 route lookups for any subsequent packet. Worst case scenario your FIB changes for each packet still improves the situation as in the first packet situation. Every lookup I don't have to do I don't have optimize a system for as badly as I would otherwise have to. Flowtable in my view, once this is fully flashed out, has no real reason to be used anymore. Everything else I think my initial reply and gnn's reply has covered. /bz From owner-svn-src-head@freebsd.org Fri Mar 25 22:14:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42851ADD3D6; Fri, 25 Mar 2016 22:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08F351712; Fri, 25 Mar 2016 22:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id nk17so19655507igb.1; Fri, 25 Mar 2016 15:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=9J5tt5dECWrAb4xH5vU1H1gMajZ8nAiAGRmcVgByKdo=; b=u9XkhCkjkGpOrR6TZAxnLZfOvVolXnNoztGosZULH68FC5zGdInG41pk92iH1vAicS 89ZYhaVozMMglMOJ/pNx30AM3ODnqsR6lU35H2QZDvQ9JLXUMuCP0WxuDnEsgvrlZjvN 6Iz2ai6JXTNTCOrs/GFZQ4UqIxBd8C1zLL7kKCwe4mKFlN0WMrr1DbvMQjfkgJWpKJzC 60T5W8RwwFNcyvCMEUSAdsCLeccAumjDj1VdMvbA3KwyLuEW698vmGvrxdVqkUcdOI6r 7ws9lKtXsOBMq5nv1G19SlRWiRMpSqsxW34bnUP5xCHsTJ0YEwHsebTN7b0dVHynw1U+ rihw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=9J5tt5dECWrAb4xH5vU1H1gMajZ8nAiAGRmcVgByKdo=; b=feuHd8HPvVKwAAuWOYmtK2gN4S4DnldmbgFADy8uz+GT/11PjgnpHMRbFSQHEaB3Qo e8f6+S3a7JbRsKYGKL4V6moH7okTWWBlYqIgpCQX2EmFD+4M7+K3FriUN+jvg5WxhkKs WUMrgCWE0ZLpaviR8DjfBVP46NZ+fuAm34Xp/0CEqBsmIz4GUZgqjxfFYl//7/uMeSbm hSmv2NZBQ4i1r93Ve6gBKsnZ/+3vqp+1cKuNRPE7xrAWroYWRFxYrim4byxe6gDAN8FR G4BddF5iDBMfGjd0CwaL4UQv8m8SUFAjDGIGRrlX5ajfDXN3IdfCqoDV+b0naR38Rs4r jE7Q== X-Gm-Message-State: AD7BkJIxCNRViHjuhfXdsSenGhvOKGyBwHa1qR7JE1eMFwEBXU9cghRZa7mYcEUHTEgW/hZ8I7twiJPIhd+Gqw== MIME-Version: 1.0 X-Received: by 10.50.50.234 with SMTP id f10mr677658igo.37.1458944045317; Fri, 25 Mar 2016 15:14:05 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Fri, 25 Mar 2016 15:14:05 -0700 (PDT) In-Reply-To: References: <201603240754.u2O7suvM006925@repo.freebsd.org> <20160324203117.GY2616@FreeBSD.org> Date: Fri, 25 Mar 2016 15:14:05 -0700 Message-ID: Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: Gleb Smirnoff , "George V. Neville-Neil" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:14:06 -0000 [snip] The thing flowtable gave you is the ability to set a per connection (L4 match) to be able to set a destination MAC to forward to - so you COULD build a complete load balancer in kernel. Gleb stripped out the L4 bits to simplify it for netflix, which removed that functionality. I'd love to see it re-added back in and a userland API to let us do that - then yes, we can build kernel load balancers for this stuff. -a From owner-svn-src-head@freebsd.org Fri Mar 25 22:32:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 755E5ADD8DB; Fri, 25 Mar 2016 22:32:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DDD11ED0; Fri, 25 Mar 2016 22:32:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMWRmH025133; Fri, 25 Mar 2016 22:32:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMWQWc025120; Fri, 25 Mar 2016 22:32:26 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201603252232.u2PMWQWc025120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 25 Mar 2016 22:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297276 - in head/contrib/byacc: . package package/debian package/pkgsrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:32:28 -0000 Author: jkim Date: Fri Mar 25 22:32:26 2016 New Revision: 297276 URL: https://svnweb.freebsd.org/changeset/base/297276 Log: Merge byacc 20160324. Modified: head/contrib/byacc/CHANGES head/contrib/byacc/MANIFEST head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/main.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/debian/copyright head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile head/contrib/byacc/reader.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/CHANGES Fri Mar 25 22:32:26 2016 (r297276) @@ -1,3 +1,28 @@ +2016-03-24 Thomas E. Dickey + + * reader.c: unused variable + + * package/pkgsrc/Makefile, package/debian/copyright: bump + +2016-03-24 Jung-uk.Kim + + * main.c: + correct logic for finding output suffix in the "-o" option, which matched + the first occurrence of ".c" in the name in 2005-08-13 changes rather than + at the end of the filename (patch by Jung-uk Kim) + +2016-03-24 Thomas E. Dickey + + * aclocal.m4: + update CF_WITH_MAN2HTML to use configured shell rather than /bin/sh + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2016-01-25 Thomas E. Dickey + + * config.guess, config.sub: 2016-01-01 + 2015-07-10 Thomas E. Dickey * lr0.c: fix a duplicate-free in the leak-checking @@ -2275,7 +2300,7 @@ * vmsbuild.com: original version -2000-02-23 Thomas E. Dickey +2000-02-23 dickey * test/RCS, RCS: PERMIT FILE Modified: head/contrib/byacc/MANIFEST ============================================================================== --- head/contrib/byacc/MANIFEST Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/MANIFEST Fri Mar 25 22:32:26 2016 (r297276) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20150711, version t20150711 +MANIFEST for byacc-20160324, version t20160324 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/VERSION Fri Mar 25 22:32:26 2016 (r297276) @@ -1 +1 @@ -20150711 +20160324 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/aclocal.m4 Fri Mar 25 22:32:26 2016 (r297276) @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.38 2015/07/05 22:16:23 tom Exp $ +dnl $Id: aclocal.m4,v 1.39 2016/03/25 00:06:44 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2014,2015 Thomas E. Dickey +dnl Copyright 2004-2015,2016 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -1121,7 +1121,7 @@ if test "$with_dmalloc" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_MAN2HTML version: 4 updated: 2015/05/03 19:10:48 +dnl CF_WITH_MAN2HTML version: 5 updated: 2015/08/20 04:51:36 dnl ---------------- dnl Check for man2html and groff. Optionally prefer man2html over groff. dnl Generate a shell script which hides the differences between the two. @@ -1157,7 +1157,7 @@ esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <. @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -221,7 +221,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -249,6 +249,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -962,6 +965,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1038,7 +1044,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1117,7 +1123,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1387,6 +1393,9 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < #ifndef _WIN32 @@ -410,32 +410,46 @@ alloc_file_name(size_t len, const char * return result; } +static char * +find_suffix(char *name, const char *suffix) +{ + size_t len = strlen(name); + size_t slen = strlen(suffix); + if (len >= slen) + { + name += len - slen; + if (strcmp(name, suffix) == 0) + return name; + } + return NULL; +} + static void create_file_names(void) { size_t len; const char *defines_suffix; const char *externs_suffix; - char *prefix; + char *suffix; - prefix = NULL; + suffix = NULL; defines_suffix = DEFINES_SUFFIX; externs_suffix = EXTERNS_SUFFIX; /* compute the file_prefix from the user provided output_file_name */ if (output_file_name != 0) { - if (!(prefix = strstr(output_file_name, OUTPUT_SUFFIX)) - && (prefix = strstr(output_file_name, ".c"))) + if (!(suffix = find_suffix(output_file_name, OUTPUT_SUFFIX)) + && (suffix = find_suffix(output_file_name, ".c"))) { defines_suffix = ".h"; externs_suffix = ".i"; } } - if (prefix != NULL) + if (suffix != NULL) { - len = (size_t) (prefix - output_file_name); + len = (size_t) (suffix - output_file_name); file_prefix = TMALLOC(char, len + 1); NO_SPACE(file_prefix); strncpy(file_prefix, output_file_name, len)[len] = 0; @@ -477,7 +491,7 @@ create_file_names(void) CREATE_FILE_NAME(graph_file_name, GRAPH_SUFFIX); } - if (prefix != NULL) + if (suffix != NULL) { FREE(file_prefix); } Modified: head/contrib/byacc/package/byacc.spec ============================================================================== --- head/contrib/byacc/package/byacc.spec Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/package/byacc.spec Fri Mar 25 22:32:26 2016 (r297276) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20150711 +%define AppVersion 20160324 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.28 2015/07/11 00:53:15 tom Exp $ +# $XTermId: byacc.spec,v 1.29 2016/03/24 23:55:52 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/debian/changelog ============================================================================== --- head/contrib/byacc/package/debian/changelog Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/package/debian/changelog Fri Mar 25 22:32:26 2016 (r297276) @@ -1,3 +1,9 @@ +byacc (20160324) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Thu, 24 Mar 2016 19:55:52 -0400 + byacc (20150711) unstable; urgency=low * maintenance updates Modified: head/contrib/byacc/package/debian/copyright ============================================================================== --- head/contrib/byacc/package/debian/copyright Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/package/debian/copyright Fri Mar 25 22:32:26 2016 (r297276) @@ -1,4 +1,4 @@ -Upstream source http://dickey.his.com/byacc/byacc.html +Upstream source http://invisible-island.net/byacc/byacc.html Berkeley Yacc is in the public domain; changes made to it by the current maintainer are likewise unrestricted. That applies to most of the files. @@ -36,7 +36,7 @@ skeleton.c with the bug report. Do not Files: aclocal.m4 Licence: other-BSD -Copyright: 2004-2014,2015 by Thomas E. Dickey +Copyright: 2004-2015,2016 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including Modified: head/contrib/byacc/package/mingw-byacc.spec ============================================================================== --- head/contrib/byacc/package/mingw-byacc.spec Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/package/mingw-byacc.spec Fri Mar 25 22:32:26 2016 (r297276) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20150711 +%define AppVersion 20160324 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.10 2015/07/11 00:53:15 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.11 2016/03/24 23:55:52 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/pkgsrc/Makefile ============================================================================== --- head/contrib/byacc/package/pkgsrc/Makefile Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/package/pkgsrc/Makefile Fri Mar 25 22:32:26 2016 (r297276) @@ -1,14 +1,14 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20150711 +DISTNAME= byacc-20160324 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= http://dickey.his.com/byacc/byacc.html +HOMEPAGE= http://invisible-island.net/byacc/byacc.html COMMENT= Berkeley Yacc PKG_DESTDIR_SUPPORT= user-destdir Modified: head/contrib/byacc/reader.c ============================================================================== --- head/contrib/byacc/reader.c Fri Mar 25 21:34:18 2016 (r297275) +++ head/contrib/byacc/reader.c Fri Mar 25 22:32:26 2016 (r297276) @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.59 2015/07/11 00:39:03 tom Exp $ */ +/* $Id: reader.c,v 1.60 2016/03/25 00:51:07 tom Exp $ */ #include "defs.h" @@ -895,7 +895,7 @@ copy_param(int k) } buf[i--] = '\0'; - i = trim_blanks(buf); + (void)trim_blanks(buf); comma = buf - 1; do From owner-svn-src-head@freebsd.org Fri Mar 25 22:36:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438DFADD965; Fri, 25 Mar 2016 22:36:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 155421098; Fri, 25 Mar 2016 22:36:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMaDCH025327; Fri, 25 Mar 2016 22:36:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMaD6W025326; Fri, 25 Mar 2016 22:36:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603252236.u2PMaD6W025326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 22:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297277 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:36:14 -0000 Author: bdrewery Date: Fri Mar 25 22:36:13 2016 New Revision: 297277 URL: https://svnweb.freebsd.org/changeset/base/297277 Log: WITHOUT_CROSS_COMPILER: Fix this to use external compiler logic. Without this the default toolchain in /usr/bin/ would not use WORLDTMP via --sysroot, and would lack --target if cross-building. PR: 196193 Related: D3970 Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 22:32:26 2016 (r297276) +++ head/Makefile.inc1 Fri Mar 25 22:36:13 2016 (r297277) @@ -413,7 +413,8 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="$ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ SIZE="${XSIZE}" -.if ${XCC:N${CCACHE_BIN}:M/*} +# External compiler needs sysroot and target flags. +.if ${XCC:N${CCACHE_BIN}:M/*} || ${MK_CROSS_COMPILER} == "no" .if defined(CROSS_BINUTILS_PREFIX) # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a # directory, but the compiler will look in the right place for it's @@ -454,7 +455,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} XCFLAGS+= ${BFLAGS} XCXXFLAGS+= ${BFLAGS} .endif -.endif # ${XCC:M/*} +.endif # ${XCC:M/*} || ${MK_CROSS_COMPILER} == "no" .if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ ${TARGET_ARCH} == "powerpc64") From owner-svn-src-head@freebsd.org Fri Mar 25 22:36:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07BA4ADD9B5; Fri, 25 Mar 2016 22:36:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C952411F4; Fri, 25 Mar 2016 22:36:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMaNcs025388; Fri, 25 Mar 2016 22:36:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMaN49025387; Fri, 25 Mar 2016 22:36:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603252236.u2PMaN49025387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 22:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297278 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:36:25 -0000 Author: bdrewery Date: Fri Mar 25 22:36:23 2016 New Revision: 297278 URL: https://svnweb.freebsd.org/changeset/base/297278 Log: External compiler: Remove redundant flags from CXXFLAGS. The use of XCXXFLAGS is to assign it to CXX in CROSSENV. XCFLAGS is also assigned here so there is no need to have --syroot and -B flags again. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 22:36:13 2016 (r297277) +++ head/Makefile.inc1 Fri Mar 25 22:36:23 2016 (r297278) @@ -448,12 +448,10 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x8 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} -XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} .else .if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${CROSS_BINUTILS_PREFIX} XCFLAGS+= ${BFLAGS} -XCXXFLAGS+= ${BFLAGS} .endif .endif # ${XCC:M/*} || ${MK_CROSS_COMPILER} == "no" From owner-svn-src-head@freebsd.org Fri Mar 25 22:36:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7BFADDA3D; Fri, 25 Mar 2016 22:36:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C93712AF; Fri, 25 Mar 2016 22:36:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMaTFH025481; Fri, 25 Mar 2016 22:36:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMaTXR025480; Fri, 25 Mar 2016 22:36:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603252236.u2PMaTXR025480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 22:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297280 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:36:31 -0000 Author: bdrewery Date: Fri Mar 25 22:36:29 2016 New Revision: 297280 URL: https://svnweb.freebsd.org/changeset/base/297280 Log: WITHOUT_TOOLCHAIN: Also exclude LLDB. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Mar 25 22:36:26 2016 (r297279) +++ head/share/mk/src.opts.mk Fri Mar 25 22:36:29 2016 (r297280) @@ -355,6 +355,7 @@ MK_CLANG:= no MK_GCC:= no MK_GDB:= no MK_INCLUDES:= no +MK_LLDB:= no .endif .if ${MK_CLANG} == "no" From owner-svn-src-head@freebsd.org Fri Mar 25 22:36:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F58ADDA7E; Fri, 25 Mar 2016 22:36:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F25A136E; Fri, 25 Mar 2016 22:36:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMaWco025526; Fri, 25 Mar 2016 22:36:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMaW44025525; Fri, 25 Mar 2016 22:36:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603252236.u2PMaW44025525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 22:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297281 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:36:33 -0000 Author: bdrewery Date: Fri Mar 25 22:36:32 2016 New Revision: 297281 URL: https://svnweb.freebsd.org/changeset/base/297281 Log: WITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP. This has been the case since r264930 and r274662. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 22:36:29 2016 (r297280) +++ head/Makefile.inc1 Fri Mar 25 22:36:32 2016 (r297281) @@ -623,9 +623,9 @@ _includes: # Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need # headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last. ${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \ - includes + MK_INCLUDES=yes includes .if !empty(SUBDIR_OVERRIDE) && make(buildworld) - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes + ${_+_}cd ${.CURDIR}; ${WMAKE} MK_INCLUDES=yes SHARED=symlinks includes .endif _libraries: @echo From owner-svn-src-head@freebsd.org Fri Mar 25 22:36:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87AAADDA1A; Fri, 25 Mar 2016 22:36:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C6E111FB; Fri, 25 Mar 2016 22:36:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2PMaQDf025433; Fri, 25 Mar 2016 22:36:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2PMaQps025432; Fri, 25 Mar 2016 22:36:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603252236.u2PMaQps025432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 25 Mar 2016 22:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297279 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 22:36:28 -0000 Author: bdrewery Date: Fri Mar 25 22:36:26 2016 New Revision: 297279 URL: https://svnweb.freebsd.org/changeset/base/297279 Log: CROSS_BINUTILS_PREFIX: Reduce redundant logic. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 25 22:36:23 2016 (r297278) +++ head/Makefile.inc1 Fri Mar 25 22:36:26 2016 (r297279) @@ -413,16 +413,16 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="$ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ SIZE="${XSIZE}" -# External compiler needs sysroot and target flags. -.if ${XCC:N${CCACHE_BIN}:M/*} || ${MK_CROSS_COMPILER} == "no" -.if defined(CROSS_BINUTILS_PREFIX) +.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX}) # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a -# directory, but the compiler will look in the right place for it's +# directory, but the compiler will look in the right place for its # tools so we don't need to tell it where to look. -.if exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif -.else + +# External compiler needs sysroot and target flags. +.if ${XCC:N${CCACHE_BIN}:M/*} || ${MK_CROSS_COMPILER} == "no" +.if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" @@ -447,13 +447,13 @@ TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} .endif -XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} +XCFLAGS+= --sysroot=${WORLDTMP} .else -.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX}) -BFLAGS+= -B${CROSS_BINUTILS_PREFIX} +.endif # ${XCC:M/*} || ${MK_CROSS_COMPILER} == "no" + +.if !empty(BFLAGS) XCFLAGS+= ${BFLAGS} .endif -.endif # ${XCC:M/*} || ${MK_CROSS_COMPILER} == "no" .if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ ${TARGET_ARCH} == "powerpc64") From owner-svn-src-head@freebsd.org Sat Mar 26 03:46:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD3EADED43; Sat, 26 Mar 2016 03:46:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A494A1EF4; Sat, 26 Mar 2016 03:46:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q3k4Zc019869; Sat, 26 Mar 2016 03:46:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q3k49U019864; Sat, 26 Mar 2016 03:46:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603260346.u2Q3k49U019864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 26 Mar 2016 03:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297282 - in head: kerberos5/lib/libroken share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 03:46:05 -0000 Author: bdrewery Date: Sat Mar 26 03:46:04 2016 New Revision: 297282 URL: https://svnweb.freebsd.org/changeset/base/297282 Log: We don't have a CPPFLAGS, COPTS or CPUFLAGS. Sponsored by: EMC / Isilon Storage Division Modified: head/kerberos5/lib/libroken/Makefile head/share/mk/bsd.README head/share/mk/bsd.clang-analyze.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.progs.mk Modified: head/kerberos5/lib/libroken/Makefile ============================================================================== --- head/kerberos5/lib/libroken/Makefile Fri Mar 25 22:36:32 2016 (r297281) +++ head/kerberos5/lib/libroken/Makefile Sat Mar 26 03:46:04 2016 (r297282) @@ -76,7 +76,6 @@ SRCS= base64.c \ write_pid.c \ xfree.c -CPPFLAGS+= -DBUILD_ROKEN_LIB CFLAGS+=-I${KRB5DIR}/lib/roken -I. CLEANFILES= roken.h Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Mar 25 22:36:32 2016 (r297281) +++ head/share/mk/bsd.README Sat Mar 26 03:46:04 2016 (r297282) @@ -309,7 +309,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make SRCS.bar= bar_src.c The supported variables are BINDIR BINGRP BINMODE BINOWN - CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD + CFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD LDFLAGS LIBADD MAN MLINKS PROGNAME SRCS. PROGNAME The name that the above program will be installed as, if Modified: head/share/mk/bsd.clang-analyze.mk ============================================================================== --- head/share/mk/bsd.clang-analyze.mk Fri Mar 25 22:36:32 2016 (r297281) +++ head/share/mk/bsd.clang-analyze.mk Sat Mar 26 03:46:04 2016 (r297282) @@ -58,14 +58,12 @@ CLANG_ANALYZE_CXXFLAGS= ${CXXFLAGS:N-Wa, .c.clang-analyzer: ${CC:N${CCACHE_BIN}} ${CLANG_ANALYZE_FLAGS} \ - ${CLANG_ANALYZE_CFLAGS} ${CPPFLAGS} \ - ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \ - ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} + ${CLANG_ANALYZE_CFLAGS} \ + ${.IMPSRC} .cc.clang-analyzer .cpp.clang-analyzer .cxx.clang-analyzer .C.clang-analyzer: ${CXX:N${CCACHE_BIN}} ${CLANG_ANALYZE_CXX_FLAGS} \ - ${CLANG_ANALYZE_CXXFLAGS} ${CPPFLAGS} \ - ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \ - ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} + ${CLANG_ANALYZE_CXXFLAGS} \ + ${.IMPSRC} CLANG_ANALYZE_SRCS= \ ${SRCS:M*.[cC]} ${SRCS:M*.cc} \ Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Mar 25 22:36:32 2016 (r297281) +++ head/share/mk/bsd.prog.mk Sat Mar 26 03:46:04 2016 (r297282) @@ -8,6 +8,7 @@ # XXX The use of COPTS in modern makefiles is discouraged. .if defined(COPTS) +.warning COPTS should be CFLAGS. CFLAGS+=${COPTS} .endif Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 25 22:36:32 2016 (r297281) +++ head/share/mk/bsd.progs.mk Sat Mar 26 03:46:04 2016 (r297282) @@ -24,7 +24,7 @@ PROGS += ${PROGS_CXX} # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS WARNS -PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LINKS \ +PROG_VARS += CFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LINKS \ LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) From owner-svn-src-head@freebsd.org Sat Mar 26 03:46:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF5DADED67; Sat, 26 Mar 2016 03:46:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57F1E105B; Sat, 26 Mar 2016 03:46:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q3kEIj019940; Sat, 26 Mar 2016 03:46:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q3kCfd019916; Sat, 26 Mar 2016 03:46:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603260346.u2Q3kCfd019916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 26 Mar 2016 03:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297283 - in head: lib/clang/libllvmsupport lib/libc/net lib/libc/stdtime lib/libclang_rt/asan_dynamic lib/libz lib/msun/arm share/mk sys/boot/i386/boot0 sys/boot/i386/boot2 sys/boot/i3... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 03:46:15 -0000 Author: bdrewery Date: Sat Mar 26 03:46:12 2016 New Revision: 297283 URL: https://svnweb.freebsd.org/changeset/base/297283 Log: Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/clang/libllvmsupport/Makefile head/lib/libc/net/Makefile.inc head/lib/libc/stdtime/Makefile.inc head/lib/libclang_rt/asan_dynamic/Makefile head/lib/libz/Makefile head/lib/msun/arm/Makefile.inc head/share/mk/bsd.README head/share/mk/bsd.sys.mk head/sys/boot/i386/boot0/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/cdboot/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/btx/btx/Makefile head/sys/boot/pc98/btx/btxldr/Makefile head/sys/boot/pc98/cdboot/Makefile Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/clang/libllvmsupport/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -113,4 +113,3 @@ SRCS+= StringPool.cpp # Ugly hack to work around CLOCK_PROCESS_CPUTIME_ID not being properly defined # between r239347 and r245428. CXXFLAGS.Process.cpp= -DCLOCK_PROCESS_CPUTIME_ID=15 -CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} Modified: head/lib/libc/net/Makefile.inc ============================================================================== --- head/lib/libc/net/Makefile.inc Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/libc/net/Makefile.inc Sat Mar 26 03:46:12 2016 (r297283) @@ -35,7 +35,6 @@ YFLAGS+=-p_nsyy LFLAGS+=-P_nsyy CFLAGS.nslexer.c= -DYY_BUF_SIZE=1024 -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} MAN+= byteorder.3 ethers.3 eui64.3 \ getaddrinfo.3 gai_strerror.3 gethostbyname.3 \ Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/libc/stdtime/Makefile.inc Sat Mar 26 03:46:12 2016 (r297283) @@ -12,7 +12,6 @@ SYM_MAPS+= ${LIBC_SRCTOP}/stdtime/Symbol CFLAGS+= -I${LIBC_SRCTOP}/../../contrib/tzcode/stdtime -I${LIBC_SRCTOP}/stdtime CFLAGS.localtime.c= -fwrapv -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 MAN+= tzfile.5 Modified: head/lib/libclang_rt/asan_dynamic/Makefile ============================================================================== --- head/lib/libclang_rt/asan_dynamic/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/libclang_rt/asan_dynamic/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -101,4 +101,3 @@ CXXFLAGS.ubsan_handlers_cxx.cc= -frtti CXXFLAGS.ubsan_type_hash.cc= -frtti CXXFLAGS.ubsan_type_hash_itanium.cc= -frtti CXXFLAGS.ubsan_type_hash_win.cc= -frtti -CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/libz/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -75,4 +75,3 @@ FILESDIR= ${LIBDATADIR}/pkgconfig ## XXX: clang integrated-as doesn't grok .intel_syntax directives yet #ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} -#ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Sat Mar 26 03:46:04 2016 (r297282) +++ head/lib/msun/arm/Makefile.inc Sat Mar 26 03:46:12 2016 (r297283) @@ -8,5 +8,3 @@ ARCH_SRCS = fenv-softfp.c fenv-vfp.c .endif CFLAGS.fenv-vfp.c= -mfpu=vfp -mfloat-abi=softfp -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} - Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sat Mar 26 03:46:04 2016 (r297282) +++ head/share/mk/bsd.README Sat Mar 26 03:46:12 2016 (r297283) @@ -120,6 +120,10 @@ object. The following variables are common: +ACFLAGS.${SRC} + Flags dependent on source file name. +CFLAGS.${SRC} + Flags dependent on source file name. CFLAGS.${COMPILER_TYPE} Flags dependent on compiler added to CXXFLAGS. CFLAGS.${MACHINE_ARCH} @@ -131,6 +135,8 @@ CXXFLAGS.${COMPILER_TYPE} Flags dependent on compiler added to CXXFLAGS. CXXFLAGS.${MACHINE_ARCH} Architectural flags added to CXXFLAGS. +CXXFLAGS.${SRC} + Flags dependent on source file name. COMPILER_FEATURES A list of features that the compiler supports. Zero or more of: Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat Mar 26 03:46:04 2016 (r297282) +++ head/share/mk/bsd.sys.mk Sat Mar 26 03:46:12 2016 (r297283) @@ -174,6 +174,10 @@ CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} +ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} +CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} + # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ Modified: head/sys/boot/i386/boot0/Makefile ============================================================================== --- head/sys/boot/i386/boot0/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/boot0/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -80,4 +80,3 @@ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.boot0.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/boot2/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -115,4 +115,3 @@ machine: ${.CURDIR}/../../../i386/includ # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.boot1.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/btx/btx/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -31,4 +31,3 @@ LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.btx.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/btx/btxldr/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -18,4 +18,3 @@ LDFLAGS=-e start -Ttext ${LOADER_ADDRESS # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.btxldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/cdboot/Makefile ============================================================================== --- head/sys/boot/i386/cdboot/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/cdboot/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -16,4 +16,3 @@ LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.cdboot.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/gptboot/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -90,4 +90,3 @@ machine: .NOMETA # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.gptldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/gptzfsboot/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -88,4 +88,3 @@ machine: .NOMETA # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.gptldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/libi386/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -75,7 +75,6 @@ machine: .NOMETA # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} .if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/pxeldr/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -46,4 +46,3 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXK # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.pxeldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/i386/zfsboot/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -93,4 +93,3 @@ machine: .NOMETA # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.zfsldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/pc98/boot2/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -114,4 +114,3 @@ boot2.h: boot1.out # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.boot1.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btx/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/pc98/btx/btx/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -31,4 +31,3 @@ LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.btx.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btxldr/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/pc98/btx/btxldr/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -18,4 +18,3 @@ LDFLAGS=-e start -Ttext ${LOADER_ADDRESS # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.btxldr.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/cdboot/Makefile ============================================================================== --- head/sys/boot/pc98/cdboot/Makefile Sat Mar 26 03:46:04 2016 (r297282) +++ head/sys/boot/pc98/cdboot/Makefile Sat Mar 26 03:46:12 2016 (r297283) @@ -16,4 +16,3 @@ LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.cdboot.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-head@freebsd.org Sat Mar 26 06:55:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19403ADDA8B; Sat, 26 Mar 2016 06:55:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEF481EF3; Sat, 26 Mar 2016 06:55:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q6tuV1077461; Sat, 26 Mar 2016 06:55:56 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q6ttWj077457; Sat, 26 Mar 2016 06:55:55 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603260655.u2Q6ttWj077457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 26 Mar 2016 06:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297284 - in head/sys/arm: arm at91 conf include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 06:55:57 -0000 Author: mmel Date: Sat Mar 26 06:55:55 2016 New Revision: 297284 URL: https://svnweb.freebsd.org/changeset/base/297284 Log: ARM: Teach LINUX_BOOT_ABI to recognize DT blob. This allow us to boot FreeBSD kernel (using uImage encapsulation) directly from U-boot using 'bootm' command or by Android fastboot loader. For now, kernel uImage must be marked as Linux, but we can add support for FreeBSD into U-Boot later. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/board_tsc4370.c head/sys/arm/conf/TEGRA124 head/sys/arm/include/machdep.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 26 03:46:12 2016 (r297283) +++ head/sys/arm/arm/machdep.c Sat Mar 26 06:55:55 2016 (r297284) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef FDT +#include #include #include #endif @@ -959,7 +960,8 @@ makectx(struct trapframe *tf, struct pcb * Fake up a boot descriptor table */ vm_offset_t -fake_preload_metadata(struct arm_boot_params *abp __unused) +fake_preload_metadata(struct arm_boot_params *abp __unused, void *dtb_ptr, + size_t dtb_size) { #ifdef DDB vm_offset_t zstart = 0, zend = 0; @@ -997,6 +999,16 @@ fake_preload_metadata(struct arm_boot_pa } else #endif lastaddr = (vm_offset_t)&end; + if (dtb_ptr != NULL) { + /* Copy DTB to KVA space and insert it into module chain. */ + lastaddr = roundup(lastaddr, sizeof(int)); + fake_preload[i++] = MODINFO_METADATA | MODINFOMD_DTBP; + fake_preload[i++] = sizeof(uint32_t); + fake_preload[i++] = (uint32_t)lastaddr; + memmove((void *)lastaddr, dtb_ptr, dtb_size); + lastaddr += dtb_size; + lastaddr = roundup(lastaddr, sizeof(int)); + } fake_preload[i++] = 0; fake_preload[i] = 0; preload_metadata = (void *)fake_preload; @@ -1023,20 +1035,35 @@ linux_parse_boot_param(struct arm_boot_p struct arm_lbabi_tag *walker; uint32_t revision; uint64_t serial; +#ifdef FDT + struct fdt_header *dtb_ptr; + uint32_t dtb_size; +#endif /* * Linux boot ABI: r0 = 0, r1 is the board type (!= 0) and r2 * is atags or dtb pointer. If all of these aren't satisfied, - * then punt. + * then punt. Unfortunately, it looks like DT enabled kernels + * doesn't uses board type and U-Boot delivers 0 in r1 for them. */ - if (!(abp->abp_r0 == 0 && abp->abp_r1 != 0 && abp->abp_r2 != 0)) - return 0; + if (abp->abp_r0 != 0 || abp->abp_r2 == 0) + return (0); +#ifdef FDT + /* Test if r2 point to valid DTB. */ + dtb_ptr = (struct fdt_header *)abp->abp_r2; + if (fdt_check_header(dtb_ptr) == 0) { + dtb_size = fdt_totalsize(dtb_ptr); + return (fake_preload_metadata(abp, dtb_ptr, dtb_size)); + } +#endif + /* Old, ATAG based boot must have board type set. */ + if (abp->abp_r1 == 0) + return (0); board_id = abp->abp_r1; walker = (struct arm_lbabi_tag *) (abp->abp_r2 + KERNVIRTADDR - abp->abp_physaddr); - /* xxx - Need to also look for binary device tree */ if (ATAG_TAG(walker) != ATAG_CORE) return 0; @@ -1077,7 +1104,7 @@ linux_parse_boot_param(struct arm_boot_p init_static_kenv(NULL, 0); - return fake_preload_metadata(abp); + return fake_preload_metadata(abp, NULL, 0); } #endif @@ -1135,7 +1162,7 @@ default_parse_boot_param(struct arm_boot return lastaddr; #endif /* Fall back to hardcoded metadata. */ - lastaddr = fake_preload_metadata(abp); + lastaddr = fake_preload_metadata(abp, NULL, 0); return lastaddr; } Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Sat Mar 26 03:46:12 2016 (r297283) +++ head/sys/arm/at91/board_tsc4370.c Sat Mar 26 06:55:55 2016 (r297284) @@ -601,7 +601,7 @@ parse_boot_param(struct arm_boot_params inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); } - return fake_preload_metadata(abp); + return fake_preload_metadata(abp, NULL, 0); } ARM_BOARD(NONE, "TSC4370 Controller Board"); Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Sat Mar 26 03:46:12 2016 (r297283) +++ head/sys/arm/conf/TEGRA124 Sat Mar 26 06:55:55 2016 (r297284) @@ -28,6 +28,7 @@ options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC options PLATFORM_SMP options SMP # Enable multiple cores +options LINUX_BOOT_ABI # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Mar 26 03:46:12 2016 (r297283) +++ head/sys/arm/include/machdep.h Sat Mar 26 06:55:55 2016 (r297284) @@ -37,7 +37,8 @@ struct arm_boot_params; vm_offset_t default_parse_boot_param(struct arm_boot_params *abp); vm_offset_t freebsd_parse_boot_param(struct arm_boot_params *abp); vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp); -vm_offset_t fake_preload_metadata(struct arm_boot_params *abp); +vm_offset_t fake_preload_metadata(struct arm_boot_params *abp, + void *dtb_ptr, size_t dtb_size); vm_offset_t parse_boot_param(struct arm_boot_params *abp); void arm_generic_initclocks(void); From owner-svn-src-head@freebsd.org Sat Mar 26 06:57:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4BFADDB00; Sat, 26 Mar 2016 06:57:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A160D10AB; Sat, 26 Mar 2016 06:57:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q6va0V077562; Sat, 26 Mar 2016 06:57:36 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q6vaWA077560; Sat, 26 Mar 2016 06:57:36 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603260657.u2Q6vaWA077560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 26 Mar 2016 06:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297285 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 06:57:38 -0000 Author: mmel Date: Sat Mar 26 06:57:36 2016 New Revision: 297285 URL: https://svnweb.freebsd.org/changeset/base/297285 Log: ARM: Fix ATAG handling in LINUX_BOOT_API: - Don't convert atags address passed from U-Boot. It's real physical address (and we have 1:1 mapping). - Size of tags is encoded in words, not in bytes Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/atags.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 26 06:55:55 2016 (r297284) +++ head/sys/arm/arm/machdep.c Sat Mar 26 06:57:36 2016 (r297285) @@ -1035,6 +1035,7 @@ linux_parse_boot_param(struct arm_boot_p struct arm_lbabi_tag *walker; uint32_t revision; uint64_t serial; + int size; #ifdef FDT struct fdt_header *dtb_ptr; uint32_t dtb_size; @@ -1061,8 +1062,7 @@ linux_parse_boot_param(struct arm_boot_p return (0); board_id = abp->abp_r1; - walker = (struct arm_lbabi_tag *) - (abp->abp_r2 + KERNVIRTADDR - abp->abp_physaddr); + walker = (struct arm_lbabi_tag *)abp->abp_r2; if (ATAG_TAG(walker) != ATAG_CORE) return 0; @@ -1079,8 +1079,9 @@ linux_parse_boot_param(struct arm_boot_p case ATAG_INITRD2: break; case ATAG_SERIAL: - serial = walker->u.tag_sn.low | - ((uint64_t)walker->u.tag_sn.high << 32); + serial = walker->u.tag_sn.high; + serial <<= 32; + serial |= walker->u.tag_sn.low; board_set_serial(serial); break; case ATAG_REVISION: @@ -1089,8 +1090,12 @@ linux_parse_boot_param(struct arm_boot_p break; case ATAG_CMDLINE: /* XXX open question: Parse this for boothowto? */ - bcopy(walker->u.tag_cmd.command, linux_command_line, - ATAG_SIZE(walker)); + size = ATAG_SIZE(walker) - + sizeof(struct arm_lbabi_header); + size = min(size, sizeof(linux_command_line) - 1); + strncpy(linux_command_line, walker->u.tag_cmd.command, + size); + linux_command_line[size] = '\0'; break; default: break; Modified: head/sys/arm/include/atags.h ============================================================================== --- head/sys/arm/include/atags.h Sat Mar 26 06:55:55 2016 (r297284) +++ head/sys/arm/include/atags.h Sat Mar 26 06:57:36 2016 (r297285) @@ -123,7 +123,7 @@ struct arm_lbabi_tag }; #define ATAG_TAG(a) (a)->tag_hdr.tag -#define ATAG_SIZE(a) (a)->tag_hdr.size +#define ATAG_SIZE(a) ((a)->tag_hdr.size * sizeof(uint32_t)) #define ATAG_NEXT(a) (struct arm_lbabi_tag *)((char *)(a) + ATAG_SIZE(a)) #endif /* __MACHINE_ATAGS_H__ */ From owner-svn-src-head@freebsd.org Sat Mar 26 06:59:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BE0ADDC91; Sat, 26 Mar 2016 06:59:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A705B12D5; Sat, 26 Mar 2016 06:59:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q6x1lN077652; Sat, 26 Mar 2016 06:59:01 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q6x1Qf077649; Sat, 26 Mar 2016 06:59:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603260659.u2Q6x1Qf077649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 26 Mar 2016 06:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297286 - in head/sys: arm/arm dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 06:59:03 -0000 Author: mmel Date: Sat Mar 26 06:59:01 2016 New Revision: 297286 URL: https://svnweb.freebsd.org/changeset/base/297286 Log: ARM: Parse command line delivered by U-Boot: - in atags - in DT blob (by using 'fdt chosen' U-Boot command) The command line must start with guard's string 'FreeBSD:' and can contain list of comma separated kenv strings. Also, boot modifier strings from boot.h are recognised and parsed into boothowto. The command line must be passed from U-Boot by setting of bootargs variable: 'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a' followed by 'fdt chosen' (only for DT based boot) Modified: head/sys/arm/arm/machdep.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 26 06:57:36 2016 (r297285) +++ head/sys/arm/arm/machdep.c Sat Mar 26 06:59:01 2016 (r297286) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -232,6 +234,7 @@ static struct pv_addr kernelstack; #if defined(LINUX_BOOT_ABI) #define LBABI_MAX_BANKS 10 +#define CMDLINE_GUARD "FreeBSD:" uint32_t board_id; struct arm_lbabi_tag *atag_list; char linux_command_line[LBABI_MAX_COMMAND_LINE + 1]; @@ -1029,6 +1032,53 @@ pcpu0_init(void) } #if defined(LINUX_BOOT_ABI) + +/* Convert the U-Boot command line into FreeBSD kenv and boot options. */ +static void +cmdline_set_env(char *cmdline, const char *guard) +{ + char *cmdline_next, *env; + size_t size, guard_len; + int i; + + size = strlen(cmdline); + /* Skip leading spaces. */ + for (; isspace(*cmdline) && (size > 0); cmdline++) + size--; + + /* Test and remove guard. */ + if (guard != NULL && guard[0] != '\0') { + guard_len = strlen(guard); + if (strncasecmp(cmdline, guard, guard_len) != 0){ + init_static_kenv(cmdline, 0); + return; + + cmdline += guard_len; + size -= guard_len; + } + } + + /* Skip leading spaces. */ + for (; isspace(*cmdline) && (size > 0); cmdline++) + size--; + + /* Replace ',' with '\0'. */ + /* TODO: implement escaping for ',' character. */ + cmdline_next = cmdline; + while(strsep(&cmdline_next, ",") != NULL) + ; + init_static_kenv(cmdline, 0); + /* Parse boothowto. */ + for (i = 0; howto_names[i].ev != NULL; i++) { + env = kern_getenv(howto_names[i].ev); + if (env != NULL) { + if (strtoul(env, NULL, 10) != 0) + boothowto |= howto_names[i].mask; + freeenv(env); + } + } +} + vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp) { @@ -1036,6 +1086,7 @@ linux_parse_boot_param(struct arm_boot_p uint32_t revision; uint64_t serial; int size; + vm_offset_t lastaddr; #ifdef FDT struct fdt_header *dtb_ptr; uint32_t dtb_size; @@ -1057,9 +1108,6 @@ linux_parse_boot_param(struct arm_boot_p return (fake_preload_metadata(abp, dtb_ptr, dtb_size)); } #endif - /* Old, ATAG based boot must have board type set. */ - if (abp->abp_r1 == 0) - return (0); board_id = abp->abp_r1; walker = (struct arm_lbabi_tag *)abp->abp_r2; @@ -1089,10 +1137,9 @@ linux_parse_boot_param(struct arm_boot_p board_set_revision(revision); break; case ATAG_CMDLINE: - /* XXX open question: Parse this for boothowto? */ size = ATAG_SIZE(walker) - sizeof(struct arm_lbabi_header); - size = min(size, sizeof(linux_command_line) - 1); + size = min(size, LBABI_MAX_COMMAND_LINE); strncpy(linux_command_line, walker->u.tag_cmd.command, size); linux_command_line[size] = '\0'; @@ -1107,9 +1154,9 @@ linux_parse_boot_param(struct arm_boot_p bcopy(atag_list, atags, (char *)walker - (char *)atag_list + ATAG_SIZE(walker)); - init_static_kenv(NULL, 0); - - return fake_preload_metadata(abp, NULL, 0); + lastaddr = fake_preload_metadata(abp, NULL, 0); + cmdline_set_env(linux_command_line, CMDLINE_GUARD); + return lastaddr; } #endif @@ -1785,6 +1832,12 @@ initarm(struct arm_boot_params *abp) if (OF_init((void *)dtbp) != 0) panic("OF_init failed with the found device tree"); +#if defined(LINUX_BOOT_ABI) + if (fdt_get_chosen_bootargs(linux_command_line, + LBABI_MAX_COMMAND_LINE) == 0) + cmdline_set_env(linux_command_line, CMDLINE_GUARD); +#endif + #ifdef EFI efihdr = (struct efi_map_header *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sat Mar 26 06:57:36 2016 (r297285) +++ head/sys/dev/fdt/fdt_common.c Sat Mar 26 06:59:01 2016 (r297286) @@ -722,3 +722,16 @@ fdt_get_unit(device_t dev) return (strtol(name,NULL,0)); } + +int +fdt_get_chosen_bootargs(char *bootargs, size_t max_size) +{ + phandle_t chosen; + + chosen = OF_finddevice("/chosen"); + if (chosen == -1) + return (ENXIO); + if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1) + return (ENXIO); + return (0); +} \ No newline at end of file Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sat Mar 26 06:57:36 2016 (r297285) +++ head/sys/dev/fdt/fdt_common.h Sat Mar 26 06:59:01 2016 (r297286) @@ -100,5 +100,6 @@ int fdt_parent_addr_cells(phandle_t); int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); int fdt_get_unit(device_t); +int fdt_get_chosen_bootargs(char *bootargs, size_t max_size); #endif /* _FDT_COMMON_H_ */ From owner-svn-src-head@freebsd.org Sat Mar 26 08:59:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B8FADC6F3; Sat, 26 Mar 2016 08:59:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4F6215AE; Sat, 26 Mar 2016 08:59:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2Q8xulA013266; Sat, 26 Mar 2016 08:59:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2Q8xuI7013265; Sat, 26 Mar 2016 08:59:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603260859.u2Q8xuI7013265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Mar 2016 08:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297287 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 08:59:57 -0000 Author: avos Date: Sat Mar 26 08:59:56 2016 New Revision: 297287 URL: https://svnweb.freebsd.org/changeset/base/297287 Log: net80211: fix panic for DWDS vaps Since r248069, TX IC lock must obtained before calling ieee80211_encap() and/or ieee80211_parent_xmitpkt(). Tested with: Intel 3945BG. Modified: head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Sat Mar 26 06:59:01 2016 (r297286) +++ head/sys/net80211/ieee80211_wds.c Sat Mar 26 08:59:56 2016 (r297287) @@ -288,9 +288,11 @@ ieee80211_dwds_mcast(struct ieee80211vap /* * Encapsulate the packet in prep for transmission. */ + IEEE80211_TX_LOCK(ic); mcopy = ieee80211_encap(vap, ni, mcopy); if (mcopy == NULL) { /* NB: stat+msg handled in ieee80211_encap */ + IEEE80211_TX_UNLOCK(ic); ieee80211_free_node(ni); continue; } @@ -298,6 +300,7 @@ ieee80211_dwds_mcast(struct ieee80211vap mcopy->m_pkthdr.rcvif = (void *) ni; err = ieee80211_parent_xmitpkt(ic, mcopy); + IEEE80211_TX_UNLOCK(ic); if (!err) { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); From owner-svn-src-head@freebsd.org Sat Mar 26 10:09:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66F8ADBEB2; Sat, 26 Mar 2016 10:09:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73DC31EA3; Sat, 26 Mar 2016 10:09:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QA9SiO035279; Sat, 26 Mar 2016 10:09:28 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QA9SYA035278; Sat, 26 Mar 2016 10:09:28 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603261009.u2QA9SYA035278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 26 Mar 2016 10:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297288 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 10:09:29 -0000 Author: mmel Date: Sat Mar 26 10:09:28 2016 New Revision: 297288 URL: https://svnweb.freebsd.org/changeset/base/297288 Log: TEGRA: Fixes for UART driver: - add mising 'or' in tegra_uart_attach() Pointed by: kan - fix indentation of tegra_softc - remove forgoten debug printf Modified: head/sys/arm/nvidia/tegra_uart.c Modified: head/sys/arm/nvidia/tegra_uart.c ============================================================================== --- head/sys/arm/nvidia/tegra_uart.c Sat Mar 26 08:59:56 2016 (r297287) +++ head/sys/arm/nvidia/tegra_uart.c Sat Mar 26 10:09:28 2016 (r297288) @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); * High-level UART interface. */ struct tegra_softc { - struct ns8250_softc ns8250_base; - clk_t clk; + struct ns8250_softc ns8250_base; + clk_t clk; hwreset_t reset; }; @@ -82,7 +82,7 @@ tegra_uart_attach(struct uart_softc *sc) ns8250->ier_rxbits = 0x1d; ns8250->ier_mask = 0xc0; ns8250->ier = uart_getreg(bas, REG_IER) & ns8250->ier_mask; - ns8250->ier = ns8250->ier_rxbits; + ns8250->ier |= ns8250->ier_rxbits; uart_setreg(bas, REG_IER, ns8250->ier); uart_barrier(bas); return (0); @@ -217,7 +217,6 @@ tegra_uart_probe(device_t dev) device_printf(dev, "Cannot enable UART clock: %d\n", rv); return (ENXIO); } - device_printf(dev, "got UART clock: %lld\n", freq); return (uart_bus_probe(dev, shift, (int)freq, 0, 0)); } From owner-svn-src-head@freebsd.org Sat Mar 26 11:13:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D8DDADDD9F; Sat, 26 Mar 2016 11:13:19 +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 B77F61434; Sat, 26 Mar 2016 11:13:18 +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 u2QBDIqw056582; Sat, 26 Mar 2016 11:13:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QBDIVq056581; Sat, 26 Mar 2016 11:13:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201603261113.u2QBDIVq056581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 26 Mar 2016 11:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297289 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 11:13:19 -0000 Author: bapt Date: Sat Mar 26 11:13:17 2016 New Revision: 297289 URL: https://svnweb.freebsd.org/changeset/base/297289 Log: Update pci_vendors database to 2016-02-27 MFC after: 1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sat Mar 26 10:09:28 2016 (r297288) +++ head/share/misc/pci_vendors Sat Mar 26 11:13:17 2016 (r297289) @@ -3,11 +3,11 @@ # # List of PCI ID's # -# Version: 2015.07.31 -# Date: 2015-07-31 03:15:02 +# Version: 2016.02.27 +# Date: 2016-02-27 03:15:01 # -# Maintained by Martin Mares and other volunteers from the -# PCI ID Project at http://pci-ids.ucw.cz/. +# Maintained by Albert Pool, Martin Mares, and other volunteers from +# the PCI ID Project at http://pci-ids.ucw.cz/. # # New data are always welcome, especially if they are accurate. If you have # anything to contribute, please follow the instructions at the web site. @@ -23,6 +23,7 @@ # device device_name <-- single tab # subvendor subdevice subsystem_name <-- two tabs +0001 SafeNet (wrong ID) 0010 Allied Telesis, Inc (Wrong ID) # This is a relabelled RTL-8139 8139 AT-2500TX V3 Ethernet @@ -287,6 +288,10 @@ 0050 SAS1064 PCI-X Fusion-MPT SAS 1028 1f04 SAS 5/E 1028 1f09 SAS 5i/R + 0052 MegaRAID SAS-3 3216/3224 [Cutlass] + 0053 MegaRAID SAS-3 3216/3224 [Cutlass] + 1000 9350 MegaRAID SAS 9341-16i + 1000 9351 MegaRAID SAS 9341-24i 0054 SAS1068 PCI-X Fusion-MPT SAS 1028 1f04 SAS 5/E Adapter Controller 1028 1f05 SAS 5/i Adapter Controller @@ -364,6 +369,7 @@ 1028 1f4c PERC H330 Mini (for blades) 1028 1f4d PERC H330 Embedded (for monolithic) 1054 306a SAS 3004 iMR ROMB + 1d49 04db ServeRAID M1210 SAS/SATA Controller 0060 MegaRAID SAS 1078 1000 1006 MegaRAID SAS 8888ELP 1000 100a MegaRAID SAS 8708ELP @@ -482,6 +488,8 @@ 0085 SAS2208 PCI-Express Fusion-MPT SAS-2 0086 SAS2308 PCI-Express Fusion-MPT SAS-2 0087 SAS2308 PCI-Express Fusion-MPT SAS-2 + 1000 3020 9207-8i SAS2.1 HBA + 1000 3040 9207-8e SAS2.1 HBA 1590 0044 H220i 008f 53c875J 1092 8000 FirePort 40 SCSI Controller @@ -494,6 +502,21 @@ 0097 SAS3008 PCI-Express Fusion-MPT SAS-3 1028 1f45 12GB/s HBA internal 1028 1f46 12Gbps HBA + 00c0 SAS3324 PCI-Express Fusion-MPT SAS-3 + 00c1 SAS3324 PCI-Express Fusion-MPT SAS-3 + 00c2 SAS3324 PCI-Express Fusion-MPT SAS-3 + 00c3 SAS3324 PCI-Express Fusion-MPT SAS-3 + 00c4 SAS3224 PCI-Express Fusion-MPT SAS-3 + 00c5 SAS3316 PCI-Express Fusion-MPT SAS-3 + 00c6 SAS3316 PCI-Express Fusion-MPT SAS-3 + 00c7 SAS3316 PCI-Express Fusion-MPT SAS-3 + 00c8 SAS3316 PCI-Express Fusion-MPT SAS-3 + 00c9 SAS3216 PCI-Express Fusion-MPT SAS-3 + 00ce MegaRAID SAS-3 3316 [Intruder] + 1000 9371 MegaRAID SAS 9361-16i + 1000 9390 MegaRAID SAS 9380-8i8e + 00cf MegaRAID SAS-3 3324 [Intruder] + 1000 9370 MegaRAID SAS 9361-24i 0407 MegaRAID 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller @@ -1260,7 +1283,7 @@ 5652 RV410/M26 [Mobility Radeon X700] 5653 RV410/M26 [Mobility Radeon X700] 1025 0080 Aspire 5024WLMi - 103c 0940 HP Compaq NW8240 Mobile Workstation + 103c 0940 Compaq NW8240 Mobile Workstation 5654 264VT [Mach64 VT] 1002 5654 Mach64VT Reference 5655 264VT3 [Mach64 VT3] @@ -1515,6 +1538,12 @@ 1462 3271 Radeon R9 360 OEM 1682 7360 Radeon R7 360 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330] + 1028 05ea Radeon HD 8670M + 1028 06bf Radeon R5 M335 + 103c 1970 Radeon HD 8670M + 103c 80be Radeon R5 M330 + 103c 8136 Radeon R5 M330 + 17aa 3804 Radeon R5 M330 17aa 3809 Radeon R5 M330 17aa 390c Radeon R5 M330 6663 Sun PRO [Radeon HD 8570A/8570M] @@ -2075,6 +2104,7 @@ 1458 228c R9 290X WindForce 3X 1458 228d R9 290X WindForce 3X OC 1458 2290 R9 290X WindForce 3X + 1458 22c1 Grenada PRO [Radeon R9 390] 1462 3070 R9 290X Lightning 1462 3071 R9 290X Lightning 1462 3072 R9 290X Lightning LE @@ -2103,7 +2133,7 @@ 1002 0310 FirePro S7000 1002 0420 Radeon Sky 500 6809 Pitcairn LE GL [FirePro W5000] - 6810 Curacao XT [Radeon R7 370 / R9 270X/370 OEM] + 6810 Curacao XT / Trinidad XT [Radeon R7 370 / R9 270X/370X] 148c 0908 Radeon R9 370 OEM 1682 7370 Radeon R7 370 6811 Curacao PRO [Radeon R7 370 / R9 270/370 OEM] @@ -2743,20 +2773,42 @@ 174b e180 Radeon HD 7350 17af 3015 Radeon HD 7350 68fe Cedar LE - 6900 Topaz XT [Radeon R7 M260/M265] - 1028 0640 Radeon R7 M265 + 6900 Topaz XT [Radeon R7 M260/M265 / M340/M360] + 1025 1056 Radeon R7 M360 / R8 M365DX + 1028 0640 Radeon R7 M260/M265 + 1028 0643 Radeon R7 M260/M265 + 1028 067f Radeon R7 M260 + 1028 130a Radeon R7 M260 + 103c 2263 Radeon R7 M260 103c 2269 Radeon R7 M260 + 103c 22c6 Radeon R7 M260 103c 22c8 Radeon R7 M260 + 103c 808c Radeon R7 M260 + 103c 8099 Radeon R7 M360 + 103c 80b5 Radeon R7 M360 + 103c 80b9 Radeon R7 M360 + 103c 811c Radeon R7 M340 + 10cf 1906 Radeon R7 M260 + 1170 9979 Radeon R7 M360 1179 f903 Radeon R7 M260 + 1179 f922 Radeon R7 M260 + 1179 f923 Radeon R7 M260 1179 f934 Radeon R7 M260 + 17aa 3822 Radeon R7 M360 + 17aa 3824 Radeon R7 M360 + 17aa 5021 Radeon R7 M260 6901 Topaz PRO [Radeon R5 M255] + 103c 1318 Radeon R6 M255DX 6921 Amethyst XT [Radeon R9 M295X] - 6929 Tonga PRO GL [FirePro Series] + 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] - 692f Tonga XT GL [FirePro W8100] - 6938 Amethyst XT [Radeon R9 M295X Mac Edition] + 692f Tonga XTV GL [FirePro S7150V] + 6938 Tonga XT / Amethyst XT [Radeon R9 380X / R9 M295X Mac Edition] + 174b e308 Radeon R9 380X Nitro 4G D5 6939 Tonga PRO [Radeon R9 285/380] 148c 9380 Radeon R9 380 +# Make naming scheme consistent + 174b e308 Radeon R9 380 Nitro 4G D5 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -2877,7 +2929,11 @@ 72a8 RV570 [Radeon X1950 GT] (Secondary) 72b1 RV560 [Radeon X1650 XT] (Secondary) 72b3 RV560 [Radeon X1650 GT] (Secondary) - 7300 Fiji XT [Radeon R9 FURY X] + 7300 Fiji [Radeon R9 FURY / NANO Series] + 1002 0b36 Radeon R9 FURY X / NANO + 1043 049e Radeon R9 FURY + 1043 04a0 Radeon R9 FURY X + 174b e329 Radeon R9 FURY 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3144,10 +3200,12 @@ 985f Mullins 9874 Carrizo 9900 Trinity [Radeon HD 7660G] + 103c 1985 Pavilion 17-e163sg Notebook PC # AMD A10-5800K CPU 9901 Trinity [Radeon HD 7660D] 9902 Trinity HDMI Audio Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 9903 Trinity [Radeon HD 7640G] 103c 194e ProBook 455 G1 Notebook 103c 1952 ProBook 455 G1 Notebook @@ -3168,6 +3226,8 @@ 9917 Trinity [Radeon HD 7620G] 9918 Trinity [Radeon HD 7600G] 9919 Trinity [Radeon HD 7500G] + 9920 Liverpool Graphics + 9921 Liverpool HDMI/DP Audio Controller 9990 Trinity [Radeon HD 7520G] 9991 Trinity [Radeon HD 7540D] 9992 Trinity [Radeon HD 7420G] @@ -3214,6 +3274,11 @@ 174b aa98 Radeon HD 6450 1GB DDR3 aaa0 Tahiti XT HDMI Audio [Radeon HD 7970 Series] aab0 Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] + aac0 Tobago HDMI Audio [Radeon R7 360 / R9 360 OEM] + aac8 Hawaii HDMI Audio +# I have a Tonga card and this is the HDMI Audio part + aad8 Tonga HDMI Audio [Radeon R9 285/380] + 174b aad8 Radeon R9 285/380 HDMI Audio ac00 Theater 600 Pro ac02 TV Wonder HD 600 PCIe ac12 Theater HD T507 (DVB-T) TV tuner/capture device @@ -3630,9 +3695,12 @@ 1014 049a PCIe3 x16 SAS RAID Internal Adapter 6Gb (57EE) 1014 04c7 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCA) 1014 04c8 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CD2) - 1014 0c49 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCD) + 1014 04c9 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCD) 044b GenWQE Accelerator Adapter 04aa Flash Adapter 90 (PCIe2 0.9TB) + 04da PCI-E IPR SAS+ Adapter (ASIC) + 1014 04fb PCIe3 x16 20GB Cache 12Gb Quad SAS RAID+ Adapter(580B) + 1014 04fc PCIe3 x8 12Gb Quad SAS RAID+ Adapter(580A) 3022 QLA3022 Network Adapter 4022 QLA3022 Network Adapter ffff MPIC-2 interrupt controller @@ -3727,9 +3795,12 @@ 1404 Family 15h (Models 10h-1fh) Processor Function 4 1405 Family 15h (Models 10h-1fh) Processor Function 5 1410 Family 15h (Models 10h-1fh) Processor Root Complex + 103c 1985 Pavilion 17-e163sg Notebook PC 1412 Family 15h (Models 10h-1fh) Processor Root Port + 1022 1234 Trinity A-series APU 1413 Family 15h (Models 10h-1fh) Processor Root Port 1414 Family 15h (Models 10h-1fh) Processor Root Port + 1022 1234 Trinity A-series APU 1415 Family 15h (Models 10h-1fh) Processor Root Port 1416 Family 15h (Models 10h-1fh) Processor Root Port 1417 Family 15h (Models 10h-1fh) Processor Root Port @@ -3744,7 +3815,11 @@ 1422 Family 15h (Models 30h-3fh) Processor Root Complex 1423 Family 15h (Models 30h-3fh) I/O Memory Management Unit 1426 Family 15h (Models 30h-3fh) Processor Root Port + 1436 Liverpool Processor Root Complex + 1437 Liverpool I/O Memory Management Unit + 1438 Liverpool Processor Root Port 1439 Family 16h Processor Functions 5:1 + 145b Zeppelin Non-Transparent Bridge 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -3890,27 +3965,34 @@ 7802 FCH SATA Controller [RAID mode] 7803 FCH SATA Controller [RAID mode] 7804 FCH SATA Controller [AHCI mode] + 103c 1985 Pavilion 17-e163sg Notebook PC 7805 FCH SATA Controller [RAID mode] 7806 FCH SD Flash Controller 7807 FCH USB OHCI Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 7808 FCH USB EHCI Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 7809 FCH USB OHCI Controller 103c 194e ProBook 455 G1 Notebook 780b FCH SMBus Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 780c FCH IDE Controller 780d FCH Azalia Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 1043 8444 F2A85-M Series 780e FCH LPC Bridge 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 780f FCH PCI Bridge 7812 FCH USB XHCI Controller 7813 FCH SD Flash Controller 7814 FCH USB XHCI Controller 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC 7900 FCH SATA Controller [IDE mode] 7901 FCH SATA Controller [AHCI mode] 7902 FCH SATA Controller [RAID mode] @@ -3923,6 +4005,7 @@ 790f FCH PCI Bridge 7914 FCH USB XHCI Controller 9600 RS780 Host Bridge + 1043 82ee M378A-CM Motherboard 1043 82f1 M3A78-EH Motherboard 9601 RS880 Host Bridge 1019 2120 A785GM-M @@ -4479,6 +4562,7 @@ 103c 1293 USB add-in card 103c 1294 USB 2.0 add-in card 1179 0001 USB + 1186 0035 DUB-C2 USB 2.0 2-port 32-bit cardbus controller 12ee 7000 Root Hub 14c2 0105 PTI-205N USB 2.0 Host Controller 1799 0001 Root Hub @@ -4510,6 +4594,7 @@ 00ce uPD72871 [Firewarden] IEEE1394a OHCI 1.0 Link/1-port PHY Controller 00df Vr4131 00e0 uPD72010x USB 2.0 Controller + 1186 f100 DUB-C2 USB 2.0 2-port 32-bit cardbus controller 12ee 7001 Root hub 14c2 0205 PTI-205N USB 2.0 Host Controller 1799 0002 Root Hub @@ -4796,30 +4881,30 @@ 103c 3212 Smart Array E200 3239 Smart Array Gen9 Controllers 103c 21bd P244br - 103c 21be Smart Array + 103c 21be P741m 103c 21bf H240ar 103c 21c0 P440ar - 103c 21c1 Smart Array + 103c 21c1 P840ar 103c 21c2 P440 103c 21c3 P441 103c 21c4 Smart Array - 103c 21c5 Smart Array + 103c 21c5 P841 103c 21c6 H244br 103c 21c7 H240 103c 21c8 H241 103c 21c9 Smart Array - 103c 21ca Smart Array + 103c 21ca P246br 103c 21cb P840 103c 21cc Smart Array - 103c 21cd Smart Array - 103c 21ce Smart Array + 103c 21cd P240nr + 103c 21ce H240nr 323a Smart Array G6 controllers 103c 3241 Smart Array P212 103c 3243 Smart Array P410 103c 3245 Smart Array P410i 103c 3247 Smart Array P411 103c 3249 Smart Array P812 - 103c 324a HP Smart Array 712m (Mezzanine RAID controller) + 103c 324a Smart Array 712m (Mezzanine RAID controller) 103c 324b Smart Array P711m (Mezzanine RAID controller) 323b Smart Array Gen8 Controllers 103c 3350 P222 @@ -5140,6 +5225,7 @@ 803b 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) 103c 309f nx9420 103c 30a3 Compaq nw8440 + 104d 8212 VAIO VGN-N21E 104d 902d VAIO VGN-NR120E 803c PCIxx12 SDA Standard Compliant SD Host Controller 103c 309f nx9420 @@ -5171,6 +5257,7 @@ 1395 2201 WL22-PC 16ab 8501 WL-8305 IEEE802.11b+ Wireless LAN PCI Adapter 8401 ACX 100 22Mbps Wireless Interface + 8888 Multicore DSP+ARM KeyStone II SOC 9000 Wireless Interface (of unknown type) 9065 TMS320DM642 9066 ACX 111 54Mbps Wireless Interface @@ -5294,6 +5381,14 @@ 8056 Rockwell HCF 56K modem 808a Memory Stick Controller 81ce SxS Pro memory card + 908f Aeolia ACPI + 909e Aeolia Ethernet Controller (Marvell Yukon 2 Family) + 909f Aeolia SATA AHCI Controller + 90a0 Aeolia SD/MMC Host Controller + 90a1 Aeolia PCI Express Glue and Miscellaneous Devices + 90a2 Aeolia DMA Controller + 90a3 Aeolia Memory (DDR3/SPM) + 90a4 Aeolia USB 3.0 xHCI Host Controller 104e Oak Technology, Inc 0017 OTI-64017 0107 OTI-107 [Spitfire] @@ -5435,7 +5530,6 @@ 6400 MPC190 Security Processor (S1 family, encryption) 6405 MPC184 Security Processor (S1 family) 1058 Electronics & Telecommunications RSH -# Formerly: Teknor Industrial Computers Inc 1059 Kontron 105a Promise Technology, Inc. 0d30 PDC20265 (FastTrak100 Lite/Ultra100) @@ -5701,6 +5795,7 @@ 0074 U4 HT Bridge # should be 14e4:1645 1645 Broadcom NetXtreme BCM5701 Gigabit Ethernet + 2001 PCI Express SSD 106c Hynix Semiconductor 8139 8139c 100BaseTX Ethernet Controller 8801 Dual Pentium ISA/PCI Motherboard @@ -5757,13 +5852,52 @@ 101e 8493 QLA12160 on AMI MegaRAID 1240 ISP1240 SCSI Host Adapter 1280 ISP1280 SCSI Host Adapter + 1634 FastLinQ QL45000 Series 40GbE Controller + 1077 e4f1 FastLinQ QL45212H 40GbE Adapter + 1077 e4f2 FastLinQ QL45211H 40GbE Adapter + 1077 e4f3 FastLinQ QL45412H 40GbE Adapter + 1077 e4f4 FastLinQ QL45411H 40GbE Adapter + 1644 FastLinQ QL45000 Series 100GbE Controller + 1077 e4f8 FastLinQ QL45611H 100GbE Adapter + 1656 FastLinQ QL45000 Series 25GbE Controller + 1077 e4f6 FastLinQ QL45211H 25GbE Adapter + 1077 e4f7 FastLinQ QL45212H 25GbE Adapter + 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) + 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter + 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter + 165e FastLinQ QL45000 Series 40GbE Controller (iSCSI) + 1077 e4f1 FastLinQ QL45462H 40GbE iSCSI Adapter + 1077 e4f2 FastLinQ QL45461H 40GbE iSCSI Adapter + 1664 FastLinQ QL45000 Series Gigabit Ethernet Controller (SR-IOV VF) + 1077 e4f1 FastLinQ QL45462H 40GbE Adapter (SR-IOV VF) + 1077 e4f2 FastLinQ QL45461H 40GbE Adapter (SR-IOV VF) + 1077 e4f3 FastLinQ QL45412H 40GbE Adapter (SR-IOV VF) + 1077 e4f4 FastLinQ QL45411H 40GbE Adapter (SR-IOV VF) + 1077 e4f6 FastLinQ QL45211H 25GbE Adapter (SR-IOV VF) + 1077 e4f7 FastLinQ QL45212H 25GbE Adapter (SR-IOV VF) + 1077 e4f8 FastLinQ QL45611H 100GbE Adapter (SR-IOV VF) 2020 ISP2020A Fast!SCSI Basic Adapter 2031 ISP8324-based 16Gb Fibre Channel to PCI Express Adapter + 103c 17e7 HP SN1000Q 16Gb Single Port Fibre Channel Adapter + 103c 17e8 HP SN1000Q 16Gb Dual Port Fibre Channel Adapter + 103c 1939 HP QMH2672 16Gb Dual Port Fibre Channel Adapter 103c 8002 3830C 16G Fibre Channel Host Bus Adapter + 2071 ISP2714-based 16/32Gb Fibre Channel to PCIe Adapter + 1077 0283 QLE2764 Quad Port 32Gb Fibre Channel to PCIe Adapter + 1077 029e QLE2694 Quad Port 16Gb Fibre Channel to PCIe Adapter + 1077 02a2 QLE2694L Quad Port 16Gb Fibre Channel to PCIe Adapter + 1077 02ad QLE2694U Quad Port 16/32Gb Fibre Channel to PCIe Adapter 2100 QLA2100 64-bit Fibre Channel Adapter 1077 0001 QLA2100 64-bit Fibre Channel Adapter 2200 QLA2200 64-bit Fibre Channel Adapter 1077 0002 QLA2200 + 2261 ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter + 1077 0299 QLE2740 Single Port 32Gb Fibre Channel to PCIe Adapter + 1077 029a QLE2742 Dual Port 32Gb Fibre Channel to PCIe Adapter + 1077 029b QLE2690 Single Port 16Gb Fibre Channel to PCIe Adapter + 1077 029c QLE2692 Dual Port 16Gb Fibre Channel to PCIe Adapter + 1590 00f9 HPE StoreFabric SN1100Q 16Gb Single Port Fibre Channel Host Bus Adapter + 1590 00fa HPE StoreFabric SN1100Q 16Gb Dual Port Fibre Channel Host Bus Adapter 2300 QLA2300 64-bit Fibre Channel Adapter 2312 ISP2312-based 2Gb Fibre Channel to PCI-X HBA 103c 0131 2Gb Fibre Channel - Single port [A7538A] @@ -5777,6 +5911,7 @@ 2532 ISP2532-based 8Gb Fibre Channel to PCI Express HBA 103c 3262 StorageWorks 81Q 1077 0167 QME2572 Dual Port FC8 HBA Mezzanine + 1590 00fc HPE StoreFabric 84Q 8Gb Quad Port Fibre Channel Host Bus Adapter 3022 ISP4022-based Ethernet NIC 3032 ISP4032-based Ethernet IPv6 NIC 4010 ISP4010-based iSCSI TOE HBA @@ -5994,6 +6129,7 @@ 1093 National Instruments 0160 PCI-DIO-96 0162 PCI-MIO-16XE-50 + 0fe1 PXI-8320 1150 PCI-6533 (PCI-DIO-32HS) 1170 PCI-MIO-16XE-10 1180 PCI-MIO-16E-1 @@ -6085,7 +6221,10 @@ 7004 PXI-6551 700b PXI-5421 700c PCI-5421 + 701a VXIpc-87xB + 701b VXIpc-770 7023 PXI-2593 + 7027 PCI-MXI-2 Universal 702c PXI-7831R 702d PCI-7831R 702e PXI-7811R @@ -6354,6 +6493,7 @@ 731d PXI-2536 7322 PXIe-6124 7327 PXI-6529 + 732c VXI-8360T 7331 PXIe-5602 7332 PXIe-5601 7333 PXI-5900 @@ -6493,6 +6633,7 @@ 75e5 PXI-6683 75e6 PXI-6683H 75ef PXIe-5632 + 761c VXI-8360LT 761f PXI-2540 7620 PXIe-2540 7621 PXI-2541 @@ -6523,6 +6664,7 @@ 76a3 PXIe-6535B 76a4 PXIe-6536B 76a5 PXIe-6537B + 783e PXI-8368 9020 PXI-2501 9030 PXI-2503 9040 PXI-2527 @@ -6532,6 +6674,7 @@ 9080 PXI-2580 9090 PCI-4021 90a0 PXI-4021 + a001 PCI-MXI-2 b001 PCI-1408 b011 PXI-1408 b021 PCI-1424 @@ -6621,7 +6764,9 @@ 1093 762b PXIe-4138 1093 762c PXIe-4144 1093 762d PXIe-4145 + 1093 762e PXIe-5606 1093 7644 PXIe-4841 + 1093 764a PCIe-8237R-S 1093 7658 PXIe-5162 (4CH) 1093 76ab PXIe-4322 1093 76ad PXIe-4112 @@ -6629,14 +6774,25 @@ 1093 76b5 PXIe-7971R 1093 76b6 PXIe-7972R 1093 76b7 PXIe-7975R + 1093 76b8 PXIe-5696 + 1093 76b9 PXIe-5654 1093 76c8 PXIe-6614 1093 76c9 PXIe-6612 1093 76cb PXIe-5646R 1093 76cc PXIe-5162 (2CH) + 1093 76ce CVS-1459 1093 76d0 PXIe-5160 (2CH) 1093 76d1 PXIe-5160 (4CH) 1093 76dc PXIe-4610 + 1093 76ec PXIe-2524 + 1093 76ed PXIe-2525 + 1093 76ee PXIe-2526 + 1093 76ef PXIe-2737 + 1093 76f0 PXIe-2738 + 1093 76f1 PXIe-2739 1093 76fb PCIe-1473R-LX110 + 1093 76fc PXIe-5105 + 1093 76fd PXIe-5114 1093 76fe PXIe-5644R 1093 76ff PXIe-5644R 1093 7700 PXIe-5644R @@ -6645,24 +6801,49 @@ 1093 7703 PXIe-5645R 1093 770c PXIe-4139 1093 7711 PXIe-4464 + 1093 7712 PXIe-4463 1093 7716 PCIe-6612 + 1093 771d Unconfigured CA4 Switch 1093 771e PXIe-4339 1093 7735 cRIO-9033 + 1093 773e PXIe-5624R 1093 774b cRIO-9031 1093 774d cRIO-9034 1093 7755 cRIO-9030 + 1093 7768 PXIe-2747 + 1093 7769 PXIe-2748 + 1093 776a PXIe-2746 1093 7777 PXIe-7976R 1093 7782 PXIe-5646R 1093 7783 PXIe-5646R 1093 7784 PXIe-5646R + 1093 7790 PXIe-5170R (4CH) + 1093 7791 PXIe-5170R (8CH) + 1093 7793 PXIe-5171R (8CH) 1093 77a5 PXIe-6345 1093 77a6 PXIe-6355 1093 77a7 PXIe-6365 1093 77a8 PXIe-6375 + 1093 77aa CVS-1458 + 1093 77ad IC-3173 1093 77b4 PXIe-7820R 1093 77b5 PXIe-7821R 1093 77b6 PXIe-7822R 1093 77b9 cRIO-9038 + 1093 77ba PXIe-4136 + 1093 77bb PXIe-4137 + 1093 77c0 PXIe-5624R + 1093 77c1 PXIe-5624R + 1093 77c2 PXIe-5624R + 1093 77ca PXIe-6738 + 1093 77cb PXIe-6739 + 1093 77db cRIO-9035 + 1093 77dc cRIO-9036 + 1093 77dd cRIO-9039 + 1093 7802 PXIe-4302 + 1093 7803 PXIe-4303 + 1093 7805 PXIe-4305 + 1093 788e PXIe-4304 c801 PCI-GPIB c811 PCI-GPIB+ c821 PXI-GPIB @@ -6700,6 +6881,13 @@ e251 PXI-8460 (2 ports) e261 PCI-CAN/DS e271 PXI-8462 + f110 VMEpc-650 + f120 VXIpc-650 + fe00 VXIpc-87x + fe41 VXIpc-860 + fe51 VXIpc-74x + fe61 VXIpc-850 + fe70 VXIpc-880 1094 First International Computers [FIC] # nee CMD Technology Inc 1095 Silicon Image, Inc. @@ -7073,6 +7261,7 @@ 8747 PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch # This is the Non-Transparent-Bridge Virtualized Port as presented by the PLX PEX 8732 chip, the physical bridges show up at 10b5:8732 87b0 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch + 1093 7761 PXIe-8830mc 9016 PLX 9016 8-port serial controller 9030 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge 10b5 2695 Hilscher CIF50-PB/DPS Profibus @@ -7084,6 +7273,7 @@ 10b5 3025 Alpermann+Velte PCL PCI L (3V/5V): Timecode Reader Board 10b5 3068 Alpermann+Velte PCL PCI HD (3V/5V): Timecode Reader Board 10b5 3463 Alpermann+Velte PCL PCI D (v2) (3V/5V): Timecode Reader Board + 10b5 3591 PLURA PCL PCI L (v2) (3.3V/5V): Time Code Reader Board 12fe 0111 CPCI-ASIO4 (ESD 4-port Serial Interface Board) 1369 9c01 VX222v2 1369 9d01 VX222-Mic @@ -7096,7 +7286,7 @@ 1369 a801 LCM200 1397 3136 4xS0-ISDN PCI Adapter 1397 3137 S2M-E1-ISDN PCI Adapter - 1518 0200 Kontron ThinkIO-C + 1518 0200 ThinkIO-C 15ed 1002 MCCS 8-port Serial Hot Swap 15ed 1003 MCCS 16-port Serial Hot Swap # MIL-STD-1553B Board @@ -8751,7 +8941,7 @@ 0446 MCP65 SMBus 103c 30cf Pavilion dv9668eg Laptop 0447 MCP65 SMU - 103c 30cf Pavilion dv9668eg Laptop + 103c 30cf Pavilion dv9500/9600/9700 series 0448 MCP65 IDE 103c 30cf Pavilion dv9668eg Laptop 0449 MCP65 PCI bridge @@ -9575,6 +9765,7 @@ 0f00 GF108 [GeForce GT 630] 0f01 GF108 [GeForce GT 620] 0f02 GF108 [GeForce GT 730] + 0f06 GF108 [GeForce GT 730] 0fbb GM204 High Definition Audio Controller 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] @@ -9619,6 +9810,7 @@ 0fea GK107M [GeForce GT 755M Mac Edition] 0fec GK107M [GeForce 710A] 0fed GK107M [GeForce 820M] + 0fee GK107M [GeForce 810M] 0fef GK107GL [GRID K340] 0ff1 GK107 [NVS 1000] 0ff2 GK107GL [GRID K1] @@ -9747,6 +9939,7 @@ 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] + 1019 0799 GeForce 820M 1019 999f GeForce GT 720M 1025 0600 GeForce GT 620M 1025 0606 GeForce GT 620M @@ -9846,6 +10039,7 @@ 1028 065e GeForce 820M 1028 0662 GeForce 820M 1028 068d GeForce 820M + 1028 06c1 GeForce 820M 103c 18ef GeForce GT 630M 103c 18f9 GeForce GT 630M 103c 18fb GeForce GT 630M @@ -10052,12 +10246,18 @@ 1854 0180 GeForce 710M 1854 0190 GeForce GT 720M 1854 0192 GeForce GT 720M + 1854 0224 GeForce 820M + 1b0a 01c0 GeForce 820M 1b0a 20dd GeForce GT 620M 1b0a 20df GeForce GT 620M 1b0a 210e GeForce 820M 1b0a 2202 GeForce GT 720M 1b0a 90d7 GeForce 820M 1b0a 90dd GeForce 820M + 1b50 5530 GeForce 820M + 1b6c 5531 GeForce GT 720M + 1bab 0106 GeForce 820M + 1d05 1013 GeForce 810M 1180 GK104 [GeForce GTX 680] 1043 83f1 GTX680-DC2-2GD5 3842 3682 GeForce GTX 680 Mac Edition @@ -10185,6 +10385,7 @@ 1287 GK208 [GeForce GT 730] 1288 GK208 [GeForce GT 720] 1289 GK208 [GeForce GT 710] + 128b GK208 [GeForce GT 710] 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -10209,7 +10410,7 @@ 1296 GK208M [GeForce 825M] 1298 GK208M [GeForce GT 720M] 1299 GK208M [GeForce 920M] - 129a GK208GL [N16V-GL] + 129a GK208M [GeForce 910M] 12a0 GK208 12b9 GK208GLM [Quadro K610M] 12ba GK208GLM [Quadro K510M] @@ -10222,6 +10423,9 @@ 1344 GM108M [GeForce 845M] 1346 GM108M [GeForce 930M] 1347 GM108M [GeForce 940M] + 1348 GM108M [GeForce 945A] + 1349 GM108M [GeForce 930M] + 134d GM108M [GeForce 940MX] 137a GM108GLM [Quadro K620M] 137d GM108M [GeForce 940A] 1380 GM107 [GeForce GTX 750 Ti] @@ -10236,12 +10440,19 @@ 1393 GM107M [GeForce 840M] 1398 GM107M [GeForce 845M] 139a GM107M [GeForce GTX 950M] + 17aa 362c GeForce GTX 950A + 17aa 362f GeForce GTX 950A + 17aa 363f GeForce GTX 950A + 17aa 3640 GeForce GTX 950A + 17aa 36b9 GeForce GTX 950A 139b GM107M [GeForce GTX 960M] + 103c 2b4c GeForce GTX 960A 139c GM107M [GeForce 940M] 13b0 GM107GLM [Quadro M2000M] 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] 13b3 GM107GLM [Quadro K2200M] + 13b9 GM107GL [NVS 810] 13ba GM107GL [Quadro K2200] 13bb GM107GL [Quadro K620] 13bc GM107GL [Quadro K1200] @@ -10254,23 +10465,35 @@ 13d7 GM204M [GeForce GTX 980M] 13d8 GM204M [GeForce GTX 970M] 13d9 GM204M [GeForce GTX 965M] + 13da GM204M [GeForce GTX 980] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] + 13f3 GM204GL [Tesla M6] + 13f8 GM204GLM [Quadro M5000M] + 13f9 GM204GLM [Quadro M4000M] + 13fa GM204GLM [Quadro M3000M] 1401 GM206 [GeForce GTX 960] + 1402 GM206 [GeForce GTX 950] + 1407 GM206 [GeForce GTX 750 v2] + 1427 GM206M [GeForce GTX 965M] + 1431 GM206GL [Tesla M4] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] + 161a GM204M [GeForce GTX 980] + 1667 GM204M [GeForce GTX 965M] 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] + 17fd GM200GL [Tesla M40] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) - 103c 1934 HP FlexFabric 20Gb 2-port 650M Adapter - 103c 1935 HP FlexFabric 20Gb 2-port 650FLB Adapter - 103c 21d4 HP StoreFabric CN1200E 10Gb Converged Network Adapter - 103c 220a HP FlexFabric 10Gb 2-port 556FLR-SFP+ Adapter - 103c 803f HP Ethernet 10Gb 2-port 557SFP+ Adapter + 103c 1934 FlexFabric 20Gb 2-port 650M Adapter + 103c 1935 FlexFabric 20Gb 2-port 650FLB Adapter + 103c 21d4 StoreFabric CN1200E 10Gb Converged Network Adapter + 103c 220a FlexFabric 10Gb 2-port 556FLR-SFP+ Adapter + 103c 803f Ethernet 10Gb 2-port 557SFP+ Adapter 17aa 1056 ThinkServer OCm14102-UX-L AnyFabric 17aa 1057 ThinkServer OCm14104-UX-L AnyFabric 17aa 1059 ThinkServer OCm14104-UT-L AnyFabric @@ -10308,6 +10531,7 @@ f0e5 Zephyr LightPulse Fibre Channel Host Adapter f0f5 Neptune LightPulse Fibre Channel Host Adapter f100 Saturn-X: LightPulse Fibre Channel Host Adapter + 103c 3282 8Gb Dual-port PCI-e FC HBA f111 Saturn-X LightPulse Fibre Channel Host Adapter f112 Saturn-X LightPulse Fibre Channel Host Adapter f180 LPSe12002 EmulexSecure Fibre Channel Adapter @@ -10423,8 +10647,14 @@ 5229 RTS5229 PCI Express Card Reader 1025 0813 Aspire R7-571 103c 194e ProBook 455 G1 Notebook + 103c 1985 Pavilion 17-e163sg Notebook PC + 522a RTS522A PCI Express Card Reader 5249 RTS5249 PCI Express Card Reader 103c 1909 ZBook 15 + 524a RTS524A PCI Express Card Reader + 5250 RTS5250 PCI Express Card Reader + 525a RTS525A PCI Express Card Reader + 5286 RTS5286 PCI Express Card Reader 5288 RTS5288 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader 1043 1457 K55A Laptop @@ -10438,11 +10668,12 @@ 8129 RTL-8129 10ec 8129 RT8129 Fast Ethernet Adapter 11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) - 8136 RTL8101E/RTL8102E PCI Express Fast Ethernet controller + 8136 RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller + 103c 1985 Pavilion 17-e163sg Notebook PC 103c 2ab1 Pavilion p6774 103c 30cc Pavilion dv6700 1179 ff64 RTL8102E PCI-E Fast Ethernet NIC - 17c0 1053 AzureWave AW-NE766 802.11B/G/N Mini PCIe Card Model RT2700E + 17c0 1053 RTL8101e Medion WIM 2210 Notebook PC [MD96850] 8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter 10ec 8138 RT8139 (B/C) Fast Ethernet Adapter 8139 RTL-8100/8101L/8139 PCI Fast Ethernet Adapter @@ -10511,7 +10742,7 @@ 1043 11f5 A6J-Q008 1043 16d5 U6V/U31J laptop 1043 81aa P5B - 1043 82c6 M3A78-EH Motherboard + 1043 82c6 M3A78 Series Motherboard 1043 83a3 M4A785TD Motherboard 1043 8432 P8P67 and other motherboards 1043 8505 P8 series motherboard @@ -10581,7 +10812,6 @@ 0405 Wildcard TE405P (2nd Gen) 0410 Wildcard TE410P (2nd Gen) 0600 Xilinx 6 Designs (Xilinx IP) - 2b00 Zomojo Zcard 3fc0 RME Digi96 3fc1 RME Digi96/8 3fc2 RME Digi96/8 Pro @@ -10775,6 +11005,8 @@ 127d 0000 CineView II 8485 EM8485 REALmagic DVD/MPEG-4 A/V Decoder 8486 EM8486 REALmagic DVD/MPEG-4 A/V Decoder +# Found in Cisco DMP-4305G + c621 EM8621L Digital Media Processor c622 EM8622L MPEG-4.10 (H.264) and SMPTE 421M (VC-1) A/V Decoder 1106 VIA Technologies, Inc. 0102 Embedded VIA Ethernet Controller @@ -11010,6 +11242,7 @@ 1043 8095 A7V8X Motherboard (Realtek ALC650 codec) 1043 80a1 A7V8X-X Motherboard 1043 80b0 A7V600/K8V-X/K8V Deluxe motherboard (ADI AD1980 codec [SoundMAX]) + 1043 80f3 ASUSTek SK8V motherboard 1043 810d Asus P5VD1-X (AD1888 codec [SoundMax]) 1043 812a A8V Deluxe motherboard (Realtek ALC850 codec) 10ec 8168 High Definition Audio @@ -11989,6 +12222,7 @@ 1137 012c VIC 1340 Dual 40Gb MLOM 1137 012e VIC 1227 Dual 10Gb SFP+ PCIe 1137 0137 VIC 1380 Dual 40Gb Mezzanine + 1137 014d VIC 1385 Dual 40Gb PCIe 0041 VIC PCIe Downstream Port 0042 VIC Management Controller 1137 0047 VIC P81E PCIe Management Controller @@ -11996,6 +12230,7 @@ 1137 00cd VIC 1285 PCIe Management Controller 1137 00ce VIC 1225T PCIe Management Controller 1137 012e VIC 1227 PCIe Management Controller + 1137 014d VIC 1385 PCIe Management Controller 0043 VIC Ethernet NIC 1137 0047 VIC P81E PCIe Ethernet NIC 1137 0048 VIC M81KR Mezzanine Ethernet NIC @@ -12008,6 +12243,7 @@ 1137 012c VIC 1340 MLOM Ethernet NIC 1137 012e VIC 1227 PCIe Ethernet NIC 1137 0137 VIC 1380 Mezzanine Ethernet NIC + 1137 014d VIC 1385 PCIe Ethernet NIC 0044 VIC Ethernet NIC Dynamic 1137 0047 VIC P81E PCIe Ethernet NIC Dynamic 1137 0048 VIC M81KR Mezzanine Ethernet NIC Dynamic @@ -12020,6 +12256,7 @@ 1137 012c VIC 1340 MLOM Ethernet NIC Dynamic 1137 012e VIC 1227 PCIe Ethernet NIC Dynamic 1137 0137 VIC 1380 Mezzanine Ethernet NIC Dynamic + 1137 014d VIC 1385 PCIe Ethernet NIC Dynamic 0045 VIC FCoE HBA 1137 0047 VIC P81E PCIe FCoE HBA 1137 0048 VIC M81KR Mezzanine FCoE HBA @@ -12032,6 +12269,7 @@ 1137 012c VIC 1340 MLOM FCoE HBA 1137 012e VIC 1227 PCIe FCoE HBA 1137 0137 VIC 1380 Mezzanine FCoE HBA + 1137 014d VIC 1385 PCIe FCoE HBA 0046 VIC SCSI Controller 1137 012a VIC M4308 SCSI Controller 004e VIC 82 PCIe Upstream Port @@ -12040,6 +12278,7 @@ 1137 012a VIC M4308 Dual 40Gb 1137 012c VIC 1340 Dual 40Gb MLOM 1137 0137 VIC 1380 Dual 40Gb Mezzanine + 1137 014d VIC 1385 Dual 40Gb PCIe 00cf VIC Userspace NIC 1137 004f VIC 1280 Mezzanine Userspace NIC 1137 0084 VIC 1240 MLOM Userspace NIC @@ -12053,7 +12292,7 @@ 1138 Ziatech Corporation 8905 8905 [STD 32 Bridge] 1139 Dynamic Pictures, Inc - 0001 VGA Compatable 3D Graphics + 0001 VGA Compatible 3D Graphics 113a FWB Inc 113b Network Computing Devices 113c Cyclone Microsystems, Inc. @@ -12467,6 +12706,7 @@ 144d c006 vpr Matrix 170B4 CardBus bridge 0476 RL5c476 II 1014 0185 ThinkPad A/T/X Series + 1014 0555 ThinkPad X41 1014 056c ThinkPad Z60t 1028 014f Latitude X300 laptop 1028 0188 Inspiron 6000 laptop @@ -12513,14 +12753,14 @@ 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 - 103c 30cf Pavilion dv9668eg Laptop + 103c 30cf Pavilion dv9500/9600/9700 series 1043 1237 A6J-Q008 1043 1967 V6800V 144d c018 X20 IV 17aa 20ca ThinkPad T61 0811 R5C811 0822 R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter - 1014 0556 ThinkPad X60s / Z60t + 1014 0556 ThinkPad X40 / X41 / X60s / Z60t 1014 0598 ThinkPad Z60m 1025 0121 Aspire 5920G 1028 0188 Inspiron 6000 laptop @@ -12559,6 +12799,7 @@ 1028 024f Dell Latitude e6500 103c 03b5 Presario V3242AU 103c 30b7 Presario V6133CL + 103c 30cf Pavilion dv9500/9600/9700 series 1183 0843 Alienware Aurora m9700 0852 xD-Picture Card Controller 1025 0121 Aspire 5920G @@ -12686,7 +12927,6 @@ 1198 Lambda Systems Inc 1199 Attachmate Corporation 0101 Advanced ISCA/PCI Adapter - 6832 Sierra Wireless MC8780 Device 119a Mind Share, Inc. 119b Omega Micro Inc. 1221 82C092G @@ -13721,14 +13961,14 @@ 1273 Hughes Network Systems 0002 DirecPC 1274 Ensoniq - 1171 ES1373 [AudioPCI] (also Creative Labs CT5803) - 1371 ES1371 / Creative Labs CT2518 [AudioPCI-97] + 1171 ES1373 / Creative Labs CT5803 [AudioPCI] + 1371 ES1371 / Creative Labs CT2518/ES1373 0e11 0024 AudioPCI on Motherboard Compaq Deskpro 0e11 b1a7 ES1371, ES1373 AudioPCI 1033 80ac ES1371, ES1373 AudioPCI 1042 1854 Tazer 107b 8054 Tabor2 - 1274 1371 AudioPCI 64V/128 / Creative Sound Blaster CT4810 + 1274 1371 AudioPCI 64V/128 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI] 1274 8001 CT4751 board 1462 6470 ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A 1462 6560 ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10 @@ -13779,10 +14019,10 @@ 8086 5643 ES1371, ES1373 AudioPCI On Motherboard Vancouver 8086 5753 ES1371, ES1373 AudioPCI On Motherboard WS440BX 5000 ES1370 [AudioPCI] - 5880 5880B [AudioPCI] - 1274 2000 Creative Sound Blaster AudioPCI128 + 5880 5880B / Creative Labs CT5880 + 1274 2000 Creative CT4810 [Sound Blaster AudioPCI 128] 1274 2003 Creative SoundBlaster AudioPCI 128 - 1274 5880 Creative Sound Blaster AudioPCI128 + 1274 5880 Creative CT4750 [Sound Blaster PCI 128] 1274 8001 Sound Blaster 16PCI 4.1ch 1458 a000 5880 AudioPCI On Motherboard 6OXET 1462 6880 5880 AudioPCI On Motherboard MS-6188 1.00 @@ -13948,9 +14188,10 @@ 8213 IT8213 IDE Controller 1458 b000 GA-EG45M-DS2H Mainboard 8330 IT8330G - 8872 IT8874F PCI Dual Serial Port Controller + 8872 IT887xF PCI to ISA I/O chip with SMB, GPIO, Serial or Parallel Port 8888 IT8888F/G PCI to ISA Bridge with SMB [Golden Gate] 8889 IT8889F PCI to ISA Bridge + 8893 IT8893E PCIe to PCI Bridge e886 IT8330G 1284 Sahara Networks, Inc. 1285 Platform Technologies, Inc. @@ -15032,6 +15273,8 @@ 1752 PCI-1752 1754 PCI-1754 1756 PCI-1756 +# FPGA bridge to two SJA1000 + c302 MIOe-3680 2-Port CAN-Bus MIOe Module with Isolation Protection 13ff Silicon Spice Inc 1400 Artx Inc *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Mar 26 11:41:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59A2DADE8A1; Sat, 26 Mar 2016 11:41:37 +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 0D15016F9; Sat, 26 Mar 2016 11:41:36 +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 u2QBfaAF063014; Sat, 26 Mar 2016 11:41:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QBfZSn063010; Sat, 26 Mar 2016 11:41:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201603261141.u2QBfZSn063010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 26 Mar 2016 11:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297290 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 11:41:37 -0000 Author: bapt Date: Sat Mar 26 11:41:35 2016 New Revision: 297290 URL: https://svnweb.freebsd.org/changeset/base/297290 Log: Remove some unneeded headers Found by 'include-what-you-use' Modified: head/usr.sbin/pw/cpdir.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pw_utils.c head/usr.sbin/pw/pw_vpw.c Modified: head/usr.sbin/pw/cpdir.c ============================================================================== --- head/usr.sbin/pw/cpdir.c Sat Mar 26 11:13:17 2016 (r297289) +++ head/usr.sbin/pw/cpdir.c Sat Mar 26 11:41:35 2016 (r297290) @@ -37,7 +37,6 @@ static const char rcsid[] = #include #include "pw.h" -#include "pwupd.h" void copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat Mar 26 11:13:17 2016 (r297289) +++ head/usr.sbin/pw/pw_user.c Sat Mar 26 11:41:35 2016 (r297290) @@ -31,8 +31,6 @@ static const char rcsid[] = #endif /* not lint */ #include -#include -#include #include #include Modified: head/usr.sbin/pw/pw_utils.c ============================================================================== --- head/usr.sbin/pw/pw_utils.c Sat Mar 26 11:13:17 2016 (r297289) +++ head/usr.sbin/pw/pw_utils.c Sat Mar 26 11:41:35 2016 (r297290) @@ -27,13 +27,10 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include -#include #include -#include #include #include #include Modified: head/usr.sbin/pw/pw_vpw.c ============================================================================== --- head/usr.sbin/pw/pw_vpw.c Sat Mar 26 11:13:17 2016 (r297289) +++ head/usr.sbin/pw/pw_vpw.c Sat Mar 26 11:41:35 2016 (r297290) @@ -37,7 +37,6 @@ static const char rcsid[] = #include #include #include -#include #include #include "pwupd.h" From owner-svn-src-head@freebsd.org Sat Mar 26 12:11:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A099AADD3BD; Sat, 26 Mar 2016 12:11:47 +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 71EEA1FD4; Sat, 26 Mar 2016 12: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 u2QCBkYi072973; Sat, 26 Mar 2016 12:11:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QCBk7V072971; Sat, 26 Mar 2016 12:11:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201603261211.u2QCBk7V072971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 26 Mar 2016 12:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297291 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 12:11:47 -0000 Author: bapt Date: Sat Mar 26 12:11:46 2016 New Revision: 297291 URL: https://svnweb.freebsd.org/changeset/base/297291 Log: Cleanup headers Found by: include-what-you-use Modified: head/usr.sbin/sesutil/eltsub.c head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/eltsub.c ============================================================================== --- head/usr.sbin/sesutil/eltsub.c Sat Mar 26 11:41:35 2016 (r297290) +++ head/usr.sbin/sesutil/eltsub.c Sat Mar 26 12:11:46 2016 (r297291) @@ -37,13 +37,9 @@ #include #include -#include #include -#include #include #include -#include -#include #include #include "eltsub.h" Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Sat Mar 26 11:41:35 2016 (r297290) +++ head/usr.sbin/sesutil/sesutil.c Sat Mar 26 12:11:46 2016 (r297291) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "eltsub.h" From owner-svn-src-head@freebsd.org Sat Mar 26 12:19:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C82ADD4F4; Sat, 26 Mar 2016 12:19:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2228C13CA; Sat, 26 Mar 2016 12:19:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QCJRHc075198; Sat, 26 Mar 2016 12:19:27 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QCJRqX075197; Sat, 26 Mar 2016 12:19:27 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603261219.u2QCJRqX075197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 26 Mar 2016 12:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297292 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 12:19:28 -0000 Author: mmel Date: Sat Mar 26 12:19:27 2016 New Revision: 297292 URL: https://svnweb.freebsd.org/changeset/base/297292 Log: ARM: Fix bug introduced in r297286. - don't put command line without guard to kernel environment. - kernel environment delivered from ubldr must have absolute precedence. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 26 12:11:46 2016 (r297291) +++ head/sys/arm/arm/machdep.c Sat Mar 26 12:19:27 2016 (r297292) @@ -1049,13 +1049,10 @@ cmdline_set_env(char *cmdline, const cha /* Test and remove guard. */ if (guard != NULL && guard[0] != '\0') { guard_len = strlen(guard); - if (strncasecmp(cmdline, guard, guard_len) != 0){ - init_static_kenv(cmdline, 0); + if (strncasecmp(cmdline, guard, guard_len) != 0) return; - - cmdline += guard_len; - size -= guard_len; - } + cmdline += guard_len; + size -= guard_len; } /* Skip leading spaces. */ @@ -1833,7 +1830,7 @@ initarm(struct arm_boot_params *abp) panic("OF_init failed with the found device tree"); #if defined(LINUX_BOOT_ABI) - if (fdt_get_chosen_bootargs(linux_command_line, + if (loader_envp == NULL && fdt_get_chosen_bootargs(linux_command_line, LBABI_MAX_COMMAND_LINE) == 0) cmdline_set_env(linux_command_line, CMDLINE_GUARD); #endif From owner-svn-src-head@freebsd.org Sat Mar 26 14:07:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948A7ADE877 for ; Sat, 26 Mar 2016 14:07:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F1511172 for ; Sat, 26 Mar 2016 14:07:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id u125so41000853wmg.1 for ; Sat, 26 Mar 2016 07:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=JI/ELhHlgKzQrSElYnk3myeg5L7OZf+iu2J9ioxuirQ=; b=p6t/y8fPoR/wuWBpWTf5UF889EtFD+hnUzPmZGug/pOpZ94YaFoX/DbzcqYQ8CNycA TQq71dO11OJRPY7d+ksvSscJHS1TZSDtfNl05si4E7mUTYQejNdNRP29If00vQU1T3lu 1T7r4JsEVdbiNyppbZjzVlsSgjTcTHfFx2xjBe3BqHiVGAHe9tGFd1rUM1wBt1nJ05E7 coEV6SAxh4hXr4qGrZPwRP4j/2s+7LybJfTOSATcRn1pP74ZzLKK389xV6d6t/Dqp9Kz DqZjryQSHcsm92sVjhQo/+ENb44fS7SRQoyrtIdlwTxSVxgZj/EshSvIotnMe1OITvSd Mk4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=JI/ELhHlgKzQrSElYnk3myeg5L7OZf+iu2J9ioxuirQ=; b=g9U0zXo03hApuO9QOGuLZINmgXSMnT+sIOk4+NhqcXxzKqBhY9Z3oCUFO5iiGoKAO5 y5UCrDgLnMScSu1GaJVnaY1drXOeei2fe05eMbH+FzfjC3BK4Y0yXwvyhA8D6DZmnCUN x4EOaX075wQuHWqAgSlC71RvTZtrn4npUZEl92L1sAN1/ESiekvos+P27PhA+YAo4mPF RkK8CjK2Eml1ujrKEHKCWK4hY9yyJDeeC+vQd8P/qClFsZbu/Gn7dRkxyIzP37Ks4kcr Q2AC7FgBDPkhwK1tUV2Aos0wK5JDoQItejjHmCscVJHNqDpyOZbyAO8kCfWtVujKME64 8gaA== X-Gm-Message-State: AD7BkJJk6wYZSwV9JSrL/55p4aN9uLlmlyDpH8ukSZWMEMdHBGy2gy8DHQTwIapmD8BTp3n8ags2WooUtgHRoMyp MIME-Version: 1.0 X-Received: by 10.194.77.193 with SMTP id u1mr19969580wjw.73.1459001275800; Sat, 26 Mar 2016 07:07:55 -0700 (PDT) Received: by 10.194.243.98 with HTTP; Sat, 26 Mar 2016 07:07:55 -0700 (PDT) In-Reply-To: <201603260655.u2Q6ttWj077457@repo.freebsd.org> References: <201603260655.u2Q6ttWj077457@repo.freebsd.org> Date: Sat, 26 Mar 2016 15:07:55 +0100 Message-ID: Subject: Re: svn commit: r297284 - in head/sys/arm: arm at91 conf include From: Oliver Pinter To: Michal Meloun , Andrew Turner Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 14:07:58 -0000 Hi Michal! Is there any chance to add similar workaround to arm64 kernel too? There are some arm64 devices without UEFI for example Odroid C2 and Beelink Mini MX... Thanks, Oliver On Sat, Mar 26, 2016 at 7:55 AM, Michal Meloun wrote: > Author: mmel > Date: Sat Mar 26 06:55:55 2016 > New Revision: 297284 > URL: https://svnweb.freebsd.org/changeset/base/297284 > > Log: > ARM: Teach LINUX_BOOT_ABI to recognize DT blob. > This allow us to boot FreeBSD kernel (using uImage encapsulation) directly > from U-boot using 'bootm' command or by Android fastboot loader. > For now, kernel uImage must be marked as Linux, but we can add support for > FreeBSD into U-Boot later. > > Modified: > head/sys/arm/arm/machdep.c > head/sys/arm/at91/board_tsc4370.c > head/sys/arm/conf/TEGRA124 > head/sys/arm/include/machdep.h > > Modified: head/sys/arm/arm/machdep.c > ============================================================================== > --- head/sys/arm/arm/machdep.c Sat Mar 26 03:46:12 2016 (r297283) > +++ head/sys/arm/arm/machdep.c Sat Mar 26 06:55:55 2016 (r297284) > @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); > #include > > #ifdef FDT > +#include > #include > #include > #endif > @@ -959,7 +960,8 @@ makectx(struct trapframe *tf, struct pcb > * Fake up a boot descriptor table > */ > vm_offset_t > -fake_preload_metadata(struct arm_boot_params *abp __unused) > +fake_preload_metadata(struct arm_boot_params *abp __unused, void *dtb_ptr, > + size_t dtb_size) > { > #ifdef DDB > vm_offset_t zstart = 0, zend = 0; > @@ -997,6 +999,16 @@ fake_preload_metadata(struct arm_boot_pa > } else > #endif > lastaddr = (vm_offset_t)&end; > + if (dtb_ptr != NULL) { > + /* Copy DTB to KVA space and insert it into module chain. */ > + lastaddr = roundup(lastaddr, sizeof(int)); > + fake_preload[i++] = MODINFO_METADATA | MODINFOMD_DTBP; > + fake_preload[i++] = sizeof(uint32_t); > + fake_preload[i++] = (uint32_t)lastaddr; > + memmove((void *)lastaddr, dtb_ptr, dtb_size); > + lastaddr += dtb_size; > + lastaddr = roundup(lastaddr, sizeof(int)); > + } > fake_preload[i++] = 0; > fake_preload[i] = 0; > preload_metadata = (void *)fake_preload; > @@ -1023,20 +1035,35 @@ linux_parse_boot_param(struct arm_boot_p > struct arm_lbabi_tag *walker; > uint32_t revision; > uint64_t serial; > +#ifdef FDT > + struct fdt_header *dtb_ptr; > + uint32_t dtb_size; > +#endif > > /* > * Linux boot ABI: r0 = 0, r1 is the board type (!= 0) and r2 > * is atags or dtb pointer. If all of these aren't satisfied, > - * then punt. > + * then punt. Unfortunately, it looks like DT enabled kernels > + * doesn't uses board type and U-Boot delivers 0 in r1 for them. > */ > - if (!(abp->abp_r0 == 0 && abp->abp_r1 != 0 && abp->abp_r2 != 0)) > - return 0; > + if (abp->abp_r0 != 0 || abp->abp_r2 == 0) > + return (0); > +#ifdef FDT > + /* Test if r2 point to valid DTB. */ > + dtb_ptr = (struct fdt_header *)abp->abp_r2; > + if (fdt_check_header(dtb_ptr) == 0) { > + dtb_size = fdt_totalsize(dtb_ptr); > + return (fake_preload_metadata(abp, dtb_ptr, dtb_size)); > + } > +#endif > + /* Old, ATAG based boot must have board type set. */ > + if (abp->abp_r1 == 0) > + return (0); > > board_id = abp->abp_r1; > walker = (struct arm_lbabi_tag *) > (abp->abp_r2 + KERNVIRTADDR - abp->abp_physaddr); > > - /* xxx - Need to also look for binary device tree */ > if (ATAG_TAG(walker) != ATAG_CORE) > return 0; > > @@ -1077,7 +1104,7 @@ linux_parse_boot_param(struct arm_boot_p > > init_static_kenv(NULL, 0); > > - return fake_preload_metadata(abp); > + return fake_preload_metadata(abp, NULL, 0); > } > #endif > > @@ -1135,7 +1162,7 @@ default_parse_boot_param(struct arm_boot > return lastaddr; > #endif > /* Fall back to hardcoded metadata. */ > - lastaddr = fake_preload_metadata(abp); > + lastaddr = fake_preload_metadata(abp, NULL, 0); > > return lastaddr; > } > > Modified: head/sys/arm/at91/board_tsc4370.c > ============================================================================== > --- head/sys/arm/at91/board_tsc4370.c Sat Mar 26 03:46:12 2016 (r297283) > +++ head/sys/arm/at91/board_tsc4370.c Sat Mar 26 06:55:55 2016 (r297284) > @@ -601,7 +601,7 @@ parse_boot_param(struct arm_boot_params > inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); > } > > - return fake_preload_metadata(abp); > + return fake_preload_metadata(abp, NULL, 0); > } > > ARM_BOARD(NONE, "TSC4370 Controller Board"); > > Modified: head/sys/arm/conf/TEGRA124 > ============================================================================== > --- head/sys/arm/conf/TEGRA124 Sat Mar 26 03:46:12 2016 (r297283) > +++ head/sys/arm/conf/TEGRA124 Sat Mar 26 06:55:55 2016 (r297284) > @@ -28,6 +28,7 @@ options SCHED_ULE # ULE scheduler > options PLATFORM # Platform based SoC > options PLATFORM_SMP > options SMP # Enable multiple cores > +options LINUX_BOOT_ABI > > # Debugging for use in -current > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > > Modified: head/sys/arm/include/machdep.h > ============================================================================== > --- head/sys/arm/include/machdep.h Sat Mar 26 03:46:12 2016 (r297283) > +++ head/sys/arm/include/machdep.h Sat Mar 26 06:55:55 2016 (r297284) > @@ -37,7 +37,8 @@ struct arm_boot_params; > vm_offset_t default_parse_boot_param(struct arm_boot_params *abp); > vm_offset_t freebsd_parse_boot_param(struct arm_boot_params *abp); > vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp); > -vm_offset_t fake_preload_metadata(struct arm_boot_params *abp); > +vm_offset_t fake_preload_metadata(struct arm_boot_params *abp, > + void *dtb_ptr, size_t dtb_size); > vm_offset_t parse_boot_param(struct arm_boot_params *abp); > void arm_generic_initclocks(void); > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat Mar 26 14:36:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72AD5ADEDFD; Sat, 26 Mar 2016 14:36:12 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 422D11432; Sat, 26 Mar 2016 14:36:12 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (bcdc6637.skybroadband.com [188.220.102.55]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id F37C2D78FE; Sat, 26 Mar 2016 14:36:10 +0000 (UTC) Date: Sat, 26 Mar 2016 14:36:09 +0000 From: Andrew Turner To: Oliver Pinter Cc: Michal Meloun , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297284 - in head/sys/arm: arm at91 conf include Message-ID: <20160326143609.7ed2e91f@zapp> In-Reply-To: References: <201603260655.u2Q6ttWj077457@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 14:36:12 -0000 On Sat, 26 Mar 2016 15:07:55 +0100 Oliver Pinter wrote: > Hi Michal! > > Is there any chance to add similar workaround to arm64 kernel too? > There are some arm64 devices without UEFI for example Odroid C2 and > Beelink Mini MX... No, for these you should port loader, either use loader.efi with the EFI support in U-Boot, use the port of ubldr, or write something new. Andrew From owner-svn-src-head@freebsd.org Sat Mar 26 15:39:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1BBEADD89C; Sat, 26 Mar 2016 15:39:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 711E01AD8; Sat, 26 Mar 2016 15:39:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QFdm2W035758; Sat, 26 Mar 2016 15:39:48 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QFdmY9035757; Sat, 26 Mar 2016 15:39:48 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201603261539.u2QFdmY9035757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 26 Mar 2016 15:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297293 - head/sys/boot/geli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 15:39:49 -0000 Author: allanjude Date: Sat Mar 26 15:39:48 2016 New Revision: 297293 URL: https://svnweb.freebsd.org/changeset/base/297293 Log: Do not prompt for GELI passphrase is encrypted with keys only PR: 208251 Submitted by: Fabian Keil Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/geli/geliboot.c Modified: head/sys/boot/geli/geliboot.c ============================================================================== --- head/sys/boot/geli/geliboot.c Sat Mar 26 12:19:27 2016 (r297292) +++ head/sys/boot/geli/geliboot.c Sat Mar 26 15:39:48 2016 (r297293) @@ -94,6 +94,11 @@ geli_taste(int read_func(void *vdev, voi /* Disk is not GELI boot device, skip it */ return (1); } + if (md.md_iterations < 0) { + /* XXX TODO: Support loading key files */ + /* Disk does not have a passphrase, skip it */ + return (1); + } geli_e = malloc(sizeof(struct geli_entry)); if (geli_e == NULL) return (2); @@ -137,7 +142,10 @@ geli_attach(struct dsk *dskp, const char /* * Prepare Derived-Key from the user passphrase. */ - if (geli_e->md.md_iterations == 0) { + if (geli_e->md.md_iterations < 0) { + /* XXX TODO: Support loading key files */ + return (1); + } else if (geli_e->md.md_iterations == 0) { g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, sizeof(geli_e->md.md_salt)); g_eli_crypto_hmac_update(&ctx, passphrase, From owner-svn-src-head@freebsd.org Sat Mar 26 17:38:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4114ADE539; Sat, 26 Mar 2016 17:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88ED91272; Sat, 26 Mar 2016 17:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QHcF1d074284; Sat, 26 Mar 2016 17:38:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QHcFaJ074283; Sat, 26 Mar 2016 17:38:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603261738.u2QHcFaJ074283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 26 Mar 2016 17:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297294 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 17:38:16 -0000 Author: dim Date: Sat Mar 26 17:38:15 2016 New Revision: 297294 URL: https://svnweb.freebsd.org/changeset/base/297294 Log: Pull in r264465 from upstream llvm trunk (by David Majnemer): [X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr We forgot to add the second machine operand to our ADJCALLSTACKDOWN, resulting in crashes in PEI. This fixes PR27071. This should fix an assertion failure during buildworld, when using -Os, and targeting either i386 directly, or building the 32-bit libraries on amd64. Reported by: Eric Camachat Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Mar 26 15:39:48 2016 (r297293) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Mar 26 17:38:15 2016 (r297294) @@ -22242,7 +22242,7 @@ X86TargetLowering::EmitLoweredTLSAddr(Ma // Emit CALLSEQ_START right before the instruction. unsigned AdjStackDown = TII.getCallFrameSetupOpcode(); MachineInstrBuilder CallseqStart = - BuildMI(MF, DL, TII.get(AdjStackDown)).addImm(0); + BuildMI(MF, DL, TII.get(AdjStackDown)).addImm(0).addImm(0); BB->insert(MachineBasicBlock::iterator(MI), CallseqStart); // Emit CALLSEQ_END right after the instruction. From owner-svn-src-head@freebsd.org Sat Mar 26 17:42:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F50CADE714; Sat, 26 Mar 2016 17:42:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E330119A0; Sat, 26 Mar 2016 17:42:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2QHgBnG039802 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 26 Mar 2016 19:42:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2QHgBnG039802 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2QHgARv039801; Sat, 26 Mar 2016 19:42:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Mar 2016 19:42:10 +0200 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160326174210.GU1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160326021219.X911@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 17:42:17 -0000 On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote: > This uses the i8254. Well, this is the part which I do not like most. It is ridiculous to calibrate relatively high-quality CPU oscillator with 8245 timer, which often fed from separate, low-quality crystal which currently selected by cost and exists only for legacy purposes. At least some hypervisors start offering modes where old ISA peripherals are not emulated, and I suspect that hardware would start do the same. Quite possible, some variants of SoCs already do this. More, we do not have any hooks to recalibrate our thought about TSC frequency during normal runtime. Often, system does have very precise measurement of the timecounter drift due to ntp/ptp. > xdel() is a specialized version of i8254 DELAY() > with getit() inline. It returns the initial and final values of the > i8254 counter. It doesn't handle interrupts or any other source of > large clock jitter. What it measures more precisely is the measurement > overhead. This is normally 2-5 usec. With a timer frequency of about > 1 MHz, a 5 usec error is about 5 ppm. Compensating for this reduces > the error to below 1 ppm if there are no interrupts, > > tsc_calibrate() calls xdel() twice to determine the measurement overhead. > It should be called one more time to warm up the cache. > > In other kernels, I use the following version using DELAY() which is > good enough if DELAY() works and is not delayed by interrupts > > X diff -c2 ./x86/x86/tsc.c~ ./x86/x86/tsc.c > X *** ./x86/x86/tsc.c~ Sun Feb 14 21:56:28 2016 > X --- ./x86/x86/tsc.c Sun Feb 14 22:01:46 2016 > X *************** > X *** 240,244 **** > X { > X u_int regs[4]; > X ! uint64_t tsc1, tsc2; > X > X if (cpu_high >= 6) { > X --- 240,244 ---- > X { > X u_int regs[4]; > X ! uint64_t tsc1, tsc2, tsc3; > X > X if (cpu_high >= 6) { > X *************** > X *** 306,313 **** > X if (bootverbose) > X printf("Calibrating TSC clock ... "); > X tsc1 = rdtsc(); > X ! DELAY(1000000); > X tsc2 = rdtsc(); > X ! tsc_freq = tsc2 - tsc1; > X if (bootverbose) > X printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); > X --- 306,316 ---- > X if (bootverbose) > X printf("Calibrating TSC clock ... "); > X + DELAY(1000); > X tsc1 = rdtsc(); > X ! DELAY(1000); > X tsc2 = rdtsc(); > X ! DELAY(1000000); > X ! tsc3 = rdtsc(); > X ! tsc_freq = tsc3 - tsc2 - (tsc2 - tsc1); > X if (bootverbose) > X printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); > > See also kern_tc.c:cpu_tick_calibrate(). This is quite accurate after > fixing its bugs. It gets accuracy by timing over 16 seconds instead of > 1 and by using a timecounter which is assumed to be accurate. > > See also tsccalib/tsccalib.c in my home directory on freefall. This > is a refined version of the above. It uses the time returned by > clock_gettime() as a reference. It compensates for interrupts and > runs for long enough to get the specified accuracy. If you only want > a low accuracy like 1 ppm, this takes 1.8 msec on freefall (this depends > a lot on the speed of clock_gettime(2) -- 1.8 msec is with the fast > TSC timecounter in libc). > > The worst case for all of these methods is if the i8254 is the only > timer. Then tsccalib takes much longer to get an accurate calibration > because the error reading the timer is about its access time which is > very large for the i8254. The i8254 otherwise works perfectly for > calibration provided its wrapping is always detected. > > > Below is the patch to implement calibration of the ipi_wait() busy loop. > > On my sandybridge 3.4Ghz, I get the message > > LAPIC: ipi_wait() us multiplier 37 (r 128652089678 tsc 3392383992) > > This seems OK, but it might belong closer to DELAY(). > > > ... > > + counter = lapic_ipi_wait_mult * delay; > > + for (i = 0; i < counter; i++) { > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > APIC_DELSTAT_IDLE) > > return (1); > > - DELAY(1); > > + ia32_pause(); > > } > > This part is basically DELAY() implemented as a simple loop with a > callback in the loop. I don't like callbacks and prefer direct code > like the above. The direct code is basically DELAY() implemented as > a simple loop and cloned to add a simple check on very iteration. I thought about callback interface to DELAY(). We already have something quite close imported from Linux, see sys/dev/drm2/i915/intel_drv.h:_intel_wait_for and _wait_for macros. But this is for different change as well. I will wait some time for John opinion on the patch. > > If an error factor of 10 or so is acceptable, then the simple loop > is good enough for DELAY() too. Or DELAY() can do: > > while (n > 1000) > recalibrate_every_millisecond_while_reducing_n(); > /* > * We can't reasonably get better accuracy than a factor of 1000 > * for short delays, so don't try hard. A single register read > * can take over 100 cycles waiting for DMA and buses, and we > * don't want to disable interrupts so the general case can > * reasonably be delayed by several milliseconds for interrupt > * handling. We hope that the worst case in normal operation is > * 1 quanta, giving an error factor of 100000 for DELAY(1). > */ > simple_loop(); > > Bruce From owner-svn-src-head@freebsd.org Sat Mar 26 17:49:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 950EBADE7C9; Sat, 26 Mar 2016 17:49:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6FC1EB5; Sat, 26 Mar 2016 17:49:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QHnkmZ077282; Sat, 26 Mar 2016 17:49:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QHnkpB077281; Sat, 26 Mar 2016 17:49:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603261749.u2QHnkpB077281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 26 Mar 2016 17:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297295 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 17:49:47 -0000 Author: andrew Date: Sat Mar 26 17:49:46 2016 New Revision: 297295 URL: https://svnweb.freebsd.org/changeset/base/297295 Log: Only define the platform methods for the Allwinner platforms we are building for. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/allwinner/allwinner_machdep.c Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Sat Mar 26 17:38:15 2016 (r297294) +++ head/sys/arm/allwinner/allwinner_machdep.c Sat Mar 26 17:49:46 2016 (r297295) @@ -140,6 +140,7 @@ cpu_reset() while (1); } +#if defined(SOC_ALLWINNER_A10) static platform_method_t a10_methods[] = { PLATFORMMETHOD(platform_attach, a10_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), @@ -147,7 +148,10 @@ static platform_method_t a10_methods[] = PLATFORMMETHOD_END, }; +FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); +#endif +#if defined(SOC_ALLWINNER_A20) static platform_method_t a20_methods[] = { PLATFORMMETHOD(platform_attach, a20_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), @@ -159,7 +163,10 @@ static platform_method_t a20_methods[] = #endif PLATFORMMETHOD_END, }; +FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); +#endif +#if defined(SOC_ALLWINNER_A31) static platform_method_t a31_methods[] = { PLATFORMMETHOD(platform_attach, a31_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), @@ -171,7 +178,10 @@ static platform_method_t a31_methods[] = #endif PLATFORMMETHOD_END, }; +FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31"); +#endif +#if defined(SOC_ALLWINNER_A31S) static platform_method_t a31s_methods[] = { PLATFORMMETHOD(platform_attach, a31s_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), @@ -183,6 +193,8 @@ static platform_method_t a31s_methods[] #endif PLATFORMMETHOD_END, }; +FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s"); +#endif u_int allwinner_soc_type(void) @@ -195,8 +207,3 @@ allwinner_soc_family(void) { return (soc_family); } - -FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); -FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); -FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31"); -FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s"); From owner-svn-src-head@freebsd.org Sat Mar 26 19:15:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDF9ADE98F; Sat, 26 Mar 2016 19:15:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1B1812B3; Sat, 26 Mar 2016 19:15:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QJFOf5005102; Sat, 26 Mar 2016 19:15:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QJFOpa005101; Sat, 26 Mar 2016 19:15:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603261915.u2QJFOpa005101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 26 Mar 2016 19:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297296 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 19:15:25 -0000 Author: dchagin Date: Sat Mar 26 19:15:23 2016 New Revision: 297296 URL: https://svnweb.freebsd.org/changeset/base/297296 Log: Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object. MFC after: 1 week Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sat Mar 26 17:49:46 2016 (r297295) +++ head/sys/compat/linux/linux_event.c Sat Mar 26 19:15:23 2016 (r297296) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -871,8 +872,24 @@ static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { + struct eventfd *efd; - return (ENXIO); + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EINVAL); + + switch (cmd) + { + case FIONBIO: + if (*(int *)data) + efd->efd_flags |= LINUX_O_NONBLOCK; + else + efd->efd_flags &= ~LINUX_O_NONBLOCK; + case FIOASYNC: + return (0); + default: + return (ENXIO); + } } /*ARGSUSED*/ From owner-svn-src-head@freebsd.org Sat Mar 26 19:16:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE9DADEA11; Sat, 26 Mar 2016 19:16:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78822151A; Sat, 26 Mar 2016 19:16:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2QJGrUM005191; Sat, 26 Mar 2016 19:16:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QJGrKc005190; Sat, 26 Mar 2016 19:16:53 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603261916.u2QJGrKc005190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 26 Mar 2016 19:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297297 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 19:16:54 -0000 Author: dchagin Date: Sat Mar 26 19:16:53 2016 New Revision: 297297 URL: https://svnweb.freebsd.org/changeset/base/297297 Log: When write(2) on eventfd object fails with the error EAGAIN do not return the number of bytes written. MFC after: 1 week Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sat Mar 26 19:15:23 2016 (r297296) +++ head/sys/compat/linux/linux_event.c Sat Mar 26 19:16:53 2016 (r297297) @@ -751,6 +751,8 @@ retry: if (UINT64_MAX - efd->efd_count <= count) { if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) { mtx_unlock(&efd->efd_lock); + /* Do not not return the number of bytes written */ + uio->uio_resid += sizeof(eventfd_t); return (EAGAIN); } error = mtx_sleep(&efd->efd_count, &efd->efd_lock, From owner-svn-src-head@freebsd.org Sat Mar 26 19:49:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B3EADE177; Sat, 26 Mar 2016 19:49:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1E31086; Sat, 26 Mar 2016 19:49:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 31F853C3D61; Sun, 27 Mar 2016 06:49:42 +1100 (AEDT) Date: Sun, 27 Mar 2016 06:49:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160326174210.GU1741@kib.kiev.ua> Message-ID: <20160327051601.S2318@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=oU4-rSBkzfsoSkKENgcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 19:49:52 -0000 On Sat, 26 Mar 2016, Konstantin Belousov wrote: > On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote: >> This uses the i8254. > Well, this is the part which I do not like most. It is ridiculous > to calibrate relatively high-quality CPU oscillator with 8245 timer, > which often fed from separate, low-quality crystal which currently > selected by cost and exists only for legacy purposes. At least I haven't seen a single (hardware) system since I started measuring this 15-20 yeas ago on which the i8524 is not fed from the same clock as the TSC. Normally there is a PLL that can derives hundreds of different frequencies from the same clock. One is fed to the i8254, one to the ACPI timer and one to the CPU clock/TSC. > some hypervisors start offering modes where old ISA peripherals > are not emulated, and I suspect that hardware would start do the > same. Quite possible, some variants of SoCs already do this. Bug in these hypervisors. A slow clock like the i8254 is much easier to emulate than a fast one. It is impossible to emulate real time on a non-real-time system anyway, so almost all calibration code is likely to break in inverse proportion to its accuracy on real hardware. > More, we do not have any hooks to recalibrate our thought about > TSC frequency during normal runtime. Often, system does have very > precise measurement of the timecounter drift due to ntp/ptp. cpu_tick_calibrate() does exactly this (if the ticker is the TSC). My version has a precise (~1-10 usec) measurement of the timecounter drift relative to the RTC (or vice-versa). This is used some time after exit from ddb to fix up the timecounter. This depends on RTC seconds interrupts being perfectly periodic with low (or at least measurable) latency. This should be used to fix up the timecounter after suspend/ resume. An error of 1-10 usec is good enough for an ntpd server, but the current ACPI error in resume is not good enough for an nptd client. >> xdel() is a specialized version of i8254 DELAY() >> with getit() inline. It returns the initial and final values of the It can use any readable timer, but only the i8254 is easy to use and available on all (non-broken) x86 systems. Just the ifdefs/configuratation to use another timer would be very complicated. Using the cputicker or timecounter read functions doesn't quite work because these functions have unknown internals which might involve unusable timing or lockimg. Bruce From owner-svn-src-head@freebsd.org Sat Mar 26 23:39:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A23CADE5F5; Sat, 26 Mar 2016 23:39:54 +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 5B4061DD9; Sat, 26 Mar 2016 23:39:54 +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 u2QNdrpE084203; Sat, 26 Mar 2016 23:39:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2QNdrUY084200; Sat, 26 Mar 2016 23:39:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603262339.u2QNdrUY084200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 26 Mar 2016 23:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297298 - in head/sys: dev/netmap kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 23:39:54 -0000 Author: np Date: Sat Mar 26 23:39:53 2016 New Revision: 297298 URL: https://svnweb.freebsd.org/changeset/base/297298 Log: Plug leak in m_unshare. m_unshare passes on the source mbuf's flags as-is to m_getcl and this results in a leak if the flags include M_NOFREE. The fix is to clear the bits not listed in M_COPYALL before calling m_getcl. M_RDONLY should probably be filtered out too but that's outside the scope of this fix. Add assertions in the zone_mbuf and zone_pack ctors to catch similar bugs. Update netmap_get_mbuf to not pass M_NOFREE to m_getcl. It's not clear what the original code was trying to do but it's likely incorrect. Updated code is no different functionally but it avoids the newly added assertions. Reviewed by: gnn@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5698 Modified: head/sys/dev/netmap/netmap_generic.c head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Sat Mar 26 19:16:53 2016 (r297297) +++ head/sys/dev/netmap/netmap_generic.c Sat Mar 26 23:39:53 2016 (r297298) @@ -129,8 +129,9 @@ static inline struct mbuf * netmap_get_mbuf(int len) { struct mbuf *m; - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) { + m->m_flags |= M_NOFREE; /* XXXNP: Almost certainly incorrect. */ m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor; m->m_ext.ext_type = EXT_EXTREF; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Mar 26 19:16:53 2016 (r297297) +++ head/sys/kern/kern_mbuf.c Sat Mar 26 23:39:53 2016 (r297298) @@ -424,6 +424,7 @@ mb_ctor_mbuf(void *mem, int size, void * m = (struct mbuf *)mem; flags = args->flags; + MPASS((flags & M_NOFREE) == 0); error = m_init(m, how, type, flags); @@ -572,6 +573,7 @@ mb_ctor_pack(void *mem, int size, void * args = (struct mb_args *)arg; flags = args->flags; type = args->type; + MPASS((flags & M_NOFREE) == 0); #ifdef INVARIANTS trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat Mar 26 19:16:53 2016 (r297297) +++ head/sys/kern/uipc_mbuf.c Sat Mar 26 23:39:53 2016 (r297298) @@ -1670,7 +1670,7 @@ m_unshare(struct mbuf *m0, int how) * don't know how to break up the non-contiguous memory when * doing DMA. */ - n = m_getcl(how, m->m_type, m->m_flags); + n = m_getcl(how, m->m_type, m->m_flags & M_COPYFLAGS); if (n == NULL) { m_freem(m0); return (NULL); @@ -1700,7 +1700,7 @@ m_unshare(struct mbuf *m0, int how) break; off += cc; - n = m_getcl(how, m->m_type, m->m_flags); + n = m_getcl(how, m->m_type, m->m_flags & M_COPYFLAGS); if (n == NULL) { m_freem(mfirst); m_freem(m0);