From owner-svn-src-head@freebsd.org Sun Nov 24 04:35:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 149201CB293; Sun, 24 Nov 2019 04:35:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LHQn6mjJz4qRC; Sun, 24 Nov 2019 04:35:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBA2A1EE0D; Sun, 24 Nov 2019 04:35:29 +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 xAO4ZTpO070234; Sun, 24 Nov 2019 04:35:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO4ZTgw070233; Sun, 24 Nov 2019 04:35:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911240435.xAO4ZTgw070233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 24 Nov 2019 04:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355045 - head/libexec/rtld-elf/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc X-SVN-Commit-Revision: 355045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 04:35:30 -0000 Author: jhibbits Date: Sun Nov 24 04:35:29 2019 New Revision: 355045 URL: https://svnweb.freebsd.org/changeset/base/355045 Log: rtld/powerpc: Fix _rtld_bind_start for powerpcspe Summary: We need to save off the full 64-bit register, not just the low 32 bits, of all registers getting saved off in _rtld_bind_start. Additionally, we need to save off the other SPE registers (SPEFSCR and accumulator), so that their program state is not affected by the PLT resolver. Reviewed by: bdragon Differential Revision: https://reviews.freebsd.org/D22520 Modified: head/libexec/rtld-elf/powerpc/rtld_start.S Modified: head/libexec/rtld-elf/powerpc/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 02:27:50 2019 (r355044) +++ head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 04:35:29 2019 (r355045) @@ -30,6 +30,7 @@ */ #include +#include /* For SPR_SPEFSCR if needed. */ .extern _GLOBAL_OFFSET_TABLE_ .extern _DYNAMIC @@ -101,6 +102,20 @@ _ENTRY(.rtld_start) li %r0,1 /* _exit() */ sc +#ifdef __SPE__ +/* stack space for 30 GPRs + SPEFSCR/ACC/lr/cr */ +#define NREGS 31 +#define GPRWIDTH 8 +#define FUDGE 4 /* Fudge factor for alignment */ +#else +/* stack space for 30 GPRs + lr/cr */ +#define NREGS 30 +#define GPRWIDTH 4 +#define FUDGE 0 +#endif +/* Stack frame needs the 12-byte ABI frame plus fudge factor. */ +#define STACK_SIZE (NREGS * GPRWIDTH + 4 * 2 + 12 + FUDGE) + /* * _rtld_bind_secureplt_start() * @@ -110,8 +125,12 @@ _ENTRY(.rtld_start) * So for bss-plt, we multiply the index by 12 to get the offset. */ _ENTRY(_rtld_bind_secureplt_start) - stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr + stwu %r1,-STACK_SIZE(%r1) +#ifdef __SPE__ + evstdd %r0,24(%r1) +#else stw %r0,20(%r1) # save r0 +#endif /* * Instead of division which is costly we will use multiplicative @@ -137,28 +156,113 @@ _ENTRY(_rtld_bind_secureplt_start) .globl _rtld_bind _ENTRY(_rtld_bind_start) - stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr + stwu %r1,-STACK_SIZE(%r1) +#ifdef __SPE__ + evstdd %r0,24(%r1) +#else stw %r0,20(%r1) # save r0 +#endif 1: mflr %r0 stw %r0,16(%r1) # save lr mfcr %r0 stw %r0,12(%r1) # save cr +#ifdef __SPE__ + evstdd %r3, 32(%r1) + evstdd %r4, 40(%r1) + evstdd %r5, 48(%r1) + evstdd %r6, 56(%r1) + evstdd %r7, 64(%r1) + evstdd %r8, 72(%r1) + evstdd %r9, 80(%r1) + evstdd %r10, 88(%r1) + evstdd %r11, 96(%r1) + evstdd %r12, 104(%r1) + evstdd %r13, 112(%r1) + evstdd %r14, 120(%r1) + evstdd %r15, 128(%r1) + evstdd %r16, 136(%r1) + evstdd %r17, 144(%r1) + evstdd %r18, 152(%r1) + evstdd %r19, 160(%r1) + evstdd %r20, 168(%r1) + evstdd %r21, 176(%r1) + evstdd %r22, 184(%r1) + evstdd %r23, 192(%r1) + evstdd %r24, 200(%r1) + evstdd %r25, 208(%r1) + evstdd %r26, 216(%r1) + evstdd %r27, 224(%r1) + evstdd %r28, 232(%r1) + evstdd %r29, 240(%r1) + evstdd %r30, 248(%r1) + li %r3, 256 + evstddx %r31, %r1, %r3 + evxor %r0, %r0, %r0 + li %r3, 264 + evmwumiaa %r0, %r0, %r0 + evstddx %r0, %r1, %r3 + mfspr %r3, SPR_SPEFSCR + stw %r3, 20(%r1) +#else stmw %r3,24(%r1) # save r3-r31 +#endif mr %r3,%r12 # obj mulli %r4,%r11,12 # rela index * sizeof(Elf_Rela) bl _rtld_bind # target addr = _rtld_bind(obj, reloff) mtctr %r3 # move absolute target addr into ctr +#ifdef __SPE__ + lwz %r3, 20(%r1) + mtspr SPR_SPEFSCR, %r3 + li %r3, 264 + evlddx %r0, %r3, %r1 + evmra %r0, %r0 + evldd %r3, 32(%r1) + evldd %r4, 40(%r1) + evldd %r5, 48(%r1) + evldd %r6, 56(%r1) + evldd %r7, 64(%r1) + evldd %r8, 72(%r1) + evldd %r9, 80(%r1) + evldd %r10, 88(%r1) + evldd %r11, 96(%r1) + evldd %r12, 104(%r1) + evldd %r13, 112(%r1) + evldd %r14, 120(%r1) + evldd %r15, 128(%r1) + evldd %r16, 136(%r1) + evldd %r17, 144(%r1) + evldd %r18, 152(%r1) + evldd %r19, 160(%r1) + evldd %r20, 168(%r1) + evldd %r21, 176(%r1) + evldd %r22, 184(%r1) + evldd %r23, 192(%r1) + evldd %r24, 200(%r1) + evldd %r25, 208(%r1) + evldd %r26, 216(%r1) + evldd %r27, 224(%r1) + evldd %r28, 232(%r1) + evldd %r29, 240(%r1) + evldd %r30, 248(%r1) + li %r0, 256 + evlddx %r31, %r1, %r0 +#else lmw %r3,24(%r1) # restore r3-r31 +#endif lwz %r0,12(%r1) # restore cr mtcr %r0 lwz %r0,16(%r1) # restore lr mtlr %r0 +#ifdef __SPE__ + evldd %r0,24(%r1) +#else lwz %r0,20(%r1) # restore r0 +#endif - addi %r1,%r1,160 # restore stack + addi %r1,%r1,STACK_SIZE # restore stack bctr # jump to target From owner-svn-src-head@freebsd.org Sun Nov 24 05:37:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67DF71CC868; Sun, 24 Nov 2019 05:37:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LJpK1wQ6z4sfF; Sun, 24 Nov 2019 05:37:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 251801F8BD; Sun, 24 Nov 2019 05:37:29 +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 xAO5bTJT005870; Sun, 24 Nov 2019 05:37:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO5bSLb005869; Sun, 24 Nov 2019 05:37:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911240537.xAO5bSLb005869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 24 Nov 2019 05:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355046 - head/sys/dev/cxgbe/firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/firmware X-SVN-Commit-Revision: 355046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 05:37:29 -0000 Author: np Date: Sun Nov 24 05:37:28 2019 New Revision: 355046 URL: https://svnweb.freebsd.org/changeset/base/355046 Log: cxgbe(4): Update the firmware interface header. This allows the driver to be updated for the next firmware without waiting for it to be released. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Nov 24 04:35:29 2019 (r355045) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Nov 24 05:37:28 2019 (r355046) @@ -142,6 +142,7 @@ enum fw_wr_opcodes { FW_ISCSI_TX_DATA_WR = 0x45, FW_PTP_TX_PKT_WR = 0x46, FW_TLSTX_DATA_WR = 0x68, + FW_TLS_TUNNEL_OFLD_WR = 0x69, FW_CRYPTO_LOOKASIDE_WR = 0x6d, FW_COISCSI_TGT_WR = 0x70, FW_COISCSI_TGT_CONN_WR = 0x71, @@ -2200,6 +2201,11 @@ enum fw_chnet_ifconf_wr_subop { FW_CHNET_IFCONF_WR_SUBOP_ICMP_PING4, FW_CHNET_IFCONF_WR_SUBOP_ICMP_PING6, + FW_CHNET_IFCONF_WR_SUBOP_ICMP_PLD_PING4, + FW_CHNET_IFCONF_WR_SUBOP_ICMP_PLD_PING6, + + FW_CHNET_IFCONF_WR_SUBOP_PMTU6_CLEAR, + FW_CHNET_IFCONF_WR_SUBOP_MAX, }; @@ -2228,7 +2234,8 @@ struct fw_chnet_ifconf_wr { } mac; } u; struct fw_chnet_ifconf_params { - __be32 r0; + __be16 ping_pldsize; + __be16 r0; __be16 vlanid; __be16 mtu; union fw_chnet_ifconf_addr_type { @@ -4080,6 +4087,13 @@ struct fw_crypto_lookaside_wr { (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) & \ M_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) +struct fw_tls_tunnel_ofld_wr { + __be32 op_compl; + __be32 flowid_len16; + __be32 plen; + __be32 r4; +}; + /****************************************************************************** * C O M M A N D s *********************/ @@ -4137,6 +4151,7 @@ enum fw_cmd_opcodes { FW_DEVLOG_CMD = 0x25, FW_WATCHDOG_CMD = 0x27, FW_CLIP_CMD = 0x28, + FW_CLIP2_CMD = 0x29, FW_CHNET_IFACE_CMD = 0x26, FW_FCOE_RES_INFO_CMD = 0x31, FW_FCOE_LINK_CMD = 0x32, @@ -4752,6 +4767,22 @@ enum fw_params_mnem { /* * device parameters */ +#define S_FW_PARAMS_PARAM_FILTER_MODE 16 +#define M_FW_PARAMS_PARAM_FILTER_MODE 0xffff +#define V_FW_PARAMS_PARAM_FILTER_MODE(x) \ + ((x) << S_FW_PARAMS_PARAM_FILTER_MODE) +#define G_FW_PARAMS_PARAM_FILTER_MODE(x) \ + (((x) >> S_FW_PARAMS_PARAM_FILTER_MODE) & \ + M_FW_PARAMS_PARAM_FILTER_MODE) + +#define S_FW_PARAMS_PARAM_FILTER_MASK 0 +#define M_FW_PARAMS_PARAM_FILTER_MASK 0xffff +#define V_FW_PARAMS_PARAM_FILTER_MASK(x) \ + ((x) << S_FW_PARAMS_PARAM_FILTER_MASK) +#define G_FW_PARAMS_PARAM_FILTER_MASK(x) \ + (((x) >> S_FW_PARAMS_PARAM_FILTER_MASK) & \ + M_FW_PARAMS_PARAM_FILTER_MASK) + enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */ FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */ @@ -4799,6 +4830,14 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_ADD_SMAC = 0x25, FW_PARAMS_PARAM_DEV_HPFILTER_REGION_SUPPORT = 0x26, FW_PARAMS_PARAM_DEV_OPAQUE_VIID_SMT_EXTN = 0x27, + FW_PARAMS_PARAM_DEV_HASHFILTER_WITH_OFLD = 0x28, + FW_PARAMS_PARAM_DEV_DBQ_TIMER = 0x29, + FW_PARAMS_PARAM_DEV_DBQ_TIMERTICK = 0x2A, + FW_PARAMS_PARAM_DEV_NUM_TM_CLASS = 0x2B, + FW_PARAMS_PARAM_DEV_VF_TRVLAN = 0x2C, + FW_PARAMS_PARAM_DEV_TCB_CACHE_FLUSH = 0x2D, + FW_PARAMS_PARAM_DEV_FILTER = 0x2E, + FW_PARAMS_PARAM_DEV_CLIP2_CMD = 0x2F, }; /* @@ -4827,8 +4866,14 @@ enum fw_params_param_dev_diag { FW_PARAM_DEV_DIAG_TMP = 0x00, FW_PARAM_DEV_DIAG_VDD = 0x01, FW_PARAM_DEV_DIAG_MAXTMPTHRESH = 0x02, + FW_PARAM_DEV_DIAG_RESET_TMP_SENSOR = 0x03, }; +enum fw_params_param_dev_filter{ + FW_PARAM_DEV_FILTER_VNIC_MODE = 0x00, + FW_PARAM_DEV_FILTER_MODE_MASK = 0x01, +}; + enum fw_params_param_dev_fwcache { FW_PARAM_DEV_FWCACHE_FLUSH = 0x00, FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01, @@ -4892,9 +4937,21 @@ enum fw_params_param_pfvf { FW_PARAMS_PARAM_PFVF_PPOD_EDRAM_START = 0x3B, FW_PARAMS_PARAM_PFVF_PPOD_EDRAM_END = 0x3C, FW_PARAMS_PARAM_PFVF_MAX_PKTS_PER_ETH_TX_PKTS_WR = 0x3D, + FW_PARAMS_PARAM_PFVF_GET_SMT_START = 0x3E, + FW_PARAMS_PARAM_PFVF_GET_SMT_SIZE = 0x3F, + FW_PARAMS_PARAM_PFVF_LINK_STATE = 0x40, }; /* + * virtual link state as seen by the specified VF + */ +enum vf_link_states { + VF_LINK_STATE_AUTO = 0x00, + VF_LINK_STATE_ENABLE = 0x01, + VF_LINK_STATE_DISABLE = 0x02, +}; + +/* * dma queue parameters */ enum fw_params_param_dmaq { @@ -4907,6 +4964,7 @@ enum fw_params_param_dmaq { FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12, FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13, FW_PARAMS_PARAM_DMAQ_EQ_DCA = 0x14, + FW_PARAMS_PARAM_DMAQ_EQ_TIMERIX = 0x15, FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20, FW_PARAMS_PARAM_DMAQ_FLM_DCA = 0x30 }; @@ -4922,6 +4980,7 @@ enum fw_params_param_chnet_flags { FW_PARAMS_PARAM_CHNET_FLAGS_ENABLE_IPV6 = 0x1, FW_PARAMS_PARAM_CHNET_FLAGS_ENABLE_DAD = 0x2, FW_PARAMS_PARAM_CHNET_FLAGS_ENABLE_MLDV2= 0x4, + FW_PARAMS_PARAM_CHNET_FLAGS_ENABLE_IPV6_SLAAC = 0x8, }; #define S_FW_PARAMS_MNEM 24 @@ -5852,7 +5911,7 @@ struct fw_eq_eth_cmd { __be32 dcaen_to_eqsize; __be64 eqaddr; __be32 autoequiqe_to_viid; - __be32 r8_lo; + __be32 timeren_timerix; __be64 r9; }; @@ -6046,6 +6105,19 @@ struct fw_eq_eth_cmd { #define G_FW_EQ_ETH_CMD_VIID(x) \ (((x) >> S_FW_EQ_ETH_CMD_VIID) & M_FW_EQ_ETH_CMD_VIID) +#define S_FW_EQ_ETH_CMD_TIMEREN 3 +#define M_FW_EQ_ETH_CMD_TIMEREN 0x1 +#define V_FW_EQ_ETH_CMD_TIMEREN(x) ((x) << S_FW_EQ_ETH_CMD_TIMEREN) +#define G_FW_EQ_ETH_CMD_TIMEREN(x) \ + (((x) >> S_FW_EQ_ETH_CMD_TIMEREN) & M_FW_EQ_ETH_CMD_TIMEREN) +#define F_FW_EQ_ETH_CMD_TIMEREN V_FW_EQ_ETH_CMD_TIMEREN(1U) + +#define S_FW_EQ_ETH_CMD_TIMERIX 0 +#define M_FW_EQ_ETH_CMD_TIMERIX 0x7 +#define V_FW_EQ_ETH_CMD_TIMERIX(x) ((x) << S_FW_EQ_ETH_CMD_TIMERIX) +#define G_FW_EQ_ETH_CMD_TIMERIX(x) \ + (((x) >> S_FW_EQ_ETH_CMD_TIMERIX) & M_FW_EQ_ETH_CMD_TIMERIX) + struct fw_eq_ctrl_cmd { __be32 op_to_vfn; __be32 alloc_to_len16; @@ -6414,6 +6486,8 @@ struct fw_eq_ofld_cmd { #define G_FW_EQ_OFLD_CMD_EQSIZE(x) \ (((x) >> S_FW_EQ_OFLD_CMD_EQSIZE) & M_FW_EQ_OFLD_CMD_EQSIZE) +/* Following macros present here only to maintain backward + * compatibiity. Driver must not use these anymore */ /* Macros for VIID parsing: VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number */ #define S_FW_VIID_PFN 8 @@ -7125,11 +7199,12 @@ enum fw_port_mdi { #define FW_PORT_CAP32_MDISTRAIGHT 0x00400000UL #define FW_PORT_CAP32_FEC_RS 0x00800000UL #define FW_PORT_CAP32_FEC_BASER_RS 0x01000000UL -#define FW_PORT_CAP32_FEC_RESERVED1 0x02000000UL +#define FW_PORT_CAP32_FEC_NO_FEC 0x02000000UL #define FW_PORT_CAP32_FEC_RESERVED2 0x04000000UL #define FW_PORT_CAP32_FEC_RESERVED3 0x08000000UL #define FW_PORT_CAP32_FORCE_PAUSE 0x10000000UL -#define FW_PORT_CAP32_RESERVED2 0xe0000000UL +#define FW_PORT_CAP32_FORCE_FEC 0x20000000UL +#define FW_PORT_CAP32_RESERVED2 0xc0000000UL #define S_FW_PORT_CAP32_SPEED 0 #define M_FW_PORT_CAP32_SPEED 0xfff @@ -7190,6 +7265,14 @@ enum fw_port_mdi32 { #define CAP32_FC(__cap32) \ (V_FW_PORT_CAP32_FC(M_FW_PORT_CAP32_FC) & __cap32) +static inline bool +fec_supported(uint32_t caps) +{ + + return ((caps & (FW_PORT_CAP32_SPEED_25G | FW_PORT_CAP32_SPEED_50G | + FW_PORT_CAP32_SPEED_100G)) != 0); +} + enum fw_port_action { FW_PORT_ACTION_L1_CFG = 0x0001, FW_PORT_ACTION_L2_CFG = 0x0002, @@ -7226,7 +7309,8 @@ enum fw_port_l2cfg_ctlbf { FW_PORT_L2_CTLBF_OVLAN3 = 0x08, FW_PORT_L2_CTLBF_IVLAN = 0x10, FW_PORT_L2_CTLBF_TXIPG = 0x20, - FW_PORT_L2_CTLBF_MTU = 0x40 + FW_PORT_L2_CTLBF_MTU = 0x40, + FW_PORT_L2_CTLBF_OVLAN_FILT = 0x80, }; enum fw_dcb_app_tlv_sf { @@ -7435,6 +7519,13 @@ struct fw_port_cmd { (((x) >> S_FW_PORT_CMD_IVLAN0) & M_FW_PORT_CMD_IVLAN0) #define F_FW_PORT_CMD_IVLAN0 V_FW_PORT_CMD_IVLAN0(1U) +#define S_FW_PORT_CMD_OVLAN_FILT 2 +#define M_FW_PORT_CMD_OVLAN_FILT 0x1 +#define V_FW_PORT_CMD_OVLAN_FILT(x) ((x) << S_FW_PORT_CMD_OVLAN_FILT) +#define G_FW_PORT_CMD_OVLAN_FILT(x) \ + (((x) >> S_FW_PORT_CMD_OVLAN_FILT) & M_FW_PORT_CMD_OVLAN_FILT) +#define F_FW_PORT_CMD_OVLAN_FILT V_FW_PORT_CMD_OVLAN_FILT(1U) + #define S_FW_PORT_CMD_TXIPG 3 #define M_FW_PORT_CMD_TXIPG 0x1fff #define V_FW_PORT_CMD_TXIPG(x) ((x) << S_FW_PORT_CMD_TXIPG) @@ -8145,7 +8236,7 @@ struct fw_ptp_cmd { __u8 txchan; __be16 absid; __be16 mode; - __be16 r3; + __be16 ptp_rx_ctrl_pkd; } init; struct fw_ptp_ts { __u8 sc; @@ -8164,6 +8255,14 @@ struct fw_ptp_cmd { #define G_FW_PTP_CMD_PORTID(x) \ (((x) >> S_FW_PTP_CMD_PORTID) & M_FW_PTP_CMD_PORTID) +#define S_FW_PTP_CMD_PTP_RX_CTRL 15 +#define M_FW_PTP_CMD_PTP_RX_CTRL 0x1 +#define V_FW_PTP_CMD_PTP_RX_CTRL(x) ((x) << S_FW_PTP_CMD_PTP_RX_CTRL) +#define G_FW_PTP_CMD_PTP_RX_CTRL(x) \ + (((x) >> S_FW_PTP_CMD_PTP_RX_CTRL) & M_FW_PTP_CMD_PTP_RX_CTRL) +#define F_FW_PTP_CMD_PTP_RX_CTRL V_FW_PTP_CMD_PTP_RX_CTRL(1U) + + struct fw_rss_ind_tbl_cmd { __be32 op_to_viid; __be32 retval_len16; @@ -8815,6 +8914,16 @@ struct fw_clip_cmd { #define G_FW_CLIP_CMD_INDEX(x) \ (((x) >> S_FW_CLIP_CMD_INDEX) & M_FW_CLIP_CMD_INDEX) +struct fw_clip2_cmd { + __be32 op_to_write; + __be32 alloc_to_len16; + __be64 ip_hi; + __be64 ip_lo; + __be64 ipm_hi; + __be64 ipm_lo; + __be32 r4[2]; +}; + /****************************************************************************** * F O i S C S I C O M M A N D s **************************************/ @@ -9880,6 +9989,10 @@ enum { T6FW_HDR_INTFVER_FCOE = 0x00, }; +#define FW_VERSION32(MAJOR, MINOR, MICRO, BUILD) ( \ + V_FW_HDR_FW_VER_MAJOR(MAJOR) | V_FW_HDR_FW_VER_MINOR(MINOR) | \ + V_FW_HDR_FW_VER_MICRO(MICRO) | V_FW_HDR_FW_VER_BUILD(BUILD)) + enum { FW_HDR_MAGIC_RUNTIME = 0x00000000, FW_HDR_MAGIC_BOOTSTRAP = 0x626f6f74, @@ -9918,6 +10031,10 @@ struct fw_ifconf_dhcp_info { __u8 op; __u8 len; __u8 data[270]; +}; + +struct fw_ifconf_ping_info { + __be16 ping_pldsize; }; #endif /* _T4FW_INTERFACE_H_ */ From owner-svn-src-head@freebsd.org Sun Nov 24 06:43:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38F621CE02D; Sun, 24 Nov 2019 06:43:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LLG00ftfz3C3P; Sun, 24 Nov 2019 06:43:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE1FF20510; Sun, 24 Nov 2019 06:43:03 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAO6h3pt046261; Sun, 24 Nov 2019 06:43:03 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO6h3R0046260; Sun, 24 Nov 2019 06:43:03 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201911240643.xAO6h3R0046260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 24 Nov 2019 06:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355047 - head/libexec/rtld-elf/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc X-SVN-Commit-Revision: 355047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 06:43:04 -0000 Author: bdragon Date: Sun Nov 24 06:43:03 2019 New Revision: 355047 URL: https://svnweb.freebsd.org/changeset/base/355047 Log: [PowerPC] Fix stack padding issue on ppc32. Four bytes of padding are needed in the regular powerpc case to bring the stack frame size up to a multiple of 16 bytes to meet ABI requirements. Fixes odd hangs I was encountering during testing. Modified: head/libexec/rtld-elf/powerpc/rtld_start.S Modified: head/libexec/rtld-elf/powerpc/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 05:37:28 2019 (r355046) +++ head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 06:43:03 2019 (r355047) @@ -111,7 +111,7 @@ _ENTRY(.rtld_start) /* stack space for 30 GPRs + lr/cr */ #define NREGS 30 #define GPRWIDTH 4 -#define FUDGE 0 +#define FUDGE 4 #endif /* Stack frame needs the 12-byte ABI frame plus fudge factor. */ #define STACK_SIZE (NREGS * GPRWIDTH + 4 * 2 + 12 + FUDGE) From owner-svn-src-head@freebsd.org Sun Nov 24 07:52:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E815F1CF816; Sun, 24 Nov 2019 07:52:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LMpC5jHCz3G9m; Sun, 24 Nov 2019 07:52:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7187211AB; Sun, 24 Nov 2019 07:52:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAO7qZ4J087715; Sun, 24 Nov 2019 07:52:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO7qZne087714; Sun, 24 Nov 2019 07:52:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201911240752.xAO7qZne087714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 24 Nov 2019 07:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355050 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 355050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 07:52:36 -0000 Author: eadler Date: Sun Nov 24 07:52:35 2019 New Revision: 355050 URL: https://svnweb.freebsd.org/changeset/base/355050 Log: bsd-family-tree: add several new entries Reviewed by: imp, scottl Differential Revision: https://reviews.freebsd.org/D22529 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun Nov 24 06:54:17 2019 (r355049) +++ head/share/misc/bsd-family-tree Sun Nov 24 07:52:35 2019 (r355050) @@ -400,14 +400,14 @@ FreeBSD 5.2 | | | | | | | | 8.1 | DragonFly 5.6 | | | | | | | | | | | | | DragonFly 5.6.1 - | | FreeBSD | | | | - | | 11.3 | | | | + | | FreeBSD macOS | | | + | | 11.3 10.15 | | | | FreeBSD | | OpenBSD 6.6 | - | 12.1 | | | | - | | | | | | + | 12.1 macOS | | | + | | 10.15.1 | | DragonFly 5.6.2 | v | | | | | | | | | -FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -793,7 +793,10 @@ NetBSD 8.1 2019-06-04 [NBD] DragonFly 5.6 2019-06-17 [DFB] DragonFly 5.6.1 2019-06-19 [DFB] FreeBSD 11.3 2019-07-09 [FBD] +DragonFly 5.6.2 2019-08-11 [DFB] OpenBSD 6.6 2019-10-17 [OBD] +macOS 10.15 2019-10.29 [APL] +macOS 10.15.1 2019-10-29 [APL] (security/critical release) FreeBSD 12.1 2019-11-04 [FBD] Bibliography From owner-svn-src-head@freebsd.org Sun Nov 24 13:04:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DA581AEE92; Sun, 24 Nov 2019 13:04:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LVkV1KQrz41NT; Sun, 24 Nov 2019 13:04:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAOD4f6X033334 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 24 Nov 2019 15:04:44 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAOD4f6X033334 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAOD4fe1033333; Sun, 24 Nov 2019 15:04:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Nov 2019 15:04:41 +0200 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355045 - head/libexec/rtld-elf/powerpc Message-ID: <20191124130441.GA2707@kib.kiev.ua> References: <201911240435.xAO4ZTgw070233@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911240435.xAO4ZTgw070233@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47LVkV1KQrz41NT X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 13:04:50 -0000 On Sun, Nov 24, 2019 at 04:35:29AM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Sun Nov 24 04:35:29 2019 > New Revision: 355045 > URL: https://svnweb.freebsd.org/changeset/base/355045 > > Log: > rtld/powerpc: Fix _rtld_bind_start for powerpcspe > > Summary: > We need to save off the full 64-bit register, not just the low 32 bits, > of all registers getting saved off in _rtld_bind_start. Additionally, > we need to save off the other SPE registers (SPEFSCR and accumulator), > so that their program state is not affected by the PLT resolver. Why do you need to save these registers ? Why would rtld touch them ? > > Reviewed by: bdragon > Differential Revision: https://reviews.freebsd.org/D22520 > > Modified: > head/libexec/rtld-elf/powerpc/rtld_start.S > > Modified: head/libexec/rtld-elf/powerpc/rtld_start.S > ============================================================================== > --- head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 02:27:50 2019 (r355044) > +++ head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 04:35:29 2019 (r355045) > @@ -30,6 +30,7 @@ > */ > > #include > +#include /* For SPR_SPEFSCR if needed. */ > > .extern _GLOBAL_OFFSET_TABLE_ > .extern _DYNAMIC > @@ -101,6 +102,20 @@ _ENTRY(.rtld_start) > li %r0,1 /* _exit() */ > sc > > +#ifdef __SPE__ > +/* stack space for 30 GPRs + SPEFSCR/ACC/lr/cr */ > +#define NREGS 31 > +#define GPRWIDTH 8 > +#define FUDGE 4 /* Fudge factor for alignment */ > +#else > +/* stack space for 30 GPRs + lr/cr */ > +#define NREGS 30 > +#define GPRWIDTH 4 > +#define FUDGE 0 > +#endif > +/* Stack frame needs the 12-byte ABI frame plus fudge factor. */ > +#define STACK_SIZE (NREGS * GPRWIDTH + 4 * 2 + 12 + FUDGE) > + > /* > * _rtld_bind_secureplt_start() > * > @@ -110,8 +125,12 @@ _ENTRY(.rtld_start) > * So for bss-plt, we multiply the index by 12 to get the offset. > */ > _ENTRY(_rtld_bind_secureplt_start) > - stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr > + stwu %r1,-STACK_SIZE(%r1) > +#ifdef __SPE__ > + evstdd %r0,24(%r1) > +#else > stw %r0,20(%r1) # save r0 > +#endif > > /* > * Instead of division which is costly we will use multiplicative > @@ -137,28 +156,113 @@ _ENTRY(_rtld_bind_secureplt_start) > .globl _rtld_bind > > _ENTRY(_rtld_bind_start) > - stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr > + stwu %r1,-STACK_SIZE(%r1) > +#ifdef __SPE__ > + evstdd %r0,24(%r1) > +#else > stw %r0,20(%r1) # save r0 > +#endif > 1: > mflr %r0 > stw %r0,16(%r1) # save lr > mfcr %r0 > stw %r0,12(%r1) # save cr > +#ifdef __SPE__ > + evstdd %r3, 32(%r1) > + evstdd %r4, 40(%r1) > + evstdd %r5, 48(%r1) > + evstdd %r6, 56(%r1) > + evstdd %r7, 64(%r1) > + evstdd %r8, 72(%r1) > + evstdd %r9, 80(%r1) > + evstdd %r10, 88(%r1) > + evstdd %r11, 96(%r1) > + evstdd %r12, 104(%r1) > + evstdd %r13, 112(%r1) > + evstdd %r14, 120(%r1) > + evstdd %r15, 128(%r1) > + evstdd %r16, 136(%r1) > + evstdd %r17, 144(%r1) > + evstdd %r18, 152(%r1) > + evstdd %r19, 160(%r1) > + evstdd %r20, 168(%r1) > + evstdd %r21, 176(%r1) > + evstdd %r22, 184(%r1) > + evstdd %r23, 192(%r1) > + evstdd %r24, 200(%r1) > + evstdd %r25, 208(%r1) > + evstdd %r26, 216(%r1) > + evstdd %r27, 224(%r1) > + evstdd %r28, 232(%r1) > + evstdd %r29, 240(%r1) > + evstdd %r30, 248(%r1) > + li %r3, 256 > + evstddx %r31, %r1, %r3 > + evxor %r0, %r0, %r0 > + li %r3, 264 > + evmwumiaa %r0, %r0, %r0 > + evstddx %r0, %r1, %r3 > + mfspr %r3, SPR_SPEFSCR > + stw %r3, 20(%r1) > +#else > stmw %r3,24(%r1) # save r3-r31 > +#endif > > mr %r3,%r12 # obj > mulli %r4,%r11,12 # rela index * sizeof(Elf_Rela) > bl _rtld_bind # target addr = _rtld_bind(obj, reloff) > mtctr %r3 # move absolute target addr into ctr > > +#ifdef __SPE__ > + lwz %r3, 20(%r1) > + mtspr SPR_SPEFSCR, %r3 > + li %r3, 264 > + evlddx %r0, %r3, %r1 > + evmra %r0, %r0 > + evldd %r3, 32(%r1) > + evldd %r4, 40(%r1) > + evldd %r5, 48(%r1) > + evldd %r6, 56(%r1) > + evldd %r7, 64(%r1) > + evldd %r8, 72(%r1) > + evldd %r9, 80(%r1) > + evldd %r10, 88(%r1) > + evldd %r11, 96(%r1) > + evldd %r12, 104(%r1) > + evldd %r13, 112(%r1) > + evldd %r14, 120(%r1) > + evldd %r15, 128(%r1) > + evldd %r16, 136(%r1) > + evldd %r17, 144(%r1) > + evldd %r18, 152(%r1) > + evldd %r19, 160(%r1) > + evldd %r20, 168(%r1) > + evldd %r21, 176(%r1) > + evldd %r22, 184(%r1) > + evldd %r23, 192(%r1) > + evldd %r24, 200(%r1) > + evldd %r25, 208(%r1) > + evldd %r26, 216(%r1) > + evldd %r27, 224(%r1) > + evldd %r28, 232(%r1) > + evldd %r29, 240(%r1) > + evldd %r30, 248(%r1) > + li %r0, 256 > + evlddx %r31, %r1, %r0 > +#else > lmw %r3,24(%r1) # restore r3-r31 > +#endif > lwz %r0,12(%r1) # restore cr > mtcr %r0 > lwz %r0,16(%r1) # restore lr > mtlr %r0 > +#ifdef __SPE__ > + evldd %r0,24(%r1) > +#else > lwz %r0,20(%r1) # restore r0 > +#endif > > - addi %r1,%r1,160 # restore stack > + addi %r1,%r1,STACK_SIZE # restore stack > bctr # jump to target > > From owner-svn-src-head@freebsd.org Sun Nov 24 13:10:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B1CD1AEF8E; Sun, 24 Nov 2019 13:10:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LVrp2Hd4z41X6; Sun, 24 Nov 2019 13:10:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAODAAPa034648 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 24 Nov 2019 15:10:13 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAODAAPa034648 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAODAAwm034647; Sun, 24 Nov 2019 15:10:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Nov 2019 15:10:10 +0200 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355037 - head/sys/dev/pci Message-ID: <20191124131010.GB2707@kib.kiev.ua> References: <201911232343.xANNhqkQ097797@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911232343.xANNhqkQ097797@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47LVrp2Hd4z41X6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-0.99)[-0.994,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 13:10:18 -0000 On Sat, Nov 23, 2019 at 11:43:52PM +0000, Warner Losh wrote: > Author: imp > Date: Sat Nov 23 23:43:52 2019 > New Revision: 355037 > URL: https://svnweb.freebsd.org/changeset/base/355037 > > Log: > Push Giant down one layer > > The /dev/pci device doesn't need GIANT, per se. However, one routine > that it calls, pci_find_dbsf implicitly does. It walks a list that can > change when PCI scans a new bus. With hotplug, this means we could > have a race with that scanning. To prevent that, take out Giant around > scanning the list. > > However, given that we have places in the tree that drop giant, if > held when we call into them, the whole use of Giant to protect newbus > may be less effective that we desire, so add a comment about why we're > talking it out, and we'll address the issue when we lock newbus with > something other than Giant. > > Modified: > head/sys/dev/pci/pci.c > head/sys/dev/pci/pci_user.c > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Sat Nov 23 23:41:21 2019 (r355036) > +++ head/sys/dev/pci/pci.c Sat Nov 23 23:43:52 2019 (r355037) > @@ -445,18 +445,21 @@ pci_find_bsf(uint8_t bus, uint8_t slot, uint8_t func) > device_t > pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t slot, uint8_t func) > { > - struct pci_devinfo *dinfo; > + struct pci_devinfo *dinfo = NULL; > > + /* Giant because newbus is Giant locked revisit with newbus locking */ > + mtx_lock(&Giant); > STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { > if ((dinfo->cfg.domain == domain) && > (dinfo->cfg.bus == bus) && > (dinfo->cfg.slot == slot) && > (dinfo->cfg.func == func)) { > - return (dinfo->cfg.dev); > + break; > } > } > + mtx_unlock(&Giant); > > - return (NULL); > + return (dinfo != NULL ? dinfo->cfg.dev : NULL); I do not think this change is correct. If the parallel hotplug, or rather, hot-unplug event occurs, then dinfo potentially becomes invalid right after the Giant unlock, which makes both this function and its callers to access freed memory. Having caller to lock a newbus lock around both the call and consumption of the returned data is required. > } > > /* Find a device_t by vendor/device ID */ > > Modified: head/sys/dev/pci/pci_user.c > ============================================================================== > --- head/sys/dev/pci/pci_user.c Sat Nov 23 23:41:21 2019 (r355036) > +++ head/sys/dev/pci/pci_user.c Sat Nov 23 23:43:52 2019 (r355037) > @@ -119,7 +119,7 @@ static d_ioctl_t pci_ioctl; > > struct cdevsw pcicdev = { > .d_version = D_VERSION, > - .d_flags = D_NEEDGIANT, > + .d_flags = 0, > .d_open = pci_open, > .d_close = pci_close, > .d_ioctl = pci_ioctl, From owner-svn-src-head@freebsd.org Sun Nov 24 13:53:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9762B1AFF41; Sun, 24 Nov 2019 13:53:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LWpn3WFNz43Qg; Sun, 24 Nov 2019 13:53:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D5AA25274; Sun, 24 Nov 2019 13:53:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAODrbJr001059; Sun, 24 Nov 2019 13:53:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAODrbTh001057; Sun, 24 Nov 2019 13:53:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201911241353.xAODrbTh001057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 24 Nov 2019 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355054 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 355054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 13:53:37 -0000 Author: kp Date: Sun Nov 24 13:53:36 2019 New Revision: 355054 URL: https://svnweb.freebsd.org/changeset/base/355054 Log: pf: Add endline to all DPFPRINTF() DPFPRINTF() doesn't automatically add an endline, so be consistent and always add it. Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Nov 24 12:35:16 2019 (r355053) +++ head/sys/netpfil/pf/pf.c Sun Nov 24 13:53:36 2019 (r355054) @@ -3755,7 +3755,8 @@ pf_create_state(struct pf_rule *r, struct pf_rule *nr, &s->src, &s->dst, rewrite)) { /* This really shouldn't happen!!! */ DPFPRINTF(PF_DEBUG_URGENT, - ("pf_normalize_tcp_stateful failed on first pkt")); + ("pf_normalize_tcp_stateful failed on first " + "pkt\n")); pf_normalize_tcp_cleanup(s); pf_src_tree_remove_state(s); STATE_DEC_COUNTERS(s); Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Sun Nov 24 12:35:16 2019 (r355053) +++ head/sys/netpfil/pf/pf_norm.c Sun Nov 24 13:53:36 2019 (r355054) @@ -550,25 +550,25 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct /* No empty fragments. */ if (frent->fe_len == 0) { - DPFPRINTF(("bad fragment: len 0")); + DPFPRINTF(("bad fragment: len 0\n")); goto bad_fragment; } /* All fragments are 8 byte aligned. */ if (frent->fe_mff && (frent->fe_len & 0x7)) { - DPFPRINTF(("bad fragment: mff and len %d", frent->fe_len)); + DPFPRINTF(("bad fragment: mff and len %d\n", frent->fe_len)); goto bad_fragment; } /* Respect maximum length, IP_MAXPACKET == IPV6_MAXPACKET. */ if (frent->fe_off + frent->fe_len > IP_MAXPACKET) { - DPFPRINTF(("bad fragment: max packet %d", + DPFPRINTF(("bad fragment: max packet %d\n", frent->fe_off + frent->fe_len)); goto bad_fragment; } DPFPRINTF((key->frc_af == AF_INET ? - "reass frag %d @ %d-%d" : "reass frag %#08x @ %d-%d", + "reass frag %d @ %d-%d\n" : "reass frag %#08x @ %d-%d\n", key->frc_id, frent->fe_off, frent->fe_off + frent->fe_len)); /* Fully buffer all of the fragments in this fragment queue. */ @@ -642,7 +642,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct precut = prev->fe_off + prev->fe_len - frent->fe_off; if (precut >= frent->fe_len) goto bad_fragment; - DPFPRINTF(("overlap -%d", precut)); + DPFPRINTF(("overlap -%d\n", precut)); m_adj(frent->fe_m, precut); frent->fe_off += precut; frent->fe_len -= precut; @@ -653,7 +653,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct uint16_t aftercut; aftercut = frent->fe_off + frent->fe_len - after->fe_off; - DPFPRINTF(("adjust overlap %d", aftercut)); + DPFPRINTF(("adjust overlap %d\n", aftercut)); if (aftercut < after->fe_len) { m_adj(after->fe_m, aftercut); after->fe_off += aftercut; @@ -670,7 +670,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct /* If part of the queue gets too long, there is not way to recover. */ if (pf_frent_insert(frag, frent, prev)) { - DPFPRINTF(("fragment queue limit exceeded")); + DPFPRINTF(("fragment queue limit exceeded\n")); goto bad_fragment; } @@ -744,7 +744,7 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir m = *m0 = NULL; if (frag->fr_holes) { - DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); + DPFPRINTF(("frag %d, holes %d\n", frag->fr_id, frag->fr_holes)); return (PF_PASS); /* drop because *m0 is NULL, no error */ } @@ -771,7 +771,7 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir ip->ip_off &= ~(IP_MF|IP_OFFMASK); if (hdrlen + total > IP_MAXPACKET) { - DPFPRINTF(("drop: too big: %d", total)); + DPFPRINTF(("drop: too big: %d\n", total)); ip->ip_len = 0; REASON_SET(reason, PFRES_SHORT); /* PF_DROP requires a valid mbuf *m0 in pf_test() */ @@ -830,7 +830,8 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, m = *m0 = NULL; if (frag->fr_holes) { - DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); + DPFPRINTF(("frag %d, holes %d\n", frag->fr_id, + frag->fr_holes)); PF_FRAG_UNLOCK(); return (PF_PASS); /* Drop because *m0 is NULL, no error. */ } @@ -891,14 +892,14 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, ip6->ip6_nxt = proto; if (hdrlen - sizeof(struct ip6_hdr) + total > IPV6_MAXPACKET) { - DPFPRINTF(("drop: too big: %d", total)); + DPFPRINTF(("drop: too big: %d\n", total)); ip6->ip6_plen = 0; REASON_SET(reason, PFRES_SHORT); /* PF_DROP requires a valid mbuf *m0 in pf_test6(). */ return (PF_DROP); } - DPFPRINTF(("complete: %p(%d)", m, ntohs(ip6->ip6_plen))); + DPFPRINTF(("complete: %p(%d)\n", m, ntohs(ip6->ip6_plen))); return (PF_PASS); fail: @@ -967,7 +968,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, st action = PF_PASS; } else { /* Drop expects an mbuf to free. */ - DPFPRINTF(("refragment error %d", error)); + DPFPRINTF(("refragment error %d\n", error)); action = PF_DROP; } for (t = m; m; m = t) { @@ -1572,7 +1573,7 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, str if (got_ts) { /* Huh? Multiple timestamps!? */ if (V_pf_status.debug >= PF_DEBUG_MISC) { - DPFPRINTF(("multiple TS??")); + DPFPRINTF(("multiple TS??\n")); pf_print_state(state); printf("\n"); } From owner-svn-src-head@freebsd.org Sun Nov 24 14:37:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65B431B09E2 for ; Sun, 24 Nov 2019 14:37:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LXn63Gwlz44lb for ; Sun, 24 Nov 2019 14:37:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x741.google.com with SMTP id d13so10494299qko.3 for ; Sun, 24 Nov 2019 06:37:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qEJARp+MD8dHucsPZ4rIDMzVDGQtn4wy0pQpMomYnKY=; b=X0QDfnu1i+SdG+7MwQ+IE7I/MCcKPx4au+yeZlZaHm0bXwrYY+mSQLRrIcEML25SDI ykV1tCn/emeEL8fAUdFRvf7QCLweaMnppsvV3e4x6H8GR9eydUFuwE2TKd0qUjlHvDoN XcQnNa8O/aK/oUAtPnoBDolrZoc79wxgmUYBhzehLhqszW9VZRddBWItz7LMLIHjVjXz zD4RDOO+eg3G2oYCuuWktaKwOOSwyCMCvzd2wow2fA0yhGh01hRCMaeQZk81JXYhZegE nF57mMlOdI24W2suXQ3LRtjqoGKeAS0RR2icLXQ4jLQ0HDzd32lgtYBxQnKIS3ywQIrp OeNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qEJARp+MD8dHucsPZ4rIDMzVDGQtn4wy0pQpMomYnKY=; b=Gj29p4M0VRAmdcn42ku7fl7Gu8aSp20TtxwuwbrhxG1E2P9q+t+LuZHRJDDTEWHAMl VeIprwdfu8QZbcI3YrWQ8M7c5BhAREw0m+AikmiTjzQSXh89xndmTShlTxPz2DbrbYs3 N23T6KMfwlDXLW3tSGLpeNxe6+1xOOtEZ/oLLchtaHtoYfw2BCB0RmPi9DUfGHqdeFcq Y1v5QIuQobM3sAtx9n8l1uQ6bFpNiUOCk4HmrW4YBb1INpDun/DCIvi1turZye6v1xRm R+HILltB19HhcakDfJ2BHnVT0bqFmw0fLUY4gqDm784caKIcgOUZpZMCPiqHov0KKmOp h7tw== X-Gm-Message-State: APjAAAVPAB6HitV5CbLmv017tWKLY0hwiF91GT0z7J1h+a02HJVvGZ9v 7ROgnRQtsFwqhRkMQGMcOOZ6vupQ/4fnn4pT2xte8A== X-Google-Smtp-Source: APXvYqxTM3aSEzJ6wWPbL+KOk5axpu5x+/WkBHToPa25/71HGjuwCEsjH+rQK3s6NqO8EUW4n/4+joKGVc7r23AMxqc= X-Received: by 2002:a37:4716:: with SMTP id u22mr22242527qka.495.1574606232786; Sun, 24 Nov 2019 06:37:12 -0800 (PST) MIME-Version: 1.0 References: <201911232343.xANNhqkQ097797@repo.freebsd.org> <20191124131010.GB2707@kib.kiev.ua> In-Reply-To: <20191124131010.GB2707@kib.kiev.ua> From: Warner Losh Date: Sun, 24 Nov 2019 07:37:01 -0700 Message-ID: Subject: Re: svn commit: r355037 - head/sys/dev/pci To: Konstantin Belousov Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47LXn63Gwlz44lb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=X0QDfnu1; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::741) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.37 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.37)[ip: (2.45), ipnet: 2607:f8b0::/32(-2.28), asn: 15169(-1.96), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 14:37:15 -0000 On Sun, Nov 24, 2019, 6:10 AM Konstantin Belousov wrote: > On Sat, Nov 23, 2019 at 11:43:52PM +0000, Warner Losh wrote: > > Author: imp > > Date: Sat Nov 23 23:43:52 2019 > > New Revision: 355037 > > URL: https://svnweb.freebsd.org/changeset/base/355037 > > > > Log: > > Push Giant down one layer > > > > The /dev/pci device doesn't need GIANT, per se. However, one routine > > that it calls, pci_find_dbsf implicitly does. It walks a list that can > > change when PCI scans a new bus. With hotplug, this means we could > > have a race with that scanning. To prevent that, take out Giant around > > scanning the list. > > > > However, given that we have places in the tree that drop giant, if > > held when we call into them, the whole use of Giant to protect newbus > > may be less effective that we desire, so add a comment about why we're > > talking it out, and we'll address the issue when we lock newbus with > > something other than Giant. > > > > Modified: > > head/sys/dev/pci/pci.c > > head/sys/dev/pci/pci_user.c > > > > Modified: head/sys/dev/pci/pci.c > > > ============================================================================== > > --- head/sys/dev/pci/pci.c Sat Nov 23 23:41:21 2019 (r355036) > > +++ head/sys/dev/pci/pci.c Sat Nov 23 23:43:52 2019 (r355037) > > @@ -445,18 +445,21 @@ pci_find_bsf(uint8_t bus, uint8_t slot, uint8_t > func) > > device_t > > pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t slot, uint8_t func) > > { > > - struct pci_devinfo *dinfo; > > + struct pci_devinfo *dinfo = NULL; > > > > + /* Giant because newbus is Giant locked revisit with newbus > locking */ > > + mtx_lock(&Giant); > > STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { > > if ((dinfo->cfg.domain == domain) && > > (dinfo->cfg.bus == bus) && > > (dinfo->cfg.slot == slot) && > > (dinfo->cfg.func == func)) { > > - return (dinfo->cfg.dev); > > + break; > > } > > } > > + mtx_unlock(&Giant); > > > > - return (NULL); > > + return (dinfo != NULL ? dinfo->cfg.dev : NULL); > I do not think this change is correct. If the parallel hotplug, or > rather, hot-unplug event occurs, then dinfo potentially becomes invalid > right after the Giant unlock, which makes both this function and its > callers to access freed memory. Having caller to lock a newbus lock > around both the call and consumption of the returned data is required. There are many data lifetime issues. If anything the PCI user device calls drops Giant and then picks it back up again we are in the same boat... I totally agree this is a bad situation, but can only really be fixed by locking newbus with a different lock than Giant and likely using some kind of reference count for device_t that are handed out... In the mean time, I'll move giant back up into the ioctl routine and hope it isn't dropped by things it calls..m Warner > } > > > > /* Find a device_t by vendor/device ID */ > > > > Modified: head/sys/dev/pci/pci_user.c > > > ============================================================================== > > --- head/sys/dev/pci/pci_user.c Sat Nov 23 23:41:21 2019 > (r355036) > > +++ head/sys/dev/pci/pci_user.c Sat Nov 23 23:43:52 2019 > (r355037) > > @@ -119,7 +119,7 @@ static d_ioctl_t pci_ioctl; > > > > struct cdevsw pcicdev = { > > .d_version = D_VERSION, > > - .d_flags = D_NEEDGIANT, > > + .d_flags = 0, > > .d_open = pci_open, > > .d_close = pci_close, > > .d_ioctl = pci_ioctl, > From owner-svn-src-head@freebsd.org Sun Nov 24 15:03:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 321A91B16A8; Sun, 24 Nov 2019 15:03:36 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LYMX0Tzkz462d; Sun, 24 Nov 2019 15:03:36 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E96A525ECD; Sun, 24 Nov 2019 15:03:35 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOF3Zu4042072; Sun, 24 Nov 2019 15:03:35 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOF3Zqd042071; Sun, 24 Nov 2019 15:03:35 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911241503.xAOF3Zqd042071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 24 Nov 2019 15:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355055 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 355055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 15:03:36 -0000 Author: lwhsu Date: Sun Nov 24 15:03:35 2019 New Revision: 355055 URL: https://svnweb.freebsd.org/changeset/base/355055 Log: Fix gcc build We have -Werror=strict-overflow so gcc complains: In file included from /tmp/obj/workspace/src/amd64.amd64/tmp/usr/include/bitstring.h:36:0, from /workspace/src/tests/sys/sys/bitstring_test.c:34: /workspace/src/tests/sys/sys/bitstring_test.c: In function 'bit_ffc_at_test': /workspace/src/sys/sys/bitstring.h:239:5: error: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Werror=strict-overflow] if (_start >= _nbits) { ^ Disable assuming overflow of signed integer will never happen by specifying -fno-strict-overflow Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/sys/Makefile Modified: head/tests/sys/sys/Makefile ============================================================================== --- head/tests/sys/sys/Makefile Sun Nov 24 13:53:36 2019 (r355054) +++ head/tests/sys/sys/Makefile Sun Nov 24 15:03:35 2019 (r355055) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + TESTSDIR= ${TESTSBASE}/sys/sys ATF_TESTS_C= arb_test bitstring_test qmath_test rb_test splay_test WARNS?= 5 + +.if ${COMPILER_TYPE} == "gcc" +CFLAGS.bitstring_test= -fno-strict-overflow +.endif .include From owner-svn-src-head@freebsd.org Sun Nov 24 15:10:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5AB51B17D8; Sun, 24 Nov 2019 15:10:44 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LYWm4t4Rz46R9; Sun, 24 Nov 2019 15:10:44 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf1-x130.google.com with SMTP id b20so8985427lfp.4; Sun, 24 Nov 2019 07:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KsB8B/VnwEd202dEr4iuEVYFWt/ZCWsFaMPzoAbdD9M=; b=hphXf/QxbGHKNo4+gDTh973djvAIsfEAaEszM+fz8/b87Ryy+k+A7AQ/k9fYsDCH3Y t7f6+6dPOMTA/5txDVk41NT8Bxim0KvEXr2TAszzn7w2Z/j1sdTdH+eoGuaqLzFE+wGZ ZCpH7dv2pNl28CeTB5qQIVqQa8Z9y5pHY1gefVMJM8plLht7Zbyp6hgI9soGyCgIF2P0 T27lOkbvofmH7hw+toCvGjsNZwPJs39BUPZpxjuFysvVaolz7bT35+R5mh5n0riqVlEB zGNA1jIOxD5Tv3mPCCE4zYEWEC/SftYtb5wB6B8kLn8kSLhAd6oLEFJFFgka7CnZC1DD 8gOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KsB8B/VnwEd202dEr4iuEVYFWt/ZCWsFaMPzoAbdD9M=; b=lO+t+oOd0GMwl9Tpn51taYadAe61w5CoQluCvAL+b6j27yDJFhtd+7x7tPV5nUn8nF Fi3mRrP4BcrtnUGZD0RXieoSrRSzuO7JlXmm2g10XZlDBqXl8Mnb19cw9tT5VCC6T8bw rKhMIapd4xz1kHkUIgqyDBEHKrUFG1fQEOvpy+YRXIz7Ah7Dcn83190sGDLGaOMNavis 9BoDMJ2y90DAzJz2czqta+jWRQoJw2Qk5uylM7L/6eeKvh/2qAcFCfE/OfnvY4xRey2Q Aq+cJhsNlvFiTFwz1hQsWsKsOevOo3nrS+WeG5szTi4J6oyDEHYmSrICgHS/IXpJOQj5 Kx9A== X-Gm-Message-State: APjAAAXQhMgV3Kdw0Cn3X4QaBXyfW4tFF8+STydy69Sz98mZy6/f2clx DTksTg0QzvhI+vJ4YyNn0NcQSuQ4fd60T9gF0JNZqg== X-Google-Smtp-Source: APXvYqy4yXMKavFi92jeTKycSZPKj0RTZJqiuDg+8EHKmdBQUBWBQE+hh6s9L2k6LYQrbiL0X3/RR/JxQpBbP2IM4BU= X-Received: by 2002:ac2:4312:: with SMTP id l18mr17649721lfh.38.1574608240760; Sun, 24 Nov 2019 07:10:40 -0800 (PST) MIME-Version: 1.0 References: <201911240643.xAO6h3R0046260@repo.freebsd.org> In-Reply-To: <201911240643.xAO6h3R0046260@repo.freebsd.org> From: Justin Hibbits Date: Sun, 24 Nov 2019 09:10:29 -0600 Message-ID: Subject: Re: svn commit: r355047 - head/libexec/rtld-elf/powerpc To: Brandon Bergren Cc: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47LYWm4t4Rz46R9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 15:10:44 -0000 On Sun, Nov 24, 2019, 00:43 Brandon Bergren wrote: > Author: bdragon > Date: Sun Nov 24 06:43:03 2019 > New Revision: 355047 > URL: https://svnweb.freebsd.org/changeset/base/355047 > > Log: > [PowerPC] Fix stack padding issue on ppc32. > > Four bytes of padding are needed in the regular powerpc case to bring the > stack frame size up to a multiple of 16 bytes to meet ABI requirements. > > Fixes odd hangs I was encountering during testing. > > Modified: > head/libexec/rtld-elf/powerpc/rtld_start.S > > Modified: head/libexec/rtld-elf/powerpc/rtld_start.S > > ============================================================================== > --- head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 05:37:28 2019 > (r355046) > +++ head/libexec/rtld-elf/powerpc/rtld_start.S Sun Nov 24 06:43:03 2019 > (r355047) > @@ -111,7 +111,7 @@ _ENTRY(.rtld_start) > /* stack space for 30 GPRs + lr/cr */ > #define NREGS 30 > #define GPRWIDTH 4 > -#define FUDGE 0 > +#define FUDGE 4 > #endif > /* Stack frame needs the 12-byte ABI frame plus fudge factor. */ > #define STACK_SIZE (NREGS * GPRWIDTH + 4 * 2 + 12 + FUDGE) > Oh right, ABI calls for 16-bye alignment. - Justin > From owner-svn-src-head@freebsd.org Sun Nov 24 15:24:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4F201B1ED9; Sun, 24 Nov 2019 15:24:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LYqB3pzLz47Nv; Sun, 24 Nov 2019 15:24:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C33A26253; Sun, 24 Nov 2019 15:24:06 +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 xAOFO6Ts053878; Sun, 24 Nov 2019 15:24:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOFO6Bg053877; Sun, 24 Nov 2019 15:24:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911241524.xAOFO6Bg053877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Nov 2019 15:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355056 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 355056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 15:24:06 -0000 Author: imp Date: Sun Nov 24 15:24:05 2019 New Revision: 355056 URL: https://svnweb.freebsd.org/changeset/base/355056 Log: Fix leak in state machine for commands. When we get a device departed message from the firmware, we send a TARGET_REST to the device to let the firmware know we're done and as part of the recovery process. This will abort all the commands. While the documentation says the IOC is responsible for writing the completion message for all the commands pending with an aborted status, we sometimes have queued commands for the target that haven't been completed so are in the INQUEUE state. So, when we later complete the pending CCB as aborted, these commands are freed and we hit the "state not busy" panic. Elsewhere where we dequeue commands, we move the state to BUSY from INQUEUE. Do that here as well. In talking to Ken, Scott and Justin, they recommended a series of tests to see if this is 100% safe. Those tests are ongoing, but preliminary tests suggest this is safe as we see no duplicate completions when we hit this case at work. We have a machine that has a dodgy powersupply which usually doesn't apply power to a few drives, but sometimes does when the machine is under heavy load so we get a rash of the connect / disconnect messages over half an hour. Without this change, we'd see state not busy panic. With this change, the drives just annoyingly come and go without affecting the rest of the machine, but without a complete error injection test suite, it's hard to know if all edge cases are now covered or not. Discussed with: scottl, ken, gibbs Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sun Nov 24 15:03:35 2019 (r355055) +++ head/sys/dev/mpr/mpr_sas.c Sun Nov 24 15:24:05 2019 (r355056) @@ -624,6 +624,7 @@ mprsas_remove_device(struct mpr_softc *sc, struct mpr_ mpr_dprint(sc, MPR_XINFO, "Completing missed command %p\n", tm); ccb = tm->cm_complete_data; mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE); + tm->cm_state = MPR_CM_STATE_BUSY; mprsas_scsiio_complete(sc, tm); } } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sun Nov 24 15:03:35 2019 (r355055) +++ head/sys/dev/mps/mps_sas.c Sun Nov 24 15:24:05 2019 (r355056) @@ -619,6 +619,7 @@ mpssas_remove_device(struct mps_softc *sc, struct mps_ mps_dprint(sc, MPS_XINFO, "Completing missed command %p\n", tm); ccb = tm->cm_complete_data; mpssas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE); + tm->cm_state = MPS_CM_STATE_BUSY; mpssas_scsiio_complete(sc, tm); } } From owner-svn-src-head@freebsd.org Sun Nov 24 15:37:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C5641B2434; Sun, 24 Nov 2019 15:37:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LZ6L6c6Vz487m; Sun, 24 Nov 2019 15:37:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C629D26416; Sun, 24 Nov 2019 15:37:14 +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 xAOFbENw060101; Sun, 24 Nov 2019 15:37:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOFbEVF060099; Sun, 24 Nov 2019 15:37:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911241537.xAOFbEVF060099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Nov 2019 15:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355057 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 355057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 15:37:15 -0000 Author: imp Date: Sun Nov 24 15:37:14 2019 New Revision: 355057 URL: https://svnweb.freebsd.org/changeset/base/355057 Log: Hoist locking giant back up into the ioctl handler Move the locking back into the ioctl handler. This "fixes" the race where we hve a hot plug event just after the dropping of Giant in pci_find_dbsf, assuming the driver doesn't then call anything that drops and picks up Giant again... It's a little safer since don't think it doesn't, but we lack the tools to know for sure. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Nov 24 15:24:05 2019 (r355056) +++ head/sys/dev/pci/pci.c Sun Nov 24 15:37:14 2019 (r355057) @@ -447,8 +447,6 @@ pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t sl { struct pci_devinfo *dinfo = NULL; - /* Giant because newbus is Giant locked revisit with newbus locking */ - mtx_lock(&Giant); STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { if ((dinfo->cfg.domain == domain) && (dinfo->cfg.bus == bus) && @@ -457,7 +455,6 @@ pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t sl break; } } - mtx_unlock(&Giant); return (dinfo != NULL ? dinfo->cfg.dev : NULL); } Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Sun Nov 24 15:24:05 2019 (r355056) +++ head/sys/dev/pci/pci_user.c Sun Nov 24 15:37:14 2019 (r355057) @@ -965,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, } + /* Giant because newbus is Giant locked revisit with newbus locking */ + mtx_lock(&Giant); + switch (cmd) { case PCIOCGETCONF: #ifdef COMPAT_FREEBSD32 @@ -1288,8 +1291,10 @@ getconfexit: case PCIOCBARMMAP: pbm = (struct pci_bar_mmap *)data; if ((flag & FWRITE) == 0 && - (pbm->pbm_flags & PCIIO_BAR_MMAP_RW) != 0) - return (EPERM); + (pbm->pbm_flags & PCIIO_BAR_MMAP_RW) != 0) { + error = EPERM; + break; + } pcidev = pci_find_dbsf(pbm->pbm_sel.pc_domain, pbm->pbm_sel.pc_bus, pbm->pbm_sel.pc_dev, pbm->pbm_sel.pc_func); @@ -1300,6 +1305,8 @@ getconfexit: error = ENOTTY; break; } + + mtx_unlock(&Giant); return (error); } From owner-svn-src-head@freebsd.org Sun Nov 24 15:37:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA0A1B245C; Sun, 24 Nov 2019 15:37:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LZ6S2d82z48FK; Sun, 24 Nov 2019 15:37:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38BE426417; Sun, 24 Nov 2019 15:37:20 +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 xAOFbKcT060156; Sun, 24 Nov 2019 15:37:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOFbJNn060154; Sun, 24 Nov 2019 15:37:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911241537.xAOFbJNn060154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Nov 2019 15:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355058 - in head/sys/dev: aac aacraid X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: aac aacraid X-SVN-Commit-Revision: 355058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 15:37:20 -0000 Author: imp Date: Sun Nov 24 15:37:19 2019 New Revision: 355058 URL: https://svnweb.freebsd.org/changeset/base/355058 Log: Don't need giant for these drivers dev nodes. Also, Giant isn't required to busy / unbusy a device, so drop that too while I'm here. It's not done elsewhere in the tree and in the future will likely be handled by a node lock to ensure consistency. Leave Giant in place for attach and removing childing, as that's actually still needed, even if imperfect. Remove stale comment about contigmalloc taking Giant and calling w/o the lock held. Neither of these is still true. Modified: head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sun Nov 24 15:37:14 2019 (r355057) +++ head/sys/dev/aac/aac.c Sun Nov 24 15:37:19 2019 (r355058) @@ -215,7 +215,7 @@ static struct aac_mntinforesp * static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = 0, .d_open = aac_open, .d_ioctl = aac_ioctl, .d_poll = aac_poll, @@ -3210,9 +3210,7 @@ aac_cdevpriv_dtor(void *arg) sc = arg; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - mtx_lock(&Giant); device_unbusy(sc->aac_dev); - mtx_unlock(&Giant); } /* Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sun Nov 24 15:37:14 2019 (r355057) +++ head/sys/dev/aacraid/aacraid.c Sun Nov 24 15:37:19 2019 (r355058) @@ -218,7 +218,7 @@ static u_int32_t static struct cdevsw aacraid_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = 0, .d_open = aac_open, #if __FreeBSD_version < 702000 .d_close = aac_close, @@ -1044,9 +1044,7 @@ aac_command_thread(struct aac_softc *sc) "aacraid_aifthd", AAC_PERIODIC_INTERVAL * hz); /* - * First see if any FIBs need to be allocated. This needs - * to be called without the driver lock because contigmalloc - * will grab Giant, and would result in an LOR. + * First see if any FIBs need to be allocated. */ if ((sc->aifflags & AAC_AIFFLAGS_ALLOCFIBS) != 0) { aac_alloc_commands(sc); @@ -3090,9 +3088,7 @@ aac_cdevpriv_dtor(void *arg) sc = arg; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - mtx_lock(&Giant); device_unbusy(sc->aac_dev); - mtx_unlock(&Giant); } #else static int From owner-svn-src-head@freebsd.org Sun Nov 24 16:32:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CACBC1B3B99; Sun, 24 Nov 2019 16:32:45 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LbLN2JTGz4Bs6; Sun, 24 Nov 2019 16:32:43 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 24D41226CA; Sun, 24 Nov 2019 11:32:43 -0500 (EST) Received: from imap1 ([10.202.2.51]) by compute5.internal (MEProxy); Sun, 24 Nov 2019 11:32:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RCMnID SjUKr8BIMRDiAO7zplnszgUNVMoUMXczTZfJw=; b=AemZInnZIoHoWfUCFTjKdk ifWIvloBv3a/yZGp0zWc8tJBfTYcJuJtBWsqX98VKndrYdHp+ez3a5zNRNjn5mRv evWC53eimlqXijYD8SswPULeZnwPziSBis7Jk6odc4vh21HpgzNZSWIzdCDU96lc IRNdY79maM87a2eM1HEKWC2YS1AkfCW1tkrd6xV7OT8FlXmlo+IsaahdcJFd5m5y /nv/cXXxpPHNWCb+WQn7jr+G8dHncwm8NKLj4GYJBeG5WHPYYuLJN/M488zrOEio FGFSpAvwWvr26TiKkiGyybYd/971FDsv8HLvVowmnYX4Xq2VrieJW9Q9imnmjVPg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehkedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdeurhgr nhguohhnuceuvghrghhrvghnfdcuoehfrhgvvggsshgusegsughrrghgohhnrdhrthhktd drnhgvtheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehfrhgvvggsshgusegsughrrghgohhnrdhrthhktddrnhgvthenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 809E6C200A4; Sun, 24 Nov 2019 11:32:42 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-578-g826f590-fmstable-20191119v1 Mime-Version: 1.0 Message-Id: <849a4306-1cf7-4296-b594-236caa1572a0@www.fastmail.com> In-Reply-To: <20191124130441.GA2707@kib.kiev.ua> References: <201911240435.xAO4ZTgw070233@repo.freebsd.org> <20191124130441.GA2707@kib.kiev.ua> Date: Sun, 24 Nov 2019 10:32:23 -0600 From: "Brandon Bergren" To: "Konstantin Belousov" , "Justin Hibbits" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355045 - head/libexec/rtld-elf/powerpc Content-Type: text/plain X-Rspamd-Queue-Id: 47LbLN2JTGz4Bs6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=AemZInnZ; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@bdragon.rtk0.net has no SPF policy when checking 66.111.4.29) smtp.mailfrom=freebsd@bdragon.rtk0.net X-Spamd-Result: default: False [-4.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm1]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-3.49)[ip: (-9.83), ipnet: 66.111.4.0/24(-4.87), asn: 11403(-2.68), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[rtk0.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[messagingengine.com:+]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_IN_DNSWL_LOW(-0.10)[29.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 16:32:45 -0000 On Sun, Nov 24, 2019, at 7:04 AM, Konstantin Belousov wrote: > On Sun, Nov 24, 2019 at 04:35:29AM +0000, Justin Hibbits wrote: > > Author: jhibbits > > Date: Sun Nov 24 04:35:29 2019 > > New Revision: 355045 > > URL: https://svnweb.freebsd.org/changeset/base/355045 > > > > Log: > > rtld/powerpc: Fix _rtld_bind_start for powerpcspe > > > > Summary: > > We need to save off the full 64-bit register, not just the low 32 bits, > > of all registers getting saved off in _rtld_bind_start. Additionally, > > we need to save off the other SPE registers (SPEFSCR and accumulator), > > so that their program state is not affected by the PLT resolver. > Why do you need to save these registers ? Why would rtld touch them ? > Out of a need to make the binder as invisible as possible when interacting with code that may or may not be following the normal ABI rules regarding who is responsible for saving stuff. It's not just C code using it. From owner-svn-src-head@freebsd.org Sun Nov 24 16:40:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18E0F1B3D25; Sun, 24 Nov 2019 16:40:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LbWp6wSxz4C42; Sun, 24 Nov 2019 16:40: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D12D326FE6; Sun, 24 Nov 2019 16:40: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 xAOGesLG095708; Sun, 24 Nov 2019 16:40:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOGesZs095707; Sun, 24 Nov 2019 16:40:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911241640.xAOGesZs095707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 24 Nov 2019 16:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355059 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 355059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 16:40:55 -0000 Author: np Date: Sun Nov 24 16:40:54 2019 New Revision: 355059 URL: https://svnweb.freebsd.org/changeset/base/355059 Log: cxgbe(4): sysctl to reset the temperature/voltage sensor. # sysctl dev...reset_sensor=1 # sysctl dev.t6nex.0.reset_sensor=1 MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Nov 24 15:37:19 2019 (r355058) +++ head/sys/dev/cxgbe/adapter.h Sun Nov 24 16:40:54 2019 (r355059) @@ -917,6 +917,7 @@ struct adapter { int last_op_flags; int swintr; + int sensor_resets; struct callout ktls_tick; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Nov 24 15:37:19 2019 (r355058) +++ head/sys/dev/cxgbe/t4_main.c Sun Nov 24 16:40:54 2019 (r355059) @@ -682,6 +682,7 @@ static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); static int sysctl_vdd(SYSCTL_HANDLER_ARGS); +static int sysctl_reset_sensor(SYSCTL_HANDLER_ARGS); static int sysctl_loadavg(SYSCTL_HANDLER_ARGS); static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); @@ -6264,6 +6265,9 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reset_sensor", CTLTYPE_INT | + CTLFLAG_RW, sc, 0, sysctl_reset_sensor, "I", + "reset the chip's temperature sensor."); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_loadavg, "A", @@ -7452,6 +7456,36 @@ sysctl_vdd(SYSCTL_HANDLER_ARGS) } return (sysctl_handle_int(oidp, &sc->params.core_vdd, 0, req)); +} + +static int +sysctl_reset_sensor(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int rc, v; + uint32_t param, val; + + v = sc->sensor_resets; + rc = sysctl_handle_int(oidp, &v, 0, req); + if (rc != 0 || req->newptr == NULL || v <= 0) + return (rc); + + if (sc->params.fw_vers < FW_VERSION32(1, 24, 7, 0) || + chip_id(sc) < CHELSIO_T5) + return (ENOTSUP); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4srst"); + if (rc) + return (rc); + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) | + V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_RESET_TMP_SENSOR)); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + end_synchronized_op(sc, 0); + if (rc == 0) + sc->sensor_resets++; + return (rc); } static int From owner-svn-src-head@freebsd.org Sun Nov 24 16:45:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB7711B4069; Sun, 24 Nov 2019 16:45:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LbdQ281kz4CYf; Sun, 24 Nov 2019 16:45:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAOGjbH5086102 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 24 Nov 2019 18:45:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAOGjbH5086102 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAOGjaGZ086101; Sun, 24 Nov 2019 18:45:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Nov 2019 18:45:36 +0200 From: Konstantin Belousov To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355037 - head/sys/dev/pci Message-ID: <20191124164536.GC2707@kib.kiev.ua> References: <201911232343.xANNhqkQ097797@repo.freebsd.org> <20191124131010.GB2707@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47LbdQ281kz4CYf X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.75), ipnet: 2001:470::/32(-4.63), asn: 6939(-3.51), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 16:45:47 -0000 On Sun, Nov 24, 2019 at 07:37:01AM -0700, Warner Losh wrote: > On Sun, Nov 24, 2019, 6:10 AM Konstantin Belousov > wrote: > > > On Sat, Nov 23, 2019 at 11:43:52PM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Sat Nov 23 23:43:52 2019 > > > New Revision: 355037 > > > URL: https://svnweb.freebsd.org/changeset/base/355037 > > > > > > Log: > > > Push Giant down one layer > > > > > > The /dev/pci device doesn't need GIANT, per se. However, one routine > > > that it calls, pci_find_dbsf implicitly does. It walks a list that can > > > change when PCI scans a new bus. With hotplug, this means we could > > > have a race with that scanning. To prevent that, take out Giant around > > > scanning the list. > > > > > > However, given that we have places in the tree that drop giant, if > > > held when we call into them, the whole use of Giant to protect newbus > > > may be less effective that we desire, so add a comment about why we're > > > talking it out, and we'll address the issue when we lock newbus with > > > something other than Giant. > > > > > > Modified: > > > head/sys/dev/pci/pci.c > > > head/sys/dev/pci/pci_user.c > > > > > > Modified: head/sys/dev/pci/pci.c > > > > > ============================================================================== > > > --- head/sys/dev/pci/pci.c Sat Nov 23 23:41:21 2019 (r355036) > > > +++ head/sys/dev/pci/pci.c Sat Nov 23 23:43:52 2019 (r355037) > > > @@ -445,18 +445,21 @@ pci_find_bsf(uint8_t bus, uint8_t slot, uint8_t > > func) > > > device_t > > > pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t slot, uint8_t func) > > > { > > > - struct pci_devinfo *dinfo; > > > + struct pci_devinfo *dinfo = NULL; > > > > > > + /* Giant because newbus is Giant locked revisit with newbus > > locking */ > > > + mtx_lock(&Giant); > > > STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { > > > if ((dinfo->cfg.domain == domain) && > > > (dinfo->cfg.bus == bus) && > > > (dinfo->cfg.slot == slot) && > > > (dinfo->cfg.func == func)) { > > > - return (dinfo->cfg.dev); > > > + break; > > > } > > > } > > > + mtx_unlock(&Giant); > > > > > > - return (NULL); > > > + return (dinfo != NULL ? dinfo->cfg.dev : NULL); > > I do not think this change is correct. If the parallel hotplug, or > > rather, hot-unplug event occurs, then dinfo potentially becomes invalid > > right after the Giant unlock, which makes both this function and its > > callers to access freed memory. Having caller to lock a newbus lock > > around both the call and consumption of the returned data is required. > > > There are many data lifetime issues. If anything the PCI user device calls > drops Giant and then picks it back up again we are in the same boat... I > totally agree this is a bad situation, but can only really be fixed by > locking newbus with a different lock than Giant and likely using some kind > of reference count for device_t that are handed out... > > In the mean time, I'll move giant back up into the ioctl routine and hope > it isn't dropped by things it calls..m I think we can start at least by marking the Giant acqusitions that are related to newbus. I never saw anybody talking publically why the naive translation of newbus Giant into a sleepable lock, e.g. sx in exclusive mode, cannot work. From my memory, one of the big issues is that many sleeps done at probe/attach, need to drop the newbus lock. From owner-svn-src-head@freebsd.org Sun Nov 24 16:47:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C82591B4193; Sun, 24 Nov 2019 16:47:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LbgK51YBz4Chw; Sun, 24 Nov 2019 16:47:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAOGlEOM086156 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 24 Nov 2019 18:47:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAOGlEOM086156 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAOGlEgA086155; Sun, 24 Nov 2019 18:47:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Nov 2019 18:47:14 +0200 From: Konstantin Belousov To: Brandon Bergren Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355045 - head/libexec/rtld-elf/powerpc Message-ID: <20191124164714.GD2707@kib.kiev.ua> References: <201911240435.xAO4ZTgw070233@repo.freebsd.org> <20191124130441.GA2707@kib.kiev.ua> <849a4306-1cf7-4296-b594-236caa1572a0@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <849a4306-1cf7-4296-b594-236caa1572a0@www.fastmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47LbgK51YBz4Chw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.74), ipnet: 2001:470::/32(-4.63), asn: 6939(-3.51), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 16:47:26 -0000 On Sun, Nov 24, 2019 at 10:32:23AM -0600, Brandon Bergren wrote: > On Sun, Nov 24, 2019, at 7:04 AM, Konstantin Belousov wrote: > > On Sun, Nov 24, 2019 at 04:35:29AM +0000, Justin Hibbits wrote: > > > Author: jhibbits > > > Date: Sun Nov 24 04:35:29 2019 > > > New Revision: 355045 > > > URL: https://svnweb.freebsd.org/changeset/base/355045 > > > > > > Log: > > > rtld/powerpc: Fix _rtld_bind_start for powerpcspe > > > > > > Summary: > > > We need to save off the full 64-bit register, not just the low 32 bits, > > > of all registers getting saved off in _rtld_bind_start. Additionally, > > > we need to save off the other SPE registers (SPEFSCR and accumulator), > > > so that their program state is not affected by the PLT resolver. > > Why do you need to save these registers ? Why would rtld touch them ? > > > Out of a need to make the binder as invisible as possible when interacting with code that may or may not be following the normal ABI rules regarding who is responsible for saving stuff. > > It's not just C code using it. This was not the question. If a register is saved at the bind entry, it means that it is used by rtld itself. I am surprised that rtld needs anything from SPE. From owner-svn-src-head@freebsd.org Sun Nov 24 17:24:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B532B1B4EB7; Sun, 24 Nov 2019 17:24:26 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47LcV13vh6z4F9c; Sun, 24 Nov 2019 17:24:25 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B27D922687; Sun, 24 Nov 2019 12:24:24 -0500 (EST) Received: from imap1 ([10.202.2.51]) by compute5.internal (MEProxy); Sun, 24 Nov 2019 12:24:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=xV3C3u QwcU2VHQgvYkm1H+fkVRYo6qJ5TEViyjeVGYc=; b=rrbXkVkyrJV1b8gZrutzcB RVLEnyZCDNV47CeZ6FHxscw8AT4ZHDdACDIwrzsb0inP0LnmI7Ed6s1FQEfwNVHh YRdhn/urgp9yGgUOcMZb2xviSNQcQB0CZkBQSIgEcjCzzDgV3UW0DmYpCGRxYGtw TcFqRWaQTLisJumwCS2OExqNwRguYMYjimGY9HdXzju2ZLI2Al5ATGEgIzg5wKMw T76V0EjGFXZfMVofaGo6Q2VQmbFxPFWEpr9Z/r6vZ8P2hdtnKzjubL7ZuQFP5Euy +yrqdlXmZrr8aOXLMeY347KCSH0vhMElG4e9dZHTTT+umlKSY+mZB712dESobDtA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehkedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfuehr rghnughonhcuuegvrhhgrhgvnhdfuceofhhrvggvsghsugessggurhgrghhonhdrrhhtkh dtrdhnvghtqeenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucfrrghrrghmpehm rghilhhfrhhomhepfhhrvggvsghsugessggurhgrghhonhdrrhhtkhdtrdhnvghtnecuve hluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3DFF5C200A4; Sun, 24 Nov 2019 12:24:24 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-578-g826f590-fmstable-20191119v1 Mime-Version: 1.0 Message-Id: In-Reply-To: <20191124164714.GD2707@kib.kiev.ua> References: <201911240435.xAO4ZTgw070233@repo.freebsd.org> <20191124130441.GA2707@kib.kiev.ua> <849a4306-1cf7-4296-b594-236caa1572a0@www.fastmail.com> <20191124164714.GD2707@kib.kiev.ua> Date: Sun, 24 Nov 2019 11:24:04 -0600 From: "Brandon Bergren" To: "Konstantin Belousov" Cc: "Justin Hibbits" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355045 - head/libexec/rtld-elf/powerpc Content-Type: text/plain X-Rspamd-Queue-Id: 47LcV13vh6z4F9c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=rrbXkVky; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@bdragon.rtk0.net has no SPF policy when checking 66.111.4.29) smtp.mailfrom=freebsd@bdragon.rtk0.net X-Spamd-Result: default: False [-4.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm1]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-3.49)[ip: (-9.83), ipnet: 66.111.4.0/24(-4.87), asn: 11403(-2.68), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[rtk0.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[messagingengine.com:+]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_IN_DNSWL_LOW(-0.10)[29.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 17:24:26 -0000 On Sun, Nov 24, 2019, at 10:47 AM, Konstantin Belousov wrote: > On Sun, Nov 24, 2019 at 10:32:23AM -0600, Brandon Bergren wrote: > > On Sun, Nov 24, 2019, at 7:04 AM, Konstantin Belousov wrote: > > > On Sun, Nov 24, 2019 at 04:35:29AM +0000, Justin Hibbits wrote: > > > > Author: jhibbits > > > > Date: Sun Nov 24 04:35:29 2019 > > > > New Revision: 355045 > > > > URL: https://svnweb.freebsd.org/changeset/base/355045 > > > > > > > > Log: > > > > rtld/powerpc: Fix _rtld_bind_start for powerpcspe > > > > > > > > Summary: > > > > We need to save off the full 64-bit register, not just the low 32 bits, > > > > of all registers getting saved off in _rtld_bind_start. Additionally, > > > > we need to save off the other SPE registers (SPEFSCR and accumulator), > > > > so that their program state is not affected by the PLT resolver. > > > Why do you need to save these registers ? Why would rtld touch them ? > > > > > Out of a need to make the binder as invisible as possible when interacting with code that may or may not be following the normal ABI rules regarding who is responsible for saving stuff. > > > > It's not just C code using it. > This was not the question. If a register is saved at the bind entry, it > means that it is used by rtld itself. I am surprised that rtld needs > anything from SPE. You have a point there. It's possible it's just the r0 damage (from using it to touch the 64-bit SPRs) combined with the alignment problem was throwing off the testing, and we don't actually have to save the high word of everything and that the negative results during all the testing was all from having either the r0 issue OR the alignment issue when doing the test. From owner-svn-src-head@freebsd.org Sun Nov 24 17:25:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3603D1B4F70; Sun, 24 Nov 2019 17:25:22 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LcW45vvGz4FK4; Sun, 24 Nov 2019 17:25:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-yw1-xc43.google.com with SMTP id n82so4571185ywc.7; Sun, 24 Nov 2019 09:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=o4oZoTId+LFPIMEl/whzWmKgUBF4jLs/3v8427wVJSo=; b=Thtk0KihwpAcWSKatFBrPKZVGC83HTXHZzURko49gDaU7Kq2luJmnmda3fVjKYa9IE n6d1vUWv9xVxoo6fHtseQ6f1hTi+ssJFb2wOmeERMndYZO7sya2GRjbl2AXvEZK8iIcn xxWabcR7359RisFI+qDKdbnxXomW/GkpnDmf3ULNeb0WZ4jo+rJViZvlYlR8QVYEfG1u ZP7dqEtPZGU7JfCmlzq4Pa/lqLm5W0rxPb/pK2nXADveMlgpweOu6BoxLOP5gTW7ROMg uamn8lkr0+1mHJsaDKmsjjGIXGJOvx1ILVESMIeFtRy10xSGG0XNI7acrjBFbYgTqf+W i8+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:organization:mime-version :content-transfer-encoding; bh=o4oZoTId+LFPIMEl/whzWmKgUBF4jLs/3v8427wVJSo=; b=mMT2iP71lvUrxnx7xxf+EiYZuTPE635C4cghGMpN8zQtWS04NY2SZ7BGLmPwqjTJKU 6GO1OsWTfrWK+UOEwyIpeMMRUTC4ArpbXZJtsinbq62fHgi34fvviGUX4gpWw9vhK9mC 3R6cRQC7Extyu9MU3azSWayIHinVfC3y10jpXvJV7mM20CO2kXTRb/o8p8tAcCrVZW+2 QLcS14hp6C7blxf/fL3Ywrvb8ekZn7ZG5hcaQUG7A5+1+GbyuUt3GwRDBDujOyXUQcYV fXRiY87mqLB6M9SaZw+nhDzyhirRA3hoX4jUsgSrciX3r92P/GIgjTMhWOM6eSGy0HRe EUdA== X-Gm-Message-State: APjAAAXfcy664zJv/rETus7xXF+jKQK1KTZL138tJsMgetejzGs5d6wv 50xHFLXJkhGNuPI30UCFx1M= X-Google-Smtp-Source: APXvYqze6gn0b1/VOLPNLG/TaRMXUQm4+BJkH059ijnTs6Iyp2vdwTr1cCrFaio9em2KMH1G4cXO/Q== X-Received: by 2002:a81:6c4c:: with SMTP id h73mr5633079ywc.489.1574616319379; Sun, 24 Nov 2019 09:25:19 -0800 (PST) Received: from titan.knownspace (173-19-125-130.client.mchsi.com. [173.19.125.130]) by smtp.gmail.com with ESMTPSA id 23sm2310056ywf.91.2019.11.24.09.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2019 09:25:19 -0800 (PST) Sender: Justin Hibbits Date: Sun, 24 Nov 2019 11:25:15 -0600 From: Justin Hibbits To: Konstantin Belousov Cc: Brandon Bergren , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355045 - head/libexec/rtld-elf/powerpc Message-ID: <20191124112515.4a3e69f4@titan.knownspace> In-Reply-To: <20191124164714.GD2707@kib.kiev.ua> References: <201911240435.xAO4ZTgw070233@repo.freebsd.org> <20191124130441.GA2707@kib.kiev.ua> <849a4306-1cf7-4296-b594-236caa1572a0@www.fastmail.com> <20191124164714.GD2707@kib.kiev.ua> Organization: FreeBSD X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47LcW45vvGz4FK4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Thtk0Kih; dmarc=none; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::c43 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-2.66 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_FIVE(0.00)[5]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.46)[ip: (1.97), ipnet: 2607:f8b0::/32(-2.28), asn: 15169(-1.96), country: US(-0.05)]; FORGED_SENDER(0.30)[jhibbits@FreeBSD.org,chmeeedalf@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[130.125.19.173.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@FreeBSD.org,chmeeedalf@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 17:25:22 -0000 On Sun, 24 Nov 2019 18:47:14 +0200 Konstantin Belousov wrote: > On Sun, Nov 24, 2019 at 10:32:23AM -0600, Brandon Bergren wrote: > > On Sun, Nov 24, 2019, at 7:04 AM, Konstantin Belousov wrote: > > > On Sun, Nov 24, 2019 at 04:35:29AM +0000, Justin Hibbits wrote: > > > > Author: jhibbits > > > > Date: Sun Nov 24 04:35:29 2019 > > > > New Revision: 355045 > > > > URL: https://svnweb.freebsd.org/changeset/base/355045 > > > > > > > > Log: > > > > rtld/powerpc: Fix _rtld_bind_start for powerpcspe > > > > > > > > Summary: > > > > We need to save off the full 64-bit register, not just the > > > > low 32 bits, of all registers getting saved off in > > > > _rtld_bind_start. Additionally, we need to save off the other > > > > SPE registers (SPEFSCR and accumulator), so that their program > > > > state is not affected by the PLT resolver. > > > Why do you need to save these registers ? Why would rtld touch > > > them ? > > Out of a need to make the binder as invisible as possible when > > interacting with code that may or may not be following the normal > > ABI rules regarding who is responsible for saving stuff. > > > > It's not just C code using it. > This was not the question. If a register is saved at the bind entry, > it means that it is used by rtld itself. I am surprised that rtld > needs anything from SPE. This puzzled us to no end when debugging. Brandon found that changes to SPEFSCR got stomped if done before a PLT resolution, which doesn't happen when LD_BIND_NOW=1 is used. Also, I found that sshd, when built with clang, would have a weird hang, which was also 'fixed' with LD_BIND_NOW=1. Tracing through the sshd problem, the values in question were stored in the nonvolatile registers, which shouldn't be clobbered by rtld. The SPEFSCR problem looks like the SPEFSCR was being reverted to a 'last known state in kernel', which I couldn't find a reason for. The swtch32.S code looks correct, as does save_vec() and enable_vec(). Unless I'm missing something there. I've gone over it at least a dozen times in the last week. The ACC register probably doesn't need to be touched, though. - Justin From owner-svn-src-head@freebsd.org Sun Nov 24 19:02:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6B221B7BE2; Sun, 24 Nov 2019 19:02:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lffs5kvnz4Ldj; Sun, 24 Nov 2019 19:02:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A86E19DF; Sun, 24 Nov 2019 19:02:13 +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 xAOJ2DnM085495; Sun, 24 Nov 2019 19:02:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOJ2D8G085494; Sun, 24 Nov 2019 19:02:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911241902.xAOJ2D8G085494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Nov 2019 19:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355060 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 355060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:02:14 -0000 Author: kib Date: Sun Nov 24 19:02:13 2019 New Revision: 355060 URL: https://svnweb.freebsd.org/changeset/base/355060 Log: amd64: assert that EARLY_COUNTER does not corrupt memory. Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22514 Modified: head/sys/amd64/include/counter.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Sun Nov 24 16:40:54 2019 (r355059) +++ head/sys/amd64/include/counter.h Sun Nov 24 19:02:13 2019 (r355060) @@ -82,6 +82,7 @@ static inline void counter_u64_add(counter_u64_t c, int64_t inc) { + KASSERT(IS_BSP() || c != EARLY_COUNTER, ("EARLY_COUNTER used on AP")); __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) From owner-svn-src-head@freebsd.org Sun Nov 24 19:06:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DC041B7D0A; Sun, 24 Nov 2019 19:06:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lflz1tBfz4Ltg; Sun, 24 Nov 2019 19:06:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23931A0C; Sun, 24 Nov 2019 19:06:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOJ6dTL085842; Sun, 24 Nov 2019 19:06:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOJ6dD3085841; Sun, 24 Nov 2019 19:06:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911241906.xAOJ6dD3085841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Nov 2019 19:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355061 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 355061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:06:39 -0000 Author: kib Date: Sun Nov 24 19:06:38 2019 New Revision: 355061 URL: https://svnweb.freebsd.org/changeset/base/355061 Log: tmpfs: resolve deadlock between rename and unmount. Top-level kern_renameat() increases the writecount on the mount point, which, together with tmpfs unmount suspending the mount, already ensures that unmount cannot proceed while rename unlocks and relocks all operated vnodes. Remove vfs_busy() call from tmpfs_rename() which was done while holding a vnode lock, creating the deadlock. The only intent of the busy operation seems to be the prevention of unmount, which is already ensured. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Nov 24 19:02:13 2019 (r355060) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Nov 24 19:06:38 2019 (r355061) @@ -792,7 +792,6 @@ tmpfs_rename(struct vop_rename_args *v) struct vnode *tdvp = v->a_tdvp; struct vnode *tvp = v->a_tvp; struct componentname *tcnp = v->a_tcnp; - struct mount *mp = NULL; char *newname; struct tmpfs_dirent *de; struct tmpfs_mount *tmp; @@ -829,18 +828,10 @@ tmpfs_rename(struct vop_rename_args *v) */ if (fdvp != tdvp && fdvp != tvp) { if (vn_lock(fdvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { - mp = tdvp->v_mount; - error = vfs_busy(mp, 0); - if (error != 0) { - mp = NULL; - goto out; - } error = tmpfs_rename_relock(fdvp, &fvp, tdvp, &tvp, fcnp, tcnp); - if (error != 0) { - vfs_unbusy(mp); + if (error != 0) return (error); - } ASSERT_VOP_ELOCKED(fdvp, "tmpfs_rename: fdvp not locked"); ASSERT_VOP_ELOCKED(tdvp, @@ -1083,9 +1074,6 @@ out: /* Release source nodes. */ vrele(fdvp); vrele(fvp); - - if (mp != NULL) - vfs_unbusy(mp); return (error); } From owner-svn-src-head@freebsd.org Sun Nov 24 19:12:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C0A1B7FB0; Sun, 24 Nov 2019 19:12:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lftc4NFBz4MLT; Sun, 24 Nov 2019 19:12:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79882BB0; Sun, 24 Nov 2019 19:12:24 +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 xAOJCOvW090608; Sun, 24 Nov 2019 19:12:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOJCNuc090605; Sun, 24 Nov 2019 19:12:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911241912.xAOJCNuc090605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Nov 2019 19:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355062 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 355062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:12:24 -0000 Author: kib Date: Sun Nov 24 19:12:23 2019 New Revision: 355062 URL: https://svnweb.freebsd.org/changeset/base/355062 Log: Record part of the owner struct thread pointer into busy_lock. Record as much bits from curthread into busy_lock as fits. Low bits for struct thread * representation are zero due to struct and zone alignment, and they leave space for busy flags (perhaps except statically allocated thread0). Upper bits are not very interesting for assert, and in most practical situations recorded value should allow to manually identify the owner with certainity. Assert that unbusy is performed by the owner, except few places where unbusy is done in io completion handler. For this case, add _unchecked variants of asserts and unbusy primitives. Reviewed by: markj (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D22298 Modified: head/sys/kern/kern_sendfile.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun Nov 24 19:06:38 2019 (r355061) +++ head/sys/kern/kern_sendfile.c Sun Nov 24 19:12:23 2019 (r355062) @@ -261,7 +261,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i for (int i = 0; i < count; i++) if (pg[i] != bogus_page) - vm_page_xunbusy(pg[i]); + vm_page_xunbusy_unchecked(pg[i]); if (error) sfio->error = error; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Nov 24 19:06:38 2019 (r355061) +++ head/sys/vm/vm_page.c Sun Nov 24 19:12:23 2019 (r355062) @@ -437,7 +437,7 @@ vm_page_init_marker(vm_page_t marker, int queue, uint1 bzero(marker, sizeof(*marker)); marker->flags = PG_MARKER; marker->aflags = aflags; - marker->busy_lock = VPB_SINGLE_EXCLUSIVER; + marker->busy_lock = VPB_CURTHREAD_EXCLUSIVE; marker->queue = queue; } @@ -939,18 +939,19 @@ vm_page_busy_downgrade(vm_page_t m) int vm_page_busy_tryupgrade(vm_page_t m) { - u_int x; + u_int ce, x; vm_page_assert_sbusied(m); x = m->busy_lock; + ce = VPB_CURTHREAD_EXCLUSIVE; for (;;) { if (VPB_SHARERS(x) > 1) return (0); KASSERT((x & ~VPB_BIT_WAITERS) == VPB_SHARERS_WORD(1), ("vm_page_busy_tryupgrade: invalid lock state")); if (!atomic_fcmpset_acq_int(&m->busy_lock, &x, - VPB_SINGLE_EXCLUSIVER | (x & VPB_BIT_WAITERS))) + ce | (x & VPB_BIT_WAITERS))) continue; return (1); } @@ -1108,7 +1109,7 @@ vm_page_tryxbusy(vm_page_t m) vm_object_t obj; if (atomic_cmpset_acq_int(&(m)->busy_lock, VPB_UNBUSIED, - VPB_SINGLE_EXCLUSIVER) == 0) + VPB_CURTHREAD_EXCLUSIVE) == 0) return (0); obj = m->object; @@ -1119,6 +1120,14 @@ vm_page_tryxbusy(vm_page_t m) return (1); } +static void +vm_page_xunbusy_hard_tail(vm_page_t m) +{ + atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + /* Wake the waiter. */ + wakeup(m); +} + /* * vm_page_xunbusy_hard: * @@ -1127,14 +1136,15 @@ vm_page_tryxbusy(vm_page_t m) void vm_page_xunbusy_hard(vm_page_t m) { - vm_page_assert_xbusied(m); + vm_page_xunbusy_hard_tail(m); +} - /* - * Wake the waiter. - */ - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); - wakeup(m); +void +vm_page_xunbusy_hard_unchecked(vm_page_t m) +{ + vm_page_assert_xbusied_unchecked(m); + vm_page_xunbusy_hard_tail(m); } /* @@ -1228,7 +1238,7 @@ vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_mem m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ m->oflags = VPO_UNMANAGED; - m->busy_lock = VPB_SINGLE_EXCLUSIVER; + m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; /* Fictitious pages are unevictable. */ m->ref_count = 1; pmap_page_init(m); @@ -1318,7 +1328,7 @@ vm_page_readahead_finish(vm_page_t m) else vm_page_deactivate(m); vm_page_unlock(m); - vm_page_xunbusy(m); + vm_page_xunbusy_unchecked(m); } /* @@ -1967,7 +1977,7 @@ found: VPO_UNMANAGED : 0; m->busy_lock = VPB_UNBUSIED; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) - m->busy_lock = VPB_SINGLE_EXCLUSIVER; + m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; if ((req & VM_ALLOC_SBUSY) != 0) m->busy_lock = VPB_SHARERS_WORD(1); if (req & VM_ALLOC_WIRED) { @@ -2161,7 +2171,7 @@ found: VPO_UNMANAGED : 0; busy_lock = VPB_UNBUSIED; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) - busy_lock = VPB_SINGLE_EXCLUSIVER; + busy_lock = VPB_CURTHREAD_EXCLUSIVE; if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); if ((req & VM_ALLOC_WIRED) != 0) Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Nov 24 19:06:38 2019 (r355061) +++ head/sys/vm/vm_page.h Sun Nov 24 19:12:23 2019 (r355062) @@ -307,7 +307,13 @@ struct vm_page { #define VPB_SHARERS_WORD(x) ((x) << VPB_SHARERS_SHIFT | VPB_BIT_SHARED) #define VPB_ONE_SHARER (1 << VPB_SHARERS_SHIFT) -#define VPB_SINGLE_EXCLUSIVER VPB_BIT_EXCLUSIVE +#define VPB_SINGLE_EXCLUSIVE VPB_BIT_EXCLUSIVE +#ifdef INVARIANTS +#define VPB_CURTHREAD_EXCLUSIVE \ + (VPB_BIT_EXCLUSIVE | ((u_int)(uintptr_t)curthread & ~VPB_BIT_FLAGMASK)) +#else +#define VPB_CURTHREAD_EXCLUSIVE VPB_SINGLE_EXCLUSIVE +#endif #define VPB_UNBUSIED VPB_SHARERS_WORD(0) @@ -649,6 +655,7 @@ void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, void vm_page_wire(vm_page_t); bool vm_page_wire_mapped(vm_page_t m); void vm_page_xunbusy_hard(vm_page_t m); +void vm_page_xunbusy_hard_unchecked(vm_page_t m); void vm_page_set_validclean (vm_page_t, int, int); void vm_page_clear_dirty(vm_page_t, int, int); void vm_page_set_invalid(vm_page_t, int, int); @@ -684,10 +691,19 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const ("vm_page_assert_unbusied: page %p busy @ %s:%d", \ (m), __FILE__, __LINE__)) -#define vm_page_assert_xbusied(m) \ +#define vm_page_assert_xbusied_unchecked(m) do { \ KASSERT(vm_page_xbusied(m), \ ("vm_page_assert_xbusied: page %p not exclusive busy @ %s:%d", \ - (m), __FILE__, __LINE__)) + (m), __FILE__, __LINE__)); \ +} while (0) +#define vm_page_assert_xbusied(m) do { \ + vm_page_assert_xbusied_unchecked(m); \ + KASSERT((m->busy_lock & ~VPB_BIT_WAITERS) == \ + VPB_CURTHREAD_EXCLUSIVE, \ + ("vm_page_assert_xbusied: page %p busy_lock %#x not owned" \ + " by me @ %s:%d", \ + (m), (m)->busy_lock, __FILE__, __LINE__)); \ +} while (0) #define vm_page_busied(m) \ ((m)->busy_lock != VPB_UNBUSIED) @@ -699,7 +715,7 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const } while (0) #define vm_page_xbusied(m) \ - (((m)->busy_lock & VPB_SINGLE_EXCLUSIVER) != 0) + (((m)->busy_lock & VPB_SINGLE_EXCLUSIVE) != 0) #define vm_page_xbusy(m) do { \ if (!vm_page_tryxbusy(m)) \ @@ -710,8 +726,13 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const /* Note: page m's lock must not be owned by the caller. */ #define vm_page_xunbusy(m) do { \ if (!atomic_cmpset_rel_int(&(m)->busy_lock, \ - VPB_SINGLE_EXCLUSIVER, VPB_UNBUSIED)) \ + VPB_CURTHREAD_EXCLUSIVE, VPB_UNBUSIED)) \ vm_page_xunbusy_hard(m); \ +} while (0) +#define vm_page_xunbusy_unchecked(m) do { \ + if (!atomic_cmpset_rel_int(&(m)->busy_lock, \ + VPB_CURTHREAD_EXCLUSIVE, VPB_UNBUSIED)) \ + vm_page_xunbusy_hard_unchecked(m); \ } while (0) #ifdef INVARIANTS From owner-svn-src-head@freebsd.org Sun Nov 24 19:16:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A379C1B80F0; Sun, 24 Nov 2019 19:16:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lfzt3nK2z4Mbr; Sun, 24 Nov 2019 19:16:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65547BE1; Sun, 24 Nov 2019 19:16:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOJGwBd091786; Sun, 24 Nov 2019 19:16:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOJGwW5091785; Sun, 24 Nov 2019 19:16:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201911241916.xAOJGwW5091785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 24 Nov 2019 19:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355063 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 355063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:16:58 -0000 Author: eadler Date: Sun Nov 24 19:16:57 2019 New Revision: 355063 URL: https://svnweb.freebsd.org/changeset/base/355063 Log: bsd-family-tree: correct macOS release date Reported by: Herbert J. Skuhra Reported by: Maxim Konovalov Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun Nov 24 19:12:23 2019 (r355062) +++ head/share/misc/bsd-family-tree Sun Nov 24 19:16:57 2019 (r355063) @@ -795,7 +795,7 @@ DragonFly 5.6.1 2019-06-19 [DFB] FreeBSD 11.3 2019-07-09 [FBD] DragonFly 5.6.2 2019-08-11 [DFB] OpenBSD 6.6 2019-10-17 [OBD] -macOS 10.15 2019-10.29 [APL] +macOS 10.15 2019-10-07 [APL] macOS 10.15.1 2019-10-29 [APL] (security/critical release) FreeBSD 12.1 2019-11-04 [FBD] From owner-svn-src-head@freebsd.org Sun Nov 24 19:18:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D69211B81A8; Sun, 24 Nov 2019 19:18:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lg1K59Lcz4Mkh; Sun, 24 Nov 2019 19:18:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95380BE4; Sun, 24 Nov 2019 19:18:13 +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 xAOJID5w091895; Sun, 24 Nov 2019 19:18:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOJIDab091893; Sun, 24 Nov 2019 19:18:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911241918.xAOJIDab091893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Nov 2019 19:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355064 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:18:13 -0000 Author: kib Date: Sun Nov 24 19:18:12 2019 New Revision: 355064 URL: https://svnweb.freebsd.org/changeset/base/355064 Log: Ignore object->handle for OBJ_ANON objects. Note that the change in vm_object_collapse() is arguably a correctness fix. We must not collapse into content-identity carrying objects. Reviewed by: jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D22467 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_object.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 24 19:16:57 2019 (r355063) +++ head/sys/vm/vm_map.c Sun Nov 24 19:18:12 2019 (r355064) @@ -3764,8 +3764,7 @@ vm_map_copy_entry( if ((src_object = src_entry->object.vm_object) != NULL) { VM_OBJECT_WLOCK(src_object); charged = ENTRY_CHARGED(src_entry); - if (src_object->handle == NULL && - (src_object->flags & OBJ_ANON) != 0) { + if ((src_object->flags & OBJ_ANON) != 0) { vm_object_collapse(src_object); if ((src_object->flags & OBJ_ONEMAPPING) != 0) { vm_object_split(src_entry); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Nov 24 19:16:57 2019 (r355063) +++ head/sys/vm/vm_object.c Sun Nov 24 19:18:12 2019 (r355064) @@ -530,7 +530,7 @@ vm_object_vndeallocate(vm_object_t object) void vm_object_deallocate(vm_object_t object) { - vm_object_t temp; + vm_object_t robject, temp; bool released; while (object != NULL) { @@ -565,19 +565,17 @@ vm_object_deallocate(vm_object_t object) return; } else if (object->ref_count == 1) { if (object->shadow_count == 0 && - object->handle == NULL && (object->flags & OBJ_ANON) != 0) { vm_object_set_flag(object, OBJ_ONEMAPPING); - } else if ((object->shadow_count == 1) && - (object->handle == NULL) && - (object->flags & OBJ_ANON) != 0) { - vm_object_t robject; - + } else if (object->shadow_count == 1) { + KASSERT((object->flags & OBJ_ANON) != 0, + ("obj %p with shadow_count > 0 is not anon", + object)); robject = LIST_FIRST(&object->shadow_head); KASSERT(robject != NULL, - ("vm_object_deallocate: ref_count: %d, shadow_count: %d", - object->ref_count, - object->shadow_count)); + ("vm_object_deallocate: ref_count: %d, " + "shadow_count: %d", object->ref_count, + object->shadow_count)); KASSERT((robject->flags & OBJ_TMPFS_NODE) == 0, ("shadowed tmpfs v_object %p", object)); if (!VM_OBJECT_TRYWLOCK(robject)) { @@ -602,8 +600,7 @@ vm_object_deallocate(vm_object_t object) * deallocating its shadow. */ if ((robject->flags & - (OBJ_DEAD | OBJ_ANON)) == OBJ_ANON && - robject->handle == NULL) { + (OBJ_DEAD | OBJ_ANON)) == OBJ_ANON) { refcount_acquire(&robject->ref_count); retry: @@ -1302,7 +1299,7 @@ vm_object_shadow( * will be collapsed later. */ if (source != NULL && source->ref_count == 1 && - source->handle == NULL && (source->flags & OBJ_ANON) != 0) + (source->flags & OBJ_ANON) != 0) return; /* @@ -1751,10 +1748,8 @@ vm_object_collapse(vm_object_t object) if ((backing_object->flags & OBJ_ANON) == 0) break; VM_OBJECT_WLOCK(backing_object); - if (backing_object->handle != NULL || - (backing_object->flags & OBJ_DEAD) != 0 || - object->handle != NULL || - (object->flags & OBJ_DEAD) != 0) { + if ((backing_object->flags & OBJ_DEAD) != 0 || + (object->flags & (OBJ_DEAD | OBJ_ANON)) != OBJ_ANON) { VM_OBJECT_WUNLOCK(backing_object); break; } @@ -2549,8 +2544,7 @@ DB_SHOW_COMMAND(vmochk, vm_object_check) * and none have zero ref counts. */ TAILQ_FOREACH(object, &vm_object_list, object_list) { - if (object->handle == NULL && - (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { + if ((object->flags & OBJ_ANON) != 0) { if (object->ref_count == 0) { db_printf("vmochk: internal obj has zero ref count: %ld\n", (long)object->size); From owner-svn-src-head@freebsd.org Sun Nov 24 19:42:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9F801B8D3A for ; Sun, 24 Nov 2019 19:42:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LgYd55vKz4P0k for ; Sun, 24 Nov 2019 19:42:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf41.google.com with SMTP id s18so4876280qvr.4 for ; Sun, 24 Nov 2019 11:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aJytov4nnx8d2U9RkRfcMod5EsMojNiBu1tVcy+lUEc=; b=iLmD4dmQtsZ0cesP0on0+IEHT6jyQQbtbeOZC7jbnONuZhF9hrLTEKNyw4XIJg1mdt bGySK/EI65jNRE2mxetZVL1j2LvOOAXVaQ/eXpC9sTqAZIQkv6nShRmgqyntmXj6+i7C RU8Bvezw7RfHbtfch8bU5EvqjqffKaRasv7YOa6gvxm/vQpYpvRanYTlbVtZiZ2scJfD jS9XlJMkspCDqcwFBySSiMohVuQCR+jDGUzC7M84l4HCcF2IaDRDSUu7xvCBWb+iZ6bm j+igs02tOKvBmXqiTtNhNB3/IXbQ/hAxJjJ/p/uI9Ehnu9HOgQXzwgxsalefkqgjtdI3 L3hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aJytov4nnx8d2U9RkRfcMod5EsMojNiBu1tVcy+lUEc=; b=M1q9hIM2NqkL4CebYMt6f2EYpbvSvNQUH9nBJVcq3hg9naOYJt+uEk6N53E6R0D2r4 /QUCLlXwnhm2Wv5g4nn8GzG4rkrDOKhLJZjIyk4ppdhMMjE6Nl322PfnhIcDPjqCj96P TszraYvM91ATSYT0XjFg7RlcGdWCpmWd1/haM/W9D6TcM0kj/ktWKCJotU+TIicReoil RX/i8upFdo1ltIdkbnep88HXCSZOasHrwaLYx7fXUTpzEaA+z8eKJO9254oAhKm5NYXx zWH1mNHCgbxh8nxUcHdK72xvfmxjnUzn160a58nxT/+iRzGqN6NNg6cSZyRRTGB5A/i7 CShA== X-Gm-Message-State: APjAAAWCLlwmR8zRhS8ZvFpbez8AeBOuTGm5hy+zMLRFHhCp9T/DajMa 7zaUk4PQ2/sgqe7OcLHJC8eLckAlLDqu9bPyCzKtYw== X-Google-Smtp-Source: APXvYqxKtS8vafKqEqRcjSfExGdeImlUrK8Ddb0aJ1yWblz7ov698GudOB/l3wvPUE6tuH9Rdq9Kj8IhMG1AVDeWi6o= X-Received: by 2002:a0c:8506:: with SMTP id n6mr12954277qva.87.1574624558245; Sun, 24 Nov 2019 11:42:38 -0800 (PST) MIME-Version: 1.0 References: <201911232343.xANNhqkQ097797@repo.freebsd.org> <20191124131010.GB2707@kib.kiev.ua> <20191124164536.GC2707@kib.kiev.ua> In-Reply-To: <20191124164536.GC2707@kib.kiev.ua> From: Warner Losh Date: Sun, 24 Nov 2019 12:42:26 -0700 Message-ID: Subject: Re: svn commit: r355037 - head/sys/dev/pci To: Konstantin Belousov Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47LgYd55vKz4P0k X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=iLmD4dmQ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f41) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.05 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-1.06)[ip: (-0.99), ipnet: 2607:f8b0::/32(-2.28), asn: 15169(-1.96), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 19:42:46 -0000 On Sun, Nov 24, 2019, 9:45 AM Konstantin Belousov wrote: > On Sun, Nov 24, 2019 at 07:37:01AM -0700, Warner Losh wrote: > > On Sun, Nov 24, 2019, 6:10 AM Konstantin Belousov > > wrote: > > > > > On Sat, Nov 23, 2019 at 11:43:52PM +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Sat Nov 23 23:43:52 2019 > > > > New Revision: 355037 > > > > URL: https://svnweb.freebsd.org/changeset/base/355037 > > > > > > > > Log: > > > > Push Giant down one layer > > > > > > > > The /dev/pci device doesn't need GIANT, per se. However, one > routine > > > > that it calls, pci_find_dbsf implicitly does. It walks a list that > can > > > > change when PCI scans a new bus. With hotplug, this means we could > > > > have a race with that scanning. To prevent that, take out Giant > around > > > > scanning the list. > > > > > > > > However, given that we have places in the tree that drop giant, if > > > > held when we call into them, the whole use of Giant to protect > newbus > > > > may be less effective that we desire, so add a comment about why > we're > > > > talking it out, and we'll address the issue when we lock newbus > with > > > > something other than Giant. > > > > > > > > Modified: > > > > head/sys/dev/pci/pci.c > > > > head/sys/dev/pci/pci_user.c > > > > > > > > Modified: head/sys/dev/pci/pci.c > > > > > > > > ============================================================================== > > > > --- head/sys/dev/pci/pci.c Sat Nov 23 23:41:21 2019 > (r355036) > > > > +++ head/sys/dev/pci/pci.c Sat Nov 23 23:43:52 2019 > (r355037) > > > > @@ -445,18 +445,21 @@ pci_find_bsf(uint8_t bus, uint8_t slot, uint8_t > > > func) > > > > device_t > > > > pci_find_dbsf(uint32_t domain, uint8_t bus, uint8_t slot, uint8_t > func) > > > > { > > > > - struct pci_devinfo *dinfo; > > > > + struct pci_devinfo *dinfo = NULL; > > > > > > > > + /* Giant because newbus is Giant locked revisit with newbus > > > locking */ > > > > + mtx_lock(&Giant); > > > > STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { > > > > if ((dinfo->cfg.domain == domain) && > > > > (dinfo->cfg.bus == bus) && > > > > (dinfo->cfg.slot == slot) && > > > > (dinfo->cfg.func == func)) { > > > > - return (dinfo->cfg.dev); > > > > + break; > > > > } > > > > } > > > > + mtx_unlock(&Giant); > > > > > > > > - return (NULL); > > > > + return (dinfo != NULL ? dinfo->cfg.dev : NULL); > > > I do not think this change is correct. If the parallel hotplug, or > > > rather, hot-unplug event occurs, then dinfo potentially becomes invalid > > > right after the Giant unlock, which makes both this function and its > > > callers to access freed memory. Having caller to lock a newbus lock > > > around both the call and consumption of the returned data is required. > > > > > > There are many data lifetime issues. If anything the PCI user device > calls > > drops Giant and then picks it back up again we are in the same boat... I > > totally agree this is a bad situation, but can only really be fixed by > > locking newbus with a different lock than Giant and likely using some > kind > > of reference count for device_t that are handed out... > > > > In the mean time, I'll move giant back up into the ioctl routine and hope > > it isn't dropped by things it calls..m > > I think we can start at least by marking the Giant acqusitions that are > related to newbus. > > I never saw anybody talking publically why the naive translation of newbus > Giant into a sleepable lock, e.g. sx in exclusive mode, cannot work. From > my memory, one of the big issues is that many sleeps done at probe/attach, > need to drop the newbus lock. > If we are holding a topology lock, we can't drop it... otherwise someone else can acquire it and change things out from us... Also, locks are useless for device_t lifetimes. Too many places cache them in non obvious ways, so we need to add some kind of ref count. And since these relationships are often not parent / child, we'd likely need a spoilage call to release refs. You shouldn't complete your detaching if others holding references. Finally, we walk both up and down the tree. When I tried a super naive lock in the past, I ran into a bunch of LORs due to this. And what do you do if multiple nodes in the tree want to start a detach/delete at the same time? Or if there is a suspend going on at the same time... These are all solvable problems, but simply replacing giant with a sx lock won't solve them and may introduce issues because giant is special in many ways... it would, however, fix the one aspect of giant we don't want: random parts of the kernel dropping it. Warner > From owner-svn-src-head@freebsd.org Sun Nov 24 20:41:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ADA71BA27F; Sun, 24 Nov 2019 20:41:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lhsl70ySz4RZF; Sun, 24 Nov 2019 20:41:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B471C69; Sun, 24 Nov 2019 20:41:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOKfl90045534; Sun, 24 Nov 2019 20:41:47 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOKflXo045533; Sun, 24 Nov 2019 20:41:47 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911242041.xAOKflXo045533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Nov 2019 20:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355065 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 355065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 20:41:48 -0000 Author: wulf Date: Sun Nov 24 20:41:47 2019 New Revision: 355065 URL: https://svnweb.freebsd.org/changeset/base/355065 Log: Linux epoll: Don't deregister file descriptor after EPOLLONESHOT is fired Linux epoll does not remove descriptor after one-shot event has been triggered. Set EV_DISPATCH kqueue flag rather then EV_ONESHOT to get the same behavior. Required by Linux Steam client. PR: 240590 Reported by: Alex S Reviewed by: emaste, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22513 Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun Nov 24 19:18:12 2019 (r355064) +++ head/sys/compat/linux/linux_event.c Sun Nov 24 20:41:47 2019 (r355065) @@ -306,7 +306,7 @@ epoll_to_kevent(struct thread *td, struct file *epfp, /* flags related to how event is registered */ if ((levents & LINUX_EPOLLONESHOT) != 0) - *kev_flags |= EV_ONESHOT; + *kev_flags |= EV_DISPATCH; if ((levents & LINUX_EPOLLET) != 0) *kev_flags |= EV_CLEAR; if ((levents & LINUX_EPOLLERR) != 0) @@ -501,16 +501,17 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ case LINUX_EPOLL_CTL_ADD: /* * kqueue_register() return ENOENT if event does not exists - * and the EV_ADD flag is not set. + * and the EV_ADD flag is not set. Reset EV_ENABLE flag to + * avoid accidental activation of fired oneshot events. */ - kev[0].flags &= ~EV_ADD; + kev[0].flags &= ~(EV_ADD | EV_ENABLE); error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK); if (error != ENOENT) { error = EEXIST; goto leave0; } error = 0; - kev[0].flags |= EV_ADD; + kev[0].flags |= (EV_ADD | EV_ENABLE); break; case LINUX_EPOLL_CTL_DEL: From owner-svn-src-head@freebsd.org Sun Nov 24 20:44:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2CD21BA52C; Sun, 24 Nov 2019 20:44:15 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lhwb3qdHz4Rtx; Sun, 24 Nov 2019 20:44:15 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6680C1CBF; Sun, 24 Nov 2019 20:44:15 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOKiFT9045718; Sun, 24 Nov 2019 20:44:15 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOKiFvc045717; Sun, 24 Nov 2019 20:44:15 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911242044.xAOKiFvc045717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Nov 2019 20:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355066 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 355066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 20:44:15 -0000 Author: wulf Date: Sun Nov 24 20:44:14 2019 New Revision: 355066 URL: https://svnweb.freebsd.org/changeset/base/355066 Log: Linux epoll: Check both read and write kqueue events existence in EPOLL_CTL_ADD Linux epoll EPOLL_CTL_ADD op handler should always check registration of both EVFILT_READ and EVFILT_WRITE kevents to deceide if supplied file descriptor fd is already registered with epoll instance. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22515 Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun Nov 24 20:41:47 2019 (r355065) +++ head/sys/compat/linux/linux_event.c Sun Nov 24 20:44:14 2019 (r355066) @@ -98,14 +98,16 @@ __attribute__((packed)) #define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event)) static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata); -static int epoll_to_kevent(struct thread *td, struct file *epfp, - int fd, struct epoll_event *l_event, int *kev_flags, - struct kevent *kevent, int *nkevents); +static int epoll_to_kevent(struct thread *td, int fd, + struct epoll_event *l_event, struct kevent *kevent, + int *nkevents); static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event); static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count); static int epoll_kev_copyin(void *arg, struct kevent *kevp, int count); -static int epoll_delete_event(struct thread *td, struct file *epfp, - int fd, int filter); +static int epoll_register_kevent(struct thread *td, struct file *epfp, + int fd, int filter, unsigned int flags); +static int epoll_fd_registered(struct thread *td, struct file *epfp, + int fd); static int epoll_delete_all_events(struct thread *td, struct file *epfp, int fd); @@ -296,31 +298,31 @@ linux_epoll_create1(struct thread *td, struct linux_ep /* Structure converting function from epoll to kevent. */ static int -epoll_to_kevent(struct thread *td, struct file *epfp, - int fd, struct epoll_event *l_event, int *kev_flags, +epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, struct kevent *kevent, int *nkevents) { uint32_t levents = l_event->events; struct linux_pemuldata *pem; struct proc *p; + unsigned short kev_flags = EV_ADD | EV_ENABLE; /* flags related to how event is registered */ if ((levents & LINUX_EPOLLONESHOT) != 0) - *kev_flags |= EV_DISPATCH; + kev_flags |= EV_DISPATCH; if ((levents & LINUX_EPOLLET) != 0) - *kev_flags |= EV_CLEAR; + kev_flags |= EV_CLEAR; if ((levents & LINUX_EPOLLERR) != 0) - *kev_flags |= EV_ERROR; + kev_flags |= EV_ERROR; if ((levents & LINUX_EPOLLRDHUP) != 0) - *kev_flags |= EV_EOF; + kev_flags |= EV_EOF; /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { - EV_SET(kevent++, fd, EVFILT_READ, *kev_flags, 0, 0, 0); + EV_SET(kevent++, fd, EVFILT_READ, kev_flags, 0, 0, 0); ++(*nkevents); } if ((levents & LINUX_EPOLL_EVWR) != 0) { - EV_SET(kevent++, fd, EVFILT_WRITE, *kev_flags, 0, 0, 0); + EV_SET(kevent++, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); ++(*nkevents); } @@ -451,7 +453,6 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ epoll_kev_copyin}; struct epoll_event le; cap_rights_t rights; - int kev_flags; int nchanges = 0; int error; @@ -484,9 +485,7 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ ciargs.changelist = kev; if (args->op != LINUX_EPOLL_CTL_DEL) { - kev_flags = EV_ADD | EV_ENABLE; - error = epoll_to_kevent(td, epfp, args->fd, &le, - &kev_flags, kev, &nchanges); + error = epoll_to_kevent(td, args->fd, &le, kev, &nchanges); if (error != 0) goto leave0; } @@ -499,19 +498,10 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ break; case LINUX_EPOLL_CTL_ADD: - /* - * kqueue_register() return ENOENT if event does not exists - * and the EV_ADD flag is not set. Reset EV_ENABLE flag to - * avoid accidental activation of fired oneshot events. - */ - kev[0].flags &= ~(EV_ADD | EV_ENABLE); - error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK); - if (error != ENOENT) { + if (epoll_fd_registered(td, epfp, args->fd)) { error = EEXIST; goto leave0; } - error = 0; - kev[0].flags |= (EV_ADD | EV_ENABLE); break; case LINUX_EPOLL_CTL_DEL: @@ -651,7 +641,8 @@ linux_epoll_pwait(struct thread *td, struct linux_epol } static int -epoll_delete_event(struct thread *td, struct file *epfp, int fd, int filter) +epoll_register_kevent(struct thread *td, struct file *epfp, int fd, int filter, + unsigned int flags) { struct epoll_copyin_args ciargs; struct kevent kev; @@ -660,18 +651,36 @@ epoll_delete_event(struct thread *td, struct file *epf epoll_kev_copyin}; ciargs.changelist = &kev; - EV_SET(&kev, fd, filter, EV_DELETE | EV_DISABLE, 0, 0, 0); + EV_SET(&kev, fd, filter, flags, 0, 0, 0); return (kern_kevent_fp(td, epfp, 1, 0, &k_ops, NULL)); } static int +epoll_fd_registered(struct thread *td, struct file *epfp, int fd) +{ + /* + * Set empty filter flags to avoid accidental modification of already + * registered events. In the case of event re-registration: + * 1. If event does not exists kevent() does nothing and returns ENOENT + * 2. If event does exists, it's enabled/disabled state is preserved + * but fflags, data and udata fields are overwritten. So we can not + * set socket lowats and store user's context pointer in udata. + */ + if (epoll_register_kevent(td, epfp, fd, EVFILT_READ, 0) != ENOENT || + epoll_register_kevent(td, epfp, fd, EVFILT_WRITE, 0) != ENOENT) + return (1); + + return (0); +} + +static int epoll_delete_all_events(struct thread *td, struct file *epfp, int fd) { int error1, error2; - error1 = epoll_delete_event(td, epfp, fd, EVFILT_READ); - error2 = epoll_delete_event(td, epfp, fd, EVFILT_WRITE); + error1 = epoll_register_kevent(td, epfp, fd, EVFILT_READ, EV_DELETE); + error2 = epoll_register_kevent(td, epfp, fd, EVFILT_WRITE, EV_DELETE); /* return 0 if at least one result positive */ return (error1 == 0 ? 0 : error2); From owner-svn-src-head@freebsd.org Sun Nov 24 20:47:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 232951BA6A0; Sun, 24 Nov 2019 20:47:41 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lj0Y07XSz4S78; Sun, 24 Nov 2019 20:47:41 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB1461CDD; Sun, 24 Nov 2019 20:47:40 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOKleaY045914; Sun, 24 Nov 2019 20:47:40 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOKleKU045912; Sun, 24 Nov 2019 20:47:40 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911242047.xAOKleKU045912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Nov 2019 20:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355067 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 355067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 20:47:41 -0000 Author: wulf Date: Sun Nov 24 20:47:40 2019 New Revision: 355067 URL: https://svnweb.freebsd.org/changeset/base/355067 Log: Linux epoll: Register events with zero event mask Such an events are legal and should be interpreted as EPOLLERR | EPOLLHUP. Register a disabled kqueue event in that case as we do not support EPOLLHUP yet. Required by Linux Steam client. PR: 240590 Reported by: Alex S Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22516 Modified: head/sys/compat/linux/linux_event.c head/sys/compat/linux/linux_event.h Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun Nov 24 20:44:14 2019 (r355066) +++ head/sys/compat/linux/linux_event.c Sun Nov 24 20:47:40 2019 (r355067) @@ -325,6 +325,11 @@ epoll_to_kevent(struct thread *td, int fd, struct epol EV_SET(kevent++, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); ++(*nkevents); } + /* zero event mask is legal */ + if ((levents & (LINUX_EPOLL_EVRD | LINUX_EPOLL_EVWR)) == 0) { + EV_SET(kevent++, fd, EVFILT_READ, EV_ADD|EV_DISABLE, 0, 0, 0); + ++(*nkevents); + } if ((levents & ~(LINUX_EPOLL_EVSUP)) != 0) { p = td->td_proc; Modified: head/sys/compat/linux/linux_event.h ============================================================================== --- head/sys/compat/linux/linux_event.h Sun Nov 24 20:44:14 2019 (r355066) +++ head/sys/compat/linux/linux_event.h Sun Nov 24 20:47:40 2019 (r355067) @@ -45,10 +45,10 @@ #define LINUX_EPOLLONESHOT 1u<<30 #define LINUX_EPOLLET 1u<<31 -#define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM \ - |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI) +#define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM) #define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM) #define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \ + |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI \ |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR|LINUX_EPOLLRDHUP) #define LINUX_EPOLL_CTL_ADD 1 From owner-svn-src-head@freebsd.org Sun Nov 24 20:51:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 564D91BA97C; Sun, 24 Nov 2019 20:51:10 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lj4Z1hhDz4SS9; Sun, 24 Nov 2019 20:51:10 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DED91D31; Sun, 24 Nov 2019 20:51:10 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOKpAgM047103; Sun, 24 Nov 2019 20:51:10 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOKp9pq047102; Sun, 24 Nov 2019 20:51:09 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911242051.xAOKp9pq047102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Nov 2019 20:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355068 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 355068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 20:51:10 -0000 Author: wulf Date: Sun Nov 24 20:51:09 2019 New Revision: 355068 URL: https://svnweb.freebsd.org/changeset/base/355068 Log: Linux epoll: Allow passing of any negative timeout value to epoll_wait Linux epoll allow passing of any negative timeout value to epoll_wait() to cause unbound blocking Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22517 Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun Nov 24 20:47:40 2019 (r355067) +++ head/sys/compat/linux/linux_event.c Sun Nov 24 20:51:09 2019 (r355068) @@ -557,13 +557,13 @@ linux_epoll_wait_common(struct thread *td, int epfd, s return (error); if (epfp->f_type != DTYPE_KQUEUE) { error = EINVAL; - goto leave1; + goto leave; } if (uset != NULL) { error = kern_sigprocmask(td, SIG_SETMASK, uset, &omask, 0); if (error != 0) - goto leave1; + goto leave; td->td_pflags |= TDP_OLDMASK; /* * Make sure that ast() is called on return to @@ -581,11 +581,12 @@ linux_epoll_wait_common(struct thread *td, int epfd, s coargs.count = 0; coargs.error = 0; - if (timeout != -1) { - if (timeout < 0) { - error = EINVAL; - goto leave0; - } + /* + * Linux epoll_wait(2) man page states that timeout of -1 causes caller + * to block indefinitely. Real implementation does it if any negative + * timeout value is passed. + */ + if (timeout >= 0) { /* Convert from milliseconds to timespec. */ ts.tv_sec = timeout / 1000; ts.tv_nsec = (timeout % 1000) * 1000000; @@ -605,11 +606,10 @@ linux_epoll_wait_common(struct thread *td, int epfd, s if (error == 0) td->td_retval[0] = coargs.count; -leave0: if (uset != NULL) error = kern_sigprocmask(td, SIG_SETMASK, &omask, NULL, 0); -leave1: +leave: fdrop(epfp, td); return (error); } From owner-svn-src-head@freebsd.org Sun Nov 24 20:54:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 069321BABD2; Sun, 24 Nov 2019 20:54:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lj8W1m4Tz4SwK; Sun, 24 Nov 2019 20:54:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f41.google.com with SMTP id w24so10822668otk.6; Sun, 24 Nov 2019 12:54:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=7wLFVjirV0lnPrR1qGugY89OuFIm6gjL6X6A3TDyNAc=; b=LkddP4rZK6ZX4F7yQfgF+hgMT8/uPDz4D3xYoF2zeNbGEtMpTG1C7ffLVOjFfEZquE zm3vve2bkKhwzMkBVSS42F6R2T1LHw+cY/B/C0InFJ/4pQH/6/nCjkqhzPxO7/TkiJZk Omdn3VjMRhHApJwxbVe0ZgNnDGowY+joUZEzd6IEYwxKnV2HoawOdyiEeKtHEO5jXj4v 8pORW5tCfEVmsBvhTp/ldiH6elU14/PM7SWfuejhYabn8uBpP65I5+ED7wEbYOtN09YC 5dzTNsFDhLf5CBs6j2xUoSPU5e89aV+CvUouFSES9I+v9r7dBCdZpiG/duAfTycNuM13 IU8Q== X-Gm-Message-State: APjAAAUsOOn64Ej+l95GihGcR6HvJ5OZUO26/uHcPf1eoHvdMpkTD0Vm kLfn0to+i1eq4u4LPM7OSaEPD6Kp X-Google-Smtp-Source: APXvYqyExy3fW+SBCgkLae+MDWRt+o9fGyoAs7T2dY2yIMIYww3N4hYePpLfSV4HJ3SjhCos734E+w== X-Received: by 2002:a9d:1b3:: with SMTP id e48mr18792344ote.341.1574628873948; Sun, 24 Nov 2019 12:54:33 -0800 (PST) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com. [209.85.167.181]) by smtp.gmail.com with ESMTPSA id 9sm1818367oiq.33.2019.11.24.12.54.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Nov 2019 12:54:33 -0800 (PST) Received: by mail-oi1-f181.google.com with SMTP id o12so11246930oic.9; Sun, 24 Nov 2019 12:54:33 -0800 (PST) X-Received: by 2002:a54:4105:: with SMTP id l5mr20689631oic.135.1574628873408; Sun, 24 Nov 2019 12:54:33 -0800 (PST) MIME-Version: 1.0 References: <201911222323.xAMNNfwi027342@repo.freebsd.org> <2F916664-B316-4F61-810C-31D753FAC9B2@lists.zabbadoz.net> In-Reply-To: <2F916664-B316-4F61-810C-31D753FAC9B2@lists.zabbadoz.net> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 24 Nov 2019 12:54:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355024 - in head/sys: kern net sys To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47Lj8W1m4Tz4SwK X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.41 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[41.210.85.209.rep.mailspike.net : 127.0.0.18]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[41.210.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-1.13)[ip: (-0.48), ipnet: 209.85.128.0/17(-3.17), asn: 15169(-1.96), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 20:54:36 -0000 Sorry, should be: Differential Revision: https://reviews.freebsd.org/D22504 On Sat, Nov 23, 2019 at 2:57 AM Bjoern A. Zeeb wrote: > > On 22 Nov 2019, at 23:23, Conrad Meyer wrote: > > > Author: cem > > Date: Fri Nov 22 23:23:40 2019 > > New Revision: 355024 > > URL: https://svnweb.freebsd.org/changeset/base/355024 > > > > Log: > > Add explicit SI_SUB_EPOCH > > > > Add explicit SI_SUB_EPOCH, after SI_SUB_TASKQ and before SI_SUB_SMP > > (EARLY_AP_STARTUP). Rename existing "SI_SUB_TASKQ + 1" to > > SI_SUB_EPOCH. > > > > epoch(9) consumers cannot epoch_alloc() before > > SI_SUB_EPOCH:SI_ORDER_SECOND, > > but likely should allocate before SI_SUB_SMP. Prior to this change, > > consumers (well, epoch itself, and net/if.c) just open-coded the > > SI_SUB_TASKQ + 1 order to match epoch.c, but this was fragile. > > > > Reviewed by: mmacy > > Differential Revision: https://reviews.freebsd.org/D22503 > > That=E2=80=99s the wrong review URL? From owner-svn-src-head@freebsd.org Sun Nov 24 21:08:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F6C31BBDFF; Sun, 24 Nov 2019 21:08:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LjT521yMz4VWN; Sun, 24 Nov 2019 21:08:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28E3721B8; Sun, 24 Nov 2019 21:08:57 +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 xAOL8vHt057720; Sun, 24 Nov 2019 21:08:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOL8vB1057719; Sun, 24 Nov 2019 21:08:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201911242108.xAOL8vB1057719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Nov 2019 21:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355069 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 355069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 21:08:57 -0000 Author: ian Date: Sun Nov 24 21:08:56 2019 New Revision: 355069 URL: https://svnweb.freebsd.org/changeset/base/355069 Log: When doing ARM stack unwinding as part of stack_save(9), do not search loaded modules (pass 0/false for the can_lock arg). Searching the unwind info in modules acquires an exclusive sxlock, and the stack(9) functions can be called in a context where unbounded sleeps are forbidden (such as from the witness checkorder code). Just ignoring the existence of modules in stack_save() is not ideal, so I'm looking for a better solution, but this commit will make it possible to boot an ARM kernel with WITNESS enabled again, until I get something better. PR: 242200 Modified: head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Sun Nov 24 20:51:09 2019 (r355068) +++ head/sys/arm/arm/stack_machdep.c Sun Nov 24 21:08:56 2019 (r355069) @@ -40,7 +40,7 @@ stack_capture(struct stack *st, struct unwind_state *s { stack_zero(st); - while (unwind_stack_one(state, 1) == 0) { + while (unwind_stack_one(state, 0) == 0) { if (stack_put(st, state->registers[PC]) == -1) break; } From owner-svn-src-head@freebsd.org Sun Nov 24 21:15:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E25B11BC270; Sun, 24 Nov 2019 21:15:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LjcG5RRhz4WCB; Sun, 24 Nov 2019 21:15:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id z25so10840267oti.5; Sun, 24 Nov 2019 13:15:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=aQ9Chufrti8Ln+EplPSefuolSBpBS5QzAmPJXZB86t0=; b=Ghxq4s7lb4UJ+rkR+7PJ2FV3gtxpH5m3ItXatoQnongh8ck7XgeiB+MfTD6H2MtLDM HOLFaKiP09oNdw1IHcDxQccMQYAKVTR7ZDaGXXsPeM53BSoXHx3RzvoI8oDM35NJhO2A o8NW0pjgX9z6CLFVJXEHHS2Cf87BBNFnqv7JODjSs2y6kfcaoqdow4XlnbVqN6FUsU+z 6/QTru5HuXbw8d69b4CFV/qnJJjHHA6Gte8/4oCoB4RlvJxOFKDC199ALx7I+ZB0HZmy su0UznZER9+bDAwHupkdwtuJIxBM0q1INeoBwQPwUQ872bm5tN2BgZz6ENJsXsfbLXHD ILTw== X-Gm-Message-State: APjAAAWV3tgfRnEF8E4m+QPCf30mx2YVzpksXakR8bFtvShYHymDWZfs TpK71oYVrQioxBQSAQFgdT8j2rHA X-Google-Smtp-Source: APXvYqzhoCF6kt50qXJ9lYbRS5FbK0Y2/nbMRZIB/ZBG+iEUnbDR1QtZjNeAQaMPnaznkUBuIT39Tw== X-Received: by 2002:a9d:6214:: with SMTP id g20mr16695030otj.226.1574630109333; Sun, 24 Nov 2019 13:15:09 -0800 (PST) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com. [209.85.167.178]) by smtp.gmail.com with ESMTPSA id l12sm1661546oth.76.2019.11.24.13.15.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Nov 2019 13:15:09 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id l20so11274329oie.10; Sun, 24 Nov 2019 13:15:09 -0800 (PST) X-Received: by 2002:aca:6006:: with SMTP id u6mr21082431oib.137.1574630108881; Sun, 24 Nov 2019 13:15:08 -0800 (PST) MIME-Version: 1.0 References: <201911241503.xAOF3Zqd042071@repo.freebsd.org> In-Reply-To: <201911241503.xAOF3Zqd042071@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 24 Nov 2019 13:14:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355055 - head/tests/sys/sys To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47LjcG5RRhz4WCB X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 21:15:11 -0000 Don't we already build with -fwrapv for this class of problem? The GCC docs claim that warning is only active when signed overflow is undefined. It seems that -fno-strict-overflow has similar semantics to -fwrapv, but we should probably be consistent about the flag we use. Also, if GCC is producing this warning, I think Clang needs the same flag. Best, Conrad On Sun, Nov 24, 2019 at 7:03 AM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Sun Nov 24 15:03:35 2019 > New Revision: 355055 > URL: https://svnweb.freebsd.org/changeset/base/355055 > > Log: > Fix gcc build > > We have -Werror=strict-overflow so gcc complains: > > In file included from /tmp/obj/workspace/src/amd64.amd64/tmp/usr/include/bitstring.h:36:0, > from /workspace/src/tests/sys/sys/bitstring_test.c:34: > /workspace/src/tests/sys/sys/bitstring_test.c: In function 'bit_ffc_at_test': > /workspace/src/sys/sys/bitstring.h:239:5: error: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Werror=strict-overflow] > if (_start >= _nbits) { > ^ > > Disable assuming overflow of signed integer will never happen by specifying > -fno-strict-overflow > > Sponsored by: The FreeBSD Foundation > > Modified: > head/tests/sys/sys/Makefile > > Modified: head/tests/sys/sys/Makefile > ============================================================================== > --- head/tests/sys/sys/Makefile Sun Nov 24 13:53:36 2019 (r355054) > +++ head/tests/sys/sys/Makefile Sun Nov 24 15:03:35 2019 (r355055) > @@ -1,9 +1,15 @@ > # $FreeBSD$ > > +.include > + > TESTSDIR= ${TESTSBASE}/sys/sys > > ATF_TESTS_C= arb_test bitstring_test qmath_test rb_test splay_test > > WARNS?= 5 > + > +.if ${COMPILER_TYPE} == "gcc" > +CFLAGS.bitstring_test= -fno-strict-overflow > +.endif > > .include From owner-svn-src-head@freebsd.org Sun Nov 24 23:21:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 282B21BFB21; Sun, 24 Nov 2019 23:21:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LmQN0DwNz4d9W; Sun, 24 Nov 2019 23:21:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E072D3CDE; Sun, 24 Nov 2019 23:21:47 +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 xAONLlQq038987; Sun, 24 Nov 2019 23:21:47 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAONLlm8038986; Sun, 24 Nov 2019 23:21:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911242321.xAONLlm8038986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 24 Nov 2019 23:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355070 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 355070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Nov 2019 23:21:48 -0000 Author: bz Date: Sun Nov 24 23:21:47 2019 New Revision: 355070 URL: https://svnweb.freebsd.org/changeset/base/355070 Log: Allow kernel to compile without BPF. r297816 added some bpf magic for VIMAGE unconditionally which no longer allows kernels to compile without bpf (but with other networking). Add the missing ifdef checks and allow a kernel to compile without bpf again. PR: 242136 Reported by: dave mischler.com MFC after: 2 weeks Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Nov 24 21:08:56 2019 (r355069) +++ head/sys/net/if.c Sun Nov 24 23:21:47 2019 (r355070) @@ -32,6 +32,7 @@ * $FreeBSD$ */ +#include "opt_bpf.h" #include "opt_inet6.h" #include "opt_inet.h" @@ -1260,16 +1261,20 @@ static void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; +#ifdef DEV_BPF u_int bif_dlt, bif_hdrlen; +#endif void *old; int rc; +#ifdef DEV_BPF /* * if_detach_internal() will call the eventhandler to notify * interface departure. That will detach if_bpf. We need to * safe the dlt and hdrlen so we can re-attach it later. */ bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen); +#endif /* * Detach from current vnet, but preserve LLADDR info, do not @@ -1316,8 +1321,10 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) if_attach_internal(ifp, 1, ifc); +#ifdef DEV_BPF if (ifp->if_bpf == NULL) bpfattach(ifp, bif_dlt, bif_hdrlen); +#endif CURVNET_RESTORE(); } From owner-svn-src-head@freebsd.org Mon Nov 25 01:00:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69F9B1C2642; Mon, 25 Nov 2019 01:00:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lpch25nkz3F4g; Mon, 25 Nov 2019 01:00:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA304DDA; Mon, 25 Nov 2019 01:00:52 +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 xAP10pMX093844; Mon, 25 Nov 2019 01:00:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP10peC093843; Mon, 25 Nov 2019 01:00:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911250100.xAP10peC093843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 25 Nov 2019 01:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355074 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 355074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 01:00:52 -0000 Author: mav Date: Mon Nov 25 01:00:51 2019 New Revision: 355074 URL: https://svnweb.freebsd.org/changeset/base/355074 Log: Report XLAT0 register for completeness. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Mon Nov 25 00:34:59 2019 (r355073) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Mon Nov 25 01:00:51 2019 (r355074) @@ -2409,6 +2409,14 @@ intel_ntb_sysctl_init(struct ntb_softc *ntb) if (ntb->conn_type != NTB_CONN_B2B) return; + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat01l", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_32 | XEON_B2B_XLAT_OFFSETL, + sysctl_handle_register, "IU", "Outgoing XLAT0L register"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat01u", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_32 | XEON_B2B_XLAT_OFFSETU, + sysctl_handle_register, "IU", "Outgoing XLAT0U register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat23", CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_64 | ntb->bar_info[NTB_B2B_BAR_1].pbarxlat_off, From owner-svn-src-head@freebsd.org Mon Nov 25 02:19:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFD331C46AE; Mon, 25 Nov 2019 02:19:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LrMl5tPqz3Jly; Mon, 25 Nov 2019 02:19:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92F465C24; Mon, 25 Nov 2019 02:19:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP2Jl3R040581; Mon, 25 Nov 2019 02:19:47 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP2JlBv040580; Mon, 25 Nov 2019 02:19:47 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201911250219.xAP2JlBv040580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 25 Nov 2019 02:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355076 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 02:19:47 -0000 Author: dougm Date: Mon Nov 25 02:19:47 2019 New Revision: 355076 URL: https://svnweb.freebsd.org/changeset/base/355076 Log: Where 'current' is used to index over vm_map entries, use 'entry'. Where 'entry' is used to identify the starting point for iteration, use 'first_entry'. These are the naming conventions used in most of the vm_map.c code. Where VM_MAP_ENTRY_FOREACH can be used, do so. Squeeze a few lines to fit in 80 columns. Where lines are being modified for these reasons, look to remove style(9) violations. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D22458 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Nov 25 01:32:50 2019 (r355075) +++ head/sys/vm/vm_map.c Mon Nov 25 02:19:47 2019 (r355076) @@ -2093,14 +2093,15 @@ vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_en * The map must be locked. */ void -vm_map_try_merge_entries(vm_map_t map, vm_map_entry_t prev, vm_map_entry_t entry) +vm_map_try_merge_entries(vm_map_t map, vm_map_entry_t prev_entry, + vm_map_entry_t entry) { VM_MAP_ASSERT_LOCKED(map); if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) == 0 && - vm_map_mergeable_neighbors(prev, entry)) { - vm_map_entry_unlink(map, prev, UNLINK_MERGE_NEXT); - vm_map_merged_neighbor_dispose(map, prev); + vm_map_mergeable_neighbors(prev_entry, entry)) { + vm_map_entry_unlink(map, prev_entry, UNLINK_MERGE_NEXT); + vm_map_merged_neighbor_dispose(map, prev_entry); } } @@ -2445,7 +2446,7 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current, entry, in_tran, prev_entry; + vm_map_entry_t entry, first_entry, in_tran, prev_entry; vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; @@ -2468,26 +2469,26 @@ again: VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry(map, start, &entry)) - entry = vm_map_entry_succ(entry); + if (!vm_map_lookup_entry(map, start, &first_entry)) + first_entry = vm_map_entry_succ(first_entry); /* * Make a first pass to check for protection violations. */ - for (current = entry; current->start < end; - current = vm_map_entry_succ(current)) { - if ((current->eflags & MAP_ENTRY_GUARD) != 0) + for (entry = first_entry; entry->start < end; + entry = vm_map_entry_succ(entry)) { + if ((entry->eflags & MAP_ENTRY_GUARD) != 0) continue; - if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { vm_map_unlock(map); return (KERN_INVALID_ARGUMENT); } - if ((new_prot & current->max_protection) != new_prot) { + if ((new_prot & entry->max_protection) != new_prot) { vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } - if ((current->eflags & MAP_ENTRY_IN_TRANSITION) != 0) - in_tran = current; + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = entry; } /* @@ -2511,30 +2512,30 @@ again: * some may now be mergeable. */ rv = KERN_SUCCESS; - vm_map_clip_start(map, entry, start); - for (current = entry; current->start < end; - current = vm_map_entry_succ(current)) { + vm_map_clip_start(map, first_entry, start); + for (entry = first_entry; entry->start < end; + entry = vm_map_entry_succ(entry)) { + vm_map_clip_end(map, entry, end); - vm_map_clip_end(map, current, end); - if (set_max || - ((new_prot & ~(current->protection)) & VM_PROT_WRITE) == 0 || - ENTRY_CHARGED(current) || - (current->eflags & MAP_ENTRY_GUARD) != 0) { + ((new_prot & ~entry->protection) & VM_PROT_WRITE) == 0 || + ENTRY_CHARGED(entry) || + (entry->eflags & MAP_ENTRY_GUARD) != 0) { continue; } cred = curthread->td_ucred; - obj = current->object.vm_object; + obj = entry->object.vm_object; - if (obj == NULL || (current->eflags & MAP_ENTRY_NEEDS_COPY)) { - if (!swap_reserve(current->end - current->start)) { + if (obj == NULL || + (entry->eflags & MAP_ENTRY_NEEDS_COPY) != 0) { + if (!swap_reserve(entry->end - entry->start)) { rv = KERN_RESOURCE_SHORTAGE; - end = current->end; + end = entry->end; break; } crhold(cred); - current->cred = cred; + entry->cred = cred; continue; } @@ -2551,11 +2552,11 @@ again: */ KASSERT(obj->charge == 0, ("vm_map_protect: object %p overcharged (entry %p)", - obj, current)); + obj, entry)); if (!swap_reserve(ptoa(obj->size))) { VM_OBJECT_WUNLOCK(obj); rv = KERN_RESOURCE_SHORTAGE; - end = current->end; + end = entry->end; break; } @@ -2570,22 +2571,22 @@ again: * Otherwise, just simplify entries, since some may have been modified. * [Note that clipping is not necessary the second time.] */ - for (prev_entry = vm_map_entry_pred(entry), current = entry; - current->start < end; - vm_map_try_merge_entries(map, prev_entry, current), - prev_entry = current, current = vm_map_entry_succ(current)) { + for (prev_entry = vm_map_entry_pred(first_entry), entry = first_entry; + entry->start < end; + vm_map_try_merge_entries(map, prev_entry, entry), + prev_entry = entry, entry = vm_map_entry_succ(entry)) { if (rv != KERN_SUCCESS || - (current->eflags & MAP_ENTRY_GUARD) != 0) + (entry->eflags & MAP_ENTRY_GUARD) != 0) continue; - old_prot = current->protection; + old_prot = entry->protection; if (set_max) - current->protection = - (current->max_protection = new_prot) & + entry->protection = + (entry->max_protection = new_prot) & old_prot; else - current->protection = new_prot; + entry->protection = new_prot; /* * For user wired map entries, the normal lazy evaluation of @@ -2593,25 +2594,25 @@ again: * undesirable. Instead, immediately copy any pages that are * copy-on-write and enable write access in the physical map. */ - if ((current->eflags & MAP_ENTRY_USER_WIRED) != 0 && - (current->protection & VM_PROT_WRITE) != 0 && + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0 && + (entry->protection & VM_PROT_WRITE) != 0 && (old_prot & VM_PROT_WRITE) == 0) - vm_fault_copy_entry(map, map, current, current, NULL); + vm_fault_copy_entry(map, map, entry, entry, NULL); /* * When restricting access, update the physical map. Worry * about copy-on-write here. */ - if ((old_prot & ~current->protection) != 0) { + if ((old_prot & ~entry->protection) != 0) { #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) - pmap_protect(map->pmap, current->start, - current->end, - current->protection & MASK(current)); + pmap_protect(map->pmap, entry->start, + entry->end, + entry->protection & MASK(entry)); #undef MASK } } - vm_map_try_merge_entries(map, prev_entry, current); + vm_map_try_merge_entries(map, prev_entry, entry); vm_map_unlock(map); return (rv); } @@ -2631,7 +2632,7 @@ vm_map_madvise( vm_offset_t end, int behav) { - vm_map_entry_t current, prev_entry; + vm_map_entry_t entry, prev_entry; bool modify_map; /* @@ -2670,13 +2671,13 @@ vm_map_madvise( */ VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, ¤t)) { + if (vm_map_lookup_entry(map, start, &entry)) { if (modify_map) - vm_map_clip_start(map, current, start); - prev_entry = vm_map_entry_pred(current); + vm_map_clip_start(map, entry, start); + prev_entry = vm_map_entry_pred(entry); } else { - prev_entry = current; - current = vm_map_entry_succ(current); + prev_entry = entry; + entry = vm_map_entry_succ(entry); } if (modify_map) { @@ -2686,41 +2687,44 @@ vm_map_madvise( * We clip the vm_map_entry so that behavioral changes are * limited to the specified address range. */ - for (; current->start < end; prev_entry = current, - current = vm_map_entry_succ(current)) { - if (current->eflags & MAP_ENTRY_IS_SUB_MAP) + for (; entry->start < end; + prev_entry = entry, entry = vm_map_entry_succ(entry)) { + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) continue; - vm_map_clip_end(map, current, end); + vm_map_clip_end(map, entry, end); switch (behav) { case MADV_NORMAL: - vm_map_entry_set_behavior(current, MAP_ENTRY_BEHAV_NORMAL); + vm_map_entry_set_behavior(entry, + MAP_ENTRY_BEHAV_NORMAL); break; case MADV_SEQUENTIAL: - vm_map_entry_set_behavior(current, MAP_ENTRY_BEHAV_SEQUENTIAL); + vm_map_entry_set_behavior(entry, + MAP_ENTRY_BEHAV_SEQUENTIAL); break; case MADV_RANDOM: - vm_map_entry_set_behavior(current, MAP_ENTRY_BEHAV_RANDOM); + vm_map_entry_set_behavior(entry, + MAP_ENTRY_BEHAV_RANDOM); break; case MADV_NOSYNC: - current->eflags |= MAP_ENTRY_NOSYNC; + entry->eflags |= MAP_ENTRY_NOSYNC; break; case MADV_AUTOSYNC: - current->eflags &= ~MAP_ENTRY_NOSYNC; + entry->eflags &= ~MAP_ENTRY_NOSYNC; break; case MADV_NOCORE: - current->eflags |= MAP_ENTRY_NOCOREDUMP; + entry->eflags |= MAP_ENTRY_NOCOREDUMP; break; case MADV_CORE: - current->eflags &= ~MAP_ENTRY_NOCOREDUMP; + entry->eflags &= ~MAP_ENTRY_NOCOREDUMP; break; default: break; } - vm_map_try_merge_entries(map, prev_entry, current); + vm_map_try_merge_entries(map, prev_entry, entry); } - vm_map_try_merge_entries(map, prev_entry, current); + vm_map_try_merge_entries(map, prev_entry, entry); vm_map_unlock(map); } else { vm_pindex_t pstart, pend; @@ -2732,11 +2736,11 @@ vm_map_madvise( * Since we don't clip the vm_map_entry, we have to clip * the vm_object pindex and count. */ - for (; current->start < end; - current = vm_map_entry_succ(current)) { + for (; entry->start < end; + entry = vm_map_entry_succ(entry)) { vm_offset_t useEnd, useStart; - if (current->eflags & MAP_ENTRY_IS_SUB_MAP) + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) continue; /* @@ -2747,21 +2751,21 @@ vm_map_madvise( * backing object can change. */ if (behav == MADV_FREE && - current->object.vm_object != NULL && - current->object.vm_object->backing_object != NULL) + entry->object.vm_object != NULL && + entry->object.vm_object->backing_object != NULL) continue; - pstart = OFF_TO_IDX(current->offset); - pend = pstart + atop(current->end - current->start); - useStart = current->start; - useEnd = current->end; + pstart = OFF_TO_IDX(entry->offset); + pend = pstart + atop(entry->end - entry->start); + useStart = entry->start; + useEnd = entry->end; - if (current->start < start) { - pstart += atop(start - current->start); + if (entry->start < start) { + pstart += atop(start - entry->start); useStart = start; } - if (current->end > end) { - pend -= atop(current->end - end); + if (entry->end > end) { + pend -= atop(entry->end - end); useEnd = end; } @@ -2782,7 +2786,7 @@ vm_map_madvise( pmap_advise(map->pmap, useStart, useEnd, behav); - vm_object_madvise(current->object.vm_object, pstart, + vm_object_madvise(entry->object.vm_object, pstart, pend, behav); /* @@ -2791,11 +2795,11 @@ vm_map_madvise( * paging structures are already populated. */ if (behav == MADV_WILLNEED && - current->wired_count == 0) { + entry->wired_count == 0) { vm_map_pmap_enter(map, useStart, - current->protection, - current->object.vm_object, + entry->protection, + entry->object.vm_object, pstart, ptoa(pend - pstart), MAP_PREFAULT_MADVISE @@ -3360,7 +3364,7 @@ vm_map_sync( boolean_t syncio, boolean_t invalidate) { - vm_map_entry_t current, entry, next_entry; + vm_map_entry_t entry, first_entry, next_entry; vm_size_t size; vm_object_t object; vm_ooffset_t offset; @@ -3369,25 +3373,25 @@ vm_map_sync( vm_map_lock_read(map); VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry(map, start, &entry)) { + if (!vm_map_lookup_entry(map, start, &first_entry)) { vm_map_unlock_read(map); return (KERN_INVALID_ADDRESS); } else if (start == end) { - start = entry->start; - end = entry->end; + start = first_entry->start; + end = first_entry->end; } /* * Make a first pass to check for user-wired memory and holes. */ - for (current = entry; current->start < end; - current = next_entry) { - if (invalidate && (current->eflags & MAP_ENTRY_USER_WIRED)) { + for (entry = first_entry; entry->start < end; entry = next_entry) { + if (invalidate && + (entry->eflags & MAP_ENTRY_USER_WIRED) != 0) { vm_map_unlock_read(map); return (KERN_INVALID_ARGUMENT); } - next_entry = vm_map_entry_succ(current); - if (end > current->end && - current->end != next_entry->start) { + next_entry = vm_map_entry_succ(entry); + if (end > entry->end && + entry->end != next_entry->start) { vm_map_unlock_read(map); return (KERN_INVALID_ADDRESS); } @@ -3401,15 +3405,15 @@ vm_map_sync( * Make a second pass, cleaning/uncaching pages from the indicated * objects as we go. */ - for (current = entry; current->start < end;) { - offset = current->offset + (start - current->start); - size = (end <= current->end ? end : current->end) - start; - if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { + for (entry = first_entry; entry->start < end;) { + offset = entry->offset + (start - entry->start); + size = (end <= entry->end ? end : entry->end) - start; + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { vm_map_t smap; vm_map_entry_t tentry; vm_size_t tsize; - smap = current->object.sub_map; + smap = entry->object.sub_map; vm_map_lock_read(smap); (void) vm_map_lookup_entry(smap, offset, &tentry); tsize = tentry->end - offset; @@ -3419,7 +3423,7 @@ vm_map_sync( offset = tentry->offset + (offset - tentry->start); vm_map_unlock_read(smap); } else { - object = current->object.vm_object; + object = entry->object.vm_object; } vm_object_reference(object); last_timestamp = map->timestamp; @@ -3430,8 +3434,8 @@ vm_map_sync( vm_object_deallocate(object); vm_map_lock_read(map); if (last_timestamp == map->timestamp || - !vm_map_lookup_entry(map, start, ¤t)) - current = vm_map_entry_succ(current); + !vm_map_lookup_entry(map, start, &entry)) + entry = vm_map_entry_succ(entry); } vm_map_unlock_read(map); @@ -3928,10 +3932,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_map->anon_loc = old_map->anon_loc; - old_entry = vm_map_entry_first(old_map); - - while (old_entry != &old_map->header) { - if (old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) + VM_MAP_ENTRY_FOREACH(old_entry, old_map) { + if ((old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) panic("vm_map_fork: encountered a submap"); inh = old_entry->inheritance; @@ -3945,7 +3947,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c case VM_INHERIT_SHARE: /* - * Clone the entry, creating the shared object if necessary. + * Clone the entry, creating the shared object if + * necessary. */ object = old_entry->object.vm_object; if (object == NULL) { @@ -4080,7 +4083,6 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c break; } - old_entry = vm_map_entry_succ(old_entry); } /* * Use inlined vm_map_unlock() to postpone handling the deferred From owner-svn-src-head@freebsd.org Mon Nov 25 07:13:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFD531CAC60; Mon, 25 Nov 2019 07:13:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lyt94RCpz44Sg; Mon, 25 Nov 2019 07:13:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B7C8917C; Mon, 25 Nov 2019 07:13:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP7D5sc017402; Mon, 25 Nov 2019 07:13:05 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP7D5WQ017401; Mon, 25 Nov 2019 07:13:05 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911250713.xAP7D5WQ017401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 25 Nov 2019 07:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355082 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 07:13:05 -0000 Author: jeff Date: Mon Nov 25 07:13:05 2019 New Revision: 355082 URL: https://svnweb.freebsd.org/changeset/base/355082 Log: Move anonymous object copying for fork into its own routine and so that we can avoid locking non-anonymous objects. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22472 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Nov 25 06:16:53 2019 (r355081) +++ head/sys/vm/vm_map.c Mon Nov 25 07:13:05 2019 (r355082) @@ -3722,7 +3722,57 @@ vm_map_check_protection(vm_map_t map, vm_offset_t star return (TRUE); } + /* + * + * vm_map_copy_anon_object: + * + * Copies an anonymous object from an existing map entry to a + * new one. Carries forward the swap charge. May change the + * src object on return. + */ +static void +vm_map_copy_anon_object(vm_map_entry_t src_entry, vm_map_entry_t dst_entry, + vm_offset_t size, vm_ooffset_t *fork_charge) +{ + vm_object_t src_object; + struct ucred *cred; + int charged; + + src_object = src_entry->object.vm_object; + VM_OBJECT_WLOCK(src_object); + charged = ENTRY_CHARGED(src_entry); + vm_object_collapse(src_object); + if ((src_object->flags & OBJ_ONEMAPPING) != 0) { + vm_object_split(src_entry); + src_object = src_entry->object.vm_object; + } + vm_object_reference_locked(src_object); + vm_object_clear_flag(src_object, OBJ_ONEMAPPING); + if (src_entry->cred != NULL && + !(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { + KASSERT(src_object->cred == NULL, + ("OVERCOMMIT: vm_map_copy_anon_entry: cred %p", + src_object)); + src_object->cred = src_entry->cred; + src_object->charge = size; + } + VM_OBJECT_WUNLOCK(src_object); + dst_entry->object.vm_object = src_object; + if (charged) { + cred = curthread->td_ucred; + crhold(cred); + dst_entry->cred = cred; + *fork_charge += size; + if (!(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { + crhold(cred); + src_entry->cred = cred; + *fork_charge += size; + } + } +} + +/* * vm_map_copy_entry: * * Copies the contents of the source entry to the destination @@ -3739,8 +3789,6 @@ vm_map_copy_entry( vm_object_t src_object; vm_map_entry_t fake_entry; vm_offset_t size; - struct ucred *cred; - int charged; VM_MAP_ASSERT_LOCKED(dst_map); @@ -3766,39 +3814,14 @@ vm_map_copy_entry( */ size = src_entry->end - src_entry->start; if ((src_object = src_entry->object.vm_object) != NULL) { - VM_OBJECT_WLOCK(src_object); - charged = ENTRY_CHARGED(src_entry); if ((src_object->flags & OBJ_ANON) != 0) { - vm_object_collapse(src_object); - if ((src_object->flags & OBJ_ONEMAPPING) != 0) { - vm_object_split(src_entry); - src_object = - src_entry->object.vm_object; - } - } - vm_object_reference_locked(src_object); - vm_object_clear_flag(src_object, OBJ_ONEMAPPING); - if (src_entry->cred != NULL && - !(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { - KASSERT(src_object->cred == NULL, - ("OVERCOMMIT: vm_map_copy_entry: cred %p", - src_object)); - src_object->cred = src_entry->cred; - src_object->charge = size; - } - VM_OBJECT_WUNLOCK(src_object); - dst_entry->object.vm_object = src_object; - if (charged) { - cred = curthread->td_ucred; - crhold(cred); - dst_entry->cred = cred; - *fork_charge += size; - if (!(src_entry->eflags & - MAP_ENTRY_NEEDS_COPY)) { - crhold(cred); - src_entry->cred = cred; - *fork_charge += size; - } + vm_map_copy_anon_object(src_entry, dst_entry, + size, fork_charge); + /* May have split/collapsed, reload obj. */ + src_object = src_entry->object.vm_object; + } else { + vm_object_reference(src_object); + dst_entry->object.vm_object = src_object; } src_entry->eflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; From owner-svn-src-head@freebsd.org Mon Nov 25 07:38:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 041B31CB61E; Mon, 25 Nov 2019 07:38:28 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LzRR6KB5z45Wd; Mon, 25 Nov 2019 07:38:27 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC535950C; Mon, 25 Nov 2019 07:38:27 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP7cR9d029577; Mon, 25 Nov 2019 07:38:27 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP7cRbe029576; Mon, 25 Nov 2019 07:38:27 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911250738.xAP7cRbe029576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 25 Nov 2019 07:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355083 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 07:38:28 -0000 Author: rlibby Date: Mon Nov 25 07:38:27 2019 New Revision: 355083 URL: https://svnweb.freebsd.org/changeset/base/355083 Log: sysctl sysctls: wire old buf before output with sysctl lock Several sysctl sysctls output to a user buffer while holding a non-sleepable lock that protects the sysctl topology. They need to wire the output buffer, or else they may try to sleep on a page fault. Reviewed by: cem, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22528 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 25 07:13:05 2019 (r355082) +++ head/sys/kern/kern_sysctl.c Mon Nov 25 07:38:27 2019 (r355083) @@ -1023,12 +1023,16 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) { int *name = (int *) arg1; u_int namelen = arg2; - int error = 0; + int error; struct sysctl_oid *oid; struct sysctl_oid_list *lsp = &sysctl__children, *lsp2; struct rm_priotracker tracker; char buf[10]; + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); + SYSCTL_RLOCK(&tracker); while (namelen) { if (!lsp) { @@ -1265,6 +1269,10 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) struct rm_priotracker tracker; int error; + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); + SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) @@ -1294,6 +1302,10 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_ARGS) struct rm_priotracker tracker; int error; + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); + SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) @@ -1318,6 +1330,10 @@ sysctl_sysctl_oidlabel(SYSCTL_HANDLER_ARGS) struct sysctl_oid *oid; struct rm_priotracker tracker; int error; + + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); SYSCTL_RLOCK(&tracker); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); From owner-svn-src-head@freebsd.org Mon Nov 25 07:38:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DE531CB640; Mon, 25 Nov 2019 07:38:32 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LzRX2GcBz45Z7; Mon, 25 Nov 2019 07:38:32 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B11C950D; Mon, 25 Nov 2019 07:38:32 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP7cW4x029629; Mon, 25 Nov 2019 07:38:32 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP7cWcZ029628; Mon, 25 Nov 2019 07:38:32 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911250738.xAP7cWcZ029628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 25 Nov 2019 07:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355084 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 07:38:32 -0000 Author: rlibby Date: Mon Nov 25 07:38:31 2019 New Revision: 355084 URL: https://svnweb.freebsd.org/changeset/base/355084 Log: vm_object_collapse_scan_wait: drop locks before reacquiring Regression from r352174. In the vm_page_rename() failure case we forgot to unlock the vm object locks before sleeping and reacquiring them. Reviewed by: jeff Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22542 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Nov 25 07:38:27 2019 (r355083) +++ head/sys/vm/vm_object.c Mon Nov 25 07:38:31 2019 (r355084) @@ -1496,6 +1496,8 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_pa return (next); /* The page is only NULL when rename fails. */ if (p == NULL) { + VM_OBJECT_WUNLOCK(object); + VM_OBJECT_WUNLOCK(backing_object); vm_radix_wait(); } else { if (p->object == object) From owner-svn-src-head@freebsd.org Mon Nov 25 07:48:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6C911CB9E1; Mon, 25 Nov 2019 07:48:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lzfn5cZVz46MB; Mon, 25 Nov 2019 07:48:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A38C396D7; Mon, 25 Nov 2019 07:48:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP7mHaT035241; Mon, 25 Nov 2019 07:48:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP7mGSu035234; Mon, 25 Nov 2019 07:48:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201911250748.xAP7mGSu035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Nov 2019 07:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355085 - in head: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Commit-Revision: 355085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 07:48:17 -0000 Author: delphij Date: Mon Nov 25 07:48:16 2019 New Revision: 355085 URL: https://svnweb.freebsd.org/changeset/base/355085 Log: MFV r355071: libbsdxml (expat) 2.2.9. MFC after: 2 weeks Relnotes: yes Added: head/contrib/expat/fix-xmltest-log.sh - copied unchanged from r355071, vendor/expat/dist/fix-xmltest-log.sh head/contrib/expat/xmlwf/xmlwf_helpgen.py - copied unchanged from r355071, vendor/expat/dist/xmlwf/xmlwf_helpgen.py head/contrib/expat/xmlwf/xmlwf_helpgen.sh - copied unchanged from r355071, vendor/expat/dist/xmlwf/xmlwf_helpgen.sh Modified: head/contrib/expat/Changes head/contrib/expat/FREEBSD-Xlist head/contrib/expat/Makefile.am head/contrib/expat/Makefile.in head/contrib/expat/README.md head/contrib/expat/configure.ac head/contrib/expat/doc/Makefile.am head/contrib/expat/doc/Makefile.in head/contrib/expat/doc/reference.html head/contrib/expat/examples/Makefile.in head/contrib/expat/examples/elements.c head/contrib/expat/examples/outline.c head/contrib/expat/expat_config.h.in head/contrib/expat/lib/Makefile.am head/contrib/expat/lib/Makefile.in head/contrib/expat/lib/asciitab.h head/contrib/expat/lib/expat.h head/contrib/expat/lib/expat_external.h head/contrib/expat/lib/iasciitab.h head/contrib/expat/lib/internal.h head/contrib/expat/lib/latin1tab.h head/contrib/expat/lib/nametab.h head/contrib/expat/lib/siphash.h head/contrib/expat/lib/utf8tab.h head/contrib/expat/lib/xmlparse.c head/contrib/expat/lib/xmlrole.c head/contrib/expat/lib/xmlrole.h head/contrib/expat/lib/xmltok.c head/contrib/expat/lib/xmltok.h head/contrib/expat/lib/xmltok_impl.c head/contrib/expat/lib/xmltok_impl.h head/contrib/expat/lib/xmltok_ns.c head/contrib/expat/test-driver-wrapper.sh head/contrib/expat/tests/Makefile.in head/contrib/expat/tests/benchmark/Makefile.in head/contrib/expat/tests/benchmark/benchmark.c head/contrib/expat/tests/chardata.c head/contrib/expat/tests/chardata.h head/contrib/expat/tests/memcheck.c head/contrib/expat/tests/memcheck.h head/contrib/expat/tests/minicheck.c head/contrib/expat/tests/minicheck.h head/contrib/expat/tests/runtests.c head/contrib/expat/tests/structdata.c head/contrib/expat/tests/structdata.h head/contrib/expat/tests/xmltest.sh head/contrib/expat/xmlwf/Makefile.am head/contrib/expat/xmlwf/Makefile.in head/contrib/expat/xmlwf/codepage.c head/contrib/expat/xmlwf/ct.c head/contrib/expat/xmlwf/filemap.h head/contrib/expat/xmlwf/readfilemap.c head/contrib/expat/xmlwf/unixfilemap.c head/contrib/expat/xmlwf/win32filemap.c head/contrib/expat/xmlwf/xmlfile.c head/contrib/expat/xmlwf/xmlfile.h head/contrib/expat/xmlwf/xmlmime.c head/contrib/expat/xmlwf/xmltchar.h head/contrib/expat/xmlwf/xmlwf.c head/lib/libexpat/expat_config.h head/lib/libexpat/libbsdxml.3 Directory Properties: head/contrib/expat/ (props changed) Modified: head/contrib/expat/Changes ============================================================================== --- head/contrib/expat/Changes Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/Changes Mon Nov 25 07:48:16 2019 (r355085) @@ -2,6 +2,162 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release 2.2.9 Wed Septemper 25 2019 + Other changes: + examples: Drop executable bits from elements.c + #349 Windows: Change the name of the Windows DLLs from expat*.dll + to libexpat*.dll once more (regression from 2.2.8, first + fixed in 1.95.3, issue #61 on SourceForge today, + was issue #432456 back then); needs a fix due + case-insensitive file systems on Windows and the fact that + Perl's XML::Parser::Expat compiles into Expat.dll. + #347 Windows: Only define _CRT_RAND_S if not defined + Version info bumped from 7:10:6 to 7:11:6 + + Special thanks to: + Ben Wagner + +Release 2.2.8 Fri Septemper 13 2019 + Security fixes: + #317 #318 CVE-2019-15903 -- Fix heap overflow triggered by + XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber), + and deny internal entities closing the doctype; + fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43 + + Bug fixes: + #240 Fix cases where XML_StopParser did not have any effect + when called from inside of an end element handler + #341 xmlwf: Fix exit code for operation without "-d DIRECTORY"; + previously, only "-d DIRECTORY" would give you a proper + exit code: + # xmlwf -d . <<<'' 2>/dev/null ; echo $? + 2 + # xmlwf <<<'' 2>/dev/null ; echo $? + 0 + Now both cases return exit code 2. + + Other changes: + #299 #302 Windows: Replace LoadLibrary hack to access + unofficial API function SystemFunction036 (RtlGenRandom) + by using official API function rand_s (needs WinXP+) + #325 Windows: Drop support for Visual Studio <=7.1/2003 + and document supported compilers in README.md + #286 Windows: Remove COM code from xmlwf; in case it turns + out needed later, there will be a dedicated repository + below https://github.com/libexpat/ for that code + #322 Windows: Remove explicit MSVC solution and project files. + You can generate Visual Studio solution files through + CMake, e.g.: cmake -G"Visual Studio 15 2017" . + #338 xmlwf: Make "xmlwf -h" help output more friendly + #339 examples: Improve elements.c + #244 #264 Autotools: Add argument --enable-xml-attr-info + #239 #301 Autotools: Add arguments + --with-getrandom + --without-getrandom + --with-sys-getrandom + --without-sys-getrandom + #312 #343 Autotools: Fix linking issues with "./configure LD=clang" + Autotools: Fix "make run-xmltest" for out-of-source builds + #329 #336 CMake: Pull all options from Expat <=2.2.7 into namespace + prefix EXPAT_ with the exception of DOCBOOK_TO_MAN: + - BUILD_doc -> EXPAT_BUILD_DOCS (plural) + - BUILD_examples -> EXPAT_BUILD_EXAMPLES + - BUILD_shared -> EXPAT_SHARED_LIBS + - BUILD_tests -> EXPAT_BUILD_TESTS + - BUILD_tools -> EXPAT_BUILD_TOOLS + - DOCBOOK_TO_MAN -> DOCBOOK_TO_MAN (unchanged) + - INSTALL -> EXPAT_ENABLE_INSTALL + - MSVC_USE_STATIC_CRT -> EXPAT_MSVC_STATIC_CRT + - USE_libbsd -> EXPAT_WITH_LIBBSD + - WARNINGS_AS_ERRORS -> EXPAT_WARNINGS_AS_ERRORS + - XML_CONTEXT_BYTES -> EXPAT_CONTEXT_BYTES + - XML_DEV_URANDOM -> EXPAT_DEV_URANDOM + - XML_DTD -> EXPAT_DTD + - XML_NS -> EXPAT_NS + - XML_UNICODE -> EXPAT_CHAR_TYPE=ushort (!) + - XML_UNICODE_WCHAR_T -> EXPAT_CHAR_TYPE=wchar_t (!) + #244 #264 CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF), + default OFF + #326 CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF), + default OFF + #328 CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF), + default OFF + #239 #277 CMake: Add arguments + -DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO + -DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO + #326 CMake: Install expat_config.h to include directory + #326 CMake: Generate and install configuration files for + future find_package(expat [..] CONFIG [..]) + CMake: Now produces a summary of applied configuration + CMake: Require C++ compiler only when tests are enabled + #330 CMake: Fix compilation for 16bit character types, + i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON) + #265 CMake: Fix linking with MinGW + #330 CMake: Add full support for MinGW; to enable, use + -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake + #330 CMake: Port "make run-xmltest" from GNU Autotools to CMake + #316 CMake: Windows: Make binary postfix match MSVC + Old: expat[d].lib + New: expat[w][d][MD|MT].lib + CMake: Migrate files from Windows to Unix line endings + #308 CMake: Integrate OSS-Fuzz fuzzers, option + -DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF + #14 Drop an OpenVMS support leftover + #235 #268 .. + #270 #310 .. + #313 #331 #333 Address compiler warnings + #282 #283 .. + #284 #285 Address cppcheck warnings + #294 #295 Address Clang Static Analyzer warnings + #24 #293 Mass-apply clang-format 9 (and ensure conformance during CI) + Version info bumped from 7:9:6 to 7:10:6 + + Special thanks to: + David Loffredo + Joonun Jang + Khajapasha Mohammed + Kishore Kunche + Marco Maggi + Mitch Phillips + Rolf Ade + xantares + Zhongyuan Zhou + +Release 2.2.7 Wed June 19 2019 + Security fixes: + #186 #262 CVE-2018-20843 -- Fix extraction of namespace prefixes from + XML names; XML names with multiple colons could end up in + the wrong namespace, and take a high amount of RAM and CPU + resources while processing, opening the door to + use for denial-of-service attacks + + Other changes: + #195 #197 Autotools/CMake: Utilize -fvisibility=hidden to stop + exporting non-API symbols + #227 Autotools: Add --without-examples and --without-tests + #228 Autotools: Modernize configure.ac + #245 #246 Autotools: Fix check for -fvisibility=hidden for Clang + #247 #248 Autotools: Fix compilation for lack of docbook2x-man + #236 #258 Autotools: Produce .tar.{gz,lz,xz} release archives + #212 CMake: Make libdir of pkgconfig expat.pc support multilib + #158 #263 CMake: Build man page in PROJECT_BINARY_DIR not _SOURCE_DIR + #219 Remove fallback to bcopy, assume that memmove(3) exists + #257 Use portable "/usr/bin/env bash" shebang (e.g. for OpenBSD) + #243 Windows: Fix syntax of .def module definition files + Version info bumped from 7:8:6 to 7:9:6 + + Special thanks to: + Benjamin Peterson + Caolán McNamara + Hanno Böck + KangLin + Kishore Kunche + Marco Maggi + Rhodri James + Sebastian Dröge + userwithuid + Yury Gribov + Release 2.2.6 Sun August 12 2018 Bug fixes: #170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer Modified: head/contrib/expat/FREEBSD-Xlist ============================================================================== --- head/contrib/expat/FREEBSD-Xlist Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/FREEBSD-Xlist Mon Nov 25 07:48:16 2019 (r355085) @@ -8,6 +8,7 @@ *.pc.in *.vcxproj* *config.h +cmake CMake* Configure* amiga Modified: head/contrib/expat/Makefile.am ============================================================================== --- head/contrib/expat/Makefile.am Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/Makefile.am Mon Nov 25 07:48:16 2019 (r355085) @@ -30,14 +30,21 @@ AUTOMAKE_OPTIONS = \ dist-bzip2 \ + dist-lzip \ + dist-xz \ foreign \ - no-dist-gzip \ subdir-objects ACLOCAL_AMFLAGS = -I m4 LIBTOOLFLAGS = --verbose -SUBDIRS = lib examples tests # lib goes first to build first +SUBDIRS = lib # lib goes first to build first +if WITH_EXAMPLES +SUBDIRS += examples +endif +if WITH_TESTS +SUBDIRS += tests +endif if WITH_XMLWF SUBDIRS += xmlwf doc endif @@ -47,41 +54,19 @@ pkgconfigdir = $(libdir)/pkgconfig _EXTRA_DIST_CMAKE = \ + cmake/expat-config.cmake.in \ + cmake/mingw-toolchain.cmake \ + \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ - examples/elements.vcxproj \ - examples/elements.vcxproj.filters \ - examples/outline.vcxproj \ - examples/outline.vcxproj.filters \ - \ - lib/expat_static.vcxproj \ - lib/expat_static.vcxproj.filters \ - lib/expat.vcxproj \ - lib/expat.vcxproj.filters \ - lib/expatw_static.vcxproj \ - lib/expatw_static.vcxproj.filters \ - lib/expatw.vcxproj \ - lib/expatw.vcxproj.filters \ - \ - tests/benchmark/benchmark.sln \ - tests/benchmark/benchmark.vcxproj \ - \ - tests/runtests.sln \ - tests/runtests.vcxproj \ - tests/runtests.vcxproj.filters \ - \ + win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt \ - \ - xmlwf/xmlwf.vcxproj \ - xmlwf/xmlwf.vcxproj.filters \ - \ - expat.sln + win32/README.txt EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -91,8 +76,13 @@ EXTRA_DIST = \ conftools/get-version.sh \ conftools/PrintPath \ \ + xmlwf/xmlwf_helpgen.py \ + xmlwf/xmlwf_helpgen.sh \ + \ Changes \ README.md \ + \ + fix-xmltest-log.sh \ test-driver-wrapper.sh @@ -121,7 +111,8 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 -tests/xmlts.zip: +.PHONY: download-xmlts-zip +download-xmlts-zip: if test "$(XMLTS_ZIP)" = ""; then \ wget --output-document=tests/xmlts.zip \ https://www.w3.org/XML/Test/xmlts20080827.zip; \ @@ -129,16 +120,26 @@ tests/xmlts.zip: cp $(XMLTS_ZIP) tests/xmlts.zip; \ fi -tests/xmlconf: tests/xmlts.zip +tests/xmlts.zip: + $(MAKE) download-xmlts-zip + +.PHONY: extract-xmlts-zip +extract-xmlts-zip: tests/xmlts.zip + [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround cd tests && unzip -q xmlts.zip +tests/xmlconf: tests/xmlts.zip + $(MAKE) extract-xmlts-zip + .PHONY: run-xmltest run-xmltest: tests/xmlconf if WITH_XMLWF + [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround + $(MAKE) -C lib $(MAKE) -C xmlwf - tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log - dos2unix tests/xmltest.log - diff -u tests/xmltest.log.expected tests/xmltest.log + $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log + $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log + diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log else @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2 @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2 @@ -147,7 +148,7 @@ endif .PHONY: qa qa: - ./qa.sh address - ./qa.sh memory - ./qa.sh undefined - ./qa.sh coverage + QA_COMPILER=clang QA_SANITIZER=address ./qa.sh + QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh + QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh + QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh Modified: head/contrib/expat/Makefile.in ============================================================================== --- head/contrib/expat/Makefile.in Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/Makefile.in Mon Nov 25 07:48:16 2019 (r355085) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,13 +118,22 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@WITH_XMLWF_TRUE@am__append_1 = xmlwf doc +@WITH_EXAMPLES_TRUE@am__append_1 = examples +@WITH_TESTS_TRUE@am__append_2 = tests +@WITH_XMLWF_TRUE@am__append_3 = xmlwf doc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/conftools/ac_c_bigendian_cross.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/conftools/ax-require-defined.m4 \ + $(top_srcdir)/conftools/ax-check-compile-flag.m4 \ + $(top_srcdir)/conftools/ax-check-link-flag.m4 \ + $(top_srcdir)/conftools/ax-append-flag.m4 \ + $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ + $(top_srcdir)/conftools/ax-append-link-flags.m4 \ + $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -199,7 +208,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)expat_config.h.in # Read a list of newline-separated strings from the standard input, @@ -224,14 +233,15 @@ CSCOPE = cscope DIST_SUBDIRS = lib examples tests xmlwf doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ - $(top_srcdir)/conftools/compile \ + $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ $(top_srcdir)/conftools/config.guess \ $(top_srcdir)/conftools/config.sub \ $(top_srcdir)/conftools/install-sh \ $(top_srcdir)/conftools/ltmain.sh \ $(top_srcdir)/conftools/missing AUTHORS COPYING \ - conftools/compile conftools/config.guess conftools/config.sub \ - conftools/install-sh conftools/ltmain.sh conftools/missing + conftools/ar-lib conftools/compile conftools/config.guess \ + conftools/config.sub conftools/depcomp conftools/install-sh \ + conftools/ltmain.sh conftools/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -267,9 +277,10 @@ am__relativize = \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \ + $(distdir).tar.xz GZIP_ENV = --best -DIST_ARCHIVES = $(distdir).tar.bz2 -DIST_TARGETS = dist-bzip2 +DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -402,51 +413,30 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = \ dist-bzip2 \ + dist-lzip \ + dist-xz \ foreign \ - no-dist-gzip \ subdir-objects ACLOCAL_AMFLAGS = -I m4 LIBTOOLFLAGS = --verbose -SUBDIRS = lib examples tests $(am__append_1) +SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3) pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig _EXTRA_DIST_CMAKE = \ + cmake/expat-config.cmake.in \ + cmake/mingw-toolchain.cmake \ + \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ - examples/elements.vcxproj \ - examples/elements.vcxproj.filters \ - examples/outline.vcxproj \ - examples/outline.vcxproj.filters \ - \ - lib/expat_static.vcxproj \ - lib/expat_static.vcxproj.filters \ - lib/expat.vcxproj \ - lib/expat.vcxproj.filters \ - lib/expatw_static.vcxproj \ - lib/expatw_static.vcxproj.filters \ - lib/expatw.vcxproj \ - lib/expatw.vcxproj.filters \ - \ - tests/benchmark/benchmark.sln \ - tests/benchmark/benchmark.vcxproj \ - \ - tests/runtests.sln \ - tests/runtests.vcxproj \ - tests/runtests.vcxproj.filters \ - \ + win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt \ - \ - xmlwf/xmlwf.vcxproj \ - xmlwf/xmlwf.vcxproj.filters \ - \ - expat.sln + win32/README.txt EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -456,8 +446,13 @@ EXTRA_DIST = \ conftools/get-version.sh \ conftools/PrintPath \ \ + xmlwf/xmlwf_helpgen.py \ + xmlwf/xmlwf_helpgen.sh \ + \ Changes \ README.md \ + \ + fix-xmltest-log.sh \ test-driver-wrapper.sh all: expat_config.h @@ -485,8 +480,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -653,7 +648,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -723,11 +721,9 @@ dist-gzip: distdir dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) - dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) @@ -994,7 +990,8 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 -tests/xmlts.zip: +.PHONY: download-xmlts-zip +download-xmlts-zip: if test "$(XMLTS_ZIP)" = ""; then \ wget --output-document=tests/xmlts.zip \ https://www.w3.org/XML/Test/xmlts20080827.zip; \ @@ -1002,25 +999,35 @@ tests/xmlts.zip: cp $(XMLTS_ZIP) tests/xmlts.zip; \ fi -tests/xmlconf: tests/xmlts.zip +tests/xmlts.zip: + $(MAKE) download-xmlts-zip + +.PHONY: extract-xmlts-zip +extract-xmlts-zip: tests/xmlts.zip + [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround cd tests && unzip -q xmlts.zip +tests/xmlconf: tests/xmlts.zip + $(MAKE) extract-xmlts-zip + .PHONY: run-xmltest run-xmltest: tests/xmlconf +@WITH_XMLWF_TRUE@ [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround +@WITH_XMLWF_TRUE@ $(MAKE) -C lib @WITH_XMLWF_TRUE@ $(MAKE) -C xmlwf -@WITH_XMLWF_TRUE@ tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log -@WITH_XMLWF_TRUE@ dos2unix tests/xmltest.log -@WITH_XMLWF_TRUE@ diff -u tests/xmltest.log.expected tests/xmltest.log +@WITH_XMLWF_TRUE@ $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log +@WITH_XMLWF_TRUE@ $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log +@WITH_XMLWF_TRUE@ diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log @WITH_XMLWF_FALSE@ @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2 @WITH_XMLWF_FALSE@ @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2 @WITH_XMLWF_FALSE@ @false .PHONY: qa qa: - ./qa.sh address - ./qa.sh memory - ./qa.sh undefined - ./qa.sh coverage + QA_COMPILER=clang QA_SANITIZER=address ./qa.sh + QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh + QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh + QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: head/contrib/expat/README.md ============================================================================== --- head/contrib/expat/README.md Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/README.md Mon Nov 25 07:48:16 2019 (r355085) @@ -1,8 +1,9 @@ [![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) +[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) -# Expat, Release 2.2.6 +# Expat, Release 2.2.9 This is Expat, a C library for parsing XML, started by [James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. @@ -12,6 +13,11 @@ are called when the parser discovers the associated st document being parsed. A start tag is an example of the kind of structures for which you may register handlers. +Expat supports the following compilers: +- GNU GCC >=4.5 +- LLVM Clang >=3.5 +- Microsoft Visual Studio >=8.0/2005 + Windows users should use the [`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), which includes both precompiled libraries and executables, and source code for @@ -124,3 +130,59 @@ information. A reference manual is available in the file `doc/reference.html` in this distribution. + + +The CMake build system is still *experimental* and will replace the primary +build system based on GNU Autotools at some point when it is ready. +For an idea of the available (non-advanced) options for building with CMake: + +```console +# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,' +// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +// Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +// Path to a program. +DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man + +// build man page for xmlwf +EXPAT_BUILD_DOCS:BOOL=ON + +// build the examples for expat library +EXPAT_BUILD_EXAMPLES:BOOL=ON + +// build fuzzers for the expat library +EXPAT_BUILD_FUZZERS:BOOL=OFF + +// build the tests for expat library +EXPAT_BUILD_TESTS:BOOL=ON + +// build the xmlwf tool for expat library +EXPAT_BUILD_TOOLS:BOOL=ON + +// Character type to use (char|ushort|wchar_t) [default=char] +EXPAT_CHAR_TYPE:STRING=char + +// install expat files in cmake install target +EXPAT_ENABLE_INSTALL:BOOL=ON + +// Use /MT flag (static CRT) when compiling in MSVC +EXPAT_MSVC_STATIC_CRT:BOOL=OFF + +// build a shared expat library +EXPAT_SHARED_LIBS:BOOL=ON + +// Treat all compiler warnings as errors +EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF + +// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO] +EXPAT_WITH_GETRANDOM:STRING=AUTO + +// utilize libbsd (for arc4random_buf) +EXPAT_WITH_LIBBSD:BOOL=OFF + +// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO] +EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO +``` Modified: head/contrib/expat/configure.ac ============================================================================== --- head/contrib/expat/configure.ac Mon Nov 25 07:38:31 2019 (r355084) +++ head/contrib/expat/configure.ac Mon Nov 25 07:48:16 2019 (r355085) @@ -10,8 +10,8 @@ dnl under the terms of the License (based on the MIT dnl in the file COPYING that comes with this distribution. dnl -dnl Ensure that Expat is configured with autoconf 2.58 or newer -AC_PREREQ(2.58) +dnl Ensure that Expat is configured with autoconf 2.69 or newer. +AC_PREREQ(2.69) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 @@ -23,16 +23,18 @@ dnl dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate dnl test. I believe this test will work, but I don't have a place with non- dnl GNU M4 to test it right now. -define([expat_version], ifdef([__gnu__], - [esyscmd(conftools/get-version.sh lib/expat.h)], - [2.2.x])) +m4_define([expat_version], + m4_ifdef([__gnu__], + [esyscmd(conftools/get-version.sh lib/expat.h)], + [2.2.x])) AC_INIT(expat, expat_version, expat-bugs@libexpat.org) -undefine([expat_version]) +m4_undefine([expat_version]) -AC_CONFIG_SRCDIR(Makefile.in) -AC_CONFIG_AUX_DIR(conftools) -AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR([Makefile.in]) +AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE dnl @@ -42,165 +44,211 @@ dnl If the API has changed, increment LIBCURRENT and s dnl dnl If the API changes compatibly (i.e. simply adding a new function dnl without changing or removing earlier interfaces), then increment LIBAGE. -dnl +dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=7 # sync -LIBREVISION=8 # with -LIBAGE=6 # CMakeLists.txt! +LIBCURRENT=7 # sync +LIBREVISION=11 # with +LIBAGE=6 # CMakeLists.txt! -CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H" -AC_CONFIG_HEADER(expat_config.h) +AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [CPPFLAGS]) +AC_CONFIG_HEADER([expat_config.h]) -sinclude(conftools/ac_c_bigendian_cross.m4) +AM_PROG_AR +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) AC_SUBST(LIBCURRENT) AC_SUBST(LIBREVISION) AC_SUBST(LIBAGE) -dnl Checks for programs. +AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "$GCC" = yes], + [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CFLAGS]) + dnl Be careful about adding the -fexceptions option; some versions of + dnl GCC don't support it and it causes extra warnings that are only + dnl distracting; avoid. + AX_APPEND_COMPILE_FLAGS([-fexceptions], [CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [CFLAGS])]) + +AC_LANG_PUSH([C++]) AC_PROG_CXX -AC_PROG_INSTALL +AS_IF([test "$GCC" = yes], + [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CXXFLAGS]) + dnl Be careful about adding the -fexceptions option; some versions of + dnl GCC don't support it and it causes extra warnings that are only + dnl distracting; avoid. + AX_APPEND_COMPILE_FLAGS([-fexceptions], [CXXFLAGS]) + AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [CXXFLAGS])]) +AC_LANG_POP([C++]) -if test "$GCC" = yes ; then - dnl - dnl Be careful about adding the -fexceptions option; some versions of - dnl GCC don't support it and it causes extra warnings that are only - dnl distracting; avoid. - dnl - OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" - CFLAGS="$OLDCFLAGS -fexceptions" - AC_MSG_CHECKING(whether $CC accepts -fexceptions) - AC_TRY_LINK( , , - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") - if test "x$CXXFLAGS" = x ; then - CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'` - fi +AS_IF([test "$GCC" = yes], + [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[LDFLAGS])]) - CFLAGS="${CFLAGS} -fno-strict-aliasing" - CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" - LDFLAGS="${LDFLAGS} -fno-strict-aliasing" -fi +dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312) +AS_CASE(["$LD"],[*clang*], + [AS_CASE(["${host_os}"], + [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) +EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ + AX_APPEND_FLAG([-fvisibility=hidden], [CFLAGS]) + AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [CFLAGS])]) + dnl Checks for header files. AC_HEADER_STDC dnl Checks for typedefs, structures, and compiler characteristics. -dnl Note: Avoid using AC_C_BIGENDIAN because it does not -dnl work in a cross compile. -AC_C_BIGENDIAN_CROSS +dnl We define BYTEORDER to 1234 when the platform is little endian; it +dnl defines it to 4321 when the platform is big endian. We also define +dnl WORDS_BIGENDIAN to 1 when the platform is big endian. +dnl +dnl A long time ago (early 2000 years) AC_C_BIGENDIAN was considered +dnl wrong when cross compiling, now (2018, GNU Autoconf 2.69) we assume +dnl it is fine. +AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) + AS_VAR_SET([BYTEORDER], 4321)], + [AS_VAR_SET([BYTEORDER], 1234)]) +AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST AC_TYPE_SIZE_T -AC_CHECK_FUNCS(memmove bcopy) - -AC_ARG_WITH([xmlwf], [ -AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [with_xmlwf=yes]) +AC_ARG_WITH([xmlwf], + [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], + [], + [with_xmlwf=yes]) AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes]) -AM_CONDITIONAL([MINGW], [echo -- "${host}" | ${FGREP} mingw >/dev/null]) +AC_ARG_WITH([examples], + [AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])], + [], + [with_examples=yes]) +AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes]) + +AC_ARG_WITH([tests], + [AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])], + [], + [with_tests=yes]) +AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) + + +AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) +AS_CASE("${host_os}", + [mingw*], + [AS_VAR_SET([EXPATCFG_ON_MINGW],[yes]) + AC_MSG_NOTICE([detected OS: MinGW])]) +AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes]) + AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null]) -AC_ARG_WITH([libbsd], [ -AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)]) -], [], [with_libbsd=no]) -AS_IF([test "x${with_libbsd}" != xno], [ - AC_CHECK_LIB([bsd], [arc4random_buf], [], [ - AS_IF([test "x${with_libbsd}" = xyes], [ - AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.]) - ]) - ]) -]) +AC_ARG_WITH([libbsd], + [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])], + [], + [with_libbsd=no]) +AS_IF([test "x${with_libbsd}" != xno], + [AC_CHECK_LIB([bsd], + [arc4random_buf], + [], + [AS_IF([test "x${with_libbsd}" = xyes], + [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ - #if defined(HAVE_LIBBSD) - # include - #endif - int main() { - arc4random_buf(NULL, 0U); - return 0; - } -])], [ - AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], - [Define to 1 if you have the `arc4random_buf' function.]) - AC_MSG_RESULT([yes]) -], [ - AC_MSG_RESULT([no]) + #include /* for arc4random_buf on BSD, for NULL */ + #if defined(HAVE_LIBBSD) + # include + #endif + int main() { + arc4random_buf(NULL, 0U); + return 0; + } + ])], + [AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - #if defined(HAVE_LIBBSD) - # include - #else - # include - #endif - int main() { + AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #if defined(HAVE_LIBBSD) + # include + #else + # include + #endif + int main() { arc4random(); return 0; - } - ])], [ - AC_DEFINE([HAVE_ARC4RANDOM], [1], - [Define to 1 if you have the `arc4random' function.]) - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no]) - ]) -]) + } + ])], + [AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])])]) +AC_ARG_WITH([getrandom], + [AS_HELP_STRING([--with-getrandom], + [enforce the use of getrandom function in the system @<:@default=check@:>@]) +AS_HELP_STRING([--without-getrandom], + [skip auto detect of getrandom @<:@default=check@:>@])], + [], + [with_getrandom=check]) -AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)]) -AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for NULL */ - #include - int main() { - return getrandom(NULL, 0U, 0U); - } -])], [ - AC_DEFINE([HAVE_GETRANDOM], [1], - [Define to 1 if you have the `getrandom' function.]) - AC_MSG_RESULT([yes]) -], [ - AC_MSG_RESULT([no]) +AS_IF([test "x$with_getrandom" != xno], + [AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include /* for NULL */ + #include + int main() { + return getrandom(NULL, 0U, 0U); + } + ])], + [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AS_IF([test "x$with_getrandom" = xyes], + [AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])]) - AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for NULL */ - #include /* for syscall */ - #include /* for SYS_getrandom */ - int main() { - syscall(SYS_getrandom, NULL, 0, 0); - return 0; - } - ])], [ - AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], - [Define to 1 if you have `syscall' and `SYS_getrandom'.]) - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no]) - ]) -]) +AC_ARG_WITH([sys_getrandom], + [AS_HELP_STRING([--with-sys-getrandom], + [enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@]) +AS_HELP_STRING([--without-sys-getrandom], + [skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])], + [], + [with_sys_getrandom=check]) +AS_IF([test "x$with_sys_getrandom" != xno], + [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include /* for NULL */ + #include /* for syscall */ + #include /* for SYS_getrandom */ + int main() { + syscall(SYS_getrandom, NULL, 0, 0); + return 0; + } + ])], + [AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AS_IF([test "x$with_sys_getrandom" = xyes], + [AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])]) dnl Only needed for xmlwf: AC_CHECK_HEADERS(fcntl.h unistd.h) AC_TYPE_OFF_T AC_FUNC_MMAP -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then - FILEMAP=unixfilemap -else - FILEMAP=readfilemap -fi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 25 14:16:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F05FF1ADD5B; Mon, 25 Nov 2019 14:16:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47M8Gx62XXz4Ss8; Mon, 25 Nov 2019 14:16:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEA36DE81; Mon, 25 Nov 2019 14:16:41 +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 xAPEGfSX086958; Mon, 25 Nov 2019 14:16:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPEGfep086957; Mon, 25 Nov 2019 14:16:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911251416.xAPEGfep086957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Nov 2019 14:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355088 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 355088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 14:16:42 -0000 Author: kib Date: Mon Nov 25 14:16:41 2019 New Revision: 355088 URL: https://svnweb.freebsd.org/changeset/base/355088 Log: Limit bus_dma_dmar_set_buswide() definition to kernel only. The header is abused for inclusion into userspace, and on stable branches neither device_t nor bool types are not defined when used from userspace. Sponsored by: The FreeBSD Foundation X-MFC after: now Modified: head/sys/x86/include/bus_dma.h Modified: head/sys/x86/include/bus_dma.h ============================================================================== --- head/sys/x86/include/bus_dma.h Mon Nov 25 09:53:49 2019 (r355087) +++ head/sys/x86/include/bus_dma.h Mon Nov 25 14:16:41 2019 (r355088) @@ -191,7 +191,9 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); } +#ifdef _KERNEL bool bus_dma_dmar_set_buswide(device_t dev); +#endif #endif /* !_X86_BUS_DMA_H_ */ From owner-svn-src-head@freebsd.org Mon Nov 25 16:30:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E4811B1AAD; Mon, 25 Nov 2019 16:30:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MCFW1rYnz4byB; Mon, 25 Nov 2019 16:30:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23451F663; Mon, 25 Nov 2019 16:30:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPGUdWV066463; Mon, 25 Nov 2019 16:30:39 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPGUckv066461; Mon, 25 Nov 2019 16:30:38 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201911251630.xAPGUckv066461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 25 Nov 2019 16:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355093 - in head/sys: conf powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: conf powerpc/pseries X-SVN-Commit-Revision: 355093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 16:30:39 -0000 Author: luporl Date: Mon Nov 25 16:30:38 2019 New Revision: 355093 URL: https://svnweb.freebsd.org/changeset/base/355093 Log: [PPC64] Enable phyp vty use as a GDB DBGPORT This change makes it possible to use a POWER Hypervisor virtual terminal device (phyp vty) as a GDB debug port. Similar to the uart debug port, it has to be enabled by setting the hw.uart_phyp.dbgport variable to the vty node of the device tree. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22205 Added: head/sys/powerpc/pseries/phyp_dbg.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Nov 25 15:51:05 2019 (r355092) +++ head/sys/conf/files.powerpc Mon Nov 25 16:30:38 2019 (r355093) @@ -262,6 +262,7 @@ powerpc/ps3/ps3-hvcall.S optional ps3 powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 powerpc/pseries/phyp_console.c optional pseries powerpc64 uart +powerpc/pseries/phyp_dbg.c optional pseries powerpc64 gdb powerpc/pseries/phyp_llan.c optional llan powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus powerpc/pseries/platform_chrp.c optional pseries Added: head/sys/powerpc/pseries/phyp_dbg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/pseries/phyp_dbg.c Mon Nov 25 16:30:38 2019 (r355093) @@ -0,0 +1,163 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Leandro Lupori + * + * 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 ``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 TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +#include "phyp-hvcall.h" + +static gdb_probe_f uart_phyp_dbg_probe; +static gdb_init_f uart_phyp_dbg_init; +static gdb_term_f uart_phyp_dbg_term; +static gdb_getc_f uart_phyp_dbg_getc; +static gdb_putc_f uart_phyp_dbg_putc; + +GDB_DBGPORT(uart_phyp, uart_phyp_dbg_probe, + uart_phyp_dbg_init, uart_phyp_dbg_term, + uart_phyp_dbg_getc, uart_phyp_dbg_putc); + +static struct uart_phyp_dbgport { + cell_t vtermid; + union { + uint64_t u64[2]; + char str[16]; + } inbuf; + uint64_t inbuflen; +} dbgport; + +static int +uart_phyp_dbg_probe(void) +{ + char buf[64]; + cell_t reg; + phandle_t vty; + + if (!getenv_string("hw.uart_phyp.dbgport", buf, sizeof(buf))) + return (-1); + + if ((vty = OF_finddevice(buf)) == -1) + return (-1); + + if (OF_getprop(vty, "name", buf, sizeof(buf)) <= 0) + return (-1); + if (strcmp(buf, "vty") != 0) + return (-1); + + if (OF_getprop(vty, "device_type", buf, sizeof(buf)) == -1) + return (-1); + if (strcmp(buf, "serial") != 0) + return (-1); + + if (OF_getprop(vty, "compatible", buf, sizeof(buf)) <= 0) + return (-1); + if (strcmp(buf, "hvterm1") != 0) + return (-1); + + reg = ~0U; + OF_getencprop(vty, "reg", ®, sizeof(reg)); + if (reg == ~0U) + return (-1); + + dbgport.vtermid = reg; + dbgport.inbuflen = 0; + + return (0); +} + +static void +uart_phyp_dbg_init(void) +{ +} + +static void +uart_phyp_dbg_term(void) +{ +} + +static int +uart_phyp_dbg_getc(void) +{ + int c, err, next; + + if (dbgport.inbuflen == 0) { + err = phyp_pft_hcall(H_GET_TERM_CHAR, dbgport.vtermid, + 0, 0, 0, &dbgport.inbuflen, &dbgport.inbuf.u64[0], + &dbgport.inbuf.u64[1]); + if (err != H_SUCCESS) + return (-1); + } + + if (dbgport.inbuflen == 0) + return (-1); + + c = dbgport.inbuf.str[0]; + dbgport.inbuflen--; + + if (dbgport.inbuflen == 0) + return (c); + + /* + * Since version 2.11.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * Filter it here. + */ + next = 1; + if (c == '\r' && dbgport.inbuf.str[next] == '\0') { + next++; + dbgport.inbuflen--; + } + + if (dbgport.inbuflen > 0) + memmove(&dbgport.inbuf.str[0], &dbgport.inbuf.str[next], + dbgport.inbuflen); + + return (c); +} + +static void +uart_phyp_dbg_putc(int c) +{ + int err; + + union { + uint64_t u64; + unsigned char bytes[8]; + } cbuf; + + cbuf.bytes[0] = (unsigned char)c; + + do { + err = phyp_hcall(H_PUT_TERM_CHAR, dbgport.vtermid, 1, + cbuf.u64, 0); + DELAY(100); + } while (err == H_BUSY); +} + From owner-svn-src-head@freebsd.org Mon Nov 25 17:57:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E6901B4495; Mon, 25 Nov 2019 17:57:22 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [IPv6:2a01:4f8:10a:3543::25:11]) by mx1.freebsd.org (Postfix) with ESMTP id 47MF9Y5gzXz3DGK; Mon, 25 Nov 2019 17:57:21 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail.smeets.xyz [IPv6:2a01:4f8:10a:3543::25:3]) by mail-out.smeets.xyz (Postfix) with ESMTP id 770341884E; Mon, 25 Nov 2019 18:57:14 +0100 (CET) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:10a:3543::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id D8C25B05AF; Mon, 25 Nov 2019 17:57:14 +0100 (CET) X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:10a:3543::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:10a:3543::aa:4]) (amavisd-new, port 10025) with ESMTP id 2pfbXDKTw8hF; Mon, 25 Nov 2019 17:57:14 +0100 (CET) Received: from nibbler.fritz.box (unknown [IPv6:2a02:8109:240:2b8:6484:a746:8ee6:f7e4]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id 59FB5B05A4; Mon, 25 Nov 2019 17:57:14 +0100 (CET) Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Jan Sucan , Alan Somers , "Conrad E. Meyer" Cc: svn-src-head , Hiroki Sato , svn-src-all , src-committers References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> From: Florian Smeets Message-ID: <8259e67b-2f02-c02e-8aae-cbc8da896559@smeets.xyz> Date: Mon, 25 Nov 2019 18:57:13 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Thunderbird/72.0a1 MIME-Version: 1.0 In-Reply-To: <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47MF9Y5gzXz3DGK X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.48 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-0.78)[ipnet: 2a01:4f8::/29(-2.33), asn: 24940(-1.57), country: DE(-0.01)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[smeets.xyz,reject]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 17:57:22 -0000 On 26.08.19 06:28, Jan Sucan wrote: > Hello, > > I can implement it. I suppose that ping6's manual page should be kept it > this case. > > I was also thinking about printing a warning for each option renamed to > lead a willing user to use the new unified option set of ping. It could > be either only with -v, or by default and suppressed with -q. Or should > the option translation be completely transparent? Is there an update on this? I found out the hard way today, as I updated my icinga2 host from an revision before this change to a current revision. In this case it's not as easy as fixing a script e.g. net-mgmt/monitoring-plugins check_ping command calls /sbin/ping6 with -X. Will we get a ping6 that is fully backward compatible, or should we start fixing ports? Thanks, Florian > > -Jan > > On 26. 8. 2019 1:58, Alan Somers wrote: >> Jan (please keep him CCed on replies) has been musing about the same >> thing.  That might satisfy everyone.  Jan, would it be straightforward >> to implement? >> -Alan >> >> On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: >>> Hi Alan, Hiroki, >>> >>> It would be pretty easy to install a `ping6` link to the `ping(8)` >>> binary with different option parsing (conditional on argv[0]).  That >>> removes most of the issues of code and space duplication, I think? >>> And the goal would be for the 'ping6' name to retain option >>> compatibility with historical ping6. >>> >>> It's not an uncommon pattern; for example, 'id', 'groups', and >>> 'whoami' are all a single binary with multiple linked names.  Another >>> example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', >>> 'clang++' and 'cpp' links to the same inode — and those have very >>> different behavior depending on argv[0]. >>> >>> It's less work than forcing the ping6 compatibility crowd to create a >>> port and doesn't hurt ping(8) much, AFAICT.  Is it an acceptable >>> middle ground? >>> >>> Best, >>> Conrad >>> From owner-svn-src-head@freebsd.org Mon Nov 25 18:11:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 544C81B4DD8; Mon, 25 Nov 2019 18:11:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MFTK01tPz3FFF; Mon, 25 Nov 2019 18:11:00 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f67.google.com with SMTP id c19so13427840otr.11; Mon, 25 Nov 2019 10:11:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XzfCEMhEKbFZguW08j10N7V++/6Yk/Jk+FZQC2LlZDM=; b=EfrowZZ/hbm1JHg4tfpXpqi6Ekh0xS2VTZWLf7lIA4AmL9UnKh3rOM8l+Izq9JipIW Hqi19rH7cM67h2ms9LBuhockdw/DOmo03XB59ccSxFskAy8TJ8wK3d6HCIHKS5lOJ9Tn XcErpNsqbm57kPEQZcL8HH3ZQR42mC+onNPmvh+oLuQTcM8h4hhc8EvfuEmaRK1NB7Ny 8uym0ZT23IRpUad9h0VrB3vfYbYFsUev79l87HzFL82oEjh+CeQXWF+IMui00oFqmV8K UgdJ/aZ8lSMlPW9WB0G6TNwy2zguW3ekGkfOeGSd2//yuyKBJMEIBb0blZa5cIwXqAa+ L40g== X-Gm-Message-State: APjAAAUNYRDBKaLUaHVOzrxp/Tnc/EF65Q3JTqBxeR8UE74kpdDzwBC8 B3CKwqrx74Lt7H82HxcHkYPDhYv3fGaJhWXC0g4= X-Google-Smtp-Source: APXvYqx0OxkcwIqIP82lxHndRIkz6gF/rZw2N4dxyTxqJutIO2FomAkySiWcl0idNKwLtxIMzSE4Cx0F+DphAwXi0zo= X-Received: by 2002:a9d:604d:: with SMTP id v13mr21386633otj.222.1574705459688; Mon, 25 Nov 2019 10:10:59 -0800 (PST) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> <8259e67b-2f02-c02e-8aae-cbc8da896559@smeets.xyz> In-Reply-To: <8259e67b-2f02-c02e-8aae-cbc8da896559@smeets.xyz> From: Alan Somers Date: Mon, 25 Nov 2019 11:10:49 -0700 Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Florian Smeets Cc: Jan Sucan , "Conrad E. Meyer" , svn-src-head , Hiroki Sato , svn-src-all , src-committers X-Rspamd-Queue-Id: 47MFTK01tPz3FFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.67 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[67.210.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[67.210.85.209.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.17), asn: 15169(-1.96), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_CC(0.00)[gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 18:11:02 -0000 On Mon, Nov 25, 2019 at 10:57 AM Florian Smeets wrote: > On 26.08.19 06:28, Jan Sucan wrote: > > Hello, > > > > I can implement it. I suppose that ping6's manual page should be kept it > > this case. > > > > I was also thinking about printing a warning for each option renamed to > > lead a willing user to use the new unified option set of ping. It could > > be either only with -v, or by default and suppressed with -q. Or should > > the option translation be completely transparent? > > Is there an update on this? I found out the hard way today, as I updated > my icinga2 host from an revision before this change to a current > revision. In this case it's not as easy as fixing a script e.g. > net-mgmt/monitoring-plugins check_ping command calls /sbin/ping6 with -X. > > Will we get a ping6 that is fully backward compatible, or should we > start fixing ports? > > Thanks, > Florian > Still a work in progress, though there hasn't been any progress lately. https://reviews.freebsd.org/D21434 From owner-svn-src-head@freebsd.org Mon Nov 25 18:18:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D1841B51A5; Mon, 25 Nov 2019 18:18:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MFdx3WZgz3Fws; Mon, 25 Nov 2019 18:18:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C28C18A57; Mon, 25 Nov 2019 18:18:29 +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 xAPIITcJ029243; Mon, 25 Nov 2019 18:18:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPIITuX029242; Mon, 25 Nov 2019 18:18:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911251818.xAPIITuX029242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Nov 2019 18:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355095 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 18:18:29 -0000 Author: emaste Date: Mon Nov 25 18:18:28 2019 New Revision: 355095 URL: https://svnweb.freebsd.org/changeset/base/355095 Log: remove armv6 LLVM workaround introduced in r341812 r341812 enabled only arm target support in LLVM on arm and armv6, because ld.bfd 2.17.50 lacked support for range extensions required for linking such large binaries/libraries. r341812 indicated that the workaround should be removed once the userland can be linked by lld. r354289 switched armv6 to use lld by default, so remove the workaround on armv6. The workaround remains in place for arm (v5), and will presumably be removed when arm is retired. Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Nov 25 16:46:41 2019 (r355094) +++ head/share/mk/src.opts.mk Mon Nov 25 18:18:28 2019 (r355095) @@ -286,7 +286,7 @@ __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/spar __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG # Disable other targets for arm and armv6, to work around "relocation truncated # to fit" errors with BFD ld, since libllvm.a will get too large to link. -.elif ${__T} == "arm" || ${__T} == "armv6" +.elif ${__T} == "arm" __DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} # aarch64 needs arm for -m32 support. .elif ${__TT} == "arm64" && ${__llt} == "arm" From owner-svn-src-head@freebsd.org Mon Nov 25 18:27:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7C821B558F; Mon, 25 Nov 2019 18:27:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MFqp44Rkz3Gcs; Mon, 25 Nov 2019 18:27:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FAFF18C27; Mon, 25 Nov 2019 18:27:02 +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 xAPIR2Id034921; Mon, 25 Nov 2019 18:27:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPIR2hW034920; Mon, 25 Nov 2019 18:27:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911251827.xAPIR2hW034920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Nov 2019 18:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355096 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 18:27:02 -0000 Author: emaste Date: Mon Nov 25 18:27:02 2019 New Revision: 355096 URL: https://svnweb.freebsd.org/changeset/base/355096 Log: update comment (about llvm target config) to match r355095 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Nov 25 18:18:28 2019 (r355095) +++ head/share/mk/src.opts.mk Mon Nov 25 18:27:02 2019 (r355096) @@ -284,7 +284,7 @@ __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/spar # Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG -# Disable other targets for arm and armv6, to work around "relocation truncated +# Disable other targets for arm, to work around "relocation truncated # to fit" errors with BFD ld, since libllvm.a will get too large to link. .elif ${__T} == "arm" __DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} From owner-svn-src-head@freebsd.org Mon Nov 25 18:33:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0591A1B5AC5; Mon, 25 Nov 2019 18:33:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MFz66PfWz3HDT; Mon, 25 Nov 2019 18:33:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF2A518DEA; Mon, 25 Nov 2019 18:33:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPIXM5J040585; Mon, 25 Nov 2019 18:33:22 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPIXM9h040583; Mon, 25 Nov 2019 18:33:22 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201911251833.xAPIXM9h040583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 25 Nov 2019 18:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355097 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 355097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 18:33:23 -0000 Author: oshogbo Date: Mon Nov 25 18:33:21 2019 New Revision: 355097 URL: https://svnweb.freebsd.org/changeset/base/355097 Log: procdesc: allow to collect status through wait(1) if process is traced The debugger like truss(1) depends on the wait(2) syscall. This syscall waits for ALL children. When it is waiting for ALL child's the children created by process descriptors are not returned. This behavior was introduced because we want to implement libraries which may pdfork(1). The behavior of process descriptor brakes truss(1) because it will not be able to collect the status of processes with process descriptors. To address this problem the status is returned to parent when the child is traced. While the process is traced the debugger is the new parent. In case the original parent and debugger are the same process it means the debugger explicitly used pdfork() to create the child. In that case the debugger should be using kqueue()/pdwait() instead of wait(). Add test case to verify that. The test case was implemented by markj@. Reviewed by: kib, markj Discussed with: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20362 Modified: head/sys/kern/kern_exit.c head/sys/kern/sys_procdesc.c head/tests/sys/kern/ptrace_test.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Nov 25 18:27:02 2019 (r355096) +++ head/sys/kern/kern_exit.c Mon Nov 25 18:33:21 2019 (r355097) @@ -993,11 +993,14 @@ proc_to_reap(struct thread *td, struct proc *p, idtype switch (idtype) { case P_ALL: - if (p->p_procdesc != NULL) { - PROC_UNLOCK(p); - return (0); + if (p->p_procdesc == NULL || + (p->p_pptr == td->td_proc && + (p->p_flag & P_TRACED) != 0)) { + break; } - break; + + PROC_UNLOCK(p); + return (0); case P_PID: if (p->p_pid != (pid_t)id) { PROC_UNLOCK(p); Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Mon Nov 25 18:27:02 2019 (r355096) +++ head/sys/kern/sys_procdesc.c Mon Nov 25 18:33:21 2019 (r355097) @@ -60,7 +60,6 @@ * * Open questions: * - * - How to handle ptrace(2)? * - Will we want to add a pidtoprocdesc(2) system call to allow process * descriptors to be created for processes without pdfork(2)? */ Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Nov 25 18:27:02 2019 (r355096) +++ head/tests/sys/kern/ptrace_test.c Mon Nov 25 18:33:21 2019 (r355097) @@ -4135,6 +4135,105 @@ ATF_TC_BODY(ptrace__proc_reparent, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * Ensure that traced processes created with pdfork(2) are visible to + * waitid(P_ALL). + */ +ATF_TC_WITHOUT_HEAD(ptrace__procdesc_wait_child); +ATF_TC_BODY(ptrace__procdesc_wait_child, tc) +{ + pid_t child, wpid; + int pd, status; + + child = pdfork(&pd, 0); + ATF_REQUIRE(child >= 0); + + if (child == 0) { + trace_me(); + (void)raise(SIGSTOP); + exit(0); + } + + wpid = waitpid(child, &status, 0); + ATF_REQUIRE(wpid == child); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == child); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); + + /* + * If process was created by pdfork, the return code have to + * be collected through process descriptor. + */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); + + ATF_REQUIRE(close(pd) != -1); +} + +/* + * Ensure that traced processes created with pdfork(2) are not visible + * after returning to parent - waitid(P_ALL). + */ +ATF_TC_WITHOUT_HEAD(ptrace__procdesc_reparent_wait_child); +ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc) +{ + pid_t traced, debuger, wpid; + int pd, status; + + traced = pdfork(&pd, 0); + ATF_REQUIRE(traced >= 0); + if (traced == 0) { + raise(SIGSTOP); + exit(0); + } + ATF_REQUIRE(pd >= 0); + + debuger = fork(); + ATF_REQUIRE(debuger >= 0); + if (debuger == 0) { + /* The traced process is reparented to debuger. */ + ATF_REQUIRE(ptrace(PT_ATTACH, traced, 0, 0) == 0); + wpid = waitpid(traced, &status, 0); + ATF_REQUIRE(wpid == traced); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* Allow process to die. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, traced, (caddr_t)1, 0) == 0); + wpid = waitpid(traced, &status, 0); + ATF_REQUIRE(wpid == traced); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + /* Reparent back to the orginal process. */ + ATF_REQUIRE(close(pd) == 0); + exit(0); + } + + wpid = waitpid(debuger, &status, 0); + ATF_REQUIRE(wpid == debuger); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + /* + * We have a child but it has a process descriptori + * so we should not be able to collect it process. + */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); + + ATF_REQUIRE(close(pd) == 0); +} + ATF_TP_ADD_TCS(tp) { @@ -4198,6 +4297,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); ATF_TP_ADD_TC(tp, ptrace__syscall_args); ATF_TP_ADD_TC(tp, ptrace__proc_reparent); + ATF_TP_ADD_TC(tp, ptrace__procdesc_wait_child); + ATF_TP_ADD_TC(tp, ptrace__procdesc_reparent_wait_child); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon Nov 25 19:01:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EDA91B68DE; Mon, 25 Nov 2019 19:01:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MGbH0TFXz3K16; Mon, 25 Nov 2019 19:01:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D7E3DBF02; Mon, 25 Nov 2019 19:01:14 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f172.google.com with SMTP id r20so18360260qtp.13; Mon, 25 Nov 2019 11:01:14 -0800 (PST) X-Gm-Message-State: APjAAAV0cYpgC5R26LQPhH0bMCtTm9VxtmoyytSJy0AqJ0OaTJb4uFfH OuTu082DJNb6csj6vq8fcIEzfJizY0UVon8QngI= X-Google-Smtp-Source: APXvYqxkUk9IRun4HMlBbIXwc+1eOY1SAD+YFzEcT6zQ1Td56ablqHGgi/ZRKTNdUAjppOlu8fzmP13RZ8SVweM9wlQ= X-Received: by 2002:ac8:66d7:: with SMTP id m23mr20675675qtp.53.1574708474378; Mon, 25 Nov 2019 11:01:14 -0800 (PST) MIME-Version: 1.0 References: <201907152148.x6FLm3EL068478@repo.freebsd.org> In-Reply-To: <201907152148.x6FLm3EL068478@repo.freebsd.org> From: Kyle Evans Date: Mon, 25 Nov 2019 13:01:02 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350017 - in head: lib/libc/sys sys/kern sys/sys tests/sys/kern To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 19:01:15 -0000 On Mon, Jul 15, 2019 at 4:48 PM John Baldwin wrote: > > Author: jhb > Date: Mon Jul 15 21:48:02 2019 > New Revision: 350017 > URL: https://svnweb.freebsd.org/changeset/base/350017 > > Log: > Add ptrace op PT_GET_SC_RET. > > This ptrace operation returns a structure containing the error and > return values from the current system call. It is only valid when a > thread is stopped during a system call exit (PL_FLAG_SCX is set). > > The sr_error member holds the error value from the system call. Note > that this error value is the native FreeBSD error value that has _not_ > been translated to an ABI-specific error value similar to the values > logged to ktrace. > > If sr_error is zero, then the return values of the system call will be > set in sr_retval[0] and sr_retval[1]. > > Reviewed by: kib > MFC after: 1 month > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D20901 > > Modified: > head/lib/libc/sys/ptrace.2 > head/sys/kern/sys_process.c > head/sys/sys/ptrace.h > head/tests/sys/kern/ptrace_test.c > Hey John, Any objection to MFC'ing this to stable/12 at least? I've found this to be almost-required in the ptrace user I've been working on lately... I certainly ripped out plenty of hair before realizing that it wasn't detecting error returns properly. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Mon Nov 25 19:18:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 563AE1B724B; Mon, 25 Nov 2019 19:18:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MGyg1WvGz3L12; Mon, 25 Nov 2019 19:18:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D67F2C152; Mon, 25 Nov 2019 19:18:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id p14so13821937qkm.10; Mon, 25 Nov 2019 11:18:02 -0800 (PST) X-Gm-Message-State: APjAAAXs3YLcFGTsCFUr3McbaUoeOyyLpozLeW+kOSFDzrH5iwpmZXUq 22fIKPXr43kbkb6x3H5CMcdrRVAW8zmUEXOkVV4= X-Google-Smtp-Source: APXvYqxQACyLilO9KHCAsfun4IMD2882/ihKCX87DtSbtYjG6L8EUypkUd6ADXmSmN5IZxK5DvtpFyU2sZ6TUChiJwY= X-Received: by 2002:a37:a00f:: with SMTP id j15mr3210360qke.103.1574709481293; Mon, 25 Nov 2019 11:18:01 -0800 (PST) MIME-Version: 1.0 References: <201805280812.w4S8CI56046943@repo.freebsd.org> In-Reply-To: <201805280812.w4S8CI56046943@repo.freebsd.org> From: Kyle Evans Date: Mon, 25 Nov 2019 13:17:49 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334277 - in head: contrib/libpcap contrib/ofed/usr.lib/3 contrib/pf/pflogd contrib/wpa/src/l2_packet lib lib/libpcap share/mk usr.sbin/cxgbetool To: Hans Petter Selasky Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 19:18:03 -0000 On Mon, May 28, 2018 at 3:12 AM Hans Petter Selasky wrote: > > Author: hselasky > Date: Mon May 28 08:12:18 2018 > New Revision: 334277 > URL: https://svnweb.freebsd.org/changeset/base/334277 > > Log: > MFV r333789: libpcap 1.9.0 (pre-release) > > MFC after: 1 month > Sponsored by: Mellanox Technologies > > Replaced: > head/contrib/libpcap/ > - copied from r333789, vendor/libpcap/dist/ > Deleted: > head/lib/libpcap/pcap-netmap.c > Modified: > head/contrib/ofed/usr.lib/3/Makefile > head/contrib/pf/pflogd/pflogd.c > head/contrib/wpa/src/l2_packet/l2_packet_freebsd.c > head/lib/Makefile > head/lib/libpcap/Makefile > head/lib/libpcap/config.h > head/share/mk/src.libnames.mk > head/usr.sbin/cxgbetool/cxgbetool.c > > [ ... snip ... ] > Modified: head/lib/libpcap/Makefile > ============================================================================== > --- head/lib/libpcap/Makefile Mon May 28 06:01:02 2018 (r334276) > +++ head/lib/libpcap/Makefile Mon May 28 08:12:18 2018 (r334277) > @@ -7,16 +7,51 @@ SHLIBDIR?= /lib > > PACKAGE=lib${LIB} > LIB= pcap > -SRCS= grammar.y tokdefs.h pcap_version.h pcap-bpf.c \ > - pcap-netmap.c fad-helpers.c \ > - pcap.c pcap-common.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \ > - etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \ > - scanner.l sf-pcap.c sf-pcap-ng.c version.c > > +SRCS= bpf_dump.c \ > + bpf_filter.c \ > + bpf_image.c \ > + etherent.c \ > + fad-getad.c \ > + fmtutils.c \ > + gencode.c \ > + grammar.y \ > + nametoaddr.c \ > + optimize.c \ > + pcap-bpf.c \ > + pcap-common.c \ > + pcap-netmap.c \ > + pcap-netmap.h \ > + pcap.c \ > + savefile.c \ > + scanner.l \ > + sf-pcap.c \ > + sf-pcapng.c \ > + tokdefs.h > + > # Old compatibility headers > -INCS= pcap.h pcap-namedb.h pcap-bpf.h > +INCS= fmtutils.h \ > + pcap-bpf.h \ > + pcap-namedb.h \ > + pcap-netmap.h \ > + pcap.h > > -PCAPINCS= pcap/pcap.h pcap/namedb.h pcap/bpf.h pcap/dlt.h pcap/export-defs.h > +PCAPINCS= \ > + pcap/bluetooth.h \ > + pcap/bpf.h \ > + pcap/can_socketcan.h \ > + pcap/compiler-tests.h \ > + pcap/dlt.h \ > + pcap/funcattrs.h \ > + pcap/ipnet.h \ > + pcap/namedb.h \ > + pcap/nflog.h \ > + pcap/pcap-inttypes.h \ > + pcap/pcap.h \ > + pcap/sll.h \ > + pcap/usb.h \ > + pcap/vlan.h > + > PCAPINCSDIR= ${INCLUDEDIR}/pcap > INCSGROUPS= INCS PCAPINCS > > @@ -40,6 +75,7 @@ MAN= pcap.3 \ > pcap_fileno.3 \ > pcap_findalldevs.3 \ > pcap_freecode.3 \ > + pcap_get_required_select_timeout.3 \ > pcap_get_selectable_fd.3 \ > pcap_get_tstamp_precision.3 \ > pcap_geterr.3 \ > @@ -61,6 +97,7 @@ MAN= pcap.3 \ > pcap_set_datalink.3 \ > pcap_set_immediate_mode.3 \ > pcap_set_promisc.3 \ > + pcap_set_protocol.3 \ > pcap_set_rfmon.3 \ > pcap_set_snaplen.3 \ > pcap_set_timeout.3 \ > @@ -73,12 +110,11 @@ MAN= pcap.3 \ > pcap_stats.3 \ > pcap_statustostr.3 \ > pcap_strerror.3 \ > - pcap-savefile.5 \ > pcap_tstamp_type_name_to_val.3 \ > - pcap_tstamp_type_val_to_name.3 \ > - pcap-filter.7 \ > - pcap-linktype.7 > -MLINKS= pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ > + pcap_tstamp_type_val_to_name.3 > + > +MLINKS= \ > + pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ > pcap_dump_open.3 pcap_dump_fopen.3 \ > pcap_findalldevs.3 pcap_freealldevs.3 \ > pcap_geterr.3 pcap_perror.3 \ Hi Hans, This stopped installing pcap-filter(7) by default, but that wasn't mentioned in the commit message and it's xref'd in other manpages -- any objections to reinstating it? Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Mon Nov 25 19:31:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD9531B77BE; Mon, 25 Nov 2019 19:31:39 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MHGM31Dvz3Lr5; Mon, 25 Nov 2019 19:31:39 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ADBF19870; Mon, 25 Nov 2019 19:31:39 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPJVd35075167; Mon, 25 Nov 2019 19:31:39 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPJVdF1075166; Mon, 25 Nov 2019 19:31:39 GMT (envelope-from chs@FreeBSD.org) Message-Id: <201911251931.xAPJVdF1075166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Mon, 25 Nov 2019 19:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355098 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 355098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 19:31:39 -0000 Author: chs Date: Mon Nov 25 19:31:38 2019 New Revision: 355098 URL: https://svnweb.freebsd.org/changeset/base/355098 Log: In ffs_freefile(), use a separate variable to hold the inode number within the cg rather than reusuing "ino" for this purpose. This reduces the diff for an upcoming change that improves handling of I/O errors. No functional change. Reviewed by: mckusick Approved by: mckusick (mentor) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Nov 25 18:33:21 2019 (r355097) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Nov 25 19:31:38 2019 (r355098) @@ -2786,6 +2786,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) u_int cg; u_int8_t *inosused; struct cdev *dev; + ino_t cgino; cg = ino_to_cg(fs, ino); if (devvp->v_type == VREG) { @@ -2805,16 +2806,16 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0) return (error); inosused = cg_inosused(cgp); - ino %= fs->fs_ipg; - if (isclr(inosused, ino)) { + cgino = ino % fs->fs_ipg; + if (isclr(inosused, cgino)) { printf("dev = %s, ino = %ju, fs = %s\n", devtoname(dev), - (uintmax_t)(ino + cg * fs->fs_ipg), fs->fs_fsmnt); + (uintmax_t)ino, fs->fs_fsmnt); if (fs->fs_ronly == 0) panic("ffs_freefile: freeing free inode"); } - clrbit(inosused, ino); - if (ino < cgp->cg_irotor) - cgp->cg_irotor = ino; + clrbit(inosused, cgino); + if (cgino < cgp->cg_irotor) + cgp->cg_irotor = cgino; cgp->cg_cs.cs_nifree++; UFS_LOCK(ump); fs->fs_cstotal.cs_nifree++; @@ -2828,8 +2829,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) ACTIVECLEAR(fs, cg); UFS_UNLOCK(ump); if (MOUNTEDSOFTDEP(UFSTOVFS(ump)) && devvp->v_type == VCHR) - softdep_setup_inofree(UFSTOVFS(ump), bp, - ino + cg * fs->fs_ipg, wkhd); + softdep_setup_inofree(UFSTOVFS(ump), bp, ino, wkhd); bdwrite(bp); return (0); } From owner-svn-src-head@freebsd.org Mon Nov 25 19:59:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E57C1B844D; Mon, 25 Nov 2019 19:59:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MHty2plXz3NG4; Mon, 25 Nov 2019 19:59:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4513319C6D; Mon, 25 Nov 2019 19:59:54 +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 xAPJxshV088258; Mon, 25 Nov 2019 19:59:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPJxsJa088257; Mon, 25 Nov 2019 19:59:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201911251959.xAPJxsJa088257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Nov 2019 19:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355100 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 355100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 19:59:54 -0000 Author: ian Date: Mon Nov 25 19:59:53 2019 New Revision: 355100 URL: https://svnweb.freebsd.org/changeset/base/355100 Log: Allow opt-out of automatic ntpd leapfile checking/fetching. When a system has no internet connection, or when it is configured to obtain ntpd leapfiles from some source other than the internet, or even when the sysadmin has decided for some reason to customize ntp.conf to eliminate use of the leapfile, the rc.d/ntpd script emits various error messages related to the file. This change allows setting the rc var ntp_db_leapfile to NONE to disable all automatic processing related to that file in rc.d/ntpd. Differential Revision: https://reviews.freebsd.org/D22461 Modified: head/libexec/rc/rc.d/ntpd Modified: head/libexec/rc/rc.d/ntpd ============================================================================== --- head/libexec/rc/rc.d/ntpd Mon Nov 25 19:38:05 2019 (r355099) +++ head/libexec/rc/rc.d/ntpd Mon Nov 25 19:59:53 2019 (r355100) @@ -28,6 +28,16 @@ pidfile="${_ntp_default_dir}/${name}.pid" load_rc_config $name +leapfile_is_disabled() { + # Return true (0) if automatic leapfile handling is disabled. + case "$ntp_db_leapfile" in + [Nn][Oo] | [Nn][Oo][Nn][Ee] ) + return 0;; + * ) + return 1;; + esac +} + can_run_nonroot() { # If the admin set what uid to use, we don't change it. @@ -107,7 +117,12 @@ ntpd_precmd() command_args="${command_args} -g" fi - # Make sure the leapfile is ready to use. + # Make sure the leapfile is ready to use, unless leapfile + # handling is disabled. + if leapfile_is_disabled; then + return + fi + ntpd_init_leapfile if [ ! -f "${ntp_db_leapfile}" ]; then ntpd_fetch_leapfile @@ -135,6 +150,11 @@ get_ntp_leapfile_expiry() { } ntpd_init_leapfile() { + + if leapfile_is_disabled; then + return + fi + # Refresh working leapfile with an invalid hash due to # FreeBSD id header. Ntpd will ignore leapfiles with a # mismatch hash. The file must be the virgin file from @@ -146,7 +166,12 @@ ntpd_init_leapfile() { ntpd_needfetch_leapfile() { local rc verbose - + + if leapfile_is_disabled; then + # Return code 1: ntp leapfile fetch not needed + return 1 + fi + if checkyesno ntp_leapfile_fetch_verbose; then verbose=echo else @@ -182,6 +207,11 @@ ntpd_needfetch_leapfile() { } ntpd_fetch_leapfile() { + + if leapfile_is_disabled; then + return + fi + if checkyesno ntp_leapfile_fetch_verbose; then verbose=echo else From owner-svn-src-head@freebsd.org Mon Nov 25 20:26:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12A271B92BA; Mon, 25 Nov 2019 20:26:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MJT44SDBz3PxN; Mon, 25 Nov 2019 20:26:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id ZKvkipRW4kqGXZKvliHVDo; Mon, 25 Nov 2019 13:25:58 -0700 X-Authority-Analysis: v=2.3 cv=c/jVvi1l c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=MeAgGD-zjQ4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wEqQk4lysjINT8RGvMkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id DB145A88; Mon, 25 Nov 2019 12:25:55 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id xAPKPtiS004215; Mon, 25 Nov 2019 12:25:55 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id xAPKPtBh004212; Mon, 25 Nov 2019 12:25:55 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201911252025.xAPKPtBh004212@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355100 - head/libexec/rc/rc.d In-reply-to: <201911251959.xAPJxsJa088257@repo.freebsd.org> References: <201911251959.xAPJxsJa088257@repo.freebsd.org> Comments: In-reply-to Ian Lepore message dated "Mon, 25 Nov 2019 19:59:54 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 25 Nov 2019 12:25:55 -0800 X-CMAE-Envelope: MS4wfKvbNICSeKFG5+9vlQSh7zRhCulBKniaPUUJPDr7FJs2b7yHzqcksHzgDLARSCHB7ifN/eADielKh8z7aqftmuTryrTRwPNdKEa85qhqsdVIEtpsGu/5 7VwHBAu+pPHckPLUYFPjevqjBK9TRc+SHyWSctLKUugh1NjwhLL/KzE3e4JrEzo6UNy7s6RQMFskcGYEplCeEZLzWilBtgbqOZ5BYCPQJq9mfbVAef6ifGD1 bZgDxj4uwbATZMkZyj51M060fKW/USYsVsQInSyYf7b6I4dm9j8Aqgv87SqRGqin X-Rspamd-Queue-Id: 47MJT44SDBz3PxN X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 20:26:01 -0000 In message <201911251959.xAPJxsJa088257@repo.freebsd.org>, Ian Lepore writes: > Author: ian > Date: Mon Nov 25 19:59:53 2019 > New Revision: 355100 > URL: https://svnweb.freebsd.org/changeset/base/355100 > > Log: > Allow opt-out of automatic ntpd leapfile checking/fetching. > > When a system has no internet connection, or when it is configured to obtai > n > ntpd leapfiles from some source other than the internet, or even when the > sysadmin has decided for some reason to customize ntp.conf to eliminate use > of the leapfile, the rc.d/ntpd script emits various error messages related > to the file. > > This change allows setting the rc var ntp_db_leapfile to NONE to disable al > l > automatic processing related to that file in rc.d/ntpd. > Reviewed by: cy > Differential Revision: https://reviews.freebsd.org/D22461 > > Modified: > head/libexec/rc/rc.d/ntpd > > Modified: head/libexec/rc/rc.d/ntpd > ============================================================================= > = > --- head/libexec/rc/rc.d/ntpd Mon Nov 25 19:38:05 2019 (r355099) > +++ head/libexec/rc/rc.d/ntpd Mon Nov 25 19:59:53 2019 (r355100) > @@ -28,6 +28,16 @@ pidfile="${_ntp_default_dir}/${name}.pid" > > load_rc_config $name > > +leapfile_is_disabled() { > + # Return true (0) if automatic leapfile handling is disabled. > + case "$ntp_db_leapfile" in > + [Nn][Oo] | [Nn][Oo][Nn][Ee] ) > + return 0;; > + * ) > + return 1;; > + esac > +} > + > can_run_nonroot() > { > # If the admin set what uid to use, we don't change it. > @@ -107,7 +117,12 @@ ntpd_precmd() > command_args="${command_args} -g" > fi > > - # Make sure the leapfile is ready to use. > + # Make sure the leapfile is ready to use, unless leapfile > + # handling is disabled. > + if leapfile_is_disabled; then > + return > + fi > + > ntpd_init_leapfile > if [ ! -f "${ntp_db_leapfile}" ]; then > ntpd_fetch_leapfile > @@ -135,6 +150,11 @@ get_ntp_leapfile_expiry() { > } > > ntpd_init_leapfile() { > + > + if leapfile_is_disabled; then > + return > + fi > + > # Refresh working leapfile with an invalid hash due to > # FreeBSD id header. Ntpd will ignore leapfiles with a > # mismatch hash. The file must be the virgin file from > @@ -146,7 +166,12 @@ ntpd_init_leapfile() { > > ntpd_needfetch_leapfile() { > local rc verbose > - > + > + if leapfile_is_disabled; then > + # Return code 1: ntp leapfile fetch not needed > + return 1 > + fi > + > if checkyesno ntp_leapfile_fetch_verbose; then > verbose=echo > else > @@ -182,6 +207,11 @@ ntpd_needfetch_leapfile() { > } > > ntpd_fetch_leapfile() { > + > + if leapfile_is_disabled; then > + return > + fi > + > if checkyesno ntp_leapfile_fetch_verbose; then > verbose=echo > else > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Nov 25 21:21:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 594C41BA73E; Mon, 25 Nov 2019 21:21:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MKjG0zR4z3xPH; Mon, 25 Nov 2019 21:21:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04C2E1AB5F; Mon, 25 Nov 2019 21:21:38 +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 xAPLLbxS041511; Mon, 25 Nov 2019 21:21:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPLLbpN041510; Mon, 25 Nov 2019 21:21:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911252121.xAPLLbpN041510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Nov 2019 21:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355101 - head/sys/dev/cfi X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/cfi X-SVN-Commit-Revision: 355101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 21:21:38 -0000 Author: emaste Date: Mon Nov 25 21:21:37 2019 New Revision: 355101 URL: https://svnweb.freebsd.org/changeset/base/355101 Log: cfi: check for inter overflow in cfi_devioctl Reported by: Pietro Oliva Reviewed by: markj MFC after: 3 days Security: Possible OOB read in root-only ioctl Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cfi/cfi_dev.c Modified: head/sys/dev/cfi/cfi_dev.c ============================================================================== --- head/sys/dev/cfi/cfi_dev.c Mon Nov 25 19:59:53 2019 (r355100) +++ head/sys/dev/cfi/cfi_dev.c Mon Nov 25 21:21:37 2019 (r355101) @@ -280,7 +280,8 @@ cfi_devioctl(struct cdev *dev, u_long cmd, caddr_t dat rq = (struct cfiocqry *)data; if (rq->offset >= sc->sc_size / sc->sc_width) return (ESPIPE); - if (rq->offset + rq->count > sc->sc_size / sc->sc_width) + if (rq->offset > ULONG_MAX - rq->count || + rq->offset + rq->count > sc->sc_size / sc->sc_width) return (ENOSPC); while (!error && rq->count--) { From owner-svn-src-head@freebsd.org Mon Nov 25 21:29:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E08E1BAA2A for ; Mon, 25 Nov 2019 21:29:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47MKtZ6r14z3xkD for ; Mon, 25 Nov 2019 21:29:42 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1574717381; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=qbEsmDyfBJnVFii2PcuNpdN16ZxIa+soRpw3HOqz2wFoJ9tDK1U2fNpW6xIIVeEePh2hWoMs9ovXH 9zMSU/6vIbH3Z3NNf1Chlxh1pj7F1v+fgmav10iNX+MXwDcIpHn5U+wXMR4eIyKk/43I0JPrQj2/Gh wrTt1GGv13WdY3aUygJAcE9i0MlMiaJyuE1DX2qFabuue+/eeGbO4+slvkL8psTjwQCeUc2X4aO+aI isQUYFVxaf2ov/nPJ3WPODD0gGWJ2wKDR4czuQN+IhFuX5SQBW980djVGX0dUUyfnLwhpJ4/mWUzyW j55Lx8rtBm1d5b3JVYdb5wdJjeWq9Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=8W4fkv+cr/zGTKJYWsuzsslywLY4Fz0r8t+uKmw5TpQ=; b=en9nBXmWIZ1SqBEUJP4X0nR3PJAy3gDBQrKtq+GEiYTjImOGgHWVetS54cKp6CeuQeJppjPcAWCwf lpJQPyGbage2tJsoeQcfBJcSyC8zd4JAr9gMriqjNxkF83LGHbTO2mewEmJ7XUotTQj5E3zCtbXZt9 wjPa78gnjQVkvK0CP7p/+qO0570ipAs+QbATQuIRZ/IKGZ2lXyyH6OXbRAjBe2QvbLOsaMVRCnEgqr zBkUGql/of5G2W8IY+yu0RMs4RxEZjzBDkcFHYUJsmByFmech/pYNm1os/8euAoLTjyLJZKI1IGkAY 4jOmZZXae9DcRM7JT/37wO/QiNmDtgg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=8W4fkv+cr/zGTKJYWsuzsslywLY4Fz0r8t+uKmw5TpQ=; b=MD7mu198CcCJDYPWuj6Pi6sXXelyQ3P+4lEja7zSLjZbiBpGwwXm05bkQisKAJ8v337QZhqcD3BY8 MhI3ewuBwJdxu/KV511MYEm6TmFDhJPLcEffcc+Xgja6UlzRxkTFk6pcrHfWjsNw/JeqTjr7KEhrfm M1kK+0RDcYIQoMuSJ7H7o/slmSz/bk4EcZD32I6s0ukhRuSvlApdhIvCeuhrZvM6QCIqYKzGnH/R+7 9Lnp5hJ109FDPoEJWm7IeE6Qh/aj4zFU8hAn9jK1+FZujwIRNl3ZssWydGOQ/05Kk0Y1nut9x0LC+c O1MSGe0R2T0fQKI/dfNKccfwfUj2iuQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: af7062bd-0fca-11ea-b80c-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id af7062bd-0fca-11ea-b80c-052b4a66b6b2; Mon, 25 Nov 2019 21:29:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xAPLTcHK070209; Mon, 25 Nov 2019 14:29:38 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <258a8c29c86afd8a39c2de7c12426c9dcde9c97f.camel@freebsd.org> Subject: Re: svn commit: r355100 - head/libexec/rc/rc.d From: Ian Lepore To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Nov 2019 14:29:38 -0700 In-Reply-To: <201911252025.xAPKPtBh004212@slippy.cwsent.com> References: <201911251959.xAPJxsJa088257@repo.freebsd.org> <201911252025.xAPKPtBh004212@slippy.cwsent.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47MKtZ6r14z3xkD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.81)[-0.815,0]; NEURAL_HAM_LONG(-0.85)[-0.851,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 21:29:44 -0000 On Mon, 2019-11-25 at 12:25 -0800, Cy Schubert wrote: > In message <201911251959.xAPJxsJa088257@repo.freebsd.org>, Ian > Lepore > writes: > > Author: ian > > Date: Mon Nov 25 19:59:53 2019 > > New Revision: 355100 > > URL: https://svnweb.freebsd.org/changeset/base/355100 > > > > Log: > > Allow opt-out of automatic ntpd leapfile checking/fetching. > > > > When a system has no internet connection, or when it is > > configured to obtai > > n > > ntpd leapfiles from some source other than the internet, or even > > when the > > sysadmin has decided for some reason to customize ntp.conf to > > eliminate use > > of the leapfile, the rc.d/ntpd script emits various error > > messages related > > to the file. > > > > This change allows setting the rc var ntp_db_leapfile to NONE to > > disable al > > l > > automatic processing related to that file in rc.d/ntpd. > > > > Reviewed by: cy As already indicated in: > > Differential Revision: https://reviews.freebsd.org/D22461 -- Ian > > > > Modified: > > head/libexec/rc/rc.d/ntpd > > > > Modified: head/libexec/rc/rc.d/ntpd > > =================================================================== > > ========== > > = > > --- head/libexec/rc/rc.d/ntpd Mon Nov 25 19:38:05 2019 (r3 > > 55099) > > +++ head/libexec/rc/rc.d/ntpd Mon Nov 25 19:59:53 2019 (r3 > > 55100) > > @@ -28,6 +28,16 @@ pidfile="${_ntp_default_dir}/${name}.pid" > > > > load_rc_config $name > > > > +leapfile_is_disabled() { > > + # Return true (0) if automatic leapfile handling is disabled. > > + case "$ntp_db_leapfile" in > > + [Nn][Oo] | [Nn][Oo][Nn][Ee] ) > > + return 0;; > > + * ) > > + return 1;; > > + esac > > +} > > + > > can_run_nonroot() > > { > > # If the admin set what uid to use, we don't change it. > > @@ -107,7 +117,12 @@ ntpd_precmd() > > command_args="${command_args} -g" > > fi > > > > - # Make sure the leapfile is ready to use. > > + # Make sure the leapfile is ready to use, unless leapfile > > + # handling is disabled. > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > ntpd_init_leapfile > > if [ ! -f "${ntp_db_leapfile}" ]; then > > ntpd_fetch_leapfile > > @@ -135,6 +150,11 @@ get_ntp_leapfile_expiry() { > > } > > > > ntpd_init_leapfile() { > > + > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > # Refresh working leapfile with an invalid hash due to > > # FreeBSD id header. Ntpd will ignore leapfiles with a > > # mismatch hash. The file must be the virgin file from > > @@ -146,7 +166,12 @@ ntpd_init_leapfile() { > > > > ntpd_needfetch_leapfile() { > > local rc verbose > > - > > + > > + if leapfile_is_disabled; then > > + # Return code 1: ntp leapfile fetch not needed > > + return 1 > > + fi > > + > > if checkyesno ntp_leapfile_fetch_verbose; then > > verbose=echo > > else > > @@ -182,6 +207,11 @@ ntpd_needfetch_leapfile() { > > } > > > > ntpd_fetch_leapfile() { > > + > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > if checkyesno ntp_leapfile_fetch_verbose; then > > verbose=echo > > else > > > > From owner-svn-src-head@freebsd.org Mon Nov 25 22:21:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 892811BBF54; Mon, 25 Nov 2019 22:21:51 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MM2l36RWz41QR; Mon, 25 Nov 2019 22:21:51 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id i17so19129415qtq.1; Mon, 25 Nov 2019 14:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/9FaorgoTV9hwzzXMvyzusEr+jirNQWYzpDgMrDw8dI=; b=riW/He1CPuyW3+uLA7ttczQZ5n47mkotCHxO+DpteEc/vSYzlpiwgkGEzOJn/oRGq6 W9gKZyQwa/ztfybT7T2C17GjF6/s61Xo2eQHHxJ9U7Ev6ZP0Uw5yEuqr2z5wUnPzhl5D NnfPhQ6t3RWAiyQZJdluF8rCzWJQ2WS/WfevTsEvJsIgTEqEh+Xp5mgSQzqhlm5xj2Dm XeRzG88q7TCq422aEnc1QuemBB0hCIlLeHxsgZ1s0hzUePaUlaA/24vxc6Y3cqoDN0lq YJ3UFUtzGa7kupTm0RIBHx28QHSH51b9z9FU3tNyzIsFY2lVPznvFSBIRz3RR1mykx7X F5Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/9FaorgoTV9hwzzXMvyzusEr+jirNQWYzpDgMrDw8dI=; b=k7F5vvbzB693/rYuWBUvwrQzfD4VlzBfJoml8hK72paLxtoJ07TFzMuRjAqeTyqFXH R9sbo8WDAKvQ2XgvbxrBgmqTut75bWnO8m5+EHJpIlHzDE0XIVvnp1IHqJSQtKy+mOzk Xnq7IuTvKk09f9L+KX7PHOPBAHqkQW2x6HFrK6zQb1e//DMnQum3DmKVS3jixMKs+zRK 3m71vUHv03rA/3Axl/sV1VUW5ghaJUFoMPQB4PcPL4RwxtI//x9mBZl+96lwqu4gfXkv rAdnWfTK1PFl5iKa5apbMoleXShB5DOGOzhsdVCGksdfusVHBneziyDzFuIXYSnL5LSm OHqQ== X-Gm-Message-State: APjAAAU4ucWprCUKmLPHvXma0H+awzsn2e02CF2JTKS3DT12QsUMMyA3 90msK45FMp4GDhCNZyfLTWMaRQvZ6ZlcI3px7R9rsSUm X-Google-Smtp-Source: APXvYqxiXJYex5MHSy/ELxInq8YUhaJhrYUwkUGYHzGsdQj0JWAstTAGkq11kelX6Nhec6qujoOIPRjre0MB9mXRW1I= X-Received: by 2002:ac8:41c7:: with SMTP id o7mr31517516qtm.262.1574720507272; Mon, 25 Nov 2019 14:21:47 -0800 (PST) MIME-Version: 1.0 References: <201911252121.xAPLLbpN041510@repo.freebsd.org> In-Reply-To: <201911252121.xAPLLbpN041510@repo.freebsd.org> From: Ryan Libby Date: Mon, 25 Nov 2019 14:21:35 -0800 Message-ID: Subject: Re: svn commit: r355101 - head/sys/dev/cfi To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47MM2l36RWz41QR X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 22:21:51 -0000 On Mon, Nov 25, 2019 at 1:21 PM Ed Maste wrote: > > Author: emaste > Date: Mon Nov 25 21:21:37 2019 > New Revision: 355101 > URL: https://svnweb.freebsd.org/changeset/base/355101 > > Log: > cfi: check for inter overflow in cfi_devioctl > > Reported by: Pietro Oliva > Reviewed by: markj > MFC after: 3 days > Security: Possible OOB read in root-only ioctl > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/cfi/cfi_dev.c > > Modified: head/sys/dev/cfi/cfi_dev.c > ============================================================================== > --- head/sys/dev/cfi/cfi_dev.c Mon Nov 25 19:59:53 2019 (r355100) > +++ head/sys/dev/cfi/cfi_dev.c Mon Nov 25 21:21:37 2019 (r355101) > @@ -280,7 +280,8 @@ cfi_devioctl(struct cdev *dev, u_long cmd, caddr_t dat > rq = (struct cfiocqry *)data; > if (rq->offset >= sc->sc_size / sc->sc_width) > return (ESPIPE); > - if (rq->offset + rq->count > sc->sc_size / sc->sc_width) > + if (rq->offset > ULONG_MAX - rq->count || > + rq->offset + rq->count > sc->sc_size / sc->sc_width) > return (ENOSPC); > > while (!error && rq->count--) { > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" This seems to have broken the some builds. Need sys/limits.h. From owner-svn-src-head@freebsd.org Mon Nov 25 22:25:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 186591BC0CD; Mon, 25 Nov 2019 22:25:11 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MM6Z6wPYz41dS; Mon, 25 Nov 2019 22:25:10 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0BBE1B78F; Mon, 25 Nov 2019 22:25:10 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPMPA9I077490; Mon, 25 Nov 2019 22:25:10 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPMPAKk077489; Mon, 25 Nov 2019 22:25:10 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911252225.xAPMPAKk077489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 25 Nov 2019 22:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355102 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 355102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 22:25:11 -0000 Author: rlibby Date: Mon Nov 25 22:25:10 2019 New Revision: 355102 URL: https://svnweb.freebsd.org/changeset/base/355102 Log: in6_joingroup_locked: need if_addr_lock around in6m_disconnect_locked It looks like the call that requires the lock was introduced in r337866. Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20739 Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Mon Nov 25 21:21:37 2019 (r355101) +++ head/sys/netinet6/in6_mcast.c Mon Nov 25 22:25:10 2019 (r355102) @@ -1267,6 +1267,7 @@ out_in6m_release: struct epoch_tracker et; CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm); + IF_ADDR_WLOCK(ifp); NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_protospec == inm) { @@ -1277,6 +1278,7 @@ out_in6m_release: in6m_disconnect_locked(&inmh, inm); in6m_rele_locked(&inmh, inm); NET_EPOCH_EXIT(et); + IF_ADDR_WUNLOCK(ifp); } else { *pinm = inm; } From owner-svn-src-head@freebsd.org Mon Nov 25 22:25:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3424B1BC14A; Mon, 25 Nov 2019 22:25:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MM730hMnz41mS; Mon, 25 Nov 2019 22:25:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F05A41B79A; Mon, 25 Nov 2019 22:25:34 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPMPYXu077556; Mon, 25 Nov 2019 22:25:34 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPMPYDV077555; Mon, 25 Nov 2019 22:25:34 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911252225.xAPMPYDV077555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 25 Nov 2019 22:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355103 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 355103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Nov 2019 22:25:35 -0000 Author: rlibby Date: Mon Nov 25 22:25:34 2019 New Revision: 355103 URL: https://svnweb.freebsd.org/changeset/base/355103 Log: in_mcast.c: need if_addr_lock around inm_release_deferred Apply a similar fix as for in6_mcast.c. Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20740 Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Mon Nov 25 22:25:10 2019 (r355102) +++ head/sys/netinet/in_mcast.c Mon Nov 25 22:25:34 2019 (r355103) @@ -1268,7 +1268,9 @@ in_joingroup_locked(struct ifnet *ifp, const struct in if (error) { CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); + IF_ADDR_WLOCK(ifp); inm_release_deferred(inm); + IF_ADDR_WUNLOCK(ifp); } else { *pinm = inm; } @@ -2247,7 +2249,9 @@ out_inp_unlocked: if (is_new && imf) { if (imf->imf_inm != NULL) { IN_MULTI_LIST_LOCK(); + IF_ADDR_WLOCK(ifp); inm_release_deferred(imf->imf_inm); + IF_ADDR_WUNLOCK(ifp); IN_MULTI_LIST_UNLOCK(); } ip_mfilter_free(imf); From owner-svn-src-head@freebsd.org Tue Nov 26 00:40:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F6A81BF442; Tue, 26 Nov 2019 00:40:06 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47MQ6F0dF8z47Fj; Tue, 26 Nov 2019 00:40:04 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id xAQ0dvbO000281; Mon, 25 Nov 2019 16:39:57 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xAQ0dvVk000280; Mon, 25 Nov 2019 16:39:57 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201911260039.xAQ0dvVk000280@gndrsh.dnsmgr.net> Subject: Re: svn commit: r355021 - in head: share/man/man4 sys/dev/hpt27xx In-Reply-To: <201911222023.xAMKNMRB021304@repo.freebsd.org> To: Scott Long Date: Mon, 25 Nov 2019 16:39:57 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 47MQ6F0dF8z47Fj X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.60 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; TO_DN_SOME(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.77)[0.770,0]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.03), country: US(-0.05)]; NEURAL_SPAM_LONG(0.90)[0.895,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 00:40:06 -0000 > Author: scottl > Date: Fri Nov 22 20:23:22 2019 > New Revision: 355021 > URL: https://svnweb.freebsd.org/changeset/base/355021 > > Log: > Mark hpt27xx for removal in 13.0; all CAM drivers will be Giant-free by then. > > Relnotes: yes Driver comes in at FreeBSD 10.x and goes out at 13.x? Has Hightpoint (who seems to be the author of the driver), and iXsystems (who seems to have an interest as the manpage is written for them) bought in on this deprication? > Modified: > head/share/man/man4/hpt27xx.4 > head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c > > Modified: head/share/man/man4/hpt27xx.4 > ============================================================================== > --- head/share/man/man4/hpt27xx.4 Fri Nov 22 20:22:29 2019 (r355020) > +++ head/share/man/man4/hpt27xx.4 Fri Nov 22 20:23:22 2019 (r355021) > @@ -44,6 +44,9 @@ module at boot time, place the following line in > .Bd -literal -offset indent > hpt27xx_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +This driver is scheduled for removal prior to the release of > +.Fx 13.0 . > .Sh DESCRIPTION > The > .Nm > > Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c > ============================================================================== > --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Nov 22 20:22:29 2019 (r355020) > +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Nov 22 20:23:22 2019 (r355021) > @@ -76,7 +76,9 @@ static int hpt_attach(device_t dev) > HPT_UINT size; > PVBUS vbus; > PVBUS_EXT vbus_ext; > - > + > + gone_in(13, "Giant locked CAM drivers"); > + > KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); > > him = hpt_match(dev, 1); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Nov 26 00:57:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 320841BFC10; Tue, 26 Nov 2019 00:57:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47MQVN1TdXz48Jq; Tue, 26 Nov 2019 00:57:31 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id xAQ0vI4R000352; Mon, 25 Nov 2019 16:57:18 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xAQ0vH6W000351; Mon, 25 Nov 2019 16:57:17 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201911260057.xAQ0vH6W000351@gndrsh.dnsmgr.net> Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests In-Reply-To: To: Alan Somers Date: Mon, 25 Nov 2019 16:57:17 -0800 (PST) CC: Florian Smeets , Jan Sucan , "Conrad E. Meyer" , svn-src-head , Hiroki Sato , svn-src-all , src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 47MQVN1TdXz48Jq X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.62 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.78)[0.783,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.90)[0.897,0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.03), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 00:57:33 -0000 > On Mon, Nov 25, 2019 at 10:57 AM Florian Smeets wrote: > > > On 26.08.19 06:28, Jan Sucan wrote: > > > Hello, > > > > > > I can implement it. I suppose that ping6's manual page should be kept it > > > this case. > > > > > > I was also thinking about printing a warning for each option renamed to > > > lead a willing user to use the new unified option set of ping. It could > > > be either only with -v, or by default and suppressed with -q. Or should > > > the option translation be completely transparent? > > > > Is there an update on this? I found out the hard way today, as I updated > > my icinga2 host from an revision before this change to a current > > revision. In this case it's not as easy as fixing a script e.g. > > net-mgmt/monitoring-plugins check_ping command calls /sbin/ping6 with -X. > > > > Will we get a ping6 that is fully backward compatible, or should we > > start fixing ports? > > > > Thanks, > > Florian > > > > Still a work in progress, though there hasn't been any progress lately. > https://reviews.freebsd.org/D21434 Wouldn't it make since to back the breaking change out until the fixing work in process can be completed? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Nov 26 02:26:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24E631C38ED; Tue, 26 Nov 2019 02:26:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MST706h6z4F03; Tue, 26 Nov 2019 02:26:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA1B1E3AF; Tue, 26 Nov 2019 02:26:34 +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 xAQ2QYFg020139; Tue, 26 Nov 2019 02:26:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQ2QYtd020138; Tue, 26 Nov 2019 02:26:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911260226.xAQ2QYtd020138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Nov 2019 02:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355104 - head/sys/dev/cfi X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/cfi X-SVN-Commit-Revision: 355104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 02:26:35 -0000 Author: emaste Date: Tue Nov 26 02:26:34 2019 New Revision: 355104 URL: https://svnweb.freebsd.org/changeset/base/355104 Log: cfi: #include for ULONG_MAX after r355101 Reported by: rlibby MFC with: r355101 Modified: head/sys/dev/cfi/cfi_dev.c Modified: head/sys/dev/cfi/cfi_dev.c ============================================================================== --- head/sys/dev/cfi/cfi_dev.c Mon Nov 25 22:25:34 2019 (r355103) +++ head/sys/dev/cfi/cfi_dev.c Tue Nov 26 02:26:34 2019 (r355104) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Tue Nov 26 02:27:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 704421C3A1B; Tue, 26 Nov 2019 02:27:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MSVQ3QWCz4F7Q; Tue, 26 Nov 2019 02:27:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f181.google.com with SMTP id z12so6737919iln.11; Mon, 25 Nov 2019 18:27:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lg0YUIatzEzngprS4etOZBqmO3xcQYNheTw27InjI7o=; b=uJiK5fG2w2oPp4Mikb5lMVzO7cGyzPmBd172/z7djNNW2u9u4El9yp2mNz6uef+WYC yWD64l6m6vWtLTV5ILqvnPv0HK6VjgbFzQ6hamtTdFyQzpXo3w6O7MfhlZxbtJgapTR7 oyiHaL7+kDt1gN+Dd4qkkVYBP0gjVgXO0SB84PMulOVi+SNphsloaX3ZwCkE1d4XEvvq JXtTSJzKrY3trRodthxmOTcZL9yO7NeCfeXFjzus9HALO8wGpsQgDao0dWVs6w82UeTX sRDOEv99jUUQ//eizSwIoZH8LWAZewfGCw4y776JAF089c5EP4xptXaRGKb+qqo7GoHk MfCQ== X-Gm-Message-State: APjAAAUUUN39+wFdbUjmZUQLaNCD7B1nvUd7lzeWilqqpQgGzdb4BBHX jurfRk9eYEaOTwq5kiY1Cqq4fB/tqjYwYRDz430= X-Google-Smtp-Source: APXvYqyqdF9rvBIcNNtxdmqMuKeZFwjomeJBKWCdF1DpjHApwPaAv0hu648gyD4mjsLDLI4HZzp0kVNmD9Qgp+SZAVg= X-Received: by 2002:a92:1d52:: with SMTP id d79mr35381776ild.185.1574735261160; Mon, 25 Nov 2019 18:27:41 -0800 (PST) MIME-Version: 1.0 References: <201911252121.xAPLLbpN041510@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 25 Nov 2019 17:41:06 -0500 Message-ID: Subject: Re: svn commit: r355101 - head/sys/dev/cfi To: Ryan Libby Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47MSVQ3QWCz4F7Q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.181 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.56 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[181.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.56)[ip: (-7.65), ipnet: 209.85.128.0/17(-3.16), asn: 15169(-1.96), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[181.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 02:27:43 -0000 On Mon, 25 Nov 2019 at 17:21, Ryan Libby wrote: > > On Mon, Nov 25, 2019 at 1:21 PM Ed Maste wrote: > > > > Author: emaste > > Date: Mon Nov 25 21:21:37 2019 > > New Revision: 355101 > > URL: https://svnweb.freebsd.org/changeset/base/355101 > > > This seems to have broken the some builds. Need sys/limits.h. Thanks for the report, fixed at r355104 From owner-svn-src-head@freebsd.org Tue Nov 26 05:06:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 166591A8995; Tue, 26 Nov 2019 05:06:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MX1Y6qzxz4NTR; Tue, 26 Nov 2019 05:06:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF53520155; Tue, 26 Nov 2019 05:06:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAQ56P5p014823; Tue, 26 Nov 2019 05:06:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQ56P57014822; Tue, 26 Nov 2019 05:06:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201911260506.xAQ56P57014822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Nov 2019 05:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355106 - in head/sbin: ping ping6 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sbin: ping ping6 X-SVN-Commit-Revision: 355106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 05:06:26 -0000 Author: asomers Date: Tue Nov 26 05:06:25 2019 New Revision: 355106 URL: https://svnweb.freebsd.org/changeset/base/355106 Log: ping, ping6: Use setitimer(2) instead of obsolete alarm(3) Submitted by: Ján Sučan Differential Revision: https://reviews.freebsd.org/D22103 Modified: head/sbin/ping/ping.c head/sbin/ping6/ping6.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Tue Nov 26 02:50:25 2019 (r355105) +++ head/sbin/ping/ping.c Tue Nov 26 05:06:25 2019 (r355106) @@ -505,7 +505,15 @@ main(int argc, char *const *argv) if (alarmtimeout > MAXALARM) errx(EX_USAGE, "invalid timeout: `%s' > %d", optarg, MAXALARM); - alarm((int)alarmtimeout); + { + struct itimerval itv; + + timerclear(&itv.it_interval); + timerclear(&itv.it_value); + itv.it_value.tv_sec = (time_t)alarmtimeout; + if (setitimer(ITIMER_REAL, &itv, NULL) != 0) + err(1, "setitimer"); + } break; case 'v': options |= F_VERBOSE; Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Nov 26 02:50:25 2019 (r355105) +++ head/sbin/ping6/ping6.c Tue Nov 26 05:06:25 2019 (r355106) @@ -574,7 +574,15 @@ main(int argc, char *argv[]) if (alarmtimeout > MAXALARM) errx(EX_USAGE, "invalid timeout: `%s' > %d", optarg, MAXALARM); - alarm((int)alarmtimeout); + { + struct itimerval itv; + + timerclear(&itv.it_interval); + timerclear(&itv.it_value); + itv.it_value.tv_sec = (time_t)alarmtimeout; + if (setitimer(ITIMER_REAL, &itv, NULL) != 0) + err(1, "setitimer"); + } break; #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC From owner-svn-src-head@freebsd.org Tue Nov 26 05:54:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 307B61A9F63; Tue, 26 Nov 2019 05:54:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MY4y0rCdz4QTs; Tue, 26 Nov 2019 05:54:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9E420A4F; Tue, 26 Nov 2019 05:54:25 +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 xAQ5sPVm044126; Tue, 26 Nov 2019 05:54:25 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQ5sPQY044123; Tue, 26 Nov 2019 05:54:25 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911260554.xAQ5sPQY044123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 26 Nov 2019 05:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355107 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 355107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 05:54:26 -0000 Author: np Date: Tue Nov 26 05:54:25 2019 New Revision: 355107 URL: https://svnweb.freebsd.org/changeset/base/355107 Log: cxgbe(4): Allow the driver to specify multiple FECs that the firmware should try in order to link up with the peer. Various FEC variables within the driver can now have multiple bits set instead of being powers of 2. 0 and -1 in the user knobs still mean no FEC and auto (driver decides) respectively for backward compatibility, but no-FEC and auto now have their own bits in the internal representation. There is a new bit that can be set to request the FEC recommended by the cable/transceiver module. Add sysctls to display link related capabilities of the local side as well as the link partner. Note that all this needs a new firmware and the documentation for the driver FEC knobs will be updated after that firmware is added to the driver. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Nov 26 05:06:25 2019 (r355106) +++ head/sys/dev/cxgbe/common/common.h Tue Nov 26 05:54:25 2019 (r355107) @@ -62,10 +62,21 @@ enum { }; enum { - FEC_NONE = 0, - FEC_RS = 1 << 0, - FEC_BASER_RS = 1 << 1, - FEC_AUTO = 1 << 5, /* M_FW_PORT_CAP32_FEC + 1 */ + /* + * Real FECs. In the same order as the FEC portion of caps32 so that + * the code can do (fec & M_FW_PORT_CAP32_FEC) to get all the real FECs. + */ + FEC_RS = 1 << 0, /* Reed-Solomon */ + FEC_BASER_RS = 1 << 1, /* BASE-R, aka Firecode */ + FEC_NONE = 1 << 2, /* no FEC */ + + /* + * Pseudo FECs that translate to real FECs. The firmware knows nothing + * about these and they start at M_FW_PORT_CAP32_FEC + 1. AUTO should + * be set all by itself. + */ + FEC_AUTO = 1 << 5, + FEC_MODULE = 1 << 6, /* FEC suggested by the cable/transceiver. */ }; enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS }; @@ -409,20 +420,20 @@ struct trace_params { struct link_config { /* OS-specific code owns all the requested_* fields. */ - int8_t requested_aneg; /* link autonegotiation */ - int8_t requested_fc; /* flow control */ - int8_t requested_fec; /* FEC */ - u_int requested_speed; /* speed (Mbps) */ + int8_t requested_aneg; /* link autonegotiation */ + int8_t requested_fc; /* flow control */ + int8_t requested_fec; /* FEC */ + u_int requested_speed; /* speed (Mbps) */ - uint32_t supported; /* link capabilities */ - uint32_t advertising; /* advertised capabilities */ - uint32_t lp_advertising; /* peer advertised capabilities */ - uint32_t fec_hint; /* use this fec */ - u_int speed; /* actual link speed (Mbps) */ - int8_t fc; /* actual link flow control */ - int8_t fec; /* actual FEC */ - bool link_ok; /* link up? */ - uint8_t link_down_rc; /* link down reason */ + uint32_t pcaps; /* link capabilities */ + uint32_t acaps; /* advertised capabilities */ + uint32_t lpacaps; /* peer advertised capabilities */ + u_int speed; /* actual link speed (Mbps) */ + int8_t fc; /* actual link flow control */ + int8_t fec_hint; /* cable/transceiver recommended fec */ + int8_t fec; /* actual FEC */ + bool link_ok; /* link up? */ + uint8_t link_down_rc; /* link down reason */ }; #include "adapter.h" @@ -881,7 +892,7 @@ port_top_speed(const struct port_info *pi) { /* Mbps -> Gbps */ - return (fwcap_to_speed(pi->link_cfg.supported) / 1000); + return (fwcap_to_speed(pi->link_cfg.pcaps) / 1000); } #endif /* __CHELSIO_COMMON_H */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Nov 26 05:06:25 2019 (r355106) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Nov 26 05:54:25 2019 (r355107) @@ -3841,6 +3841,43 @@ is_bt(struct port_info *pi) pi->port_type == FW_PORT_TYPE_BT_XAUI); } +static int8_t fwcap_to_fec(uint32_t caps, bool unset_means_none) +{ + int8_t fec = 0; + + if ((caps & V_FW_PORT_CAP32_FEC(M_FW_PORT_CAP32_FEC)) == 0) + return (unset_means_none ? FEC_NONE : 0); + + if (caps & FW_PORT_CAP32_FEC_RS) + fec |= FEC_RS; + if (caps & FW_PORT_CAP32_FEC_BASER_RS) + fec |= FEC_BASER_RS; + if (caps & FW_PORT_CAP32_FEC_NO_FEC) + fec |= FEC_NONE; + + return (fec); +} + +/* + * Note that 0 is not translated to NO_FEC. + */ +static uint32_t fec_to_fwcap(int8_t fec) +{ + uint32_t caps = 0; + + /* Only real FECs allowed. */ + MPASS((fec & ~M_FW_PORT_CAP32_FEC) == 0); + + if (fec & FEC_RS) + caps |= FW_PORT_CAP32_FEC_RS; + if (fec & FEC_BASER_RS) + caps |= FW_PORT_CAP32_FEC_BASER_RS; + if (fec & FEC_NONE) + caps |= FW_PORT_CAP32_FEC_NO_FEC; + + return (caps); +} + /** * t4_link_l1cfg - apply link configuration to MAC/PHY * @phy: the PHY to setup @@ -3869,41 +3906,61 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m if (!(lc->requested_fc & PAUSE_AUTONEG)) fc |= FW_PORT_CAP32_FORCE_PAUSE; - fec = 0; - if (lc->requested_fec == FEC_AUTO) - fec = lc->fec_hint; - else { - if (lc->requested_fec & FEC_RS) - fec |= FW_PORT_CAP32_FEC_RS; - if (lc->requested_fec & FEC_BASER_RS) - fec |= FW_PORT_CAP32_FEC_BASER_RS; - } - if (lc->requested_aneg == AUTONEG_DISABLE) aneg = 0; else if (lc->requested_aneg == AUTONEG_ENABLE) aneg = FW_PORT_CAP32_ANEG; else - aneg = lc->supported & FW_PORT_CAP32_ANEG; + aneg = lc->pcaps & FW_PORT_CAP32_ANEG; if (aneg) { - speed = lc->supported & V_FW_PORT_CAP32_SPEED(M_FW_PORT_CAP32_SPEED); + speed = lc->pcaps & + V_FW_PORT_CAP32_SPEED(M_FW_PORT_CAP32_SPEED); } else if (lc->requested_speed != 0) speed = speed_to_fwcap(lc->requested_speed); else - speed = fwcap_top_speed(lc->supported); + speed = fwcap_top_speed(lc->pcaps); + fec = 0; + if (fec_supported(lc->pcaps)) { + if (lc->requested_fec == FEC_AUTO) { + if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) { + if (speed & FW_PORT_CAP32_SPEED_100G) { + fec |= FW_PORT_CAP32_FEC_RS; + fec |= FW_PORT_CAP32_FEC_NO_FEC; + } else { + fec |= FW_PORT_CAP32_FEC_RS; + fec |= FW_PORT_CAP32_FEC_BASER_RS; + fec |= FW_PORT_CAP32_FEC_NO_FEC; + } + } else { + /* Set only 1b with old firmwares. */ + fec |= fec_to_fwcap(lc->fec_hint); + } + } else { + fec |= fec_to_fwcap(lc->requested_fec & + M_FW_PORT_CAP32_FEC); + if (lc->requested_fec & FEC_MODULE) + fec |= fec_to_fwcap(lc->fec_hint); + } + + if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) + fec |= FW_PORT_CAP32_FORCE_FEC; + else if (fec == FW_PORT_CAP32_FEC_NO_FEC) + fec = 0; + } + /* Force AN on for BT cards. */ if (is_bt(adap->port[adap->chan_map[port]])) - aneg = lc->supported & FW_PORT_CAP32_ANEG; + aneg = lc->pcaps & FW_PORT_CAP32_ANEG; rcap = aneg | speed | fc | fec; - if ((rcap | lc->supported) != lc->supported) { + if ((rcap | lc->pcaps) != lc->pcaps) { #ifdef INVARIANTS - CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, - lc->supported); + CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x, removed 0x%x\n", rcap, + lc->pcaps, rcap & (rcap ^ lc->pcaps)); #endif - rcap &= lc->supported; + rcap &= lc->pcaps; } rcap |= mdi; @@ -8470,7 +8527,6 @@ uint32_t fwcap_top_speed(uint32_t caps) return 0; } - /** * lstatus_to_fwcap - translate old lstatus to 32-bit Port Capabilities * @lstatus: old FW_PORT_ACTION_GET_PORT_INFO lstatus value @@ -8516,7 +8572,7 @@ static void handle_port_info(struct port_info *pi, con enum fw_port_action action, bool *mod_changed, bool *link_changed) { struct link_config old_lc, *lc = &pi->link_cfg; - unsigned char fc, fec; + unsigned char fc; u32 stat, linkattr; int old_ptype, old_mtype; @@ -8531,9 +8587,9 @@ static void handle_port_info(struct port_info *pi, con pi->mdio_addr = stat & F_FW_PORT_CMD_MDIOCAP ? G_FW_PORT_CMD_MDIOADDR(stat) : -1; - lc->supported = fwcaps16_to_caps32(be16_to_cpu(p->u.info.pcap)); - lc->advertising = fwcaps16_to_caps32(be16_to_cpu(p->u.info.acap)); - lc->lp_advertising = fwcaps16_to_caps32(be16_to_cpu(p->u.info.lpacap)); + lc->pcaps = fwcaps16_to_caps32(be16_to_cpu(p->u.info.pcap)); + lc->acaps = fwcaps16_to_caps32(be16_to_cpu(p->u.info.acap)); + lc->lpacaps = fwcaps16_to_caps32(be16_to_cpu(p->u.info.lpacap)); lc->link_ok = (stat & F_FW_PORT_CMD_LSTATUS) != 0; lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC(stat); @@ -8546,9 +8602,9 @@ static void handle_port_info(struct port_info *pi, con pi->mdio_addr = stat & F_FW_PORT_CMD_MDIOCAP32 ? G_FW_PORT_CMD_MDIOADDR32(stat) : -1; - lc->supported = be32_to_cpu(p->u.info32.pcaps32); - lc->advertising = be32_to_cpu(p->u.info32.acaps32); - lc->lp_advertising = be32_to_cpu(p->u.info32.lpacaps32); + lc->pcaps = be32_to_cpu(p->u.info32.pcaps32); + lc->acaps = be32_to_cpu(p->u.info32.acaps32); + lc->lpacaps = be32_to_cpu(p->u.info32.lpacaps32); lc->link_ok = (stat & F_FW_PORT_CMD_LSTATUS32) != 0; lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC32(stat); @@ -8559,6 +8615,7 @@ static void handle_port_info(struct port_info *pi, con } lc->speed = fwcap_to_speed(linkattr); + lc->fec = fwcap_to_fec(linkattr, true); fc = 0; if (linkattr & FW_PORT_CAP32_FC_RX) @@ -8567,23 +8624,14 @@ static void handle_port_info(struct port_info *pi, con fc |= PAUSE_TX; lc->fc = fc; - fec = FEC_NONE; - if (linkattr & FW_PORT_CAP32_FEC_RS) - fec |= FEC_RS; - if (linkattr & FW_PORT_CAP32_FEC_BASER_RS) - fec |= FEC_BASER_RS; - lc->fec = fec; - if (mod_changed != NULL) *mod_changed = false; if (link_changed != NULL) *link_changed = false; if (old_ptype != pi->port_type || old_mtype != pi->mod_type || - old_lc.supported != lc->supported) { - if (pi->mod_type != FW_PORT_MOD_TYPE_NONE) { - lc->fec_hint = lc->advertising & - V_FW_PORT_CAP32_FEC(M_FW_PORT_CAP32_FEC); - } + old_lc.pcaps != lc->pcaps) { + if (pi->mod_type != FW_PORT_MOD_TYPE_NONE) + lc->fec_hint = fwcap_to_fec(lc->acaps, true); if (mod_changed != NULL) *mod_changed = true; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Nov 26 05:06:25 2019 (r355106) +++ head/sys/dev/cxgbe/t4_main.c Tue Nov 26 05:54:25 2019 (r355107) @@ -678,6 +678,7 @@ static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS); static int sysctl_fec(SYSCTL_HANDLER_ARGS); +static int sysctl_module_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); @@ -2393,7 +2394,7 @@ cxgbe_media_change(struct ifnet *ifp) PORT_LOCK(pi); if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { /* ifconfig .. media autoselect */ - if (!(lc->supported & FW_PORT_CAP32_ANEG)) { + if (!(lc->pcaps & FW_PORT_CAP32_ANEG)) { rc = ENOTSUP; /* AN not supported by transceiver */ goto done; } @@ -4763,7 +4764,7 @@ set_current_media(struct port_info *pi) lc = &pi->link_cfg; if (lc->requested_aneg != AUTONEG_DISABLE && - lc->supported & FW_PORT_CAP32_ANEG) { + lc->pcaps & FW_PORT_CAP32_ANEG) { ifmedia_set(ifm, IFM_ETHER | IFM_AUTO); return; } @@ -4820,7 +4821,7 @@ build_medialist(struct port_info *pi) ifm = &pi->media; ifmedia_removeall(ifm); lc = &pi->link_cfg; - ss = G_FW_PORT_CAP32_SPEED(lc->supported); /* Supported Speeds */ + ss = G_FW_PORT_CAP32_SPEED(lc->pcaps); /* Supported Speeds */ if (__predict_false(ss == 0)) { /* not supposed to happen. */ MPASS(ss != 0); no_media: @@ -4846,7 +4847,7 @@ no_media: } if (unknown > 0) /* Add one unknown for all unknown media types. */ ifmedia_add4(ifm, IFM_ETHER | IFM_FDX | IFM_UNKNOWN); - if (lc->supported & FW_PORT_CAP32_ANEG) + if (lc->pcaps & FW_PORT_CAP32_ANEG) ifmedia_add(ifm, IFM_ETHER | IFM_AUTO, 0, NULL); set_current_media(pi); @@ -4874,14 +4875,16 @@ init_link_config(struct port_info *pi) lc->requested_fc = t4_pause_settings & (PAUSE_TX | PAUSE_RX | PAUSE_AUTONEG); - if (t4_fec == -1 || t4_fec & FEC_AUTO) + if (t4_fec & FEC_AUTO) lc->requested_fec = FEC_AUTO; - else { + else if (t4_fec == 0) lc->requested_fec = FEC_NONE; - if (t4_fec & FEC_RS) - lc->requested_fec |= FEC_RS; - if (t4_fec & FEC_BASER_RS) - lc->requested_fec |= FEC_BASER_RS; + else { + /* -1 is handled by the FEC_AUTO block above and not here. */ + lc->requested_fec = t4_fec & + (FEC_RS | FEC_BASER_RS | FEC_NONE | FEC_MODULE); + if (lc->requested_fec == 0) + lc->requested_fec = FEC_AUTO; } } @@ -4901,7 +4904,7 @@ fixup_link_config(struct port_info *pi) /* Speed (when not autonegotiating) */ if (lc->requested_speed != 0) { fwspeed = speed_to_fwcap(lc->requested_speed); - if ((fwspeed & lc->supported) == 0) { + if ((fwspeed & lc->pcaps) == 0) { n++; lc->requested_speed = 0; } @@ -4912,7 +4915,7 @@ fixup_link_config(struct port_info *pi) lc->requested_aneg == AUTONEG_DISABLE || lc->requested_aneg == AUTONEG_AUTO); if (lc->requested_aneg == AUTONEG_ENABLE && - !(lc->supported & FW_PORT_CAP32_ANEG)) { + !(lc->pcaps & FW_PORT_CAP32_ANEG)) { n++; lc->requested_aneg = AUTONEG_AUTO; } @@ -4920,26 +4923,26 @@ fixup_link_config(struct port_info *pi) /* Flow control */ MPASS((lc->requested_fc & ~(PAUSE_TX | PAUSE_RX | PAUSE_AUTONEG)) == 0); if (lc->requested_fc & PAUSE_TX && - !(lc->supported & FW_PORT_CAP32_FC_TX)) { + !(lc->pcaps & FW_PORT_CAP32_FC_TX)) { n++; lc->requested_fc &= ~PAUSE_TX; } if (lc->requested_fc & PAUSE_RX && - !(lc->supported & FW_PORT_CAP32_FC_RX)) { + !(lc->pcaps & FW_PORT_CAP32_FC_RX)) { n++; lc->requested_fc &= ~PAUSE_RX; } if (!(lc->requested_fc & PAUSE_AUTONEG) && - !(lc->supported & FW_PORT_CAP32_FORCE_PAUSE)) { + !(lc->pcaps & FW_PORT_CAP32_FORCE_PAUSE)) { n++; lc->requested_fc |= PAUSE_AUTONEG; } /* FEC */ if ((lc->requested_fec & FEC_RS && - !(lc->supported & FW_PORT_CAP32_FEC_RS)) || + !(lc->pcaps & FW_PORT_CAP32_FEC_RS)) || (lc->requested_fec & FEC_BASER_RS && - !(lc->supported & FW_PORT_CAP32_FEC_BASER_RS))) { + !(lc->pcaps & FW_PORT_CAP32_FEC_BASER_RS))) { n++; lc->requested_fec = FEC_AUTO; } @@ -4963,17 +4966,17 @@ apply_link_config(struct port_info *pi) PORT_LOCK_ASSERT_OWNED(pi); if (lc->requested_aneg == AUTONEG_ENABLE) - MPASS(lc->supported & FW_PORT_CAP32_ANEG); + MPASS(lc->pcaps & FW_PORT_CAP32_ANEG); if (!(lc->requested_fc & PAUSE_AUTONEG)) - MPASS(lc->supported & FW_PORT_CAP32_FORCE_PAUSE); + MPASS(lc->pcaps & FW_PORT_CAP32_FORCE_PAUSE); if (lc->requested_fc & PAUSE_TX) - MPASS(lc->supported & FW_PORT_CAP32_FC_TX); + MPASS(lc->pcaps & FW_PORT_CAP32_FC_TX); if (lc->requested_fc & PAUSE_RX) - MPASS(lc->supported & FW_PORT_CAP32_FC_RX); + MPASS(lc->pcaps & FW_PORT_CAP32_FC_RX); if (lc->requested_fec & FEC_RS) - MPASS(lc->supported & FW_PORT_CAP32_FEC_RS); + MPASS(lc->pcaps & FW_PORT_CAP32_FEC_RS); if (lc->requested_fec & FEC_BASER_RS) - MPASS(lc->supported & FW_PORT_CAP32_FEC_BASER_RS); + MPASS(lc->pcaps & FW_PORT_CAP32_FEC_BASER_RS); #endif rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc != 0) { @@ -6750,11 +6753,21 @@ cxgbe_sysctls(struct port_info *pi) "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_fec, "A", - "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); + "FECs to use (bit 0 = RS, 1 = FC, 2 = none, 5 = auto, 6 = module)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "module_fec", + CTLTYPE_STRING, pi, 0, sysctl_module_fec, "A", + "FEC recommended by the cable/transceiver"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "autoneg", CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcaps", CTLFLAG_RD, + &pi->link_cfg.pcaps, 0, "port capabilities"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "acaps", CTLFLAG_RD, + &pi->link_cfg.acaps, 0, "advertised capabilities"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lpacaps", CTLFLAG_RD, + &pi->link_cfg.lpacaps, 0, "link partner advertised capabilities"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "max_speed", CTLFLAG_RD, NULL, port_top_speed(pi), "max speed (in Gbps)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "mps_bg_map", CTLFLAG_RD, NULL, @@ -7275,7 +7288,8 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) if (req->newptr == NULL) { struct sbuf *sb; - static char *bits = "\20\1RS\2BASE-R\3RSVD1\4RSVD2\5RSVD3\6AUTO"; + static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2" + "\5RSVD3\6auto\7module"; rc = sysctl_wire_old_buffer(req, 0); if (rc != 0) @@ -7291,19 +7305,20 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) */ if (lc->link_ok) { sbuf_printf(sb, "%b", (lc->fec & M_FW_PORT_CAP32_FEC) | - (lc->requested_fec & FEC_AUTO), bits); + (lc->requested_fec & (FEC_AUTO | FEC_MODULE)), + bits); } else { sbuf_printf(sb, "%b", lc->requested_fec, bits); } rc = sbuf_finish(sb); sbuf_delete(sb); } else { - char s[3]; + char s[8]; int n; snprintf(s, sizeof(s), "%d", lc->requested_fec == FEC_AUTO ? -1 : - lc->requested_fec & M_FW_PORT_CAP32_FEC); + lc->requested_fec & (M_FW_PORT_CAP32_FEC | FEC_MODULE)); rc = sysctl_handle_string(oidp, s, sizeof(s), req); if (rc != 0) @@ -7312,12 +7327,8 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) n = strtol(&s[0], NULL, 0); if (n < 0 || n & FEC_AUTO) n = FEC_AUTO; - else { - if (n & ~M_FW_PORT_CAP32_FEC) - return (EINVAL);/* some other bit is set too */ - if (!powerof2(n)) - return (EINVAL);/* one bit can be set at most */ - } + else if (n & ~(M_FW_PORT_CAP32_FEC | FEC_MODULE)) + return (EINVAL);/* some other bit is set too */ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4fec"); @@ -7327,15 +7338,17 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) old = lc->requested_fec; if (n == FEC_AUTO) lc->requested_fec = FEC_AUTO; - else if (n == 0) + else if (n == 0 || n == FEC_NONE) lc->requested_fec = FEC_NONE; else { - if ((lc->supported | V_FW_PORT_CAP32_FEC(n)) != - lc->supported) { + if ((lc->pcaps | + V_FW_PORT_CAP32_FEC(n & M_FW_PORT_CAP32_FEC)) != + lc->pcaps) { rc = ENOTSUP; goto done; } - lc->requested_fec = n; + lc->requested_fec = n & (M_FW_PORT_CAP32_FEC | + FEC_MODULE); } fixup_link_config(pi); if (pi->up_vis > 0) { @@ -7355,6 +7368,56 @@ done: } static int +sysctl_module_fec(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc; + int8_t fec; + struct sbuf *sb; + static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2\5RSVD3"; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4mfec") != 0) + return (EBUSY); + PORT_LOCK(pi); + if (pi->up_vis == 0) { + /* + * If all the interfaces are administratively down the firmware + * does not report transceiver changes. Refresh port info here. + * This is the only reason we have a synchronized op in this + * function. Just PORT_LOCK would have been enough otherwise. + */ + t4_update_port_info(pi); + } + + fec = lc->fec_hint; + if (pi->mod_type == FW_PORT_MOD_TYPE_NONE || + !fec_supported(lc->pcaps)) { + sbuf_printf(sb, "n/a"); + } else { + if (fec == 0) + fec = FEC_NONE; + sbuf_printf(sb, "%b", fec & M_FW_PORT_CAP32_FEC, bits); + } + rc = sbuf_finish(sb); + sbuf_delete(sb); + + PORT_UNLOCK(pi); + end_synchronized_op(sc, 0); + + return (rc); +} + +static int sysctl_autoneg(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; @@ -7362,7 +7425,7 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) struct link_config *lc = &pi->link_cfg; int rc, val; - if (lc->supported & FW_PORT_CAP32_ANEG) + if (lc->pcaps & FW_PORT_CAP32_ANEG) val = lc->requested_aneg == AUTONEG_DISABLE ? 0 : 1; else val = -1; @@ -7381,7 +7444,7 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) if (rc) return (rc); PORT_LOCK(pi); - if (val == AUTONEG_ENABLE && !(lc->supported & FW_PORT_CAP32_ANEG)) { + if (val == AUTONEG_ENABLE && !(lc->pcaps & FW_PORT_CAP32_ANEG)) { rc = ENOTSUP; goto done; } From owner-svn-src-head@freebsd.org Tue Nov 26 12:20:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAE961B485F; Tue, 26 Nov 2019 12:20:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Mjfh4W0sz3GwV; Tue, 26 Nov 2019 12:20:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BA2E24EAE; Tue, 26 Nov 2019 12:20:44 +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 xAQCKiU5068090; Tue, 26 Nov 2019 12:20:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQCKi3b068073; Tue, 26 Nov 2019 12:20:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201911261220.xAQCKi3b068073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Nov 2019 12:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355108 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 12:20:44 -0000 Author: hselasky Date: Tue Nov 26 12:20:44 2019 New Revision: 355108 URL: https://svnweb.freebsd.org/changeset/base/355108 Log: Fix panic when loading kernel modules before root file system is mounted. Make sure the rootvnode is always NULL checked. Differential Revision: https://reviews.freebsd.org/D22545 PR: 241639 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue Nov 26 05:54:25 2019 (r355107) +++ head/sys/kern/kern_linker.c Tue Nov 26 12:20:44 2019 (r355108) @@ -2079,14 +2079,16 @@ linker_load_module(const char *kldname, const char *mo */ KASSERT(verinfo == NULL, ("linker_load_module: verinfo" " is not NULL")); + if (rootvnode == NULL) + return (ENXIO); pathname = linker_search_kld(kldname); } else { if (modlist_lookup2(modname, verinfo) != NULL) return (EEXIST); + if (rootvnode == NULL) + return (ENXIO); if (kldname != NULL) pathname = strdup(kldname, M_LINKER); - else if (rootvnode == NULL) - pathname = NULL; else /* * Need to find a KLD with required module From owner-svn-src-head@freebsd.org Tue Nov 26 14:25:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C951A1B81DA; Tue, 26 Nov 2019 14:25:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MmR24xGZz3NsZ; Tue, 26 Nov 2019 14:25:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C8A726591; Tue, 26 Nov 2019 14:25:50 +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 xAQEPolh042835; Tue, 26 Nov 2019 14:25:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQEPobb042834; Tue, 26 Nov 2019 14:25:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911261425.xAQEPobb042834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Nov 2019 14:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355109 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 14:25:50 -0000 Author: emaste Date: Tue Nov 26 14:25:50 2019 New Revision: 355109 URL: https://svnweb.freebsd.org/changeset/base/355109 Log: Update Makefile.inc1 dtc comment We use the BSDL dtc by default now (as long as we're using a C++11 compiler). Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 26 12:20:44 2019 (r355108) +++ head/Makefile.inc1 Tue Nov 26 14:25:50 2019 (r355109) @@ -2258,8 +2258,7 @@ ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/lib ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal .endif -# Default to building the GPL DTC, but build the BSDL one if users explicitly -# request it. +# Build BSDL or GPL DTC depending on GPL_DTC option. _dtc= usr.bin/dtc .if ${MK_GPL_DTC} != "no" _dtc= gnu/usr.bin/dtc From owner-svn-src-head@freebsd.org Tue Nov 26 15:52:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 022611BA821; Tue, 26 Nov 2019 15:52:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MpLq6H5kz3yTN; Tue, 26 Nov 2019 15:52:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAD4927564; Tue, 26 Nov 2019 15:52:19 +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 xAQFqJrF095750; Tue, 26 Nov 2019 15:52:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQFqJbD095748; Tue, 26 Nov 2019 15:52:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911261552.xAQFqJbD095748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Nov 2019 15:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355113 - in head/sys/dev: ahci usb/controller X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: ahci usb/controller X-SVN-Commit-Revision: 355113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 15:52:20 -0000 Author: mav Date: Tue Nov 26 15:52:19 2019 New Revision: 355113 URL: https://svnweb.freebsd.org/changeset/base/355113 Log: Add some IDs of Intel Wildcat Point-LP. MFC after: 1 week Modified: head/sys/dev/ahci/ahci_pci.c head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Tue Nov 26 15:24:06 2019 (r355112) +++ head/sys/dev/ahci/ahci_pci.c Tue Nov 26 15:52:19 2019 (r355113) @@ -212,6 +212,10 @@ static const struct { {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c838086, 0x00, "Intel Wildcat Point-LP", 0}, + {0x9c858086, 0x00, "Intel Wildcat Point-LP (RAID)", 0}, + {0x9c878086, 0x00, "Intel Wildcat Point-LP (RAID)", 0}, + {0x9c8f8086, 0x00, "Intel Wildcat Point-LP (RAID)", 0}, {0x9d038086, 0x00, "Intel Sunrise Point-LP", 0}, {0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, {0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Tue Nov 26 15:24:06 2019 (r355112) +++ head/sys/dev/usb/controller/ehci_pci.c Tue Nov 26 15:52:19 2019 (r355113) @@ -182,6 +182,8 @@ ehci_pci_match(device_t self) return ("Intel Wellsburg USB 2.0 controller"); case 0x9c268086: return ("Intel Lynx Point-LP USB 2.0 controller"); + case 0x9ca68086: + return ("Intel Wildcat Point-LP USB 2.0 controller"); case 0x00e01033: return ("NEC uPD 72010x USB 2.0 controller"); From owner-svn-src-head@freebsd.org Tue Nov 26 17:25:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA951BCC56; Tue, 26 Nov 2019 17:25:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MrQk46v7z43yq; Tue, 26 Nov 2019 17:25:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 709F95E0; Tue, 26 Nov 2019 17:25:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAQHPoU6049075; Tue, 26 Nov 2019 17:25:50 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQHPoR3049073; Tue, 26 Nov 2019 17:25:50 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201911261725.xAQHPoR3049073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 26 Nov 2019 17:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355114 - in head: share/man/man4 sys/dev/hpt27xx X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/hpt27xx X-SVN-Commit-Revision: 355114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 17:25:50 -0000 Author: scottl Date: Tue Nov 26 17:25:49 2019 New Revision: 355114 URL: https://svnweb.freebsd.org/changeset/base/355114 Log: Revert r355021. In my haste to grep for Giant, I missed that it was in conditional ifdefs for this driver. We will consider removing those ifdefs in the future. Reported by: imp Modified: head/share/man/man4/hpt27xx.4 head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Modified: head/share/man/man4/hpt27xx.4 ============================================================================== --- head/share/man/man4/hpt27xx.4 Tue Nov 26 15:52:19 2019 (r355113) +++ head/share/man/man4/hpt27xx.4 Tue Nov 26 17:25:49 2019 (r355114) @@ -44,9 +44,6 @@ module at boot time, place the following line in .Bd -literal -offset indent hpt27xx_load="YES" .Ed -.Sh DEPRECATION NOTICE -This driver is scheduled for removal prior to the release of -.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Nov 26 15:52:19 2019 (r355113) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Nov 26 17:25:49 2019 (r355114) @@ -76,9 +76,7 @@ static int hpt_attach(device_t dev) HPT_UINT size; PVBUS vbus; PVBUS_EXT vbus_ext; - - gone_in(13, "Giant locked CAM drivers"); - + KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); him = hpt_match(dev, 1); From owner-svn-src-head@freebsd.org Tue Nov 26 17:56:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55E9E1BD559; Tue, 26 Nov 2019 17:56:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Ms6J2Jgmz45Mg; Tue, 26 Nov 2019 17:56:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC2CB64; Tue, 26 Nov 2019 17:56:40 +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 xAQHueND067144; Tue, 26 Nov 2019 17:56:40 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQHueje067142; Tue, 26 Nov 2019 17:56:40 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911261756.xAQHueje067142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 26 Nov 2019 17:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355115 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 355115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 17:56:40 -0000 Author: mmel Date: Tue Nov 26 17:56:39 2019 New Revision: 355115 URL: https://svnweb.freebsd.org/changeset/base/355115 Log: Finish implementation of RK3299 clocks. - implement of all but mmc clocks. MMC clocks will be added later by own commit. - use 'link' clock type for external clocks. - use macros for initialization of structure's named members. MFC after: 3 weeks Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D22441 Added: head/sys/arm64/rockchip/clk/rk3399_cru_dt.h (contents, props changed) Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c head/sys/arm64/rockchip/clk/rk_cru.h Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Tue Nov 26 17:25:49 2019 (r355114) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Tue Nov 26 17:56:39 2019 (r355115) @@ -50,1930 +50,1188 @@ __FBSDID("$FreeBSD$"); #include -/* GATES */ +#include -#define SCLK_USB2PHY0_REF 123 -#define SCLK_USB2PHY1_REF 124 -#define SCLK_USB3OTG0_REF 129 -#define SCLK_USB3OTG1_REF 130 -#define SCLK_USB3OTG0_SUSPEND 131 -#define SCLK_USB3OTG1_SUSPEND 132 -#define ACLK_EMMC_CORE 241 -#define ACLK_EMMC_NOC 242 -#define ACLK_EMMC_GRF 243 -#define ACLK_USB3_NOC 245 -#define ACLK_USB3OTG0 246 -#define ACLK_USB3OTG1 247 -#define ACLK_USB3_RKSOC_AXI_PERF 248 -#define ACLK_USB3_GRF 249 -#define PCLK_GPIO2 336 -#define PCLK_GPIO3 337 -#define PCLK_GPIO4 338 -#define PCLK_I2C1 341 -#define PCLK_I2C2 342 -#define PCLK_I2C3 343 -#define PCLK_I2C5 344 -#define PCLK_I2C6 345 -#define PCLK_I2C7 346 -#define PCLK_SPI0 347 -#define PCLK_SPI1 348 -#define PCLK_SPI2 349 -#define PCLK_SPI4 350 -#define PCLK_SPI5 351 -#define HCLK_HOST0 456 -#define HCLK_HOST0_ARB 457 -#define HCLK_HOST1 458 -#define HCLK_HOST1_ARB 459 -#define HCLK_SDMMC 462 +#define CRU_CLKSEL_CON(x) (0x100 + (x) * 0x4) +#define CRU_CLKGATE_CON(x) (0x300 + (x) * 0x4) + +/* GATES */ + static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON0 */ - CRU_GATE(0, "clk_core_l_lpll_src", "lpll", 0x300, 0) - CRU_GATE(0, "clk_core_l_bpll_src", "bpll", 0x300, 1) - CRU_GATE(0, "clk_core_l_dpll_src", "dpll", 0x300, 2) - CRU_GATE(0, "clk_core_l_gpll_src", "gpll", 0x300, 3) + /* 15-8 unused */ + GATE(SCLK_PVTM_CORE_L, "clk_pvtm_core_l", "xin24m", 0, 7), + GATE(0, "pclk_dbg_core_l", "pclk_dbg_core_l_c", 0, 6), + GATE(0, "atclk_core_l", "atclk_core_l_c", 0, 5), + GATE(0, "aclkm_core_l", "aclkm_core_l_c", 0, 4), + GATE(0, "clk_core_l_gpll_src", "gpll", 0, 3), + GATE(0, "clk_core_l_dpll_src", "dpll", 0, 2), + GATE(0, "clk_core_l_bpll_src", "bpll", 0, 1), + GATE(0, "clk_core_l_lpll_src", "lpll", 0, 0), /* CRU_CLKGATE_CON1 */ - CRU_GATE(0, "clk_core_b_lpll_src", "lpll", 0x304, 0) - CRU_GATE(0, "clk_core_b_bpll_src", "bpll", 0x304, 1) - CRU_GATE(0, "clk_core_b_dpll_src", "dpll", 0x304, 2) - CRU_GATE(0, "clk_core_b_gpll_src", "gpll", 0x304, 3) + /* 15 - 8 unused */ + GATE(SCLK_PVTM_CORE_B, "clk_pvtm_core_b", "xin24m", 1, 7), + GATE(0, "pclk_dbg_core_b","pclk_dbg_core_b_c", 1, 6), + GATE(0, "atclk_core_b", "atclk_core_b_c", 1, 5), + GATE(0, "aclkm_core_b", "aclkm_core_b_c", 1, 4), + GATE(0, "clk_core_b_gpll_src", "gpll", 1, 3), + GATE(0, "clk_core_b_dpll_src", "dpll", 1, 2), + GATE(0, "clk_core_b_bpll_src", "bpll", 1, 1), + GATE(0, "clk_core_b_lpll_src", "lpll", 1, 0), + /* CRU_CLKGATE_CON2 */ + /* 15 - 11 unused */ + GATE(0, "npll_cs", "npll", 2, 10), + GATE(0, "gpll_cs", "gpll", 2, 9), + GATE(0, "cpll_cs", "cpll", 2, 8), + GATE(SCLK_CCI_TRACE, "clk_cci_trace", "clk_cci_trace_c", 2, 7), + GATE(0, "gpll_cci_trace", "gpll", 2, 6), + GATE(0, "cpll_cci_trace", "cpll", 2, 5), + GATE(0, "aclk_cci_pre", "aclk_cci_pre_c", 2, 4), + GATE(0, "vpll_aclk_cci_src", "vpll", 2, 3), + GATE(0, "npll_aclk_cci_src", "npll", 2, 2), + GATE(0, "gpll_aclk_cci_src", "gpll", 2, 1), + GATE(0, "cpll_aclk_cci_src", "cpll", 2, 0), + + /* CRU_CLKGATE_CON3 */ + /* 15 - 8 unused */ + GATE(0, "aclk_center", "aclk_center_c", 3, 7), + /* 6 unused */ + /* 5 unused */ + GATE(PCLK_DDR, "pclk_ddr", "pclk_ddr_c", 3, 4), + GATE(0, "clk_ddrc_gpll_src", "gpll", 3, 3), + GATE(0, "clk_ddrc_dpll_src", "dpll", 3, 2), + GATE(0, "clk_ddrc_bpll_src", "bpll", 3, 1), + GATE(0, "clk_ddrc_lpll_src", "lpll", 3, 0), + + + /* CRU_CLKGATE_CON4 */ + /* 15 - 12 unused */ + GATE(SCLK_PVTM_DDR, "clk_pvtm_ddr", "xin24m", 4, 11), + GATE(0, "clk_rga_core", "clk_rga_core_c", 4, 10), + GATE(0, "hclk_rga_pre", "hclk_rga_pre_c", 4, 9), + GATE(0, "aclk_rga_pre", "aclk_rga_pre_c", 4, 8), + GATE(0, "hclk_iep_pre", "hclk_iep_pre_c", 4, 7), + GATE(0, "aclk_iep_pre", "aclk_iep_pre_c", 4, 6), + GATE(SCLK_VDU_CA, "clk_vdu_ca", "clk_vdu_ca_c", 4, 5), + GATE(SCLK_VDU_CORE, "clk_vdu_core", "clk_vdu_core_c", 4, 4), + GATE(0, "hclk_vdu_pre", "hclk_vdu_pre_c", 4, 3), + GATE(0, "aclk_vdu_pre", "aclk_vdu_pre_c", 4, 2), + GATE(0, "hclk_vcodec_pre", "hclk_vcodec_pre_c", 4, 1), + GATE(0, "aclk_vcodec_pre", "aclk_vcodec_pre_c", 4, 0), + /* CRU_CLKGATE_CON5 */ - CRU_GATE(0, "cpll_aclk_perihp_src", "cpll", 0x314, 0) - CRU_GATE(0, "gpll_aclk_perihp_src", "gpll", 0x314, 1) + /* 15 - 10 unused */ + GATE(SCLK_MAC_TX, "clk_rmii_tx", "clk_rmii_src", 5, 9), + GATE(SCLK_MAC_RX, "clk_rmii_rx", "clk_rmii_src", 5, 8), + GATE(SCLK_MACREF, "clk_mac_ref", "clk_rmii_src", 5, 7), + GATE(SCLK_MACREF_OUT, "clk_mac_refout", "clk_rmii_src", 5, 6), + GATE(SCLK_MAC, "clk_gmac", "clk_gmac_c", 5, 5), + GATE(PCLK_PERIHP, "pclk_perihp", "pclk_perihp_c", 5, 4), + GATE(HCLK_PERIHP, "hclk_perihp", "hclk_perihp_c", 5, 3), + GATE(ACLK_PERIHP, "aclk_perihp", "aclk_perihp_c", 5, 2), + GATE(0, "cpll_aclk_perihp_src", "cpll", 5, 1), + GATE(0, "gpll_aclk_perihp_src", "gpll", 5, 0), /* CRU_CLKGATE_CON6 */ - CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12) - CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13) - CRU_GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 0x318, 5) - CRU_GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m", 0x318, 6) + /* 15 unused */ + GATE(SCLK_EMMC, "clk_emmc", "clk_emmc_c", 6, 14), + GATE(0, "cpll_aclk_emmc_src", "cpll", 6, 13), + GATE(0, "gpll_aclk_emmc_src", "gpll", 6, 12), + GATE(0, "pclk_gmac_pre", "pclk_gmac_pre_c", 6, 11), + GATE(0, "aclk_gmac_pre", "aclk_gmac_pre_c", 6, 10), + GATE(0, "cpll_aclk_gmac_src", "cpll", 6, 9), + GATE(0, "gpll_aclk_gmac_src", "gpll", 6, 8), + /* 7 unused */ + GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m", 6, 6), + GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 6, 5), + GATE(SCLK_HSICPHY, "clk_hsicphy", "clk_hsicphy_c", 6, 4), + GATE(0, "clk_pcie_core_cru", "clk_pcie_core_cru_c", 6, 3), + GATE(SCLK_PCIE_PM, "clk_pcie_pm", "clk_pcie_pm_c", 6, 2), + GATE(SCLK_SDMMC, "clk_sdmmc", "clk_sdmmc_c", 6, 1), + GATE(SCLK_SDIO, "clk_sdio", "clk_sdio_c", 6, 0), /* CRU_CLKGATE_CON7 */ - CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) - CRU_GATE(0, "cpll_aclk_perilp0_src", "cpll", 0x31C, 1) + /* 15 - 10 unused */ + GATE(FCLK_CM0S, "fclk_cm0s", "fclk_cm0s_c", 7, 9), + GATE(SCLK_CRYPTO1, "clk_crypto1", "clk_crypto1_c", 7, 8), + GATE(SCLK_CRYPTO0, "clk_crypto0", "clk_crypto0_c", 7, 7), + GATE(0, "cpll_fclk_cm0s_src", "cpll", 7, 6), + GATE(0, "gpll_fclk_cm0s_src", "gpll", 7, 5), + GATE(PCLK_PERILP0, "pclk_perilp0", "pclk_perilp0_c", 7, 4), + GATE(HCLK_PERILP0, "hclk_perilp0", "hclk_perilp0_c", 7, 3), + GATE(ACLK_PERILP0, "aclk_perilp0", "aclk_perilp0_c", 7, 2), + GATE(0, "cpll_aclk_perilp0_src", "cpll", 7, 1), + GATE(0, "gpll_aclk_perilp0_src", "gpll", 7, 0), /* CRU_CLKGATE_CON8 */ - CRU_GATE(0, "hclk_perilp1_cpll_src", "cpll", 0x320, 1) - CRU_GATE(0, "hclk_perilp1_gpll_src", "gpll", 0x320, 0) + GATE(SCLK_SPDIF_8CH, "clk_spdif", "clk_spdif_mux", 8, 15), + GATE(0, "clk_spdif_frac", "clk_spdif_frac_c", 8, 14), + GATE(0, "clk_spdif_div", "clk_spdif_div_c", 8, 13), + GATE(SCLK_I2S_8CH_OUT, "clk_i2sout", "clk_i2sout_c", 8, 12), + GATE(SCLK_I2S2_8CH, "clk_i2s2", "clk_i2s2_mux", 8, 11), + GATE(0, "clk_i2s2_frac", "clk_i2s2_frac_c", 8, 10), + GATE(0, "clk_i2s2_div", "clk_i2s2_div_c", 8, 9), + GATE(SCLK_I2S1_8CH, "clk_i2s1", "clk_i2s1_mux", 8, 8), + GATE(0, "clk_i2s1_frac", "clk_i2s1_frac_c", 8, 7), + GATE(0, "clk_i2s1_div", "clk_i2s1_div_c", 8, 6), + GATE(SCLK_I2S0_8CH, "clk_i2s0", "clk_i2s0_mux", 8, 5), + GATE(0, "clk_i2s0_frac","clk_i2s0_frac_c", 8, 4), + GATE(0, "clk_i2s0_div","clk_i2s0_div_c", 8, 3), + GATE(PCLK_PERILP1, "pclk_perilp1", "pclk_perilp1_c", 8, 2), + GATE(HCLK_PERILP1, "cpll_hclk_perilp1_src", "cpll", 8, 1), + GATE(0, "gpll_hclk_perilp1_src", "gpll", 8, 0), - /* CRU_CLKGATE_CON12 */ - CRU_GATE(SCLK_USB3OTG0_REF, "sclk_usb3otg0_ref", "xin24m", 0x330, 1) - CRU_GATE(SCLK_USB3OTG1_REF, "sclk_usb3otg1_ref", "xin24m", 0x330, 2) - CRU_GATE(SCLK_USB3OTG0_SUSPEND, "sclk_usb3otg0_suspend", "xin24m", 0x330, 3) - CRU_GATE(SCLK_USB3OTG1_SUSPEND, "sclk_usb3otg1_suspend", "xin24m", 0x330, 4) + /* CRU_CLKGATE_CON9 */ + GATE(SCLK_SPI4, "clk_spi4", "clk_spi4_c", 9, 15), + GATE(SCLK_SPI2, "clk_spi2", "clk_spi2_c", 9, 14), + GATE(SCLK_SPI1, "clk_spi1", "clk_spi1_c", 9, 13), + GATE(SCLK_SPI0, "clk_spi0", "clk_spi0_c", 9, 12), + GATE(SCLK_SARADC, "clk_saradc", "clk_saradc_c", 9, 11), + GATE(SCLK_TSADC, "clk_tsadc", "clk_tsadc_c", 9, 10), + /* 9 - 8 unused */ + GATE(0, "clk_uart3_frac", "clk_uart3_frac_c", 9, 7), + GATE(0, "clk_uart3_div", "clk_uart3_div_c", 9, 6), + GATE(0, "clk_uart2_frac", "clk_uart2_frac_c", 9, 5), + GATE(0, "clk_uart2_div", "clk_uart2_div_c", 9, 4), + GATE(0, "clk_uart1_frac", "clk_uart1_frac_c", 9, 3), + GATE(0, "clk_uart1_div", "clk_uart1_div_c", 9, 2), + GATE(0, "clk_uart0_frac", "clk_uart0_frac_c", 9, 1), + GATE(0, "clk_uart0_div", "clk_uart0_div_c", 9, 0), - /* CRU_CLKGATE_CON20 */ - CRU_GATE(HCLK_HOST0, "hclk_host0", "hclk_perihp", 0x350, 5) - CRU_GATE(HCLK_HOST0_ARB, "hclk_host0_arb", "hclk_perihp", 0x350, 6) - CRU_GATE(HCLK_HOST1, "hclk_host1", "hclk_perihp", 0x350, 7) - CRU_GATE(HCLK_HOST1_ARB, "hclk_host1_arb", "hclk_perihp", 0x350, 8) + /* CRU_CLKGATE_CON10 */ + GATE(SCLK_VOP1_PWM, "clk_vop1_pwm", "clk_vop1_pwm_c", 10, 15), + GATE(SCLK_VOP0_PWM, "clk_vop0_pwm", "clk_vop0_pwm_c", 10, 14), + GATE(DCLK_VOP0_DIV, "dclk_vop0_div", "dclk_vop0_div_c", 10, 12), + GATE(DCLK_VOP1_DIV, "dclk_vop1_div", "dclk_vop1_div_c", 10, 13), + GATE(0, "hclk_vop1_pre", "hclk_vop1_pre_c", 10, 11), + GATE(ACLK_VOP1_PRE, "aclk_vop1_pre", "aclk_vop1_pre_c", 10, 10), + GATE(0, "hclk_vop0_pre", "hclk_vop0_pre_c", 10, 9), + GATE(ACLK_VOP0_PRE, "aclk_vop0_pre", "aclk_vop0_pre_c", 10, 8), + GATE(0, "clk_cifout_src", "clk_cifout_src_c", 10, 7), + GATE(SCLK_SPDIF_REC_DPTX, "clk_spdif_rec_dptx", "clk_spdif_rec_dptx_c", 10, 6), + GATE(SCLK_I2C7, "clk_i2c7", "clk_i2c7_c", 10, 5), + GATE(SCLK_I2C3, "clk_i2c3", "clk_i2c3_c", 10, 4), + GATE(SCLK_I2C6, "clk_i2c6", "clk_i2c6_c", 10, 3), + GATE(SCLK_I2C2, "clk_i2c2", "clk_i2c2_c", 10, 2), + GATE(SCLK_I2C5, "clk_i2c5", "clk_i2c5_c", 10, 1), + GATE(SCLK_I2C1, "clk_i2c1", "clk_i2c1_c", 10, 0), - /* CRU_CLKGATE_CON22 */ - CRU_GATE(PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", 0x358, 5) - CRU_GATE(PCLK_I2C1, "pclk_rki2c1", "pclk_perilp1", 0x358, 6) - CRU_GATE(PCLK_I2C5, "pclk_rki2c5", "pclk_perilp1", 0x358, 7) - CRU_GATE(PCLK_I2C6, "pclk_rki2c6", "pclk_perilp1", 0x358, 8) - CRU_GATE(PCLK_I2C2, "pclk_rki2c2", "pclk_perilp1", 0x358, 9) - CRU_GATE(PCLK_I2C3, "pclk_rki2c3", "pclk_perilp1", 0x358, 10) - /* CRU_CLKGATE_CON23 */ - CRU_GATE(PCLK_SPI0, "pclk_spi0", "pclk_perilp1", 0x35C, 10) - CRU_GATE(PCLK_SPI1, "pclk_spi1", "pclk_perilp1", 0x35C, 11) - CRU_GATE(PCLK_SPI2, "pclk_spi2", "pclk_perilp1", 0x35C, 12) - CRU_GATE(PCLK_SPI4, "pclk_spi4", "pclk_perilp1", 0x35C, 13) + /* CRU_CLKGATE_CON11 */ + GATE(SCLK_MIPIDPHY_CFG, "clk_mipidphy_cfg", "xin24m", 11, 15), + GATE(SCLK_MIPIDPHY_REF, "clk_mipidphy_ref", "xin24m", 11, 14), + /* 13-12 unused */ + GATE(PCLK_EDP, "pclk_edp", "pclk_edp_c", 11, 11), + GATE(PCLK_HDCP, "pclk_hdcp", "pclk_hdcp_c", 11, 10), + /* 9 unuwsed */ + GATE(SCLK_DP_CORE, "clk_dp_core", "clk_dp_core_c", 11, 8), + GATE(SCLK_HDMI_CEC, "clk_hdmi_cec", "clk_hdmi_cec_c", 11, 7), + GATE(SCLK_HDMI_SFR, "clk_hdmi_sfr", "xin24m", 11, 6), + GATE(SCLK_ISP1, "clk_isp1", "clk_isp1_c", 11, 5), + GATE(SCLK_ISP0, "clk_isp0", "clk_isp0_c", 11, 4), + GATE(HCLK_HDCP, "hclk_hdcp", "hclk_hdcp_c", 11, 3), + GATE(ACLK_HDCP, "aclk_hdcp", "aclk_hdcp_c", 11, 2), + GATE(PCLK_VIO, "pclk_vio", "pclk_vio_c", 11, 1), + GATE(ACLK_VIO, "aclk_vio", "aclk_vio_c", 11, 0), - /* CRU_CLKGATE_CON30 */ - CRU_GATE(ACLK_USB3_NOC, "aclk_usb3_noc", "aclk_usb3", 0x378, 0) - CRU_GATE(ACLK_USB3OTG0, "aclk_usb3otg0", "aclk_usb3", 0x378, 1) - CRU_GATE(ACLK_USB3OTG1, "aclk_usb3otg1", "aclk_usb3", 0x378, 2) - CRU_GATE(ACLK_USB3_RKSOC_AXI_PERF, "aclk_usb3_rksoc_axi_perf", "aclk_usb3", 0x378, 3) - CRU_GATE(ACLK_USB3_GRF, "aclk_usb3_grf", "aclk_usb3", 0x378, 4) + /* CRU_CLKGATE_CON12 */ + /* 15 - 14 unused */ + GATE(HCLK_SD, "hclk_sd", "hclk_sd_c", 12, 13), + GATE(ACLK_GIC_PRE, "aclk_gic_pre", "aclk_gic_pre_c", 12, 12), + GATE(HCLK_ISP1, "hclk_isp1", "hclk_isp1_c", 12, 11), + GATE(ACLK_ISP1, "aclk_isp1", "aclk_isp1_c", 12, 10), + GATE(HCLK_ISP0, "hclk_isp0", "hclk_isp0_c", 12, 9), + GATE(ACLK_ISP0, "aclk_isp0", "aclk_isp0_c", 12, 8), + /* 7 unused */ + GATE(SCLK_PCIEPHY_REF100M, "clk_pciephy_ref100m", "clk_pciephy_ref100m_c", 12, 6), + /* 5 unused */ + GATE(SCLK_USB3OTG1_SUSPEND, "clk_usb3otg1_suspend", "clk_usb3otg1_suspend_c", 12, 4), + GATE(SCLK_USB3OTG0_SUSPEND, "clk_usb3otg0_suspend", "clk_usb3otg0_suspend_c", 12, 3), + GATE(SCLK_USB3OTG1_REF, "clk_usb3otg1_ref", "xin24m", 12, 2), + GATE(SCLK_USB3OTG0_REF, "clk_usb3otg0_ref", "xin24m", 12, 1), + GATE(ACLK_USB3, "aclk_usb3", "aclk_usb3_c", 12, 0), - /* CRU_CLKGATE_CON31 */ - CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3) - CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) - CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) + /* CRU_CLKGATE_CON13 */ + GATE(SCLK_TESTCLKOUT2, "clk_testout2", "clk_testout2_c", 13, 15), + GATE(SCLK_TESTCLKOUT1, "clk_testout1", "clk_testout1_c", 13, 14), + GATE(SCLK_SPI5, "clk_spi5", "clk_spi5_c", 13, 13), + GATE(0, "clk_usbphy0_480m_src", "clk_usbphy0_480m", 13, 12), + GATE(0, "clk_usbphy1_480m_src", "clk_usbphy1_480m", 13, 12), + GATE(0, "clk_test", "clk_test_c", 13, 11), + /* 10 unused */ + GATE(0, "clk_test_frac", "clk_test_frac_c", 13, 9), + /* 8 unused */ + GATE(SCLK_UPHY1_TCPDCORE, "clk_uphy1_tcpdcore", "clk_uphy1_tcpdcore_c", 13, 7), + GATE(SCLK_UPHY1_TCPDPHY_REF, "clk_uphy1_tcpdphy_ref", "clk_uphy1_tcpdphy_ref_c", 13, 6), + GATE(SCLK_UPHY0_TCPDCORE, "clk_uphy0_tcpdcore", "clk_uphy0_tcpdcore_c", 13, 5), + GATE(SCLK_UPHY0_TCPDPHY_REF, "clk_uphy0_tcpdphy_ref", "clk_uphy0_tcpdphy_ref_c", 13, 4), + /* 3 - 2 unused */ + GATE(SCLK_PVTM_GPU, "aclk_pvtm_gpu", "xin24m", 13, 1), + GATE(0, "aclk_gpu_pre", "aclk_gpu_pre_c", 13, 0), - /* CRU_CLKGATE_CON32 */ - CRU_GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc", 0x380, 8) - CRU_GATE(ACLK_EMMC_NOC, "aclk_emmc_noc", "aclk_emmc", 0x380, 9) - CRU_GATE(ACLK_EMMC_GRF, "aclk_emmcgrf", "aclk_emmc", 0x380, 10) + /* CRU_CLKGATE_CON14 */ + /* 15 - 14 unused */ + GATE(ACLK_PERF_CORE_L, "aclk_perf_core_l", "aclkm_core_l", 14, 13), + GATE(ACLK_CORE_ADB400_CORE_L_2_CCI500, "aclk_core_adb400_core_l_2_cci500", "aclkm_core_l", 14, 12), + GATE(ACLK_GIC_ADB400_CORE_L_2_GIC, "aclk_core_adb400_core_l_2_gic", "armclkl", 14, 11), + GATE(ACLK_GIC_ADB400_GIC_2_CORE_L, "aclk_core_adb400_gic_2_core_l", "armclkl", 14, 10), + GATE(0, "clk_dbg_pd_core_l", "armclkl", 14, 9), + /* 8 - 7 unused */ + GATE(ACLK_PERF_CORE_B, "aclk_perf_core_b", "aclkm_core_b", 14, 6), + GATE(ACLK_CORE_ADB400_CORE_B_2_CCI500, "aclk_core_adb400_core_b_2_cci500", "aclkm_core_b", 14, 5), + GATE(ACLK_GIC_ADB400_CORE_B_2_GIC, "aclk_core_adb400_core_b_2_gic", "armclkb", 14, 4), + GATE(ACLK_GIC_ADB400_GIC_2_CORE_B, "aclk_core_adb400_gic_2_core_b", "armclkb", 14, 3), + GATE(0, "pclk_dbg_cxcs_pd_core_b", "pclk_dbg_core_b", 14, 2), + GATE(0, "clk_dbg_pd_core_b", "armclkb", 14, 1), + /* 0 unused */ - /* CRU_CLKGATE_CON33 */ - CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8) + /* CRU_CLKGATE_CON15 */ + /* 15 - 8 unused */ + GATE(ACLK_CCI_GRF, "aclk_cci_grf", "aclk_cci_pre", 15, 7), + GATE(0, "clk_dbg_noc", "clk_cs", 15, 6), + GATE(0, "clk_dbg_cxcs", "clk_cs", 15, 5), + GATE(ACLK_CCI_NOC1, "aclk_cci_noc1", "aclk_cci_pre", 15, 4), + GATE(ACLK_CCI_NOC0, "aclk_cci_noc0", "aclk_cci_pre", 15, 3), + GATE(ACLK_CCI, "aclk_cci", "aclk_cci_pre", 15, 2), + GATE(ACLK_ADB400M_PD_CORE_B, "aclk_adb400m_pd_core_b", "aclk_cci_pre", 15, 1), + GATE(ACLK_ADB400M_PD_CORE_L, "aclk_adb400m_pd_core_l", "aclk_cci_pre", 15, 0), - /* CRU_CLKGATE_CON34 */ - CRU_GATE(PCLK_SPI4, "pclk_spi5", "pclk_perilp1", 0x388, 5) -}; + /* CRU_CLKGATE_CON16 */ + /* 15 - 12 unused */ + GATE(HCLK_RGA_NOC, "hclk_rga_noc", "hclk_rga_pre", 16, 11), + GATE(HCLK_RGA, "hclk_rga", "hclk_rga_pre", 16, 10), + GATE(ACLK_RGA_NOC, "aclk_rga_noc", "aclk_rga_pre", 16, 9), + GATE(ACLK_RGA, "aclk_rga", "aclk_rga_pre", 16, 8), + /* 7 - 4 unused */ + GATE(HCLK_IEP_NOC, "hclk_iep_noc", "hclk_iep_pre", 16, 3), + GATE(HCLK_IEP, "hclk_iep", "hclk_iep_pre", 16, 2), + GATE(ACLK_IEP_NOC, "aclk_iep_noc", "aclk_iep_pre", 16, 1), + GATE(ACLK_IEP, "aclk_iep", "aclk_iep_pre", 16, 0), -/* - * PLLs - */ + /* CRU_CLKGATE_CON17 */ + /* 15 - 12 unused */ + GATE(HCLK_VDU_NOC, "hclk_vdu_noc", "hclk_vdu_pre", 17, 11), + GATE(HCLK_VDU, "hclk_vdu", "hclk_vdu_pre", 17, 10), + GATE(ACLK_VDU_NOC, "aclk_vdu_noc", "aclk_vdu_pre", 17, 9), + GATE(ACLK_VDU, "aclk_vdu", "aclk_vdu_pre", 17, 8), + GATE(0, "hclk_vcodec_noc", "hclk_vcodec_pre", 17, 3), + GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 17, 2), + GATE(0, "aclk_vcodec_noc", "aclk_vcodec_pre", 17, 1), + GATE(ACLK_VCODEC, "aclk_vcodec", "aclk_vcodec_pre", 17, 0), -#define PLL_APLLL 1 -#define PLL_APLLB 2 -#define PLL_DPLL 3 -#define PLL_CPLL 4 -#define PLL_GPLL 5 -#define PLL_NPLL 6 -#define PLL_VPLL 7 + /* CRU_CLKGATE_CON18 */ + GATE(PCLK_CIC, "pclk_cic", "pclk_ddr", 18, 15), + GATE(0, "clk_ddr_mon_timer", "xin24m", 18, 14), + GATE(0, "clk_ddr_mon", "clk_ddrc_div2", 18, 13), + GATE(PCLK_DDR_MON, "pclk_ddr_mon", "pclk_ddr", 18, 12), + GATE(0, "clk_ddr_cic", "clk_ddrc_div2", 18, 11), + GATE(PCLK_CENTER_MAIN_NOC, "pclk_center_main_noc", "pclk_ddr", 18, 10), + GATE(0, "clk_ddrcfg_msch1", "clk_ddrc_div2", 18, 9), + GATE(0, "clk_ddrphy1", "clk_ddrc_div2", 18, 8), + GATE(0, "clk_ddrphy_ctrl1", "clk_ddrc_div2", 18, 7), + GATE(0, "clk_ddrc1", "clk_ddrc_div2", 18, 6), + GATE(0, "clk_ddr1_msch", "clk_ddrc_div2", 18, 5), + GATE(0, "clk_ddrcfg_msch0", "clk_ddrc_div2", 18, 4), + GATE(0, "clk_ddrphy0", "clk_ddrc_div2", 18, 3), + GATE(0, "clk_ddrphy_ctrl0", "clk_ddrc_div2", 18, 2), + GATE(0, "clk_ddrc0", "clk_ddrc_div2", 18, 1), -static struct rk_clk_pll_rate rk3399_pll_rates[] = { - { - .freq = 2208000000, - .refdiv = 1, - .fbdiv = 92, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2184000000, - .refdiv = 1, - .fbdiv = 91, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2160000000, - .refdiv = 1, - .fbdiv = 90, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2136000000, - .refdiv = 1, - .fbdiv = 89, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2112000000, - .refdiv = 1, - .fbdiv = 88, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2088000000, - .refdiv = 1, - .fbdiv = 87, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2064000000, - .refdiv = 1, - .fbdiv = 86, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2040000000, - .refdiv = 1, - .fbdiv = 85, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 2016000000, - .refdiv = 1, - .fbdiv = 84, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1992000000, - .refdiv = 1, - .fbdiv = 83, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1968000000, - .refdiv = 1, - .fbdiv = 82, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1944000000, - .refdiv = 1, - .fbdiv = 81, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1920000000, - .refdiv = 1, - .fbdiv = 80, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1896000000, - .refdiv = 1, - .fbdiv = 79, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1872000000, - .refdiv = 1, - .fbdiv = 78, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1848000000, - .refdiv = 1, - .fbdiv = 77, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1824000000, - .refdiv = 1, - .fbdiv = 76, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1800000000, - .refdiv = 1, - .fbdiv = 75, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1776000000, - .refdiv = 1, - .fbdiv = 74, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1752000000, - .refdiv = 1, - .fbdiv = 73, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1728000000, - .refdiv = 1, - .fbdiv = 72, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1704000000, - .refdiv = 1, - .fbdiv = 71, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1680000000, - .refdiv = 1, - .fbdiv = 70, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1656000000, - .refdiv = 1, - .fbdiv = 69, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1632000000, - .refdiv = 1, - .fbdiv = 68, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1608000000, - .refdiv = 1, - .fbdiv = 67, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1600000000, - .refdiv = 3, - .fbdiv = 200, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1584000000, - .refdiv = 1, - .fbdiv = 66, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1560000000, - .refdiv = 1, - .fbdiv = 65, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1536000000, - .refdiv = 1, - .fbdiv = 64, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1512000000, - .refdiv = 1, - .fbdiv = 63, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1488000000, - .refdiv = 1, - .fbdiv = 62, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1464000000, - .refdiv = 1, - .fbdiv = 61, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1440000000, - .refdiv = 1, - .fbdiv = 60, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1416000000, - .refdiv = 1, - .fbdiv = 59, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1392000000, - .refdiv = 1, - .fbdiv = 58, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1368000000, - .refdiv = 1, - .fbdiv = 57, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1344000000, - .refdiv = 1, - .fbdiv = 56, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1320000000, - .refdiv = 1, - .fbdiv = 55, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1296000000, - .refdiv = 1, - .fbdiv = 54, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1272000000, - .refdiv = 1, - .fbdiv = 53, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1248000000, - .refdiv = 1, - .fbdiv = 52, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1200000000, - .refdiv = 1, - .fbdiv = 50, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1188000000, - .refdiv = 2, - .fbdiv = 99, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1104000000, - .refdiv = 1, - .fbdiv = 46, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1100000000, - .refdiv = 12, - .fbdiv = 550, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1008000000, - .refdiv = 1, - .fbdiv = 84, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1000000000, - .refdiv = 1, - .fbdiv = 125, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 984000000, - .refdiv = 1, - .fbdiv = 82, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 960000000, - .refdiv = 1, - .fbdiv = 80, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 936000000, - .refdiv = 1, - .fbdiv = 78, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 912000000, - .refdiv = 1, - .fbdiv = 76, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 900000000, - .refdiv = 4, - .fbdiv = 300, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 888000000, - .refdiv = 1, - .fbdiv = 74, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 864000000, - .refdiv = 1, - .fbdiv = 72, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 840000000, - .refdiv = 1, - .fbdiv = 70, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 816000000, - .refdiv = 1, - .fbdiv = 68, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 800000000, - .refdiv = 1, - .fbdiv = 100, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 700000000, - .refdiv = 6, - .fbdiv = 350, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 696000000, - .refdiv = 1, - .fbdiv = 58, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 676000000, - .refdiv = 3, - .fbdiv = 169, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 600000000, - .refdiv = 1, - .fbdiv = 75, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 594000000, - .refdiv = 1, - .fbdiv = 99, - .postdiv1 = 4, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 533250000, - .refdiv = 8, - .fbdiv = 711, - .postdiv1 = 4, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 504000000, - .refdiv = 1, - .fbdiv = 63, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 500000000, - .refdiv = 6, - .fbdiv = 250, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 408000000, - .refdiv = 1, - .fbdiv = 68, - .postdiv1 = 2, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 312000000, - .refdiv = 1, - .fbdiv = 52, - .postdiv1 = 2, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 297000000, - .refdiv = 1, - .fbdiv = 99, - .postdiv1 = 4, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 216000000, - .refdiv = 1, - .fbdiv = 72, - .postdiv1 = 4, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 148500000, - .refdiv = 1, - .fbdiv = 99, - .postdiv1 = 4, - .postdiv2 = 4, - .dsmpd = 1, - }, - { - .freq = 106500000, - .refdiv = 1, - .fbdiv = 71, - .postdiv1 = 4, - .postdiv2 = 4, - .dsmpd = 1, - }, - { - .freq = 96000000, - .refdiv = 1, - .fbdiv = 64, - .postdiv1 = 4, - .postdiv2 = 4, - .dsmpd = 1, - }, - { - .freq = 74250000, - .refdiv = 2, - .fbdiv = 99, - .postdiv1 = 4, - .postdiv2 = 4, - .dsmpd = 1, - }, - { - .freq = 65000000, - .refdiv = 1, - .fbdiv = 65, - .postdiv1 = 6, - .postdiv2 = 4, - .dsmpd = 1, - }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 26 20:46:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6FC61C1046; Tue, 26 Nov 2019 20:46:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Mwt441byz4FVl; Tue, 26 Nov 2019 20:46:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ED1329F1; Tue, 26 Nov 2019 20:46:20 +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 xAQKkK90066756; Tue, 26 Nov 2019 20:46:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQKkKNr066755; Tue, 26 Nov 2019 20:46:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911262046.xAQKkKNr066755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Nov 2019 20:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355119 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 355119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 20:46:20 -0000 Author: emaste Date: Tue Nov 26 20:46:20 2019 New Revision: 355119 URL: https://svnweb.freebsd.org/changeset/base/355119 Log: stop building arm LINT-V5 kernel r354290 removed arm.arm from universe, but arm.arm kernels were still found and built during the kernel stage. r354934 tagged armv5 kernel configs as NO_UNIVERSE, but LINT-V5 remained. Stop building it as well. Leave the clean rule in place for now so folks don't end up with a stale LINT-V5. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22560 Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Tue Nov 26 19:04:19 2019 (r355118) +++ head/sys/conf/makeLINT.mk Tue Nov 26 20:46:20 2019 (r355119) @@ -12,6 +12,8 @@ clean: rm -f LINT-NOINET LINT-NOINET6 LINT-NOIP .endif .if ${TARGET} == "arm" + # LINT-V5 removed 2019-11-26. The clean rule is left here temporarily + # to avoid having stale copies left behind. rm -f LINT-V5 LINT-V7 .endif .if ${TARGET} == "powerpc" @@ -54,8 +56,6 @@ LINT: ${NOTES} ${MAKELINT_SED} echo "nodevice netmap" >> ${.TARGET}-NOIP .endif .if ${TARGET} == "arm" - cat ${NOTES} ${.CURDIR}/NOTES.armv5 | sed -E -n -f ${MAKELINT_SED} > \ - ${.TARGET}-V5 cat ${NOTES} ${.CURDIR}/NOTES.armv7 | sed -E -n -f ${MAKELINT_SED} > \ ${.TARGET}-V7 rm ${.TARGET} From owner-svn-src-head@freebsd.org Tue Nov 26 21:18:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4413A1C1AFF; Tue, 26 Nov 2019 21:18:55 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Mxbf27zdz4H0T; Tue, 26 Nov 2019 21:18:54 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: by mail-wr1-x436.google.com with SMTP id 4so20920540wro.7; Tue, 26 Nov 2019 13:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=tSIz9qpDFduj+r36ox0b5TcT/Yhv/2mMK5N2CoYfwFI=; b=r/1Fk85e2gLs0pjwAe8mWmc5Cz1zY0qRtlSpfAGCb5qhJIJWbJh166mnBjE1Vizsq1 4ZwOiCpFrmCgP4aatmTNWPM3Dzq9Dt2J9GolfSWTe+30d/HSIbu1Id5outytaZLEQI9T 3tfw8h/astvY1mjrvoxb6GQEFRgzXLHnIEcKFKWGQUQCravJl8fNiMKlltHurso1sVJn M/c0JZguTTq1tnFgzms7FdoM/yXTP+g9+gZsyc5rDZWAWlN2JvF4dzBXmejESbj7I48h waT3/UhQcTHShzrDzGEjxZKXbjMlt5ghlr1bLOHxPxhhNreQYyV3FrAsUaKvfBid+3tu PC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=tSIz9qpDFduj+r36ox0b5TcT/Yhv/2mMK5N2CoYfwFI=; b=i2EQqEIMva2dB8lnU6K/gmvfZoNkGDOaR561pAzu0AYM1DQdEO8lCP8lwSe71pMTRL WDW7q+pbGt0iXBUFBY0daTcMa8nUQzpRSPpae5G8AOAR7V4dG2WfUrYm9+PuCmxknGok jSNqdzYX/94rqKH5wzWXwM6xKHOupfAowV+WHvlJYrcQOcCrhlibEFilWDa7FEXGj5YF sBZnuezx37evra6r9k9iNW6017KcA0Q+kQjpi7x29mESKBIp0B6jmcSfhTjkoL67Fviv WUBaLWHjyPZDQjSWVb8GszPkTYss4Gob5oV60zS2YdAGWYONCTpgZZDKSKSxLuqV7s/t ATvQ== X-Gm-Message-State: APjAAAXWlCTw1IyRTumHI/piHueRVHJ8teKAopoDztI6xG/+JFbTmf4l UPBsl9T0SqKTM8VBrCVJd3bBfw6DVP7L4Q== X-Google-Smtp-Source: APXvYqzBZ+wZunI3gJ8kYiPcWtcnfsno6ZBbA9xrlUN4UH0whuscUGEfP2EHdbeZ3BpC2VIo/E3OIQ== X-Received: by 2002:adf:f290:: with SMTP id k16mr41276431wro.224.1574803132652; Tue, 26 Nov 2019 13:18:52 -0800 (PST) Received: from [192.168.1.102] (236.215.broadband18.iol.cz. [109.81.215.236]) by smtp.gmail.com with ESMTPSA id j10sm16365006wrx.30.2019.11.26.13.18.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Nov 2019 13:18:52 -0800 (PST) Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: rgrimes@freebsd.org, Alan Somers Cc: Florian Smeets , "Conrad E. Meyer" , svn-src-head , Hiroki Sato , svn-src-all , src-committers References: <201911260057.xAQ0vH6W000351@gndrsh.dnsmgr.net> From: Jan Sucan Message-ID: <51e71914-98a8-2219-bbfa-c075d786e2fb@gmail.com> Date: Tue, 26 Nov 2019 22:18:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911260057.xAQ0vH6W000351@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 47Mxbf27zdz4H0T X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=r/1Fk85e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sucanjan@gmail.com designates 2a00:1450:4864:20::436 as permitted sender) smtp.mailfrom=sucanjan@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[8]; RECEIVED_SPAMHAUS_PBL(0.00)[236.215.81.109.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-9.16), ipnet: 2a00:1450::/32(-2.70), asn: 15169(-1.95), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[6.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 21:18:55 -0000 On 26. 11. 2019 1:57, Rodney W. Grimes wrote: >> On Mon, Nov 25, 2019 at 10:57 AM Florian Smeets wrote: >> >>> On 26.08.19 06:28, Jan Sucan wrote: >>>> Hello, >>>> >>>> I can implement it. I suppose that ping6's manual page should be kept it >>>> this case. >>>> >>>> I was also thinking about printing a warning for each option renamed to >>>> lead a willing user to use the new unified option set of ping. It could >>>> be either only with -v, or by default and suppressed with -q. Or should >>>> the option translation be completely transparent? >>> Is there an update on this? I found out the hard way today, as I updated >>> my icinga2 host from an revision before this change to a current >>> revision. In this case it's not as easy as fixing a script e.g. >>> net-mgmt/monitoring-plugins check_ping command calls /sbin/ping6 with -X. >>> >>> Will we get a ping6 that is fully backward compatible, or should we >>> start fixing ports? >>> >>> Thanks, >>> Florian >>> >> Still a work in progress, though there hasn't been any progress lately. >> https://reviews.freebsd.org/D21434 > Wouldn't it make since to back the breaking change out until the fixing > work in process can be completed? > I have been a bit busy lately, but I think I will be able to make some progress with the backward compatibility in the next days. Stay tuned. From owner-svn-src-head@freebsd.org Tue Nov 26 22:01:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 642791C2ACF; Tue, 26 Nov 2019 22:01:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MyXQ1B91z4K9H; Tue, 26 Nov 2019 22:01:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8A4338AD; Tue, 26 Nov 2019 22:01:09 +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 xAQM19Gn013608; Tue, 26 Nov 2019 22:01:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQM19rt013607; Tue, 26 Nov 2019 22:01:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911262201.xAQM19rt013607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 26 Nov 2019 22:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355120 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 355120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 22:01:10 -0000 Author: dim Date: Tue Nov 26 22:01:09 2019 New Revision: 355120 URL: https://svnweb.freebsd.org/changeset/base/355120 Log: The fdlibm hypot() implementations shouldn't potentially left-shift negative numbers (invoking undefined behavior) Summary: Various paths through hypot(x, y) will multiply x and y by a power of two, perform the calculation in a range where IEEE-754 provides greater precision, then undo the multiplication to determine the true result. Undoing that multiplication is implemented as t1*w, where t1=2**k. 2**k is often computed by taking the high word of 1.0, then adding k<<20 (for doubles or long doubles) or k<<23 (for floats) to it, then overwriting that high word. But when k is negative this left-shifts a negative value -- and that's undefined behavior in many editions of C and C++. This patch should fix all hypot implementations to compute 2**k without triggering this particular bit of undefined behavior. Test Plan: I've only very lightly tested out the hypot(double, double) change, in SpiderMonkey's JavaScript engine, for consistency with prior behavior. The other functions' changes have more or less only been eyeballed. Careful examination appreciated! Do note, however, that an error in any of these changes would most likely produce a value that is incorrect by a factor of two, so any mistake would most likely be glaring if invoked. Submitted by: Jeff Walden Obtained from: https://github.com/freebsd/freebsd/pull/414 Reviewed by: dim, lwhsu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22354 Modified: head/lib/msun/src/e_hypot.c head/lib/msun/src/e_hypotf.c Modified: head/lib/msun/src/e_hypot.c ============================================================================== --- head/lib/msun/src/e_hypot.c Tue Nov 26 20:46:20 2019 (r355119) +++ head/lib/msun/src/e_hypot.c Tue Nov 26 22:01:09 2019 (r355120) @@ -118,10 +118,8 @@ __ieee754_hypot(double x, double y) w = sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b))); } if(k!=0) { - u_int32_t high; - t1 = 1.0; - GET_HIGH_WORD(high,t1); - SET_HIGH_WORD(t1,high+(k<<20)); + t1 = 0.0; + SET_HIGH_WORD(t1,(1023+k)<<20); return t1*w; } else return w; } Modified: head/lib/msun/src/e_hypotf.c ============================================================================== --- head/lib/msun/src/e_hypotf.c Tue Nov 26 20:46:20 2019 (r355119) +++ head/lib/msun/src/e_hypotf.c Tue Nov 26 22:01:09 2019 (r355120) @@ -77,7 +77,7 @@ __ieee754_hypotf(float x, float y) w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); } if(k!=0) { - SET_FLOAT_WORD(t1,0x3f800000+(k<<23)); + SET_FLOAT_WORD(t1,(127+k)<<23); return t1*w; } else return w; } From owner-svn-src-head@freebsd.org Tue Nov 26 22:17:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15D311C307E; Tue, 26 Nov 2019 22:17:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Mytl0Bxjz4KxM; Tue, 26 Nov 2019 22:17:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE01F3C9F; Tue, 26 Nov 2019 22:17:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAQMH2pI025158; Tue, 26 Nov 2019 22:17:02 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQMH24m025157; Tue, 26 Nov 2019 22:17:02 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911262217.xAQMH24m025157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 26 Nov 2019 22:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355121 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Nov 2019 22:17:03 -0000 Author: jeff Date: Tue Nov 26 22:17:02 2019 New Revision: 355121 URL: https://svnweb.freebsd.org/changeset/base/355121 Log: Refactor uma_zalloc_arg(). It is a mess of gotos and code which doesn't make sense after many partial refactors. Attempt to make a smaller cache footprint for the fast path. Reviewed by: markj, rlibby Differential Revision: https://reviews.freebsd.org/D22470 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 26 22:01:09 2019 (r355120) +++ head/sys/vm/uma_core.c Tue Nov 26 22:17:02 2019 (r355121) @@ -273,7 +273,7 @@ static void bucket_init(void); static uma_bucket_t bucket_alloc(uma_zone_t zone, void *, int); static void bucket_free(uma_zone_t zone, uma_bucket_t, void *); static void bucket_zone_drain(void); -static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int, int); +static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int); static uma_slab_t zone_fetch_slab(uma_zone_t, uma_keg_t, int, int); static void *slab_alloc_item(uma_keg_t keg, uma_slab_t slab); static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); @@ -282,6 +282,7 @@ static uma_keg_t uma_kcreate(uma_zone_t zone, size_t s static int zone_import(uma_zone_t, void **, int, int, int); static void zone_release(uma_zone_t, void **, int); static void uma_zero_item(void *, uma_zone_t); +static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); void uma_print_zone(uma_zone_t); void uma_print_stats(void); @@ -2441,18 +2442,58 @@ uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void * uma_zfree_arg(zone, item, udata); } +static inline void * +bucket_pop(uma_zone_t zone, uma_cache_t cache, uma_bucket_t bucket) +{ + void *item; + + bucket->ub_cnt--; + item = bucket->ub_bucket[bucket->ub_cnt]; +#ifdef INVARIANTS + bucket->ub_bucket[bucket->ub_cnt] = NULL; + KASSERT(item != NULL, ("uma_zalloc: Bucket pointer mangled.")); +#endif + cache->uc_allocs++; + + return (item); +} + +static void * +item_ctor(uma_zone_t zone, void *udata, int flags, void *item) +{ +#ifdef INVARIANTS + int skipdbg; + + skipdbg = uma_dbg_zskip(zone, item); + if (zone->uz_ctor != NULL && + (!skipdbg || zone->uz_ctor != trash_ctor || + zone->uz_dtor != trash_dtor) && +#else + if (__predict_false(zone->uz_ctor != NULL) && +#endif + zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { + counter_u64_add(zone->uz_fails, 1); + zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); + return (NULL); + } +#ifdef INVARIANTS + if (!skipdbg) + uma_dbg_alloc(zone, NULL, item); +#endif + if (flags & M_ZERO) + uma_zero_item(item, zone); + + return (item); +} + /* See uma.h */ void * uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) { - uma_zone_domain_t zdom; uma_bucket_t bucket; uma_cache_t cache; void *item; - int cpu, domain, lockfail, maxbucket; -#ifdef INVARIANTS - bool skipdbg; -#endif + int cpu, domain; /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); @@ -2501,56 +2542,55 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags * the current cache; when we re-acquire the critical section, we * must detect and handle migration if it has occurred. */ -zalloc_restart: critical_enter(); - cpu = curcpu; - cache = &zone->uz_cpu[cpu]; - -zalloc_start: - bucket = cache->uc_allocbucket; - if (bucket != NULL && bucket->ub_cnt > 0) { - bucket->ub_cnt--; - item = bucket->ub_bucket[bucket->ub_cnt]; -#ifdef INVARIANTS - bucket->ub_bucket[bucket->ub_cnt] = NULL; -#endif - KASSERT(item != NULL, ("uma_zalloc: Bucket pointer mangled.")); - cache->uc_allocs++; - critical_exit(); -#ifdef INVARIANTS - skipdbg = uma_dbg_zskip(zone, item); -#endif - if (zone->uz_ctor != NULL && -#ifdef INVARIANTS - (!skipdbg || zone->uz_ctor != trash_ctor || - zone->uz_dtor != trash_dtor) && -#endif - zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { - counter_u64_add(zone->uz_fails, 1); - zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); - return (NULL); + do { + cpu = curcpu; + cache = &zone->uz_cpu[cpu]; + bucket = cache->uc_allocbucket; + if (__predict_true(bucket != NULL && bucket->ub_cnt != 0)) { + item = bucket_pop(zone, cache, bucket); + critical_exit(); + return (item_ctor(zone, udata, flags, item)); } -#ifdef INVARIANTS - if (!skipdbg) - uma_dbg_alloc(zone, NULL, item); -#endif - if (flags & M_ZERO) - uma_zero_item(item, zone); - return (item); - } + } while (cache_alloc(zone, cache, udata, flags)); + critical_exit(); /* - * We have run out of items in our alloc bucket. - * See if we can switch with our free bucket. + * We can not get a bucket so try to return a single item. */ + if (zone->uz_flags & UMA_ZONE_NUMA) + domain = PCPU_GET(domain); + else + domain = UMA_ANYDOMAIN; + return (zone_alloc_item_locked(zone, udata, domain, flags)); +} + +/* + * Replenish an alloc bucket and possibly restore an old one. Called in + * a critical section. Returns in a critical section. + * + * A false return value indicates failure and returns with the zone lock + * held. A true return value indicates success and the caller should retry. + */ +static __noinline bool +cache_alloc(uma_zone_t zone, uma_cache_t cache, void *udata, int flags) +{ + uma_zone_domain_t zdom; + uma_bucket_t bucket; + int cpu, domain; + bool lockfail; + + CRITICAL_ASSERT(curthread); + + /* + * If we have run out of items in our alloc bucket see + * if we can switch with the free bucket. + */ bucket = cache->uc_freebucket; - if (bucket != NULL && bucket->ub_cnt > 0) { - CTR2(KTR_UMA, - "uma_zalloc: zone %s(%p) swapping empty with alloc", - zone->uz_name, zone); + if (bucket != NULL && bucket->ub_cnt != 0) { cache->uc_freebucket = cache->uc_allocbucket; cache->uc_allocbucket = bucket; - goto zalloc_start; + return (true); } /* @@ -2562,16 +2602,6 @@ zalloc_start: if (bucket != NULL) bucket_free(zone, bucket, udata); - /* Short-circuit for zones without buckets and low memory. */ - if (zone->uz_count == 0 || bucketdisable) { - ZONE_LOCK(zone); - if (zone->uz_flags & UMA_ZONE_NUMA) - domain = PCPU_GET(domain); - else - domain = UMA_ANYDOMAIN; - goto zalloc_item; - } - /* * Attempt to retrieve the item from the per-CPU cache has failed, so * we must go back to the zone. This requires the zone lock, so we @@ -2587,14 +2617,19 @@ zalloc_start: ZONE_LOCK(zone); lockfail = 1; } + critical_enter(); + /* Short-circuit for zones without buckets and low memory. */ + if (zone->uz_count == 0 || bucketdisable) + return (false); + cpu = curcpu; cache = &zone->uz_cpu[cpu]; /* See if we lost the race to fill the cache. */ if (cache->uc_allocbucket != NULL) { ZONE_UNLOCK(zone); - goto zalloc_start; + return (true); } /* @@ -2609,11 +2644,11 @@ zalloc_start: } if ((bucket = zone_fetch_bucket(zone, zdom)) != NULL) { + ZONE_UNLOCK(zone); KASSERT(bucket->ub_cnt != 0, ("uma_zalloc_arg: Returning an empty bucket.")); cache->uc_allocbucket = bucket; - ZONE_UNLOCK(zone); - goto zalloc_start; + return (true); } /* We are no longer associated with this CPU. */ critical_exit(); @@ -2625,71 +2660,39 @@ zalloc_start: if (lockfail && zone->uz_count < zone->uz_count_max) zone->uz_count++; - if (zone->uz_max_items > 0) { - if (zone->uz_items >= zone->uz_max_items) - goto zalloc_item; - maxbucket = MIN(zone->uz_count, - zone->uz_max_items - zone->uz_items); - zone->uz_items += maxbucket; - } else - maxbucket = zone->uz_count; - ZONE_UNLOCK(zone); - /* - * Now lets just fill a bucket and put it on the free list. If that - * works we'll restart the allocation from the beginning and it - * will use the just filled bucket. + * Fill a bucket and attempt to use it as the alloc bucket. */ - bucket = zone_alloc_bucket(zone, udata, domain, flags, maxbucket); + bucket = zone_alloc_bucket(zone, udata, domain, flags); CTR3(KTR_UMA, "uma_zalloc: zone %s(%p) bucket zone returned %p", zone->uz_name, zone, bucket); - ZONE_LOCK(zone); - if (bucket != NULL) { - if (zone->uz_max_items > 0 && bucket->ub_cnt < maxbucket) { - MPASS(zone->uz_items >= maxbucket - bucket->ub_cnt); - zone->uz_items -= maxbucket - bucket->ub_cnt; - if (zone->uz_sleepers > 0 && - zone->uz_items < zone->uz_max_items) - wakeup_one(zone); - } - critical_enter(); - cpu = curcpu; - cache = &zone->uz_cpu[cpu]; + critical_enter(); + if (bucket == NULL) + return (false); - /* - * See if we lost the race or were migrated. Cache the - * initialized bucket to make this less likely or claim - * the memory directly. - */ - if (cache->uc_allocbucket == NULL && - ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || - domain == PCPU_GET(domain))) { - cache->uc_allocbucket = bucket; - zdom->uzd_imax += bucket->ub_cnt; - } else if (zone->uz_bkt_count >= zone->uz_bkt_max) { - critical_exit(); - ZONE_UNLOCK(zone); - bucket_drain(zone, bucket); - bucket_free(zone, bucket, udata); - goto zalloc_restart; - } else - zone_put_bucket(zone, zdom, bucket, false); - ZONE_UNLOCK(zone); - goto zalloc_start; - } else if (zone->uz_max_items > 0) { - zone->uz_items -= maxbucket; - if (zone->uz_sleepers > 0 && - zone->uz_items + 1 < zone->uz_max_items) - wakeup_one(zone); - } - /* - * We may not be able to get a bucket so return an actual item. + * See if we lost the race or were migrated. Cache the + * initialized bucket to make this less likely or claim + * the memory directly. */ -zalloc_item: - item = zone_alloc_item_locked(zone, udata, domain, flags); - - return (item); + cpu = curcpu; + cache = &zone->uz_cpu[cpu]; + if (cache->uc_allocbucket == NULL && + ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || + domain == PCPU_GET(domain))) { + cache->uc_allocbucket = bucket; + zdom->uzd_imax += bucket->ub_cnt; + } else if (zone->uz_bkt_count >= zone->uz_bkt_max) { + critical_exit(); + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + critical_enter(); + return (true); + } else + zone_put_bucket(zone, zdom, bucket, false); + ZONE_UNLOCK(zone); + return (true); } void * @@ -2943,9 +2946,10 @@ zone_import(uma_zone_t zone, void **bucket, int max, i } static uma_bucket_t -zone_alloc_bucket(uma_zone_t zone, void *udata, int domain, int flags, int max) +zone_alloc_bucket(uma_zone_t zone, void *udata, int domain, int flags) { uma_bucket_t bucket; + int maxbucket, cnt; CTR1(KTR_UMA, "zone_alloc:_bucket domain %d)", domain); @@ -2953,13 +2957,25 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do if (domain != UMA_ANYDOMAIN && VM_DOMAIN_EMPTY(domain)) domain = UMA_ANYDOMAIN; + if (zone->uz_max_items > 0) { + if (zone->uz_items >= zone->uz_max_items) + return (false); + maxbucket = MIN(zone->uz_count, + zone->uz_max_items - zone->uz_items); + zone->uz_items += maxbucket; + } else + maxbucket = zone->uz_count; + ZONE_UNLOCK(zone); + /* Don't wait for buckets, preserve caller's NOVM setting. */ bucket = bucket_alloc(zone, udata, M_NOWAIT | (flags & M_NOVM)); - if (bucket == NULL) - return (NULL); + if (bucket == NULL) { + cnt = 0; + goto out; + } bucket->ub_cnt = zone->uz_import(zone->uz_arg, bucket->ub_bucket, - MIN(max, bucket->ub_entries), domain, flags); + MIN(maxbucket, bucket->ub_entries), domain, flags); /* * Initialize the memory if necessary. @@ -2986,11 +3002,22 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do } } + cnt = bucket->ub_cnt; if (bucket->ub_cnt == 0) { bucket_free(zone, bucket, udata); counter_u64_add(zone->uz_fails, 1); - return (NULL); + bucket = NULL; } +out: + ZONE_LOCK(zone); + if (zone->uz_max_items > 0 && cnt < maxbucket) { + MPASS(zone->uz_items >= maxbucket - cnt); + zone->uz_items -= maxbucket - cnt; + if (zone->uz_sleepers > 0 && + (cnt == 0 ? zone->uz_items + 1 : zone->uz_items) < + zone->uz_max_items) + wakeup_one(zone); + } return (bucket); } @@ -3024,9 +3051,6 @@ static void * zone_alloc_item_locked(uma_zone_t zone, void *udata, int domain, int flags) { void *item; -#ifdef INVARIANTS - bool skipdbg; -#endif ZONE_LOCK_ASSERT(zone); @@ -3057,11 +3081,8 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i domain = UMA_ANYDOMAIN; if (zone->uz_import(zone->uz_arg, &item, 1, domain, flags) != 1) - goto fail; + goto fail_cnt; -#ifdef INVARIANTS - skipdbg = uma_dbg_zskip(zone, item); -#endif /* * We have to call both the zone's init (not the keg's init) * and the zone's ctor. This is because the item is going from @@ -3071,24 +3092,12 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i if (zone->uz_init != NULL) { if (zone->uz_init(item, zone->uz_size, flags) != 0) { zone_free_item(zone, item, udata, SKIP_FINI | SKIP_CNT); - goto fail; + goto fail_cnt; } } - if (zone->uz_ctor != NULL && -#ifdef INVARIANTS - (!skipdbg || zone->uz_ctor != trash_ctor || - zone->uz_dtor != trash_dtor) && -#endif - zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { - zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); + item = item_ctor(zone, udata, flags, item); + if (item == NULL) goto fail; - } -#ifdef INVARIANTS - if (!skipdbg) - uma_dbg_alloc(zone, NULL, item); -#endif - if (flags & M_ZERO) - uma_zero_item(item, zone); counter_u64_add(zone->uz_allocs, 1); CTR3(KTR_UMA, "zone_alloc_item item %p from %s(%p)", item, @@ -3096,13 +3105,15 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i return (item); +fail_cnt: + counter_u64_add(zone->uz_fails, 1); fail: if (zone->uz_max_items > 0) { ZONE_LOCK(zone); + /* XXX Decrement without wakeup */ zone->uz_items--; ZONE_UNLOCK(zone); } - counter_u64_add(zone->uz_fails, 1); CTR2(KTR_UMA, "zone_alloc_item failed from %s(%p)", zone->uz_name, zone); return (NULL); From owner-svn-src-head@freebsd.org Wed Nov 27 00:18:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 719541C5B3B; Wed, 27 Nov 2019 00:18:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N1Zd2PNzz4RpP; Wed, 27 Nov 2019 00:18:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (unknown [IPv6:2601:648:8881:1e90:448e:f342:f404:5183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B8F97187A2; Wed, 27 Nov 2019 00:18:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r350017 - in head: lib/libc/sys sys/kern sys/sys tests/sys/kern To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <201907152148.x6FLm3EL068478@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <8b7be4f7-b8df-6951-5faa-7d35795a6a4c@FreeBSD.org> Date: Tue, 26 Nov 2019 16:18:12 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 00:18:17 -0000 On 11/25/19 11:01 AM, Kyle Evans wrote: > On Mon, Jul 15, 2019 at 4:48 PM John Baldwin wrote: >> >> Author: jhb >> Date: Mon Jul 15 21:48:02 2019 >> New Revision: 350017 >> URL: https://svnweb.freebsd.org/changeset/base/350017 >> >> Log: >> Add ptrace op PT_GET_SC_RET. >> >> This ptrace operation returns a structure containing the error and >> return values from the current system call. It is only valid when a >> thread is stopped during a system call exit (PL_FLAG_SCX is set). >> >> The sr_error member holds the error value from the system call. Note >> that this error value is the native FreeBSD error value that has _not_ >> been translated to an ABI-specific error value similar to the values >> logged to ktrace. >> >> If sr_error is zero, then the return values of the system call will be >> set in sr_retval[0] and sr_retval[1]. >> >> Reviewed by: kib >> MFC after: 1 month >> Sponsored by: DARPA >> Differential Revision: https://reviews.freebsd.org/D20901 >> >> Modified: >> head/lib/libc/sys/ptrace.2 >> head/sys/kern/sys_process.c >> head/sys/sys/ptrace.h >> head/tests/sys/kern/ptrace_test.c >> > > Hey John, > > Any objection to MFC'ing this to stable/12 at least? I've found this > to be almost-required in the ptrace user I've been working on > lately... I certainly ripped out plenty of hair before realizing that > it wasn't detecting error returns properly. Hmm, I did have it in my queue, but not the most urgent priority. Are you using truss or something else? You can achieve the same thing without the new op, it just requires arch-specific code to fetch the error status and return value from registers. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Nov 27 00:39:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F3D71C611C; Wed, 27 Nov 2019 00:39:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N23019gyz4SZp; Wed, 27 Nov 2019 00:39:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073AB55A8; Wed, 27 Nov 2019 00:39:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR0dNYB006502; Wed, 27 Nov 2019 00:39:23 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR0dNi9006499; Wed, 27 Nov 2019 00:39:23 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911270039.xAR0dNi9006499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 27 Nov 2019 00:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355122 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 355122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 00:39:24 -0000 Author: jeff Date: Wed Nov 27 00:39:23 2019 New Revision: 355122 URL: https://svnweb.freebsd.org/changeset/base/355122 Log: Use atomics in more cases for object references. We now can completely omit the object lock if we are above a certain threshold. Hold only a single vnode reference when the vnode object has any ref > 0. This allows us to only lock the object and vnode on 0-1 and 1-0 transitions. Differential Revision: https://reviews.freebsd.org/D22452 Modified: head/sys/sys/refcount.h head/sys/vm/vm_object.c head/sys/vm/vnode_pager.c Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Tue Nov 26 22:17:02 2019 (r355121) +++ head/sys/sys/refcount.h Wed Nov 27 00:39:23 2019 (r355122) @@ -72,7 +72,7 @@ refcount_init(volatile u_int *count, u_int value) *count = value; } -static __inline void +static __inline u_int refcount_acquire(volatile u_int *count) { u_int old; @@ -80,9 +80,11 @@ refcount_acquire(volatile u_int *count) old = atomic_fetchadd_int(count, 1); if (__predict_false(REFCOUNT_SATURATED(old))) _refcount_update_saturated(count); + + return (old); } -static __inline void +static __inline u_int refcount_acquiren(volatile u_int *count, u_int n) { u_int old; @@ -92,6 +94,8 @@ refcount_acquiren(volatile u_int *count, u_int n) old = atomic_fetchadd_int(count, n); if (__predict_false(REFCOUNT_SATURATED(old))) _refcount_update_saturated(count); + + return (old); } static __inline __result_use_check bool @@ -144,13 +148,13 @@ refcount_wait(volatile u_int *count, const char *wmesg * incremented. Else zero is returned. */ static __inline __result_use_check bool -refcount_acquire_if_not_zero(volatile u_int *count) +refcount_acquire_if_gt(volatile u_int *count, u_int n) { u_int old; old = *count; for (;;) { - if (REFCOUNT_COUNT(old) == 0) + if (REFCOUNT_COUNT(old) <= n) return (false); if (__predict_false(REFCOUNT_SATURATED(old))) return (true); @@ -160,19 +164,10 @@ refcount_acquire_if_not_zero(volatile u_int *count) } static __inline __result_use_check bool -refcount_release_if_not_last(volatile u_int *count) +refcount_acquire_if_not_zero(volatile u_int *count) { - u_int old; - old = *count; - for (;;) { - if (REFCOUNT_COUNT(old) == 1) - return (false); - if (__predict_false(REFCOUNT_SATURATED(old))) - return (true); - if (atomic_fcmpset_int(count, &old, old - 1)) - return (true); - } + return refcount_acquire_if_gt(count, 0); } static __inline __result_use_check bool @@ -193,4 +188,10 @@ refcount_release_if_gt(volatile u_int *count, u_int n) } } +static __inline __result_use_check bool +refcount_release_if_not_last(volatile u_int *count) +{ + + return refcount_release_if_gt(count, 1); +} #endif /* ! __SYS_REFCOUNT_H__ */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Nov 26 22:17:02 2019 (r355121) +++ head/sys/vm/vm_object.c Wed Nov 27 00:39:23 2019 (r355122) @@ -468,11 +468,28 @@ vm_object_allocate_anon(vm_pindex_t size) void vm_object_reference(vm_object_t object) { + struct vnode *vp; + u_int old; + if (object == NULL) return; - VM_OBJECT_RLOCK(object); - vm_object_reference_locked(object); - VM_OBJECT_RUNLOCK(object); + + /* + * Many places assume exclusive access to objects with a single + * ref. vm_object_collapse() in particular will directly mainpulate + * references for objects in this state. vnode objects only need + * the lock for the first ref to reference the vnode. + */ + if (!refcount_acquire_if_gt(&object->ref_count, + object->type == OBJT_VNODE ? 0 : 1)) { + VM_OBJECT_RLOCK(object); + old = refcount_acquire(&object->ref_count); + if (object->type == OBJT_VNODE && old == 0) { + vp = object->handle; + vref(vp); + } + VM_OBJECT_RUNLOCK(object); + } } /* @@ -486,10 +503,11 @@ void vm_object_reference_locked(vm_object_t object) { struct vnode *vp; + u_int old; VM_OBJECT_ASSERT_LOCKED(object); - refcount_acquire(&object->ref_count); - if (object->type == OBJT_VNODE) { + old = refcount_acquire(&object->ref_count); + if (object->type == OBJT_VNODE && old == 0) { vp = object->handle; vref(vp); } @@ -507,11 +525,10 @@ vm_object_vndeallocate(vm_object_t object) ("vm_object_vndeallocate: not a vnode object")); KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); - if (refcount_release(&object->ref_count) && - !umtx_shm_vnobj_persistent) + if (!umtx_shm_vnobj_persistent) umtx_shm_object_terminated(object); - VM_OBJECT_RUNLOCK(object); + VM_OBJECT_WUNLOCK(object); /* vrele may need the vnode lock. */ vrele(vp); } @@ -531,15 +548,9 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t robject, temp; - bool released; + bool last, released; while (object != NULL) { - VM_OBJECT_RLOCK(object); - if (object->type == OBJT_VNODE) { - vm_object_vndeallocate(object); - return; - } - /* * If the reference count goes to 0 we start calling * vm_object_terminate() on the object chain. A ref count @@ -551,7 +562,6 @@ vm_object_deallocate(vm_object_t object) released = refcount_release_if_gt(&object->ref_count, 1); else released = refcount_release_if_gt(&object->ref_count, 2); - VM_OBJECT_RUNLOCK(object); if (released) return; @@ -559,7 +569,14 @@ vm_object_deallocate(vm_object_t object) KASSERT(object->ref_count != 0, ("vm_object_deallocate: object deallocated too many times: %d", object->type)); - refcount_release(&object->ref_count); + last = refcount_release(&object->ref_count); + if (object->type == OBJT_VNODE) { + if (last) + vm_object_vndeallocate(object); + else + VM_OBJECT_WUNLOCK(object); + return; + } if (object->ref_count > 1) { VM_OBJECT_WUNLOCK(object); return; @@ -629,7 +646,7 @@ retry: VM_OBJECT_WUNLOCK(object); if (robject->ref_count == 1) { - robject->ref_count--; + refcount_release(&robject->ref_count); object = robject; goto doterm; } @@ -1838,7 +1855,7 @@ vm_object_collapse(vm_object_t object) backing_object)); vm_object_pip_wakeup(backing_object); backing_object->type = OBJT_DEAD; - backing_object->ref_count = 0; + refcount_release(&backing_object->ref_count); VM_OBJECT_WUNLOCK(backing_object); vm_object_destroy(backing_object); Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Nov 26 22:17:02 2019 (r355121) +++ head/sys/vm/vnode_pager.c Wed Nov 27 00:39:23 2019 (r355122) @@ -150,6 +150,7 @@ vnode_create_vobject(struct vnode *vp, off_t isize, st vm_object_t object; vm_ooffset_t size = isize; struct vattr va; + bool last; if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE) return (0); @@ -171,12 +172,15 @@ vnode_create_vobject(struct vnode *vp, off_t isize, st object = vnode_pager_alloc(vp, size, 0, 0, td->td_ucred); /* * Dereference the reference we just created. This assumes - * that the object is associated with the vp. + * that the object is associated with the vp. We still have + * to serialize with vnode_pager_dealloc() for the last + * potential reference. */ VM_OBJECT_RLOCK(object); - refcount_release(&object->ref_count); + last = refcount_release(&object->ref_count); VM_OBJECT_RUNLOCK(object); - vrele(vp); + if (last) + vrele(vp); KASSERT(vp->v_object != NULL, ("vnode_create_vobject: NULL object")); @@ -293,15 +297,17 @@ retry: } vp->v_object = object; VI_UNLOCK(vp); + vrefact(vp); } else { - VM_OBJECT_WLOCK(object); - refcount_acquire(&object->ref_count); + vm_object_reference(object); #if VM_NRESERVLEVEL > 0 - vm_object_color(object, 0); + if ((object->flags & OBJ_COLORED) == 0) { + VM_OBJECT_WLOCK(object); + vm_object_color(object, 0); + VM_OBJECT_WUNLOCK(object); + } #endif - VM_OBJECT_WUNLOCK(object); } - vrefact(vp); return (object); } @@ -345,7 +351,7 @@ vnode_pager_dealloc(vm_object_t object) vp->v_writecount = 0; VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(object); - while (refs-- > 0) + if (refs > 0) vunref(vp); VM_OBJECT_WLOCK(object); } From owner-svn-src-head@freebsd.org Wed Nov 27 01:13:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 937751C6AF9; Wed, 27 Nov 2019 01:13:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N2p93Fbbz4V3g; Wed, 27 Nov 2019 01:13:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4A26818E83; Wed, 27 Nov 2019 01:13:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id n4so23639582qte.2; Tue, 26 Nov 2019 17:13:21 -0800 (PST) X-Gm-Message-State: APjAAAVffg4NZvopi0vOSA8EtYoGuAPfxSZ7qK/YymJMLvJZ6IfEHTei elRbNIkbGwyTRopp87uyZTK/ljy1tzTjjKNazps= X-Google-Smtp-Source: APXvYqyC2wO36JRszudTdJ9tjgIW9Hcwpd96b4m2rSot8V39Q0GP5GQacQTz7K4+aeA+BLhFuJ846LnQApAgqWiGIu8= X-Received: by 2002:ac8:41cc:: with SMTP id o12mr37691084qtm.310.1574817200604; Tue, 26 Nov 2019 17:13:20 -0800 (PST) MIME-Version: 1.0 References: <201907152148.x6FLm3EL068478@repo.freebsd.org> <8b7be4f7-b8df-6951-5faa-7d35795a6a4c@FreeBSD.org> In-Reply-To: <8b7be4f7-b8df-6951-5faa-7d35795a6a4c@FreeBSD.org> From: Kyle Evans Date: Tue, 26 Nov 2019 19:13:08 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350017 - in head: lib/libc/sys sys/kern sys/sys tests/sys/kern To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 01:13:21 -0000 On Tue, Nov 26, 2019 at 6:18 PM John Baldwin wrote: > > On 11/25/19 11:01 AM, Kyle Evans wrote: > > On Mon, Jul 15, 2019 at 4:48 PM John Baldwin wrote: > >> > >> Author: jhb > >> Date: Mon Jul 15 21:48:02 2019 > >> New Revision: 350017 > >> URL: https://svnweb.freebsd.org/changeset/base/350017 > >> > >> Log: > >> Add ptrace op PT_GET_SC_RET. > >> > >> This ptrace operation returns a structure containing the error and > >> return values from the current system call. It is only valid when a > >> thread is stopped during a system call exit (PL_FLAG_SCX is set). > >> > >> The sr_error member holds the error value from the system call. Note > >> that this error value is the native FreeBSD error value that has _not_ > >> been translated to an ABI-specific error value similar to the values > >> logged to ktrace. > >> > >> If sr_error is zero, then the return values of the system call will be > >> set in sr_retval[0] and sr_retval[1]. > >> > >> Reviewed by: kib > >> MFC after: 1 month > >> Sponsored by: DARPA > >> Differential Revision: https://reviews.freebsd.org/D20901 > >> > >> Modified: > >> head/lib/libc/sys/ptrace.2 > >> head/sys/kern/sys_process.c > >> head/sys/sys/ptrace.h > >> head/tests/sys/kern/ptrace_test.c > >> > > > > Hey John, > > > > Any objection to MFC'ing this to stable/12 at least? I've found this > > to be almost-required in the ptrace user I've been working on > > lately... I certainly ripped out plenty of hair before realizing that > > it wasn't detecting error returns properly. > > Hmm, I did have it in my queue, but not the most urgent priority. Are > you using truss or something else? You can achieve the same thing without > the new op, it just requires arch-specific code to fetch the error status > and return value from registers. > Alrighty- that's good to hear. =-) It's actually an out-of-tree ptrace(2) user that's executing syscalls in the process it's attaching to. It works most of the time because the syscalls it's executing don't generally fail (mmap a single page was the only use until I started dorking with it), so it's not quite worth the overhead of adding the arch-specific bits to detect error (it grabs the return value, at least) -- this is generally just a small nicety for those of us debugging it. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Wed Nov 27 01:20:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30A751C6BF1; Wed, 27 Nov 2019 01:20:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N2yG0ZJMz4VFS; Wed, 27 Nov 2019 01:20:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6B245CA8; Wed, 27 Nov 2019 01:20:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR1KLBr030248; Wed, 27 Nov 2019 01:20:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR1KL2C030247; Wed, 27 Nov 2019 01:20:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911270120.xAR1KL2C030247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Nov 2019 01:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355123 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 01:20:22 -0000 Author: mjg Date: Wed Nov 27 01:20:21 2019 New Revision: 355123 URL: https://svnweb.freebsd.org/changeset/base/355123 Log: cache: hide "doingcache" behind DEBUG_CACHE Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Nov 27 00:39:23 2019 (r355122) +++ head/sys/kern/vfs_cache.c Wed Nov 27 01:20:21 2019 (r355123) @@ -330,9 +330,11 @@ cache_out_ts(struct namecache *ncp, struct timespec *t *ticksp = ncp_ts->nc_ticks; } +#ifdef DEBUG_CACHE static int __read_mostly doingcache = 1; /* 1 => enable the cache */ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, "VFS namecache enabled"); +#endif /* Export size information to userland */ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, @@ -1298,10 +1300,12 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st enum vgetstate vs; int error, ltype; +#ifdef DEBUG_CACHE if (__predict_false(!doingcache)) { cnp->cn_flags &= ~MAKEENTRY; return (0); } +#endif counter_u64_add(numcalls, 1); @@ -1681,8 +1685,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp, ("cache_enter: Doomed vnode used as src")); +#ifdef DEBUG_CACHE if (__predict_false(!doingcache)) return; +#endif /* * Avoid blowout in namecache entries. From owner-svn-src-head@freebsd.org Wed Nov 27 01:20:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A85731C6C6C; Wed, 27 Nov 2019 01:20:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N2yw3qwvz4VP6; Wed, 27 Nov 2019 01:20:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 683965CCA; Wed, 27 Nov 2019 01:20:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR1Kuht034236; Wed, 27 Nov 2019 01:20:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR1Kuie034221; Wed, 27 Nov 2019 01:20:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911270120.xAR1Kuie034221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Nov 2019 01:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355124 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 01:20:56 -0000 Author: mjg Date: Wed Nov 27 01:20:55 2019 New Revision: 355124 URL: https://svnweb.freebsd.org/changeset/base/355124 Log: cache: fix numcache accounting on entry . entries are never created and .. can reuse existing entries, meaning the early count bump is both spurious and leading to overcounting in certain cases. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Nov 27 01:20:21 2019 (r355123) +++ head/sys/kern/vfs_cache.c Wed Nov 27 01:20:55 2019 (r355124) @@ -1690,15 +1690,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, return; #endif - /* - * Avoid blowout in namecache entries. - */ - lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; - if (__predict_false(lnumcache >= ncsize)) { - atomic_add_long(&numcache, -1); - return; - } - cache_celockstate_init(&cel); ndd = NULL; ncp_ts = NULL; @@ -1760,6 +1751,15 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, SDT_PROBE3(vfs, namecache, enter, done, dvp, "..", vp); flag = NCF_ISDOTDOT; } + } + + /* + * Avoid blowout in namecache entries. + */ + lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (__predict_false(lnumcache >= ncsize)) { + atomic_add_long(&numcache, -1); + return; } held_dvp = false; From owner-svn-src-head@freebsd.org Wed Nov 27 01:21:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10C8D1C6CF6; Wed, 27 Nov 2019 01:21:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N2zp6mS8z4Vgh; Wed, 27 Nov 2019 01:21:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC6495E11; Wed, 27 Nov 2019 01:21:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR1LgLq035118; Wed, 27 Nov 2019 01:21:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR1LgYR035117; Wed, 27 Nov 2019 01:21:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911270121.xAR1LgYR035117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Nov 2019 01:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355125 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 01:21:43 -0000 Author: mjg Date: Wed Nov 27 01:21:42 2019 New Revision: 355125 URL: https://svnweb.freebsd.org/changeset/base/355125 Log: cache: stop reusing .. entries on enter It almost never happens in practice anyway. With this eliminated ->nc_vp cannot change vnodes, removing an obstacle on the road to lockless lookup. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Nov 27 01:20:55 2019 (r355124) +++ head/sys/kern/vfs_cache.c Wed Nov 27 01:21:42 2019 (r355125) @@ -1661,6 +1661,33 @@ cache_enter_unlock(struct celockstate *cel) cache_unlock_vnodes_cel(cel); } +static void __noinline +cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp) +{ + struct celockstate cel; + struct namecache *ncp; + uint32_t hash; + int len; + + if (dvp->v_cache_dd == NULL) + return; + len = cnp->cn_namelen; + cache_celockstate_init(&cel); + hash = cache_get_hash(cnp->cn_nameptr, len, dvp); + cache_enter_lock_dd(&cel, dvp, vp, hash); + ncp = dvp->v_cache_dd; + if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { + KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); + cache_zap_locked(ncp, false); + } else { + ncp = NULL; + } + dvp->v_cache_dd = NULL; + cache_enter_unlock(&cel); + cache_free(ncp); +} + /* * Add an entry to the cache. */ @@ -1672,11 +1699,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct namecache *ncp, *n2, *ndd; struct namecache_ts *ncp_ts, *n2_ts; struct nchashhead *ncpp; - struct neglist *neglist; uint32_t hash; int flag; int len; - bool neg_locked, held_dvp; + bool held_dvp; u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); @@ -1690,65 +1716,12 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, return; #endif - cache_celockstate_init(&cel); - ndd = NULL; - ncp_ts = NULL; flag = 0; - if (cnp->cn_nameptr[0] == '.') { + if (__predict_false(cnp->cn_nameptr[0] == '.')) { if (cnp->cn_namelen == 1) return; if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { - len = cnp->cn_namelen; - hash = cache_get_hash(cnp->cn_nameptr, len, dvp); - cache_enter_lock_dd(&cel, dvp, vp, hash); - /* - * If dotdot entry already exists, just retarget it - * to new parent vnode, otherwise continue with new - * namecache entry allocation. - */ - if ((ncp = dvp->v_cache_dd) != NULL && - ncp->nc_flag & NCF_ISDOTDOT) { - KASSERT(ncp->nc_dvp == dvp, - ("wrong isdotdot parent")); - neg_locked = false; - if (ncp->nc_flag & NCF_NEGATIVE || vp == NULL) { - neglist = NCP2NEGLIST(ncp); - mtx_lock(&ncneg_hot.nl_lock); - mtx_lock(&neglist->nl_lock); - neg_locked = true; - } - if (!(ncp->nc_flag & NCF_NEGATIVE)) { - TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, - ncp, nc_dst); - } else { - cache_negative_remove(ncp, true); - } - if (vp != NULL) { - TAILQ_INSERT_HEAD(&vp->v_cache_dst, - ncp, nc_dst); - if (ncp->nc_flag & NCF_HOTNEGATIVE) - numhotneg--; - ncp->nc_flag &= ~(NCF_NEGATIVE|NCF_HOTNEGATIVE); - } else { - if (ncp->nc_flag & NCF_HOTNEGATIVE) { - numhotneg--; - ncp->nc_flag &= ~(NCF_HOTNEGATIVE); - } - ncp->nc_flag |= NCF_NEGATIVE; - cache_negative_insert(ncp, true); - } - if (neg_locked) { - mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); - } - ncp->nc_vp = vp; - cache_enter_unlock(&cel); - return; - } - dvp->v_cache_dd = NULL; - cache_enter_unlock(&cel); - cache_celockstate_init(&cel); - SDT_PROBE3(vfs, namecache, enter, done, dvp, "..", vp); + cache_enter_dotdot_prep(dvp, vp, cnp); flag = NCF_ISDOTDOT; } } @@ -1761,6 +1734,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, atomic_add_long(&numcache, -1); return; } + + cache_celockstate_init(&cel); + ndd = NULL; + ncp_ts = NULL; held_dvp = false; if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { From owner-svn-src-head@freebsd.org Wed Nov 27 01:54:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C506F1C7418; Wed, 27 Nov 2019 01:54:40 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47N3jr4ms9z4Wj6; Wed, 27 Nov 2019 01:54:40 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E2C63AF; Wed, 27 Nov 2019 01:54:40 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR1seFX053649; Wed, 27 Nov 2019 01:54:40 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR1sep4053646; Wed, 27 Nov 2019 01:54:40 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911270154.xAR1sep4053646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 27 Nov 2019 01:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355126 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 01:54:40 -0000 Author: rlibby Date: Wed Nov 27 01:54:39 2019 New Revision: 355126 URL: https://svnweb.freebsd.org/changeset/base/355126 Log: witness: sleepable rm locks are not sleepable in read mode There are two classes of rm lock, one "sleepable" and one not. But even a "sleepable" rm lock is only sleepable in write mode, and is non-sleepable when taken in read mode. Warn about sleepable rm locks in read mode as non-sleepable locks. Do this by defining a new lock operation flag, LOP_NOSLEEP, to indicate that a lock is non-sleepable despite what the LO_SLEEPABLE flag would indicate, and defining a new witness lock instance flag, LI_SLEEPABLE, to track the product of LO_SLEEPABLE and LOP_NOSLEEP on the lock instance. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22527 Modified: head/sys/kern/kern_rmlock.c head/sys/kern/subr_witness.c head/sys/sys/lock.h Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Wed Nov 27 01:21:42 2019 (r355125) +++ head/sys/kern/kern_rmlock.c Wed Nov 27 01:54:39 2019 (r355126) @@ -652,8 +652,8 @@ _rm_rlock_debug(struct rmlock *rm, struct rm_priotrack KASSERT(!rm_wowned(rm), ("rm_rlock: wlock already held for %s @ %s:%d", rm->lock_object.lo_name, file, line)); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, - NULL); + WITNESS_CHECKORDER(&rm->lock_object, + LOP_NEWORDER | LOP_NOSLEEP, file, line, NULL); } if (_rm_rlock(rm, tracker, trylock)) { @@ -663,7 +663,7 @@ _rm_rlock_debug(struct rmlock *rm, struct rm_priotrack else LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, 0, file, line); + WITNESS_LOCK(&rm->lock_object, LOP_NOSLEEP, file, line); TD_LOCKS_INC(curthread); return (1); } else if (trylock) Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Nov 27 01:21:42 2019 (r355125) +++ head/sys/kern/subr_witness.c Wed Nov 27 01:54:39 2019 (r355126) @@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$"); #define LI_RECURSEMASK 0x0000ffff /* Recursion depth of lock instance. */ #define LI_EXCLUSIVE 0x00010000 /* Exclusive lock instance. */ #define LI_NORELEASE 0x00020000 /* Lock not allowed to be released. */ +#define LI_SLEEPABLE 0x00040000 /* Lock may be held while sleeping. */ #ifndef WITNESS_COUNT #define WITNESS_COUNT 1536 @@ -1302,7 +1303,7 @@ witness_checkorder(struct lock_object *lock, int flags * If we are locking Giant and this is a sleepable * lock, then skip it. */ - if ((lock1->li_lock->lo_flags & LO_SLEEPABLE) != 0 && + if ((lock1->li_flags & LI_SLEEPABLE) != 0 && lock == &Giant.lock_object) continue; @@ -1311,6 +1312,7 @@ witness_checkorder(struct lock_object *lock, int flags * is Giant, then skip it. */ if ((lock->lo_flags & LO_SLEEPABLE) != 0 && + (flags & LOP_NOSLEEP) == 0 && lock1->li_lock == &Giant.lock_object) continue; @@ -1320,15 +1322,16 @@ witness_checkorder(struct lock_object *lock, int flags * order violation to enfore a general lock order of * sleepable locks before non-sleepable locks. */ - if (((lock->lo_flags & LO_SLEEPABLE) != 0 && - (lock1->li_lock->lo_flags & LO_SLEEPABLE) == 0)) + if ((lock->lo_flags & LO_SLEEPABLE) != 0 && + (flags & LOP_NOSLEEP) == 0 && + (lock1->li_flags & LI_SLEEPABLE) == 0) goto reversal; /* * If we are locking Giant and this is a non-sleepable * lock, then treat it as a reversal. */ - if ((lock1->li_lock->lo_flags & LO_SLEEPABLE) == 0 && + if ((lock1->li_flags & LI_SLEEPABLE) == 0 && lock == &Giant.lock_object) goto reversal; @@ -1378,11 +1381,12 @@ witness_checkorder(struct lock_object *lock, int flags /* * Ok, yell about it. */ - if (((lock->lo_flags & LO_SLEEPABLE) != 0 && - (lock1->li_lock->lo_flags & LO_SLEEPABLE) == 0)) + if ((lock->lo_flags & LO_SLEEPABLE) != 0 && + (flags & LOP_NOSLEEP) == 0 && + (lock1->li_flags & LI_SLEEPABLE) == 0) witness_output( "lock order reversal: (sleepable after non-sleepable)\n"); - else if ((lock1->li_lock->lo_flags & LO_SLEEPABLE) == 0 + else if ((lock1->li_flags & LI_SLEEPABLE) == 0 && lock == &Giant.lock_object) witness_output( "lock order reversal: (Giant after non-sleepable)\n"); @@ -1440,7 +1444,8 @@ witness_checkorder(struct lock_object *lock, int flags */ if (flags & LOP_NEWORDER && !(plock->li_lock == &Giant.lock_object && - (lock->lo_flags & LO_SLEEPABLE) != 0)) { + (lock->lo_flags & LO_SLEEPABLE) != 0 && + (flags & LOP_NOSLEEP) == 0)) { CTR3(KTR_WITNESS, "%s: adding %s as a child of %s", __func__, w->w_name, plock->li_lock->lo_witness->w_name); itismychild(plock->li_lock->lo_witness, w); @@ -1500,10 +1505,11 @@ witness_lock(struct lock_object *lock, int flags, cons instance->li_lock = lock; instance->li_line = line; instance->li_file = file; + instance->li_flags = 0; if ((flags & LOP_EXCLUSIVE) != 0) - instance->li_flags = LI_EXCLUSIVE; - else - instance->li_flags = 0; + instance->li_flags |= LI_EXCLUSIVE; + if ((lock->lo_flags & LO_SLEEPABLE) != 0 && (flags & LOP_NOSLEEP) == 0) + instance->li_flags |= LI_SLEEPABLE; CTR4(KTR_WITNESS, "%s: pid %d added %s as lle[%d]", __func__, td->td_proc->p_pid, lock->lo_name, lle->ll_count - 1); } @@ -1763,7 +1769,7 @@ witness_warn(int flags, struct lock_object *lock, cons lock1->li_lock == &Giant.lock_object) continue; if (flags & WARN_SLEEPOK && - (lock1->li_lock->lo_flags & LO_SLEEPABLE) != 0) + (lock1->li_flags & LI_SLEEPABLE) != 0) continue; if (n == 0) { va_start(ap, fmt); Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Wed Nov 27 01:21:42 2019 (r355125) +++ head/sys/sys/lock.h Wed Nov 27 01:54:39 2019 (r355126) @@ -107,6 +107,7 @@ struct lock_class { #define LOP_TRYLOCK 0x00000004 /* Don't check lock order. */ #define LOP_EXCLUSIVE 0x00000008 /* Exclusive lock. */ #define LOP_DUPOK 0x00000010 /* Don't check for duplicate acquires */ +#define LOP_NOSLEEP 0x00000020 /* Non-sleepable despite LO_SLEEPABLE */ /* Flags passed to witness_assert. */ #define LA_MASKASSERT 0x000000ff /* Mask for witness defined asserts. */ From owner-svn-src-head@freebsd.org Wed Nov 27 07:51:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC66C1CCDDD; Wed, 27 Nov 2019 07:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NCdZ4cngz3HyM; Wed, 27 Nov 2019 07:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81F49A3DA; Wed, 27 Nov 2019 07:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAR7pUt1062594; Wed, 27 Nov 2019 07:51:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAR7pUaJ062593; Wed, 27 Nov 2019 07:51:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201911270751.xAR7pUaJ062593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Nov 2019 07:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355128 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 355128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 07:51:30 -0000 Author: delphij Date: Wed Nov 27 07:51:29 2019 New Revision: 355128 URL: https://svnweb.freebsd.org/changeset/base/355128 Log: Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800 MFC after: 3 days Modified: head/usr.sbin/ntp/ntpd/leap-seconds Modified: head/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- head/usr.sbin/ntp/ntpd/leap-seconds Wed Nov 27 03:18:35 2019 (r355127) +++ head/usr.sbin/ntp/ntpd/leap-seconds Wed Nov 27 07:51:29 2019 (r355128) @@ -62,7 +62,7 @@ # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. -# reprinted in: +# reprinted in: # Christine Hackman and Donald B Sullivan (eds.) # Time and Frequency Measurement # American Association of Physics Teachers (1996) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 # -#@ 3786480000 +#@ 3802291200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a +#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 From owner-svn-src-head@freebsd.org Wed Nov 27 10:24:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCB531CFDF9; Wed, 27 Nov 2019 10:24:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NH2Q4czZz3QYt; Wed, 27 Nov 2019 10:24:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81EBBC0C7; Wed, 27 Nov 2019 10:24:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARAOknS052444; Wed, 27 Nov 2019 10:24:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARAOkNX052443; Wed, 27 Nov 2019 10:24:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201911271024.xARAOkNX052443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 27 Nov 2019 10:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355129 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 355129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 10:24:46 -0000 Author: ae Date: Wed Nov 27 10:24:46 2019 New Revision: 355129 URL: https://svnweb.freebsd.org/changeset/base/355129 Log: Add support for dummy ESP packets with next header field equal to IPPROTO_NONE. According to RFC4303 2.6 they should be silently dropped. Submitted by: aurelien.cazuc.external_stormshield.eu MFC after: 10 days Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D22557 Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Wed Nov 27 07:51:29 2019 (r355128) +++ head/sys/netipsec/xform_esp.c Wed Nov 27 10:24:46 2019 (r355129) @@ -614,6 +614,13 @@ esp_input_cb(struct cryptop *crp) } } + /* + * RFC4303 2.6: + * Silently drop packet if next header field is IPPROTO_NONE. + */ + if (lastthree[2] == IPPROTO_NONE) + goto bad; + /* Trim the mbuf chain to remove trailing authenticator and padding */ m_adj(m, -(lastthree[1] + 2)); From owner-svn-src-head@freebsd.org Wed Nov 27 10:26:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96DFE1CFE8B; Wed, 27 Nov 2019 10:26:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NH4Z33Xkz3Qhw; Wed, 27 Nov 2019 10:26:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C1A3C0CB; Wed, 27 Nov 2019 10:26:38 +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 xARAQcYi052576; Wed, 27 Nov 2019 10:26:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARAQcki052575; Wed, 27 Nov 2019 10:26:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911271026.xARAQcki052575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 27 Nov 2019 10:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355130 - head/usr.sbin/sesutil X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/sesutil X-SVN-Commit-Revision: 355130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 10:26:38 -0000 Author: trasz Date: Wed Nov 27 10:26:37 2019 New Revision: 355130 URL: https://svnweb.freebsd.org/changeset/base/355130 Log: Fix typos. MFC after: 2 weeks Sponsored by: Klara, Inc Modified: head/usr.sbin/sesutil/eltsub.c Modified: head/usr.sbin/sesutil/eltsub.c ============================================================================== --- head/usr.sbin/sesutil/eltsub.c Wed Nov 27 10:24:46 2019 (r355129) +++ head/usr.sbin/sesutil/eltsub.c Wed Nov 27 10:26:37 2019 (r355130) @@ -65,11 +65,11 @@ geteltnm(int type) case ELMTYP_FAN: return ("Cooling"); case ELMTYP_THERM: - return ("Temperature Sensors"); + return ("Temperature Sensor"); case ELMTYP_DOORLOCK: return ("Door Lock"); case ELMTYP_ALARM: - return ("Audible alarm"); + return ("Audible Alarm"); case ELMTYP_ESCC: return ("Enclosure Services Controller Electronics"); case ELMTYP_SCC: From owner-svn-src-head@freebsd.org Wed Nov 27 16:52:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C6431B175C; Wed, 27 Nov 2019 16:52:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NRf72jYZz4HXp; Wed, 27 Nov 2019 16:52: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4075B186E8; Wed, 27 Nov 2019 16:52: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 xARGql8e081785; Wed, 27 Nov 2019 16:52:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARGqlfp081784; Wed, 27 Nov 2019 16:52:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911271652.xARGqlfp081784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 27 Nov 2019 16:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355132 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 355132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 16:52:47 -0000 Author: andrew Date: Wed Nov 27 16:52:46 2019 New Revision: 355132 URL: https://svnweb.freebsd.org/changeset/base/355132 Log: Support kernels larger than EFI_STAGING_SIZE in loader.efi With a very large kernel or module the staging area may be too small to hold it. When this is the case try to allocate more space before failing in the efi copyin/copyout/readin functions. Reviewed by: imp, tsoome Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22569 Modified: head/stand/efi/loader/copy.c Modified: head/stand/efi/loader/copy.c ============================================================================== --- head/stand/efi/loader/copy.c Wed Nov 27 13:46:28 2019 (r355131) +++ head/stand/efi/loader/copy.c Wed Nov 27 16:52:46 2019 (r355132) @@ -185,7 +185,7 @@ out: #endif #endif -EFI_PHYSICAL_ADDRESS staging, staging_end; +EFI_PHYSICAL_ADDRESS staging, staging_end, staging_base; int stage_offset_set = 0; ssize_t stage_offset; @@ -224,6 +224,7 @@ efi_copy_init(void) EFI_ERROR_CODE(status)); return (status); } + staging_base = staging; staging_end = staging + nr_pages * EFI_PAGE_SIZE; #if defined(__aarch64__) || defined(__arm__) @@ -240,6 +241,66 @@ efi_copy_init(void) return (0); } +static bool +efi_check_space(vm_offset_t end) +{ + EFI_PHYSICAL_ADDRESS addr; + EFI_STATUS status; + unsigned long nr_pages; + + /* There is already enough space */ + if (end <= staging_end) + return (true); + + end = roundup2(end, EFI_PAGE_SIZE); + nr_pages = EFI_SIZE_TO_PAGES(end - staging_end); + +#if defined(__i386__) || defined(__amd64__) + /* X86 needs all memory to be allocated under the 1G boundary */ + if (end > 1024*1024*1024) + goto before_staging; +#endif + + /* Try to allocate more space after the previous allocation */ + addr = staging_end; + status = BS->AllocatePages(AllocateAddress, EfiLoaderData, nr_pages, + &addr); + if (!EFI_ERROR(status)) { + staging_end = staging_end + nr_pages * EFI_PAGE_SIZE; + return (true); + } + +before_staging: + /* Try allocating space before the previous allocation */ + if (staging < nr_pages * EFI_PAGE_SIZE) { + printf("Not enough space before allocation\n"); + return (false); + } + addr = staging - nr_pages * EFI_PAGE_SIZE; +#if defined(__aarch64__) || defined(__arm__) + /* See efi_copy_init for why this is needed */ + addr = rounddown2(addr, 2 * 1024 * 1024); +#endif + nr_pages = EFI_SIZE_TO_PAGES(staging_base - addr); + status = BS->AllocatePages(AllocateAddress, EfiLoaderData, nr_pages, + &addr); + if (!EFI_ERROR(status)) { + /* + * Move the old allocation and update the state so + * translation still works. + */ + staging_base = addr; + memmove((void *)staging_base, (void *)staging, + staging_end - staging); + stage_offset -= (staging - staging_base); + staging = staging_base; + return (true); + } + + printf("efi_check_space: Unable to expand staging area\n"); + return (false); +} + void * efi_translate(vm_offset_t ptr) { @@ -257,7 +318,7 @@ efi_copyin(const void *src, vm_offset_t dest, const si } /* XXX: Callers do not check for failure. */ - if (dest + stage_offset + len > staging_end) { + if (!efi_check_space(dest + stage_offset + len)) { errno = ENOMEM; return (-1); } @@ -283,7 +344,7 @@ ssize_t efi_readin(const int fd, vm_offset_t dest, const size_t len) { - if (dest + stage_offset + len > staging_end) { + if (!efi_check_space(dest + stage_offset + len)) { errno = ENOMEM; return (-1); } From owner-svn-src-head@freebsd.org Wed Nov 27 19:12:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF6781B533F; Wed, 27 Nov 2019 19:12:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NVlN4jGwz4RBT; Wed, 27 Nov 2019 19:12:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84DE51A0E3; Wed, 27 Nov 2019 19:12:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARJCWt8064973; Wed, 27 Nov 2019 19:12:32 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARJCWUF064972; Wed, 27 Nov 2019 19:12:32 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201911271912.xARJCWUF064972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 27 Nov 2019 19:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355134 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 355134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 19:12:32 -0000 Author: scottl Date: Wed Nov 27 19:12:32 2019 New Revision: 355134 URL: https://svnweb.freebsd.org/changeset/base/355134 Log: Clean up and clarify meta commentary on TAA. Add a state to denote that TSX doesn't exist on the CPU. MFC after: 3 days Sponsored by: Intel Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed Nov 27 18:52:01 2019 (r355133) +++ head/sys/x86/x86/cpu_machdep.c Wed Nov 27 19:12:32 2019 (r355134) @@ -1180,11 +1180,15 @@ SYSCTL_PROC(_hw, OID_AUTO, mds_disable, CTLTYPE_INT | int x86_taa_enable; int x86_taa_state; enum { - TAA_NONE = 0, - TAA_TSX_DISABLE = 1, - TAA_VERW = 2, - TAA_AUTO = 3, - TAA_TAA_NO = 4 + TAA_NONE = 0, /* No mitigation enabled */ + TAA_TSX_DISABLE = 1, /* Disable TSX via MSR */ + TAA_VERW = 2, /* Use VERW mitigation */ + TAA_AUTO = 3, /* Automatically select the mitigation */ + + /* The states below are not selectable by the operator */ + + TAA_TAA_UC = 4, /* Mitigation present in microcode */ + TAA_NOT_PRESENT = 5 /* TSX is not present */ }; static void @@ -1208,7 +1212,7 @@ x86_taa_recalculate(void) if ((cpu_stdext_feature & CPUID_STDEXT_HLE) == 0 || (cpu_stdext_feature & CPUID_STDEXT_RTM) == 0) { /* TSX is not present */ - x86_taa_state = 0; + x86_taa_state = TAA_NOT_PRESENT; return; } @@ -1216,7 +1220,7 @@ x86_taa_recalculate(void) if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TAA_NO) { /* CPU is not suseptible to TAA */ taa_need = TAA_NONE; - taa_state = TAA_TAA_NO; + taa_state = TAA_TAA_UC; } else if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TSX_CTRL) { /* * CPU can turn off TSX. This is the next best option @@ -1323,9 +1327,11 @@ sysctl_taa_state_handler(SYSCTL_HANDLER_ARGS) case TAA_VERW: state = "VERW"; break; - case TAA_TAA_NO: - state = "Not vulnerable"; + case TAA_TAA_UC: + state = "Mitigated in microcode"; break; + case TAA_NOT_PRESENT: + state = "TSX not present"; default: state = "unknown"; } From owner-svn-src-head@freebsd.org Wed Nov 27 19:32:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A49851B5DBE; Wed, 27 Nov 2019 19:32:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NWBQ3wZxz4Sb8; Wed, 27 Nov 2019 19:32:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69E7D1A4A7; Wed, 27 Nov 2019 19:32:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARJWUdH077451; Wed, 27 Nov 2019 19:32:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARJWURH077450; Wed, 27 Nov 2019 19:32:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201911271932.xARJWURH077450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 27 Nov 2019 19:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355135 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 355135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 19:32:30 -0000 Author: tuexen Date: Wed Nov 27 19:32:29 2019 New Revision: 355135 URL: https://svnweb.freebsd.org/changeset/base/355135 Log: Plug two mbuf leaks during INIT-ACK handling. One leak happens when there is not enough memory to allocate the the resources for streams. The other leak happens if the are unknown parameters in the received INIT-ACK chunk which require reporting and the INIT-ACK requires sending an ABORT due to illegal parameter combinations. Hopefully this fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19083 MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Nov 27 19:12:32 2019 (r355134) +++ head/sys/netinet/sctp_input.c Wed Nov 27 19:32:29 2019 (r355135) @@ -495,6 +495,9 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int /* process the peer's parameters in the INIT-ACK */ retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); if (retval < 0) { + if (op_err != NULL) { + sctp_m_freem(op_err); + } return (retval); } initack_limit = offset + ntohs(cp->ch.chunk_length); @@ -502,6 +505,9 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int if ((retval = sctp_load_addresses_from_init(stcb, m, (offset + sizeof(struct sctp_init_chunk)), initack_limit, src, dst, NULL, stcb->asoc.port))) { + if (op_err != NULL) { + sctp_m_freem(op_err); + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Problem with address parameters"); SCTPDBG(SCTP_DEBUG_INPUT1, From owner-svn-src-head@freebsd.org Wed Nov 27 19:49:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2D671B6347; Wed, 27 Nov 2019 19:49:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NWZX4gTlz4TWK; Wed, 27 Nov 2019 19:49:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EB5D1A662; Wed, 27 Nov 2019 19:49:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARJnuJ5084182; Wed, 27 Nov 2019 19:49:56 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARJnuFl084178; Wed, 27 Nov 2019 19:49:56 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911271949.xARJnuFl084178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 27 Nov 2019 19:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355137 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 19:49:56 -0000 Author: rlibby Date: Wed Nov 27 19:49:55 2019 New Revision: 355137 URL: https://svnweb.freebsd.org/changeset/base/355137 Log: uma: trash memory when ctor/dtor supplied too On INVARIANTS kernels, UMA has a use-after-free detection mechanism. This mechanism previously required that all of the ctor/dtor/uminit/fini arguments to uma_zcreate() be NULL in order to function. Now, it only requires that uminit and fini be NULL; now, the trash ctor and dtor will be called in addition to any supplied ctor or dtor. Also do a little refactoring for readability of the resulting logic. This enables use-after-free detection for more zones, and will allow for simplification of some callers that worked around the previous restriction (see kern_mbuf.c). Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20722 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 27 19:34:33 2019 (r355136) +++ head/sys/vm/uma_core.c Wed Nov 27 19:49:55 2019 (r355137) @@ -1869,6 +1869,11 @@ zone_ctor(void *mem, int size, void *udata, int flags) for (i = 0; i < vm_ndomains; i++) TAILQ_INIT(&zone->uz_domain[i].uzd_buckets); +#ifdef INVARIANTS + if (arg->uminit == trash_init && arg->fini == trash_fini) + zone->uz_flags |= UMA_ZFLAG_TRASH; +#endif + /* * This is a pure cache zone, no kegs. */ @@ -2302,14 +2307,17 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct args.fini = fini; #ifdef INVARIANTS /* - * If a zone is being created with an empty constructor and - * destructor, pass UMA constructor/destructor which checks for - * memory use after free. + * Inject procedures which check for memory use after free if we are + * allowed to scramble the memory while it is not allocated. This + * requires that: UMA is actually able to access the memory, no init + * or fini procedures, no dependency on the initial value of the + * memory, and no (legitimate) use of the memory after free. Note, + * the ctor and dtor do not need to be empty. + * + * XXX UMA_ZONE_OFFPAGE. */ if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOFREE))) && - ctor == NULL && dtor == NULL && uminit == NULL && fini == NULL) { - args.ctor = trash_ctor; - args.dtor = trash_dtor; + uminit == NULL && fini == NULL) { args.uminit = trash_init; args.fini = trash_fini; } @@ -2462,15 +2470,14 @@ static void * item_ctor(uma_zone_t zone, void *udata, int flags, void *item) { #ifdef INVARIANTS - int skipdbg; + bool skipdbg; skipdbg = uma_dbg_zskip(zone, item); - if (zone->uz_ctor != NULL && - (!skipdbg || zone->uz_ctor != trash_ctor || - zone->uz_dtor != trash_dtor) && -#else - if (__predict_false(zone->uz_ctor != NULL) && + if (!skipdbg && (zone->uz_flags & UMA_ZFLAG_TRASH) != 0 && + zone->uz_ctor != trash_ctor) + trash_ctor(item, zone->uz_size, udata, flags); #endif + if (__predict_false(zone->uz_ctor != NULL) && zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { counter_u64_add(zone->uz_fails, 1); zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); @@ -2486,6 +2493,31 @@ item_ctor(uma_zone_t zone, void *udata, int flags, voi return (item); } +static inline void +item_dtor(uma_zone_t zone, void *item, void *udata, enum zfreeskip skip) +{ +#ifdef INVARIANTS + bool skipdbg; + + skipdbg = uma_dbg_zskip(zone, item); + if (skip == SKIP_NONE && !skipdbg) { + if ((zone->uz_flags & UMA_ZONE_MALLOC) != 0) + uma_dbg_free(zone, udata, item); + else + uma_dbg_free(zone, NULL, item); + } +#endif + if (skip < SKIP_DTOR) { + if (zone->uz_dtor != NULL) + zone->uz_dtor(item, zone->uz_size, udata); +#ifdef INVARIANTS + if (!skipdbg && (zone->uz_flags & UMA_ZFLAG_TRASH) != 0 && + zone->uz_dtor != trash_dtor) + trash_dtor(item, zone->uz_size, udata); +#endif + } +} + /* See uma.h */ void * uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) @@ -2523,6 +2555,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags if (zone->uz_ctor != NULL && zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { + counter_u64_add(zone->uz_fails, 1); zone->uz_fini(item, zone->uz_size); return (NULL); } @@ -3131,9 +3164,6 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata int itemdomain; #endif bool lockfail; -#ifdef INVARIANTS - bool skipdbg; -#endif /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); @@ -3157,20 +3187,7 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata return; } #endif -#ifdef INVARIANTS - skipdbg = uma_dbg_zskip(zone, item); - if (skipdbg == false) { - if (zone->uz_flags & UMA_ZONE_MALLOC) - uma_dbg_free(zone, udata, item); - else - uma_dbg_free(zone, NULL, item); - } - if (zone->uz_dtor != NULL && (!skipdbg || - zone->uz_dtor != trash_dtor || zone->uz_ctor != trash_ctor)) -#else - if (zone->uz_dtor != NULL) -#endif - zone->uz_dtor(item, zone->uz_size, udata); + item_dtor(zone, item, udata, SKIP_NONE); /* * The race here is acceptable. If we miss it we'll just have to wait @@ -3459,24 +3476,8 @@ zone_release(uma_zone_t zone, void **bucket, int cnt) static void zone_free_item(uma_zone_t zone, void *item, void *udata, enum zfreeskip skip) { -#ifdef INVARIANTS - bool skipdbg; - skipdbg = uma_dbg_zskip(zone, item); - if (skip == SKIP_NONE && !skipdbg) { - if (zone->uz_flags & UMA_ZONE_MALLOC) - uma_dbg_free(zone, udata, item); - else - uma_dbg_free(zone, NULL, item); - } - - if (skip < SKIP_DTOR && zone->uz_dtor != NULL && - (!skipdbg || zone->uz_dtor != trash_dtor || - zone->uz_ctor != trash_ctor)) -#else - if (skip < SKIP_DTOR && zone->uz_dtor != NULL) -#endif - zone->uz_dtor(item, zone->uz_size, udata); + item_dtor(zone, item, udata, skip); if (skip < SKIP_FINI && zone->uz_fini) zone->uz_fini(item, zone->uz_size); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Nov 27 19:34:33 2019 (r355136) +++ head/sys/vm/uma_int.h Wed Nov 27 19:49:55 2019 (r355137) @@ -389,6 +389,7 @@ struct uma_zone { #define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ #define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ #define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ +#define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ #define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ #define UMA_ZFLAG_INHERIT \ From owner-svn-src-head@freebsd.org Wed Nov 27 19:57:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE0EB1B6928; Wed, 27 Nov 2019 19:57:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NWl2664Yz4VMg; Wed, 27 Nov 2019 19:57:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4D071A851; Wed, 27 Nov 2019 19:57:18 +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 xARJvIdo090054; Wed, 27 Nov 2019 19:57:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARJvHCk090046; Wed, 27 Nov 2019 19:57:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911271957.xARJvHCk090046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Nov 2019 19:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355138 - in head/sys/x86: include iommu x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include iommu x86 X-SVN-Commit-Revision: 355138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 19:57:19 -0000 Author: kib Date: Wed Nov 27 19:57:17 2019 New Revision: 355138 URL: https://svnweb.freebsd.org/changeset/base/355138 Log: bus_dma_dmar_load_ident(9): load identity mapping into the map. Requested, reviewed and tested by: mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22559 Modified: head/sys/x86/include/bus_dma.h head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_gas.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/x86/include/bus_dma.h ============================================================================== --- head/sys/x86/include/bus_dma.h Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/include/bus_dma.h Wed Nov 27 19:57:17 2019 (r355138) @@ -193,6 +193,8 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t #ifdef _KERNEL bool bus_dma_dmar_set_buswide(device_t dev); +int bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags); #endif #endif /* !_X86_BUS_DMA_H_ */ Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/iommu/busdma_dmar.c Wed Nov 27 19:57:17 2019 (r355138) @@ -973,3 +973,66 @@ dmar_fini_busdma(struct dmar_unit *unit) taskqueue_free(unit->delayed_taskqueue); unit->delayed_taskqueue = NULL; } + +int +bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, + vm_paddr_t start, vm_size_t length, int flags) +{ + struct bus_dma_tag_common *tc; + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + struct dmar_ctx *ctx; + struct dmar_domain *domain; + struct dmar_map_entry *entry; + vm_page_t *ma; + vm_size_t i; + int error; + bool waitok; + + MPASS((start & PAGE_MASK) == 0); + MPASS((length & PAGE_MASK) == 0); + MPASS(length > 0); + MPASS(start + length >= start); + MPASS((flags & ~(BUS_DMA_NOWAIT | BUS_DMA_NOWRITE)) == 0); + + tc = (struct bus_dma_tag_common *)dmat; + if (tc->impl != &bus_dma_dmar_impl) + return (0); + + tag = (struct bus_dma_tag_dmar *)dmat; + ctx = tag->ctx; + domain = ctx->domain; + map = (struct bus_dmamap_dmar *)map1; + waitok = (flags & BUS_DMA_NOWAIT) != 0; + + entry = dmar_gas_alloc_entry(domain, waitok ? 0 : DMAR_PGF_WAITOK); + if (entry == NULL) + return (ENOMEM); + entry->start = start; + entry->end = start + length; + ma = malloc(sizeof(vm_page_t) * atop(length), M_TEMP, waitok ? + M_WAITOK : M_NOWAIT); + if (ma == NULL) { + dmar_gas_free_entry(domain, entry); + return (ENOMEM); + } + for (i = 0; i < atop(length); i++) { + ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, + VM_MEMATTR_DEFAULT); + } + error = dmar_gas_map_region(domain, entry, DMAR_MAP_ENTRY_READ | + ((flags & BUS_DMA_NOWRITE) ? 0 : DMAR_MAP_ENTRY_WRITE), + waitok ? DMAR_GM_CANWAIT : 0, ma); + if (error == 0) { + DMAR_DOMAIN_LOCK(domain); + TAILQ_INSERT_TAIL(&map->map_entries, entry, dmamap_link); + entry->flags |= DMAR_MAP_ENTRY_MAP; + DMAR_DOMAIN_UNLOCK(domain); + } else { + dmar_domain_unload_entry(entry, true); + } + for (i = 0; i < atop(length); i++) + vm_page_putfake(ma[i]); + free(ma, M_TEMP); + return (error); +} Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/iommu/intel_ctx.c Wed Nov 27 19:57:17 2019 (r355138) @@ -279,7 +279,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t } error1 = dmar_gas_map_region(domain, entry, DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, - DMAR_GM_CANWAIT, ma); + DMAR_GM_CANWAIT | DMAR_GM_RMRR, ma); /* * Non-failed RMRR entries are owned by context rb * tree. Get rid of the failed entry, but do not stop Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/iommu/intel_dmar.h Wed Nov 27 19:57:17 2019 (r355138) @@ -391,6 +391,7 @@ bool dmar_is_buswide_ctx(struct dmar_unit *unit, u_int #define DMAR_GM_CANWAIT 0x0001 #define DMAR_GM_CANSPLIT 0x0002 +#define DMAR_GM_RMRR 0x0004 #define DMAR_PGF_WAITOK 0x0001 #define DMAR_PGF_ZERO 0x0002 Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/iommu/intel_gas.c Wed Nov 27 19:57:17 2019 (r355138) @@ -543,13 +543,15 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru */ if (prev != NULL && prev->end > entry->start && (prev->flags & DMAR_MAP_ENTRY_PLACE) == 0) { - if ((prev->flags & DMAR_MAP_ENTRY_RMRR) == 0) + if ((flags & DMAR_GM_RMRR) == 0 || + (prev->flags & DMAR_MAP_ENTRY_RMRR) == 0) return (EBUSY); entry->start = prev->end; } if (next->start < entry->end && (next->flags & DMAR_MAP_ENTRY_PLACE) == 0) { - if ((next->flags & DMAR_MAP_ENTRY_RMRR) == 0) + if ((flags & DMAR_GM_RMRR) == 0 || + (next->flags & DMAR_MAP_ENTRY_RMRR) == 0) return (EBUSY); entry->end = next->start; } @@ -569,7 +571,8 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru found = dmar_gas_rb_insert(domain, entry); KASSERT(found, ("found RMRR dup %p start %jx end %jx", domain, (uintmax_t)entry->start, (uintmax_t)entry->end)); - entry->flags = DMAR_MAP_ENTRY_RMRR; + if ((flags & DMAR_GM_RMRR) != 0) + entry->flags = DMAR_MAP_ENTRY_RMRR; #ifdef INVARIANTS struct dmar_map_entry *ip, *in; @@ -689,7 +692,7 @@ dmar_gas_map_region(struct dmar_domain *domain, struct KASSERT(entry->flags == 0, ("used RMRR entry %p %p %x", domain, entry, entry->flags)); - KASSERT((flags & ~(DMAR_GM_CANWAIT)) == 0, + KASSERT((flags & ~(DMAR_GM_CANWAIT | DMAR_GM_RMRR)) == 0, ("invalid flags 0x%x", flags)); start = entry->start; Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Wed Nov 27 19:49:55 2019 (r355137) +++ head/sys/x86/x86/busdma_machdep.c Wed Nov 27 19:57:17 2019 (r355138) @@ -253,4 +253,11 @@ bus_dma_dmar_set_buswide(device_t dev) { return (false); } + +int +bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags) +{ + return (0); +} #endif From owner-svn-src-head@freebsd.org Wed Nov 27 20:00:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4151B1B6B23; Wed, 27 Nov 2019 20:00:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NWq1156Yz4Vw7; Wed, 27 Nov 2019 20:00:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A1441A8AC; Wed, 27 Nov 2019 20:00:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARK0i7x091669; Wed, 27 Nov 2019 20:00:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARK0i9g091668; Wed, 27 Nov 2019 20:00:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911272000.xARK0i9g091668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 27 Nov 2019 20:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355139 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 355139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:00:45 -0000 Author: brooks Date: Wed Nov 27 20:00:44 2019 New Revision: 355139 URL: https://svnweb.freebsd.org/changeset/base/355139 Log: Fix a logic bug when "mask" contains a ?: operator. Newer versions of clang warn that '&' evaluates before '?:'. Reviewed by: markj MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22573 Modified: head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwnvar.h ============================================================================== --- head/sys/dev/bwn/if_bwnvar.h Wed Nov 27 19:57:17 2019 (r355138) +++ head/sys/dev/bwn/if_bwnvar.h Wed Nov 27 20:00:44 2019 (r355139) @@ -129,7 +129,7 @@ struct bwn_mac; mac->mac_phy.phy_maskset(mac, offset, mask, 0); \ } else \ BWN_PHY_WRITE(mac, offset, \ - BWN_PHY_READ(mac, offset) & mask); \ + BWN_PHY_READ(mac, offset) & (mask)); \ } while (0) #define BWN_PHY_COPY(mac, dst, src) do { \ KASSERT(mac->mac_status < BWN_MAC_STATUS_INITED || \ From owner-svn-src-head@freebsd.org Wed Nov 27 20:08:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64E031B6DC0; Wed, 27 Nov 2019 20:08:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NX041qz6z4WBq; Wed, 27 Nov 2019 20:08:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2260E1AA5B; Wed, 27 Nov 2019 20:08:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARK8aTv096551; Wed, 27 Nov 2019 20:08:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARK8a59096550; Wed, 27 Nov 2019 20:08:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911272008.xARK8a59096550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Nov 2019 20:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355140 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:08:36 -0000 Author: cy Date: Wed Nov 27 20:08:35 2019 New Revision: 355140 URL: https://svnweb.freebsd.org/changeset/base/355140 Log: Remove redundant #ifdef'd function definitions. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:00:44 2019 (r355139) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:08:35 2019 (r355140) @@ -10279,7 +10279,6 @@ ipf_inet6_mask_del(bits, mask, mtab) ASSERT(mtab->imt6_max >= 0); } -#ifdef _KERNEL static u_int ipf_pcksum6(fin, ip6, off, len) fr_info_t *fin; @@ -10287,6 +10286,7 @@ ipf_pcksum6(fin, ip6, off, len) u_int32_t off; u_int32_t len; { +#ifdef _KERNEL struct mbuf *m; int sum; @@ -10297,15 +10297,7 @@ ipf_pcksum6(fin, ip6, off, len) sum = in6_cksum(m, ip6->ip6_nxt, off, len); return(sum); -} #else -static u_int -ipf_pcksum6(fin, ip6, off, len) - fr_info_t *fin; - ip6_t *ip6; - u_int32_t off; - u_int32_t len; -{ u_short *sp; u_int sum; @@ -10327,6 +10319,6 @@ ipf_pcksum6(fin, ip6, off, len) sum += *sp++; sum += *sp++; return(ipf_pcksum(fin, off, sum)); -} #endif +} #endif From owner-svn-src-head@freebsd.org Wed Nov 27 20:08:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE2E31B6E01; Wed, 27 Nov 2019 20:08:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NX074pdFz4WDM; Wed, 27 Nov 2019 20:08:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 884551AA5C; Wed, 27 Nov 2019 20:08:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARK8dLl096597; Wed, 27 Nov 2019 20:08:39 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARK8dXX096596; Wed, 27 Nov 2019 20:08:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911272008.xARK8dXX096596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Nov 2019 20:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355141 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:08:39 -0000 Author: cy Date: Wed Nov 27 20:08:39 2019 New Revision: 355141 URL: https://svnweb.freebsd.org/changeset/base/355141 Log: Save a little stack by removing a used once intermediate variable. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:08:35 2019 (r355140) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:08:39 2019 (r355141) @@ -10288,15 +10288,13 @@ ipf_pcksum6(fin, ip6, off, len) { #ifdef _KERNEL struct mbuf *m; - int sum; m = fin->fin_m; if (m->m_len < sizeof(struct ip6_hdr)) { return 0xffff; } - sum = in6_cksum(m, ip6->ip6_nxt, off, len); - return(sum); + return(in6_cksum(m, ip6->ip6_nxt, off, len)); #else u_short *sp; u_int sum; From owner-svn-src-head@freebsd.org Wed Nov 27 20:08:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF37F1B6E2C; Wed, 27 Nov 2019 20:08:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NX0C4CGrz4WKb; Wed, 27 Nov 2019 20:08:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750BF1AA5D; Wed, 27 Nov 2019 20:08:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARK8hZj096647; Wed, 27 Nov 2019 20:08:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARK8gaH096644; Wed, 27 Nov 2019 20:08:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911272008.xARK8gaH096644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Nov 2019 20:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355142 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:08:43 -0000 Author: cy Date: Wed Nov 27 20:08:42 2019 New Revision: 355142 URL: https://svnweb.freebsd.org/changeset/base/355142 Log: Move ipf_pcksum6() to its rightful place, in ip_fil_freebsd.c. This FreeBSD-only function should live in the O/S specific source file. This essentially reverts r349929 Now that ipftest and ipfreplay are disabled in FreeBSD 11-stable. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:08:39 2019 (r355141) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Nov 27 20:08:42 2019 (r355142) @@ -179,10 +179,6 @@ static int ipf_updateipid __P((fr_info_t *)); static int ipf_settimeout __P((struct ipf_main_softc_s *, struct ipftuneable *, ipftuneval_t *)); -#ifdef USE_INET6 -static u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *, - u_int32_t, u_int32_t)); -#endif #if !defined(_KERNEL) || SOLARIS static int ppsratecheck(struct timeval *, int *, int); #endif @@ -10277,46 +10273,5 @@ ipf_inet6_mask_del(bits, mask, mtab) } mtab->imt6_max--; ASSERT(mtab->imt6_max >= 0); -} - -static u_int -ipf_pcksum6(fin, ip6, off, len) - fr_info_t *fin; - ip6_t *ip6; - u_int32_t off; - u_int32_t len; -{ -#ifdef _KERNEL - struct mbuf *m; - - m = fin->fin_m; - if (m->m_len < sizeof(struct ip6_hdr)) { - return 0xffff; - } - - return(in6_cksum(m, ip6->ip6_nxt, off, len)); -#else - u_short *sp; - u_int sum; - - sp = (u_short *)&ip6->ip6_src; - sum = *sp++; /* ip6_src */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; /* ip6_dst */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - return(ipf_pcksum(fin, off, sum)); -#endif } #endif Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Nov 27 20:08:39 2019 (r355141) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Nov 27 20:08:42 2019 (r355142) @@ -1839,6 +1839,10 @@ extern int ipf_matchicmpqueryreply __P((int, icmpinfo struct icmp *, int)); extern u_32_t ipf_newisn __P((fr_info_t *)); extern u_int ipf_pcksum __P((fr_info_t *, int, u_int)); +#ifdef USE_INET6 +extern u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *, + u_int32_t, u_int32_t)); +#endif extern void ipf_rule_expire __P((ipf_main_softc_t *)); extern int ipf_scanlist __P((fr_info_t *, u_32_t)); extern frentry_t *ipf_srcgrpmap __P((fr_info_t *, u_32_t *)); Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Nov 27 20:08:39 2019 (r355141) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Nov 27 20:08:42 2019 (r355142) @@ -1453,3 +1453,48 @@ ipf_pcksum(fin, hlen, sum) sum2 = ~sum & 0xffff; return sum2; } + +#ifdef USE_INET6 +u_int +ipf_pcksum6(fin, ip6, off, len) + fr_info_t *fin; + ip6_t *ip6; + u_int32_t off; + u_int32_t len; +{ +#ifdef _KERNEL + struct mbuf *m; + int sum; + + m = fin->fin_m; + if (m->m_len < sizeof(struct ip6_hdr)) { + return 0xffff; + } + + sum = in6_cksum(m, ip6->ip6_nxt, off, len); + return(sum); +#else + u_short *sp; + u_int sum; + + sp = (u_short *)&ip6->ip6_src; + sum = *sp++; /* ip6_src */ + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; /* ip6_dst */ + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + return(ipf_pcksum(fin, off, sum)); +#endif +} +#endif From owner-svn-src-head@freebsd.org Wed Nov 27 20:32:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F387E1B7B0A; Wed, 27 Nov 2019 20:32:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NXWg6Fqbz4Xms; Wed, 27 Nov 2019 20:32:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA9831AFDB; Wed, 27 Nov 2019 20:32:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARKWVBE014542; Wed, 27 Nov 2019 20:32:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARKWV7W014541; Wed, 27 Nov 2019 20:32:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911272032.xARKWV7W014541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 27 Nov 2019 20:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355143 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 355143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:32:32 -0000 Author: markj Date: Wed Nov 27 20:32:31 2019 New Revision: 355143 URL: https://svnweb.freebsd.org/changeset/base/355143 Log: iwm(4): Fix version string formatting. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Nov 27 20:08:42 2019 (r355142) +++ head/sys/dev/iwm/if_iwm.c Wed Nov 27 20:32:31 2019 (r355143) @@ -851,7 +851,7 @@ iwm_read_firmware(struct iwm_softc *sc) goto parse_out; } snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), - "%d.%d.%d", + "%u.%u.%u", le32toh(((const uint32_t *)tlv_data)[0]), le32toh(((const uint32_t *)tlv_data)[1]), le32toh(((const uint32_t *)tlv_data)[2])); From owner-svn-src-head@freebsd.org Wed Nov 27 20:32:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D90191B7B86; Wed, 27 Nov 2019 20:32:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NXX56Ctnz4XvS; Wed, 27 Nov 2019 20:32:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8B7C1AFE0; Wed, 27 Nov 2019 20:32:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARKWrgS014626; Wed, 27 Nov 2019 20:32:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARKWrZQ014624; Wed, 27 Nov 2019 20:32:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911272032.xARKWrZQ014624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 27 Nov 2019 20:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355144 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 355144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:32:53 -0000 Author: markj Date: Wed Nov 27 20:32:53 2019 New Revision: 355144 URL: https://svnweb.freebsd.org/changeset/base/355144 Log: iwm(4): Remove _mvm from the namespace. This was inherited from iwlwifi, which drives devices supported by both iwn(4) and iwm(4) in FreeBSD. In iwm(4) _mvm is meaningless, so remove it. OpenBSD made the same change a long time ago. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_binding.c head/sys/dev/iwm/if_iwm_binding.h head/sys/dev/iwm/if_iwm_constants.h head/sys/dev/iwm/if_iwm_fw.c head/sys/dev/iwm/if_iwm_led.c head/sys/dev/iwm/if_iwm_led.h head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_mac_ctxt.h head/sys/dev/iwm/if_iwm_phy_ctxt.c head/sys/dev/iwm/if_iwm_phy_ctxt.h head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwm_power.h head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwm_scan.h head/sys/dev/iwm/if_iwm_sf.c head/sys/dev/iwm/if_iwm_sf.h head/sys/dev/iwm/if_iwm_sta.c head/sys/dev/iwm/if_iwm_sta.h head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h head/sys/dev/iwm/if_iwm_util.c head/sys/dev/iwm/if_iwm_util.h head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Nov 27 20:32:31 2019 (r355143) +++ head/sys/dev/iwm/if_iwm.c Wed Nov 27 20:32:53 2019 (r355144) @@ -231,10 +231,10 @@ struct iwm_nvm_section { uint8_t *data; }; -#define IWM_MVM_UCODE_ALIVE_TIMEOUT hz -#define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) +#define IWM_UCODE_ALIVE_TIMEOUT hz +#define IWM_UCODE_CALIB_TIMEOUT (2*hz) -struct iwm_mvm_alive_data { +struct iwm_alive_data { int valid; uint32_t scd_base_addr; }; @@ -263,7 +263,7 @@ static void iwm_disable_interrupts(struct iwm_softc *) static void iwm_ict_reset(struct iwm_softc *); static int iwm_allow_mcast(struct ieee80211vap *, struct iwm_softc *); static void iwm_stop_device(struct iwm_softc *); -static void iwm_mvm_nic_config(struct iwm_softc *); +static void iwm_nic_config(struct iwm_softc *); static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); @@ -317,23 +317,23 @@ static int iwm_pcie_load_given_ucode(struct iwm_softc static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_img *); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); -static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, +static int iwm_load_ucode_wait_alive(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); -static int iwm_mvm_config_ltr(struct iwm_softc *sc); +static int iwm_run_init_ucode(struct iwm_softc *, int); +static int iwm_config_ltr(struct iwm_softc *sc); static int iwm_rx_addbuf(struct iwm_softc *, int, int); -static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, +static void iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); static int iwm_get_noise(struct iwm_softc *, - const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, + const struct iwm_statistics_rx_non_phy *); +static void iwm_handle_rx_statistics(struct iwm_softc *, struct iwm_rx_packet *); -static bool iwm_mvm_rx_mpdu(struct iwm_softc *, struct mbuf *, +static bool iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, uint32_t, bool); -static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, +static int iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); -static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); +static void iwm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); static void iwm_cmd_done(struct iwm_softc *, struct iwm_rx_packet *); #if 0 static void iwm_update_sched(struct iwm_softc *, int, int, uint8_t, @@ -346,7 +346,7 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); +static int iwm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, @@ -358,10 +358,10 @@ static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); static int iwm_send_bt_init_conf(struct iwm_softc *); -static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *); -static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *); +static boolean_t iwm_is_lar_supported(struct iwm_softc *); +static boolean_t iwm_is_wifi_mcc_supported(struct iwm_softc *); static int iwm_send_update_mcc_cmd(struct iwm_softc *, const char *); -static void iwm_mvm_tt_tx_backoff(struct iwm_softc *, uint32_t); +static void iwm_tt_tx_backoff(struct iwm_softc *, uint32_t); static int iwm_init_hw(struct iwm_softc *); static void iwm_init(struct iwm_softc *); static void iwm_start(struct iwm_softc *); @@ -1093,7 +1093,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, struct iwm_tx_ * We only use rings 0 through 9 (4 EDCA + cmd) so there is no need * to allocate commands space for other rings. */ - if (qid > IWM_MVM_CMD_QUEUE) + if (qid > IWM_CMD_QUEUE) return 0; size = IWM_TX_RING_COUNT * sizeof(struct iwm_device_cmd); @@ -1106,7 +1106,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, struct iwm_tx_ ring->cmd = ring->cmd_dma.vaddr; /* FW commands may require more mapped space than packets. */ - if (qid == IWM_MVM_CMD_QUEUE) { + if (qid == IWM_CMD_QUEUE) { maxsize = IWM_RBUF_SIZE; nsegments = 1; } else { @@ -1170,7 +1170,7 @@ iwm_reset_tx_ring(struct iwm_softc *sc, struct iwm_tx_ ring->queued = 0; ring->cur = 0; - if (ring->qid == IWM_MVM_CMD_QUEUE && sc->cmd_hold_nic_awake) + if (ring->qid == IWM_CMD_QUEUE && sc->cmd_hold_nic_awake) iwm_pcie_clear_cmd_in_flight(sc); } @@ -1359,11 +1359,11 @@ iwm_stop_device(struct iwm_softc *sc) /* iwlwifi: mvm/ops.c */ static void -iwm_mvm_nic_config(struct iwm_softc *sc) +iwm_nic_config(struct iwm_softc *sc) { uint8_t radio_cfg_type, radio_cfg_step, radio_cfg_dash; uint32_t reg_val = 0; - uint32_t phy_config = iwm_mvm_get_phy_config(sc); + uint32_t phy_config = iwm_get_phy_config(sc); radio_cfg_type = (phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> IWM_FW_PHY_CFG_RADIO_TYPE_POS; @@ -1572,7 +1572,7 @@ iwm_nic_init(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_set_pwr(sc); - iwm_mvm_nic_config(sc); + iwm_nic_config(sc); if ((error = iwm_nic_rx_init(sc)) != 0) return error; @@ -1605,7 +1605,7 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, qid << 8 | 0); - if (qid == IWM_MVM_CMD_QUEUE) { + if (qid == IWM_CMD_QUEUE) { /* Disable the scheduler. */ iwm_write_prph(sc, IWM_SCD_EN_CTRL, 0); @@ -1665,7 +1665,7 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q cmd.aggregate = 0; cmd.window = IWM_FRAME_LIMIT; - error = iwm_mvm_send_cmd_pdu(sc, IWM_SCD_QUEUE_CFG, IWM_CMD_SYNC, + error = iwm_send_cmd_pdu(sc, IWM_SCD_QUEUE_CFG, IWM_CMD_SYNC, sizeof(cmd), &cmd); if (error) { device_printf(sc->sc_dev, @@ -1726,7 +1726,7 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t iwm_nic_unlock(sc); /* enable command channel */ - error = iwm_enable_txq(sc, 0 /* unused */, IWM_MVM_CMD_QUEUE, 7); + error = iwm_enable_txq(sc, 0 /* unused */, IWM_CMD_QUEUE, 7); if (error) return error; @@ -2788,7 +2788,7 @@ iwm_send_tx_ant_cfg(struct iwm_softc *sc, uint8_t vali .valid = htole32(valid_tx_ant), }; - return iwm_mvm_send_cmd_pdu(sc, IWM_TX_ANT_CONFIGURATION_CMD, + return iwm_send_cmd_pdu(sc, IWM_TX_ANT_CONFIGURATION_CMD, IWM_CMD_SYNC, sizeof(tx_ant_cmd), &tx_ant_cmd); } @@ -2800,7 +2800,7 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) enum iwm_ucode_type ucode_type = sc->cur_ucode; /* Set parameters */ - phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); + phy_cfg_cmd.phy_cfg = htole32(iwm_get_phy_config(sc)); phy_cfg_cmd.calib_control.event_trigger = sc->sc_default_calib[ucode_type].event_trigger; phy_cfg_cmd.calib_control.flow_trigger = @@ -2808,16 +2808,16 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "Sending Phy CFG command: 0x%x\n", phy_cfg_cmd.phy_cfg); - return iwm_mvm_send_cmd_pdu(sc, IWM_PHY_CONFIGURATION_CMD, IWM_CMD_SYNC, + return iwm_send_cmd_pdu(sc, IWM_PHY_CONFIGURATION_CMD, IWM_CMD_SYNC, sizeof(phy_cfg_cmd), &phy_cfg_cmd); } static int iwm_alive_fn(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) { - struct iwm_mvm_alive_data *alive_data = data; - struct iwm_mvm_alive_resp_v3 *palive3; - struct iwm_mvm_alive_resp *palive; + struct iwm_alive_data *alive_data = data; + struct iwm_alive_resp_v3 *palive3; + struct iwm_alive_resp *palive; struct iwm_umac_alive *umac; struct iwm_lmac_alive *lmac1; struct iwm_lmac_alive *lmac2 = NULL; @@ -2885,15 +2885,15 @@ iwm_wait_phy_db_entry(struct iwm_softc *sc, } static int -iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, +iwm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { struct iwm_notification_wait alive_wait; - struct iwm_mvm_alive_data alive_data; + struct iwm_alive_data alive_data; const struct iwm_fw_img *fw; enum iwm_ucode_type old_type = sc->cur_ucode; int error; - static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; + static const uint16_t alive_cmd[] = { IWM_ALIVE }; fw = &sc->sc_fw.img[ucode_type]; sc->cur_ucode = ucode_type; @@ -2918,7 +2918,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, */ IWM_UNLOCK(sc); error = iwm_wait_notification(sc->sc_notif_wait, &alive_wait, - IWM_MVM_UCODE_ALIVE_TIMEOUT); + IWM_UCODE_ALIVE_TIMEOUT); IWM_LOCK(sc); if (error) { if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { @@ -2981,7 +2981,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, * follows iwlwifi/fw.c */ static int -iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm) +iwm_run_init_ucode(struct iwm_softc *sc, int justnvm) { struct iwm_notification_wait calib_wait; static const uint16_t init_complete[] = { @@ -3005,7 +3005,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn sc->sc_phy_db); /* Will also start the device */ - ret = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); + ret = iwm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); if (ret) { device_printf(sc->sc_dev, "Failed to start INIT ucode: %d\n", ret); @@ -3033,7 +3033,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn } /* Send TX valid antennas before triggering calibrations */ - ret = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + ret = iwm_send_tx_ant_cfg(sc, iwm_get_valid_tx_ant(sc)); if (ret) { device_printf(sc->sc_dev, "failed to send antennas before calibration: %d\n", ret); @@ -3058,7 +3058,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn */ IWM_UNLOCK(sc); ret = iwm_wait_notification(sc->sc_notif_wait, &calib_wait, - IWM_MVM_UCODE_CALIB_TIMEOUT); + IWM_UCODE_CALIB_TIMEOUT); IWM_LOCK(sc); @@ -3071,7 +3071,7 @@ out: } static int -iwm_mvm_config_ltr(struct iwm_softc *sc) +iwm_config_ltr(struct iwm_softc *sc) { struct iwm_ltr_config_cmd cmd = { .flags = htole32(IWM_LTR_CFG_FLAG_FEATURE_ENABLE), @@ -3080,7 +3080,7 @@ iwm_mvm_config_ltr(struct iwm_softc *sc) if (!sc->sc_ltr_enabled) return 0; - return iwm_mvm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); + return iwm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); } /* @@ -3136,7 +3136,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) } static void -iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_rx_phy_info *phy_info = (void *)pkt->data; @@ -3150,7 +3150,7 @@ iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm */ static int iwm_get_noise(struct iwm_softc *sc, - const struct iwm_mvm_statistics_rx_non_phy *stats) + const struct iwm_statistics_rx_non_phy *stats) { int i, total, nbant, noise; @@ -3180,7 +3180,7 @@ iwm_get_noise(struct iwm_softc *sc, } static void -iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data; @@ -3190,13 +3190,13 @@ iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, str /* iwlwifi: mvm/rx.c */ /* - * iwm_mvm_get_signal_strength - use new rx PHY INFO API + * iwm_get_signal_strength - use new rx PHY INFO API * values are reported by the fw as positive values - need to negate * to obtain their dBM. Account for missing antennas by replacing 0 * values by -256dBm: practically 0 power and a non-feasible 8 bit value. */ static int -iwm_mvm_rx_get_signal_strength(struct iwm_softc *sc, +iwm_rx_get_signal_strength(struct iwm_softc *sc, struct iwm_rx_phy_info *phy_info) { int energy_a, energy_b, energy_c, max_energy; @@ -3223,7 +3223,7 @@ iwm_mvm_rx_get_signal_strength(struct iwm_softc *sc, } static int -iwm_mvm_rxmq_get_signal_strength(struct iwm_softc *sc, +iwm_rxmq_get_signal_strength(struct iwm_softc *sc, struct iwm_rx_mpdu_desc *desc) { int energy_a, energy_b; @@ -3236,12 +3236,12 @@ iwm_mvm_rxmq_get_signal_strength(struct iwm_softc *sc, } /* - * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler + * iwm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * * Handles the actual data of the Rx packet from the fw */ static bool -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic = &sc->sc_ic; @@ -3275,7 +3275,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * return false; } - rssi = iwm_mvm_rx_get_signal_strength(sc, phy_info); + rssi = iwm_rx_get_signal_strength(sc, phy_info); /* Map it to relative value */ rssi = rssi - sc->sc_noise; @@ -3354,7 +3354,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } static bool -iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic = &sc->sc_ic; @@ -3397,7 +3397,7 @@ iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf * } /* Map it to relative value */ - rssi = iwm_mvm_rxmq_get_signal_strength(sc, desc); + rssi = iwm_rxmq_get_signal_strength(sc, desc); rssi = rssi - sc->sc_noise; /* replenish ring for the buffer we're going to feed to the sharks */ @@ -3462,7 +3462,7 @@ iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf * } static bool -iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic; @@ -3473,8 +3473,8 @@ iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, ic = &sc->sc_ic; ret = sc->cfg->mqrx_supported ? - iwm_mvm_rx_mpdu_mq(sc, m, offset, stolen) : - iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen); + iwm_rx_mpdu_mq(sc, m, offset, stolen) : + iwm_rx_rx_mpdu(sc, m, offset, stolen); if (!ret) { counter_u64_add(ic->ic_ierrors, 1); return (ret); @@ -3498,10 +3498,10 @@ iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, } static int -iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, +iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, struct iwm_node *in) { - struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; + struct iwm_tx_resp *tx_resp = (void *)pkt->data; struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; struct ieee80211_node *ni = &in->in_ni; struct ieee80211vap *vap = ni->ni_vap; @@ -3567,7 +3567,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct if (new_rate != 0 && new_rate != cur_rate) { struct iwm_node *in = IWM_NODE(vap->iv_bss); iwm_setrates(sc, in, rix); - iwm_mvm_send_lq_cmd(sc, &in->in_lq, FALSE); + iwm_send_lq_cmd(sc, &in->in_lq, FALSE); } } @@ -3575,7 +3575,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } static void -iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_cmd_header *cmd_hdr; struct iwm_tx_ring *ring; @@ -3599,7 +3599,7 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_ sc->sc_tx_timer = 0; - status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); + status = iwm_rx_tx_cmd_single(sc, pkt, in); /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, txd->map, BUS_DMASYNC_POSTWRITE); @@ -3633,10 +3633,10 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_ static void iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { - struct iwm_tx_ring *ring = &sc->txq[IWM_MVM_CMD_QUEUE]; + struct iwm_tx_ring *ring = &sc->txq[IWM_CMD_QUEUE]; struct iwm_tx_data *data; - if (pkt->hdr.qid != IWM_MVM_CMD_QUEUE) { + if (pkt->hdr.qid != IWM_CMD_QUEUE) { return; /* Not a command ack. */ } @@ -4047,7 +4047,7 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * 3) wait for the transport queues to be empty */ int -iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) +iwm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) { int ret; struct iwm_tx_path_flush_cmd flush_cmd = { @@ -4055,7 +4055,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t .flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH), }; - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, + ret = iwm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, sizeof(flush_cmd), &flush_cmd); if (ret) device_printf(sc->sc_dev, @@ -4068,7 +4068,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t */ static int -iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) +iwm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) { struct iwm_time_quota_cmd cmd; int i, idx, ret, num_active_macs, quota, quota_rem; @@ -4090,7 +4090,7 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm /* * The FW's scheduling session consists of - * IWM_MVM_MAX_QUOTA fragments. Divide these fragments + * IWM_MAX_QUOTA fragments. Divide these fragments * equally between all the bindings that require quota */ num_active_macs = 0; @@ -4102,8 +4102,8 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm quota = 0; quota_rem = 0; if (num_active_macs) { - quota = IWM_MVM_MAX_QUOTA / num_active_macs; - quota_rem = IWM_MVM_MAX_QUOTA % num_active_macs; + quota = IWM_MAX_QUOTA / num_active_macs; + quota_rem = IWM_MAX_QUOTA % num_active_macs; } for (idx = 0, i = 0; i < IWM_MAX_BINDINGS; i++) { @@ -4126,7 +4126,7 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm /* Give the remainder of the session to the first binding */ cmd.quotas[0].quota = htole32(le32toh(cmd.quotas[0].quota) + quota_rem); - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_QUOTA_CMD, IWM_CMD_SYNC, + ret = iwm_send_cmd_pdu(sc, IWM_TIME_QUOTA_CMD, IWM_CMD_SYNC, sizeof(cmd), &cmd); if (ret) device_printf(sc->sc_dev, @@ -4210,13 +4210,13 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * contexts that are required), let's do a dirty hack here. */ if (iv->is_uploaded) { - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC\n", __func__); goto out; } } else { - if ((error = iwm_mvm_mac_ctxt_add(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_add(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to add MAC\n", __func__); goto out; @@ -4224,7 +4224,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } sc->sc_firmware_state = 1; - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], + if ((error = iwm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { device_printf(sc->sc_dev, "%s: failed update phy ctxt\n", __func__); @@ -4232,7 +4232,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { + if ((error = iwm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4244,7 +4244,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * finished or is aborted. */ iv->ps_disabled = TRUE; - error = iwm_mvm_power_update_mac(sc); + error = iwm_power_update_mac(sc); iv->ps_disabled = FALSE; if (error != 0) { device_printf(sc->sc_dev, @@ -4252,7 +4252,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s __func__); goto out; } - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { + if ((error = iwm_add_sta(sc, in)) != 0) { device_printf(sc->sc_dev, "%s: failed to add sta\n", __func__); goto out; @@ -4264,8 +4264,8 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * by "protecting" the session with a time event. */ /* XXX duration is in units of TU, not MS */ - duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; - iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); + duration = IWM_TE_SESSION_PROTECTION_MAX_TIME_MS; + iwm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); error = 0; out: @@ -4390,11 +4390,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #if 0 if (txant == 0) - txant = iwm_mvm_get_valid_tx_ant(sc); + txant = iwm_get_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; #else - nextant = iwm_mvm_get_valid_tx_ant(sc); + nextant = iwm_get_valid_tx_ant(sc); #endif tab = iwm_rates[ridx].plcp; tab |= nextant << IWM_RATE_MCS_ANT_POS; @@ -4445,8 +4445,8 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i ivp->iv_auth = 0; if (sc->sc_firmware_state == 3) { iwm_xmit_queue_drain(sc); -// iwm_mvm_flush_tx_path(sc, 0xf, IWM_CMD_SYNC); - error = iwm_mvm_rm_sta(sc, vap, TRUE); +// iwm_flush_tx_path(sc, 0xf, IWM_CMD_SYNC); + error = iwm_rm_sta(sc, vap, TRUE); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station: %d\n", @@ -4454,7 +4454,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4462,7 +4462,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_sf_update(sc, vap, FALSE); + error = iwm_sf_update(sc, vap, FALSE); if (error) { device_printf(sc->sc_dev, "%s: Failed to update smart FIFO: %d\n", @@ -4470,7 +4470,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_rm_sta_id(sc, vap); + error = iwm_rm_sta_id(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station id: %d\n", @@ -4478,7 +4478,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_update_quotas(sc, NULL); + error = iwm_update_quotas(sc, NULL); if (error) { device_printf(sc->sc_dev, "%s: Failed to update PHY quota: %d\n", @@ -4487,7 +4487,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } if (sc->sc_firmware_state == 3) { /* XXX Might need to specify bssid correctly. */ - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4498,7 +4498,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i sc->sc_firmware_state = 2; } if (sc->sc_firmware_state > 1) { - error = iwm_mvm_binding_remove_vif(sc, ivp); + error = iwm_binding_remove_vif(sc, ivp); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove channel ctx: %d\n", @@ -4510,7 +4510,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } ivp->phy_ctxt = NULL; if (sc->sc_firmware_state > 0) { - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4518,7 +4518,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state > 0) { - error = iwm_mvm_power_update_mac(sc); + error = iwm_power_update_mac(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update power management\n", @@ -4555,9 +4555,9 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ } if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { - iwm_mvm_led_disable(sc); + iwm_led_disable(sc); /* disable beacon filtering if we're hopping out of RUN */ - iwm_mvm_disable_beacon_filter(sc); + iwm_disable_beacon_filter(sc); if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; } @@ -4568,7 +4568,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ (nstate == IEEE80211_S_INIT || nstate == IEEE80211_S_SCAN || nstate == IEEE80211_S_AUTH)) { - iwm_mvm_stop_session_protection(sc, ivp); + iwm_stop_session_protection(sc, ivp); } if ((vap->iv_state == IEEE80211_S_RUN || @@ -4620,7 +4620,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ in = IWM_NODE(vap->iv_bss); /* Update the association state, now we have it all */ /* (eg associd comes in at this point */ - error = iwm_mvm_update_sta(sc, in); + error = iwm_update_sta(sc, in); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update STA\n", __func__); @@ -4629,25 +4629,25 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ return error; } in->in_assoc = 1; - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC: %d\n", __func__, error); } - iwm_mvm_sf_update(sc, vap, FALSE); - iwm_mvm_enable_beacon_filter(sc, ivp); - iwm_mvm_power_update_mac(sc); - iwm_mvm_update_quotas(sc, ivp); + iwm_sf_update(sc, vap, FALSE); + iwm_enable_beacon_filter(sc, ivp); + iwm_power_update_mac(sc); + iwm_update_quotas(sc, ivp); int rix = ieee80211_ratectl_rate(&in->in_ni, NULL, 0); iwm_setrates(sc, in, rix); - if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { + if ((error = iwm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, "%s: IWM_LQ_CMD failed: %d\n", __func__, error); } - iwm_mvm_led_enable(sc); + iwm_led_enable(sc); break; default: @@ -4680,12 +4680,12 @@ iwm_send_bt_init_conf(struct iwm_softc *sc) bt_cmd.mode = htole32(IWM_BT_COEX_WIFI); bt_cmd.enabled_modules = htole32(IWM_BT_COEX_HIGH_BAND_RET); - return iwm_mvm_send_cmd_pdu(sc, IWM_BT_CONFIG, 0, sizeof(bt_cmd), + return iwm_send_cmd_pdu(sc, IWM_BT_CONFIG, 0, sizeof(bt_cmd), &bt_cmd); } static boolean_t -iwm_mvm_is_lar_supported(struct iwm_softc *sc) +iwm_is_lar_supported(struct iwm_softc *sc) { boolean_t nvm_lar = sc->nvm_data->lar_enabled; boolean_t tlv_lar = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT); @@ -4704,7 +4704,7 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) } static boolean_t -iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) +iwm_is_wifi_mcc_supported(struct iwm_softc *sc) { return iwm_fw_has_api(sc, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); @@ -4729,7 +4729,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch #endif int resp_v2 = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); - if (!iwm_mvm_is_lar_supported(sc)) { + if (!iwm_is_lar_supported(sc)) { IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", __func__); return 0; @@ -4737,7 +4737,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if (iwm_mvm_is_wifi_mcc_supported(sc)) + if (iwm_is_wifi_mcc_supported(sc)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4783,7 +4783,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch } static void -iwm_mvm_tt_tx_backoff(struct iwm_softc *sc, uint32_t backoff) +iwm_tt_tx_backoff(struct iwm_softc *sc, uint32_t backoff) { struct iwm_host_cmd cmd = { .id = IWM_REPLY_THERMAL_MNG_BACKOFF, @@ -4810,8 +4810,8 @@ iwm_init_hw(struct iwm_softc *sc) return error; } - if ((error = iwm_run_init_mvm_ucode(sc, 0)) != 0) { - printf("iwm_run_init_mvm_ucode: failed %d\n", error); + if ((error = iwm_run_init_ucode(sc, 0)) != 0) { + printf("iwm_run_init_ucode: failed %d\n", error); return error; } @@ -4827,13 +4827,13 @@ iwm_init_hw(struct iwm_softc *sc) } /* omstart, this time with the regular firmware */ - error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); + error = iwm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); if (error) { device_printf(sc->sc_dev, "could not load firmware\n"); goto error; } - error = iwm_mvm_sf_update(sc, NULL, FALSE); + error = iwm_sf_update(sc, NULL, FALSE); if (error) device_printf(sc->sc_dev, "Failed to initialize Smart Fifo\n"); @@ -4842,7 +4842,7 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + error = iwm_send_tx_ant_cfg(sc, iwm_get_valid_tx_ant(sc)); if (error != 0) { device_printf(sc->sc_dev, "antenna config failed\n"); goto error; @@ -4858,7 +4858,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* Add auxiliary station for scanning */ - if ((error = iwm_mvm_add_aux_sta(sc)) != 0) { + if ((error = iwm_add_aux_sta(sc)) != 0) { device_printf(sc->sc_dev, "add_aux_sta failed\n"); goto error; } @@ -4869,19 +4869,19 @@ iwm_init_hw(struct iwm_softc *sc) * going to be overwritten in the other flows. * For now use the first channel we have. */ - if ((error = iwm_mvm_phy_ctxt_add(sc, + if ((error = iwm_phy_ctxt_add(sc, &sc->sc_phyctxt[i], &ic->ic_channels[1], 1, 1)) != 0) goto error; } /* Initialize tx backoffs to the minimum. */ if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) - iwm_mvm_tt_tx_backoff(sc, 0); + iwm_tt_tx_backoff(sc, 0); - if (iwm_mvm_config_ltr(sc) != 0) + if (iwm_config_ltr(sc) != 0) device_printf(sc->sc_dev, "PCIe LTR configuration failed\n"); - error = iwm_mvm_power_update_device(sc); + error = iwm_power_update_device(sc); if (error) goto error; @@ -4889,19 +4889,19 @@ iwm_init_hw(struct iwm_softc *sc) goto error; if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { - if ((error = iwm_mvm_config_umac_scan(sc)) != 0) + if ((error = iwm_config_umac_scan(sc)) != 0) goto error; } /* Enable Tx queues. */ for (ac = 0; ac < WME_NUM_AC; ac++) { error = iwm_enable_txq(sc, IWM_STATION_ID, ac, - iwm_mvm_ac_to_tx_fifo[ac]); + iwm_ac_to_tx_fifo[ac]); if (error) goto error; } - if ((error = iwm_mvm_disable_beacon_filter(sc)) != 0) { + if ((error = iwm_disable_beacon_filter(sc)) != 0) { device_printf(sc->sc_dev, "failed to disable beacon filter\n"); goto error; } @@ -4932,7 +4932,7 @@ iwm_allow_mcast(struct ieee80211vap *vap, struct iwm_s cmd->pass_all = 1; IEEE80211_ADDR_COPY(cmd->bssid, ni->ni_bssid); - error = iwm_mvm_send_cmd_pdu(sc, IWM_MCAST_FILTER_CMD, + error = iwm_send_cmd_pdu(sc, IWM_MCAST_FILTER_CMD, IWM_CMD_SYNC, size, cmd); free(cmd, M_DEVBUF); @@ -5372,7 +5372,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) switch (code) { case IWM_REPLY_RX_PHY_CMD: - iwm_mvm_rx_rx_phy_cmd(sc, pkt); + iwm_rx_rx_phy_cmd(sc, pkt); break; case IWM_REPLY_RX_MPDU_CMD: { @@ -5388,7 +5388,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) nextpkt->hdr.idx == 0) || (nextpkt->len_n_flags == htole32(IWM_FH_RSCSR_FRAME_INVALID))) { - if (iwm_mvm_rx_mpdu(sc, m, offset, stolen)) { + if (iwm_rx_mpdu(sc, m, offset, stolen)) { stolen = FALSE; /* Make sure we abort the loop */ nextoff = maxoff; @@ -5399,14 +5399,14 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) /* * Use m_copym instead of m_split, because that * makes it easier to keep a valid rx buffer in - * the ring, when iwm_mvm_rx_mpdu() fails. + * the ring, when iwm_rx_mpdu() fails. * * We need to start m_copym() at offset 0, to get the * M_PKTHDR flag preserved. */ m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (m1) { - if (iwm_mvm_rx_mpdu(sc, m1, offset, stolen)) + if (iwm_rx_mpdu(sc, m1, offset, stolen)) stolen = TRUE; else m_freem(m1); @@ -5415,7 +5415,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_TX_CMD: - iwm_mvm_rx_tx_cmd(sc, pkt); + iwm_rx_tx_cmd(sc, pkt); break; case IWM_MISSED_BEACONS_NOTIFICATION: { @@ -5460,14 +5460,14 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_MFUART_LOAD_NOTIFICATION: break; - case IWM_MVM_ALIVE: + case IWM_ALIVE: break; case IWM_CALIB_RES_NOTIF_PHY_DB: break; case IWM_STATISTICS_NOTIFICATION: - iwm_mvm_handle_rx_statistics(sc, pkt); + iwm_handle_rx_statistics(sc, pkt); break; case IWM_NVM_ACCESS_CMD: @@ -5548,7 +5548,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; case IWM_SCAN_OFFLOAD_COMPLETE: - iwm_mvm_rx_lmac_scan_complete_notif(sc, pkt); + iwm_rx_lmac_scan_complete_notif(sc, pkt); if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; ieee80211_runtask(ic, &sc->sc_es_task); @@ -5562,7 +5562,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_SCAN_COMPLETE_UMAC: - iwm_mvm_rx_umac_scan_complete_notif(sc, pkt); + iwm_rx_umac_scan_complete_notif(sc, pkt); if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; ieee80211_runtask(ic, &sc->sc_es_task); @@ -5591,7 +5591,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_TIME_EVENT_NOTIFICATION: - iwm_mvm_rx_time_event_notif(sc, pkt); + iwm_rx_time_event_notif(sc, pkt); break; /* @@ -5763,7 +5763,7 @@ iwm_intr(void *arg) #endif /* Dump driver status (TX and RX rings) while we're here. */ device_printf(sc->sc_dev, "driver status:\n"); - for (i = 0; i < IWM_MVM_MAX_QUEUES; i++) { + for (i = 0; i < IWM_MAX_QUEUES; i++) { struct iwm_tx_ring *ring = &sc->txq[i]; device_printf(sc->sc_dev, " tx ring %2d: qid=%-2d cur=%-3d " @@ -6266,7 +6266,7 @@ iwm_wme_update(struct ieee80211com *ic) if (ivp->is_uploaded && vap->iv_bss != NULL) { in = IWM_NODE(vap->iv_bss); if (in->in_assoc) { - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC\n", __func__); } @@ -6296,7 +6296,7 @@ iwm_preinit(void *arg) goto fail; } - error = iwm_run_init_mvm_ucode(sc, 1); + error = iwm_run_init_ucode(sc, 1); iwm_stop_device(sc); if (error) { IWM_UNLOCK(sc); @@ -6439,9 +6439,9 @@ iwm_scan_start(struct ieee80211com *ic) "%s: Previous scan not completed yet\n", __func__); } if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) - error = iwm_mvm_umac_scan(sc); + error = iwm_umac_scan(sc); else - error = iwm_mvm_lmac_scan(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 27 20:33:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 924301B7D8D; Wed, 27 Nov 2019 20:33:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NXYB38Jqz4YDJ; Wed, 27 Nov 2019 20:33:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F7381AFE2; Wed, 27 Nov 2019 20:33:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARKXoxY014909; Wed, 27 Nov 2019 20:33:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARKXowX014908; Wed, 27 Nov 2019 20:33:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201911272033.xARKXowX014908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 27 Nov 2019 20:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355145 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 355145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:33:50 -0000 Author: alc Date: Wed Nov 27 20:33:49 2019 New Revision: 355145 URL: https://svnweb.freebsd.org/changeset/base/355145 Log: There is no reason why we need to pin the underlying thread to its current processor in pmap_invalidate_{all,page,range}(). These functions are using an instruction that broadcasts the TLB invalidation to every processor, so even if a thread migrates in the middle of one of these functions every processor will still perform the required TLB invalidations. Reviewed by: andrew, markj MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D22502 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Nov 27 20:32:53 2019 (r355144) +++ head/sys/arm64/arm64/pmap.c Wed Nov 27 20:33:49 2019 (r355145) @@ -1043,7 +1043,6 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { uint64_t r; - sched_pin(); dsb(ishst); if (pmap == kernel_pmap) { r = atop(va); @@ -1054,11 +1053,10 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) } dsb(ish); isb(); - sched_unpin(); } static __inline void -pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { uint64_t end, r, start; @@ -1080,20 +1078,10 @@ pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t s } static __inline void -pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) -{ - - sched_pin(); - pmap_invalidate_range_nopin(pmap, sva, eva); - sched_unpin(); -} - -static __inline void pmap_invalidate_all(pmap_t pmap) { uint64_t r; - sched_pin(); dsb(ishst); if (pmap == kernel_pmap) { __asm __volatile("tlbi vmalle1is"); @@ -1103,7 +1091,6 @@ pmap_invalidate_all(pmap_t pmap) } dsb(ish); isb(); - sched_unpin(); } /* @@ -3114,7 +3101,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent * lookup the physical address. */ pmap_clear_bits(pte, ATTR_DESCR_VALID); - pmap_invalidate_range_nopin(pmap, va, va + size); + pmap_invalidate_range(pmap, va, va + size); /* Create the new mapping */ pmap_store(pte, newpte); From owner-svn-src-head@freebsd.org Wed Nov 27 20:33:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B69A91B7DBA; Wed, 27 Nov 2019 20:33:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NXYF4WSPz4YFP; Wed, 27 Nov 2019 20:33: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FA8B1AFE3; Wed, 27 Nov 2019 20:33:53 +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 xARKXr99014962; Wed, 27 Nov 2019 20:33:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARKXrDm014961; Wed, 27 Nov 2019 20:33:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911272033.xARKXrDm014961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Nov 2019 20:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355146 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:33:53 -0000 Author: kib Date: Wed Nov 27 20:33:53 2019 New Revision: 355146 URL: https://svnweb.freebsd.org/changeset/base/355146 Log: Requested and tested by: kevans Reviewed by: kevans (previous version), markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22546 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Nov 27 20:33:49 2019 (r355145) +++ head/sys/kern/kern_sig.c Wed Nov 27 20:33:53 2019 (r355146) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1252,11 +1253,13 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, int error, sig, timo, timevalid = 0; struct timespec rts, ets, ts; struct timeval tv; + bool traced; p = td->td_proc; error = 0; ets.tv_sec = 0; ets.tv_nsec = 0; + traced = false; if (timeout != NULL) { if (timeout->tv_nsec >= 0 && timeout->tv_nsec < 1000000000) { @@ -1309,6 +1312,11 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, timo = 0; } + if (traced) { + error = EINTR; + break; + } + error = msleep(ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", timo); if (timeout != NULL) { @@ -1320,6 +1328,16 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, error = 0; } } + + /* + * If PTRACE_SCE or PTRACE_SCX were set after + * userspace entered the syscall, return spurious + * EINTR after wait was done. Only do this as last + * resort after rechecking for possible queued signals + * and expired timeouts. + */ + if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) + traced = true; } new_block = saved_mask; @@ -1532,6 +1550,14 @@ kern_sigsuspend(struct thread *td, sigset_t mask) has_sig += postsig(sig); } mtx_unlock(&p->p_sigacts->ps_mtx); + + /* + * If PTRACE_SCE or PTRACE_SCX were set after + * userspace entered the syscall, return spurious + * EINTR. + */ + if ((p->p_ptevents & PTRACE_SYSCALL) != 0) + has_sig += 1; } PROC_UNLOCK(p); td->td_errno = EINTR; From owner-svn-src-head@freebsd.org Wed Nov 27 20:53:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B100E1B8941; Wed, 27 Nov 2019 20:53:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47NY051XRrz4bSm; Wed, 27 Nov 2019 20:53:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xARKrXt0081096 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Nov 2019 22:53:36 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xARKrXt0081096 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xARKrX4x081095; Wed, 27 Nov 2019 22:53:33 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 27 Nov 2019 22:53:33 +0200 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355146 - head/sys/kern Message-ID: <20191127205333.GL10580@kib.kiev.ua> References: <201911272033.xARKXrDm014961@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911272033.xARKXrDm014961@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47NY051XRrz4bSm X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-2.80), ipnet: 2001:470::/32(-4.64), asn: 6939(-3.52), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 20:53:42 -0000 On Wed, Nov 27, 2019 at 08:33:53PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Nov 27 20:33:53 2019 > New Revision: 355146 > URL: https://svnweb.freebsd.org/changeset/base/355146 Ease the life of PTRACE_SYSCALL users when debuggee sleeps in sigsuspend(2) and sig{timed,}wait(2). If PT_TO_SCE or PT_TO_SCX were issued after the target already entered sleep in sigsuspend(2) or sigtimedwait(2), there is no debugging events generated until a relevant signal is delivered. As result, debugger hangs waiting for an event. Introduce spurious EINTR returned in that situations to help debugger to gain control earlier. [Sorry] > > Log: > Requested and tested by: kevans > Reviewed by: kevans (previous version), markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D22546 > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Wed Nov 27 20:33:49 2019 (r355145) > +++ head/sys/kern/kern_sig.c Wed Nov 27 20:33:53 2019 (r355146) > @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -1252,11 +1253,13 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, > int error, sig, timo, timevalid = 0; > struct timespec rts, ets, ts; > struct timeval tv; > + bool traced; > > p = td->td_proc; > error = 0; > ets.tv_sec = 0; > ets.tv_nsec = 0; > + traced = false; > > if (timeout != NULL) { > if (timeout->tv_nsec >= 0 && timeout->tv_nsec < 1000000000) { > @@ -1309,6 +1312,11 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, > timo = 0; > } > > + if (traced) { > + error = EINTR; > + break; > + } > + > error = msleep(ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", timo); > > if (timeout != NULL) { > @@ -1320,6 +1328,16 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, > error = 0; > } > } > + > + /* > + * If PTRACE_SCE or PTRACE_SCX were set after > + * userspace entered the syscall, return spurious > + * EINTR after wait was done. Only do this as last > + * resort after rechecking for possible queued signals > + * and expired timeouts. > + */ > + if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) > + traced = true; > } > > new_block = saved_mask; > @@ -1532,6 +1550,14 @@ kern_sigsuspend(struct thread *td, sigset_t mask) > has_sig += postsig(sig); > } > mtx_unlock(&p->p_sigacts->ps_mtx); > + > + /* > + * If PTRACE_SCE or PTRACE_SCX were set after > + * userspace entered the syscall, return spurious > + * EINTR. > + */ > + if ((p->p_ptevents & PTRACE_SYSCALL) != 0) > + has_sig += 1; > } > PROC_UNLOCK(p); > td->td_errno = EINTR; From owner-svn-src-head@freebsd.org Wed Nov 27 21:00:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A949A1B8C40; Wed, 27 Nov 2019 21:00:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NY8D43Rpz4btx; Wed, 27 Nov 2019 21:00:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E7ED1B421; Wed, 27 Nov 2019 21:00:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARL0ipm028969; Wed, 27 Nov 2019 21:00:44 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARL0iYu028968; Wed, 27 Nov 2019 21:00:44 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201911272100.xARL0iYu028968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Wed, 27 Nov 2019 21:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355147 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 21:00:44 -0000 Author: dougm Date: Wed Nov 27 21:00:44 2019 New Revision: 355147 URL: https://svnweb.freebsd.org/changeset/base/355147 Log: Inline some splay helper functions to improve performance on a micro-benchmark. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D22544 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 27 20:33:53 2019 (r355146) +++ head/sys/vm/vm_map.c Wed Nov 27 21:00:44 2019 (r355147) @@ -1069,53 +1069,48 @@ vm_map_entry_pred(vm_map_entry_t entry) * the subsequent call to vm_map_splay_merge, rely on the start and end address * values in &map->header. */ -static vm_map_entry_t +static __always_inline vm_map_entry_t vm_map_splay_split(vm_map_t map, vm_offset_t addr, vm_size_t length, - vm_map_entry_t *out_llist, vm_map_entry_t *out_rlist) + vm_map_entry_t *llist, vm_map_entry_t *rlist) { - vm_map_entry_t llist, rlist, root, y; + vm_map_entry_t root, y; - llist = rlist = &map->header; + *llist = *rlist = &map->header; root = map->root; while (root != NULL && root->max_free >= length) { - KASSERT(llist->end <= root->start && root->end <= rlist->start, + KASSERT((*llist)->end <= root->start && + root->end <= (*rlist)->start, ("%s: root not within tree bounds", __func__)); if (addr < root->start) { - SPLAY_LEFT_STEP(root, y, rlist, + SPLAY_LEFT_STEP(root, y, *rlist, y->max_free >= length && addr < y->start); } else if (addr >= root->end) { - SPLAY_RIGHT_STEP(root, y, llist, + SPLAY_RIGHT_STEP(root, y, *llist, y->max_free >= length && addr >= y->end); } else break; } - *out_llist = llist; - *out_rlist = rlist; return (root); } -static void -vm_map_splay_findnext(vm_map_entry_t root, vm_map_entry_t *iolist) +static __always_inline void +vm_map_splay_findnext(vm_map_entry_t root, vm_map_entry_t *rlist) { - vm_map_entry_t rlist, y; + vm_map_entry_t hi, y; - root = root->right; - rlist = *iolist; - while (root != NULL) - SPLAY_LEFT_STEP(root, y, rlist, true); - *iolist = rlist; + hi = root->right; + while (hi != NULL) + SPLAY_LEFT_STEP(hi, y, *rlist, true); } -static void -vm_map_splay_findprev(vm_map_entry_t root, vm_map_entry_t *iolist) +static __always_inline void +vm_map_splay_findprev(vm_map_entry_t root, vm_map_entry_t *llist) { - vm_map_entry_t llist, y; + vm_map_entry_t lo, y; - root = root->left; - llist = *iolist; - while (root != NULL) - SPLAY_RIGHT_STEP(root, y, llist, true); - *iolist = llist; + lo = root->left; + while (lo != NULL) + SPLAY_RIGHT_STEP(lo, y, *llist, true); } static inline void @@ -1270,30 +1265,22 @@ vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry KASSERT(root != NULL, ("vm_map_entry_unlink: unlink object not mapped")); + vm_map_splay_findprev(root, &llist); vm_map_splay_findnext(root, &rlist); - switch (op) { - case UNLINK_MERGE_NEXT: + if (op == UNLINK_MERGE_NEXT) { rlist->start = root->start; rlist->offset = root->offset; - y = root->left; + } + if (llist != &map->header) { + root = llist; + llist = root->right; + root->right = NULL; + } else if (rlist != &map->header) { root = rlist; rlist = root->left; - root->left = y; - break; - case UNLINK_MERGE_NONE: - vm_map_splay_findprev(root, &llist); - if (llist != &map->header) { - root = llist; - llist = root->right; - root->right = NULL; - } else if (rlist != &map->header) { - root = rlist; - rlist = root->left; - root->left = NULL; - } else - root = NULL; - break; - } + root->left = NULL; + } else + root = NULL; y = entry->next; y->prev = entry->prev; y->prev->next = y; @@ -1322,8 +1309,7 @@ vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry VM_MAP_ASSERT_LOCKED(map); root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); - KASSERT(root != NULL, - ("%s: resize object not mapped", __func__)); + KASSERT(root != NULL, ("%s: resize object not mapped", __func__)); vm_map_splay_findnext(root, &rlist); root->right = NULL; entry->end += grow_amount; From owner-svn-src-head@freebsd.org Wed Nov 27 23:19:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12D001BB5E8; Wed, 27 Nov 2019 23:19:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NcCt6lFLz3FCQ; Wed, 27 Nov 2019 23:19:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C64811CCB5; Wed, 27 Nov 2019 23:19:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARNJ6PC010723; Wed, 27 Nov 2019 23:19:06 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARNJ6Qn010722; Wed, 27 Nov 2019 23:19:06 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911272319.xARNJ6Qn010722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 27 Nov 2019 23:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355148 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Nov 2019 23:19:07 -0000 Author: jeff Date: Wed Nov 27 23:19:06 2019 New Revision: 355148 URL: https://svnweb.freebsd.org/changeset/base/355148 Log: Refactor uma_zfree_arg into several functions to make control flow more clear and icache usage cleaner. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D22491 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 27 21:00:44 2019 (r355147) +++ head/sys/vm/uma_core.c Wed Nov 27 23:19:06 2019 (r355148) @@ -283,6 +283,7 @@ static int zone_import(uma_zone_t, void **, int, int, static void zone_release(uma_zone_t, void **, int); static void uma_zero_item(void *, uma_zone_t); static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); +static bool cache_free(uma_zone_t, uma_cache_t, void *, void *, int); void uma_print_zone(uma_zone_t); void uma_print_stats(void); @@ -2466,6 +2467,17 @@ bucket_pop(uma_zone_t zone, uma_cache_t cache, uma_buc return (item); } +static inline void +bucket_push(uma_zone_t zone, uma_cache_t cache, uma_bucket_t bucket, + void *item) +{ + KASSERT(bucket->ub_bucket[bucket->ub_cnt] == NULL, + ("uma_zfree: Freeing to non free bucket index.")); + bucket->ub_bucket[bucket->ub_cnt] = item; + bucket->ub_cnt++; + cache->uc_frees++; +} + static void * item_ctor(uma_zone_t zone, void *udata, int flags, void *item) { @@ -3158,12 +3170,7 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata { uma_cache_t cache; uma_bucket_t bucket; - uma_zone_domain_t zdom; - int cpu, domain; -#ifdef UMA_XDOMAIN - int itemdomain; -#endif - bool lockfail; + int cpu, domain, itemdomain; /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); @@ -3196,11 +3203,6 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata if (zone->uz_sleepers > 0) goto zfree_item; -#ifdef UMA_XDOMAIN - if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) - itemdomain = _vm_phys_domain(pmap_kextract((vm_offset_t)item)); -#endif - /* * If possible, free to the per-CPU cache. There are two * requirements for safe access to the per-CPU cache: (1) the thread @@ -3212,175 +3214,187 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata * current cache; when we re-acquire the critical section, we must * detect and handle migration if it has occurred. */ -zfree_restart: + domain = itemdomain = 0; critical_enter(); - cpu = curcpu; - cache = &zone->uz_cpu[cpu]; - -zfree_start: - domain = PCPU_GET(domain); + do { + cpu = curcpu; + cache = &zone->uz_cpu[cpu]; + bucket = cache->uc_allocbucket; #ifdef UMA_XDOMAIN - if ((zone->uz_flags & UMA_ZONE_NUMA) == 0) - itemdomain = domain; + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) { + itemdomain = _vm_phys_domain(pmap_kextract((vm_offset_t)item)); + domain = PCPU_GET(domain); + } + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0 && + domain != itemdomain) { + bucket = cache->uc_crossbucket; + } else #endif + + /* + * Try to free into the allocbucket first to give LIFO ordering + * for cache-hot datastructures. Spill over into the freebucket + * if necessary. Alloc will swap them if one runs dry. + */ + if (bucket == NULL || bucket->ub_cnt >= bucket->ub_entries) + bucket = cache->uc_freebucket; + if (__predict_true(bucket != NULL && + bucket->ub_cnt < bucket->ub_entries)) { + bucket_push(zone, cache, bucket, item); + critical_exit(); + return; + } + } while (cache_free(zone, cache, udata, item, itemdomain)); + critical_exit(); + /* - * Try to free into the allocbucket first to give LIFO ordering - * for cache-hot datastructures. Spill over into the freebucket - * if necessary. Alloc will swap them if one runs dry. + * If nothing else caught this, we'll just do an internal free. */ +zfree_item: + zone_free_item(zone, item, udata, SKIP_DTOR); +} + +static void +zone_free_bucket(uma_zone_t zone, uma_bucket_t bucket, void *udata, + int domain, int itemdomain) +{ + uma_zone_domain_t zdom; + #ifdef UMA_XDOMAIN - if (domain != itemdomain) { - bucket = cache->uc_crossbucket; - } else -#endif - { - bucket = cache->uc_allocbucket; - if (bucket == NULL || bucket->ub_cnt >= bucket->ub_entries) - bucket = cache->uc_freebucket; - } - if (bucket != NULL && bucket->ub_cnt < bucket->ub_entries) { - KASSERT(bucket->ub_bucket[bucket->ub_cnt] == NULL, - ("uma_zfree: Freeing to non free bucket index.")); - bucket->ub_bucket[bucket->ub_cnt] = item; - bucket->ub_cnt++; - cache->uc_frees++; - critical_exit(); + /* + * Buckets coming from the wrong domain will be entirely for the + * only other domain on two domain systems. In this case we can + * simply cache them. Otherwise we need to sort them back to + * correct domains by freeing the contents to the slab layer. + */ + if (domain != itemdomain && vm_ndomains > 2) { + CTR3(KTR_UMA, + "uma_zfree: zone %s(%p) draining cross bucket %p", + zone->uz_name, zone, bucket); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); return; } - +#endif /* - * We must go back the zone, which requires acquiring the zone lock, - * which in turn means we must release and re-acquire the critical - * section. Since the critical section is released, we may be - * preempted or migrate. As such, make sure not to maintain any - * thread-local state specific to the cache from prior to releasing - * the critical section. + * Attempt to save the bucket in the zone's domain bucket cache. + * + * We bump the uz count when the cache size is insufficient to + * handle the working set. */ - critical_exit(); - if (zone->uz_count == 0 || bucketdisable) - goto zfree_item; - - lockfail = false; if (ZONE_TRYLOCK(zone) == 0) { /* Record contention to size the buckets. */ ZONE_LOCK(zone); - lockfail = true; + if (zone->uz_count < zone->uz_count_max) + zone->uz_count++; } - critical_enter(); + + CTR3(KTR_UMA, + "uma_zfree: zone %s(%p) putting bucket %p on free list", + zone->uz_name, zone, bucket); + /* ub_cnt is pointing to the last free item */ + KASSERT(bucket->ub_cnt == bucket->ub_entries, + ("uma_zfree: Attempting to insert partial bucket onto the full list.\n")); + if (zone->uz_bkt_count >= zone->uz_bkt_max) { + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + } else { + zdom = &zone->uz_domain[itemdomain]; + zone_put_bucket(zone, zdom, bucket, true); + ZONE_UNLOCK(zone); + } +} + +/* + * Populate a free or cross bucket for the current cpu cache. Free any + * existing full bucket either to the zone cache or back to the slab layer. + * + * Enters and returns in a critical section. false return indicates that + * we can not satisfy this free in the cache layer. true indicates that + * the caller should retry. + */ +static __noinline bool +cache_free(uma_zone_t zone, uma_cache_t cache, void *udata, void *item, + int itemdomain) +{ + uma_bucket_t bucket; + int cpu, domain; + + CRITICAL_ASSERT(curthread); + + if (zone->uz_count == 0 || bucketdisable) + return false; + cpu = curcpu; - domain = PCPU_GET(domain); cache = &zone->uz_cpu[cpu]; + /* + * NUMA domains need to free to the correct zdom. When XDOMAIN + * is enabled this is the zdom of the item and the bucket may be + * the cross bucket if they do not match. + */ + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) #ifdef UMA_XDOMAIN - if (domain != itemdomain) - bucket = cache->uc_crossbucket; - else + domain = PCPU_GET(domain); +#else + itemdomain = domain = PCPU_GET(domain); #endif - bucket = cache->uc_freebucket; - if (bucket != NULL && bucket->ub_cnt < bucket->ub_entries) { - ZONE_UNLOCK(zone); - goto zfree_start; - } + else + itemdomain = domain = 0; #ifdef UMA_XDOMAIN - if (domain != itemdomain) + if (domain != itemdomain) { + bucket = cache->uc_crossbucket; cache->uc_crossbucket = NULL; - else + if (bucket != NULL) + atomic_add_64(&zone->uz_xdomain, bucket->ub_cnt); + } else #endif + { + bucket = cache->uc_freebucket; cache->uc_freebucket = NULL; + } + + /* We are no longer associated with this CPU. */ critical_exit(); + if (bucket != NULL) + zone_free_bucket(zone, bucket, udata, domain, itemdomain); + + bucket = bucket_alloc(zone, udata, M_NOWAIT); + CTR3(KTR_UMA, "uma_zfree: zone %s(%p) allocated bucket %p", + zone->uz_name, zone, bucket); + critical_enter(); + if (bucket == NULL) + return (false); + cpu = curcpu; + cache = &zone->uz_cpu[cpu]; #ifdef UMA_XDOMAIN - if (domain != itemdomain) { - if (bucket != NULL) { - zone->uz_xdomain += bucket->ub_cnt; - if (vm_ndomains > 2 || - zone->uz_bkt_count >= zone->uz_bkt_max) { - ZONE_UNLOCK(zone); - bucket_drain(zone, bucket); - bucket_free(zone, bucket, udata); - } else { - zdom = &zone->uz_domain[itemdomain]; - zone_put_bucket(zone, zdom, bucket, true); - ZONE_UNLOCK(zone); - } - } else - ZONE_UNLOCK(zone); - bucket = bucket_alloc(zone, udata, M_NOWAIT); - if (bucket == NULL) - goto zfree_item; - critical_enter(); - cpu = curcpu; - cache = &zone->uz_cpu[cpu]; - if (cache->uc_crossbucket == NULL) { + /* + * Check to see if we should be populating the cross bucket. If it + * is already populated we will fall through and attempt to populate + * the free bucket. + */ + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) { + domain = PCPU_GET(domain); + if (domain != itemdomain && cache->uc_crossbucket == NULL) { cache->uc_crossbucket = bucket; - goto zfree_start; + return (true); } - critical_exit(); - bucket_free(zone, bucket, udata); - goto zfree_restart; } #endif - - if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) { - zdom = &zone->uz_domain[domain]; - } else { - domain = 0; - zdom = &zone->uz_domain[0]; - } - - /* Can we throw this on the zone full list? */ - if (bucket != NULL) { - CTR3(KTR_UMA, - "uma_zfree: zone %s(%p) putting bucket %p on free list", - zone->uz_name, zone, bucket); - /* ub_cnt is pointing to the last free item */ - KASSERT(bucket->ub_cnt == bucket->ub_entries, - ("uma_zfree: Attempting to insert not full bucket onto the full list.\n")); - if (zone->uz_bkt_count >= zone->uz_bkt_max) { - ZONE_UNLOCK(zone); - bucket_drain(zone, bucket); - bucket_free(zone, bucket, udata); - goto zfree_restart; - } else - zone_put_bucket(zone, zdom, bucket, true); - } - /* - * We bump the uz count when the cache size is insufficient to - * handle the working set. + * We may have lost the race to fill the bucket or switched CPUs. */ - if (lockfail && zone->uz_count < zone->uz_count_max) - zone->uz_count++; - ZONE_UNLOCK(zone); - - bucket = bucket_alloc(zone, udata, M_NOWAIT); - CTR3(KTR_UMA, "uma_zfree: zone %s(%p) allocated bucket %p", - zone->uz_name, zone, bucket); - if (bucket) { - critical_enter(); - cpu = curcpu; - cache = &zone->uz_cpu[cpu]; - if (cache->uc_freebucket == NULL && - ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || - domain == PCPU_GET(domain))) { - cache->uc_freebucket = bucket; - goto zfree_start; - } - /* - * We lost the race, start over. We have to drop our - * critical section to free the bucket. - */ + if (cache->uc_freebucket != NULL) { critical_exit(); bucket_free(zone, bucket, udata); - goto zfree_restart; - } + critical_enter(); + } else + cache->uc_freebucket = bucket; - /* - * If nothing else caught this, we'll just do an internal free. - */ -zfree_item: - zone_free_item(zone, item, udata, SKIP_DTOR); + return (true); } void From owner-svn-src-head@freebsd.org Thu Nov 28 00:19:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C00301BCA4A; Thu, 28 Nov 2019 00:19:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NdY959htz3Hlv; Thu, 28 Nov 2019 00:19:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94B321D766; Thu, 28 Nov 2019 00:19:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0J9xP045873; Thu, 28 Nov 2019 00:19:09 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0J95e045871; Thu, 28 Nov 2019 00:19:09 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911280019.xAS0J95e045871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 28 Nov 2019 00:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355149 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 00:19:09 -0000 Author: jeff Date: Thu Nov 28 00:19:09 2019 New Revision: 355149 URL: https://svnweb.freebsd.org/changeset/base/355149 Log: Implement a sysctl tree for uma zones to assist in debugging and provide more statistcs than are exported via the ABI stable vmstat interface. Rename uz_count to uz_bucket_size because even I was confused by the name after returning to the source years later. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D22554 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 27 23:19:06 2019 (r355148) +++ head/sys/vm/uma_core.c Thu Nov 28 00:19:09 2019 (r355149) @@ -119,6 +119,7 @@ static uma_zone_t hashzone; int uma_align_cache = 64 - 1; static MALLOC_DEFINE(M_UMAHASH, "UMAHash", "UMA Hash Buckets"); +static MALLOC_DEFINE(M_UMA, "UMA", "UMA Misc"); /* * Are we allowed to allocate buckets? @@ -258,8 +259,8 @@ static void zone_dtor(void *, int, void *); static int zero_init(void *, int, int); static void keg_small_init(uma_keg_t keg); static void keg_large_init(uma_keg_t keg); -static void zone_foreach(void (*zfunc)(uma_zone_t)); -static void zone_timeout(uma_zone_t zone); +static void zone_foreach(void (*zfunc)(uma_zone_t, void *), void *); +static void zone_timeout(uma_zone_t zone, void *); static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); @@ -285,10 +286,10 @@ static void uma_zero_item(void *, uma_zone_t); static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); static bool cache_free(uma_zone_t, uma_cache_t, void *, void *, int); -void uma_print_zone(uma_zone_t); -void uma_print_stats(void); static int sysctl_vm_zone_count(SYSCTL_HANDLER_ARGS); static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_uma_zone_allocs(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS static bool uma_dbg_kskip(uma_keg_t keg, void *mem); @@ -296,6 +297,7 @@ static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); static void uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item); +SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, "Memory allocation debugging"); @@ -458,7 +460,7 @@ bucket_alloc(uma_zone_t zone, void *udata, int flags) } if ((uintptr_t)udata & UMA_ZFLAG_CACHEONLY) flags |= M_NOVM; - ubz = bucket_zone_lookup(zone->uz_count); + ubz = bucket_zone_lookup(zone->uz_bucket_size); if (ubz->ubz_zone == zone && (ubz + 1)->ubz_entries != 0) ubz++; bucket = uma_zalloc_arg(ubz->ubz_zone, udata, flags); @@ -575,7 +577,7 @@ static void uma_timeout(void *unused) { bucket_enable(); - zone_foreach(zone_timeout); + zone_foreach(zone_timeout, NULL); /* Reschedule this event */ callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); @@ -605,7 +607,7 @@ zone_domain_update_wss(uma_zone_domain_t zdom) * Returns nothing. */ static void -zone_timeout(uma_zone_t zone) +zone_timeout(uma_zone_t zone, void *unused) { uma_keg_t keg; u_int slabs; @@ -845,19 +847,20 @@ cache_drain(uma_zone_t zone) } static void -cache_shrink(uma_zone_t zone) +cache_shrink(uma_zone_t zone, void *unused) { if (zone->uz_flags & UMA_ZFLAG_INTERNAL) return; ZONE_LOCK(zone); - zone->uz_count = (zone->uz_count_min + zone->uz_count) / 2; + zone->uz_bucket_size = + (zone->uz_bucket_size_min + zone->uz_bucket_size) / 2; ZONE_UNLOCK(zone); } static void -cache_drain_safe_cpu(uma_zone_t zone) +cache_drain_safe_cpu(uma_zone_t zone, void *unused) { uma_cache_t cache; uma_bucket_t b1, b2, b3; @@ -920,9 +923,9 @@ pcpu_cache_drain_safe(uma_zone_t zone) * Polite bucket sizes shrinking was not enouth, shrink aggressively. */ if (zone) - cache_shrink(zone); + cache_shrink(zone, NULL); else - zone_foreach(cache_shrink); + zone_foreach(cache_shrink, NULL); CPU_FOREACH(cpu) { thread_lock(curthread); @@ -930,9 +933,9 @@ pcpu_cache_drain_safe(uma_zone_t zone) thread_unlock(curthread); if (zone) - cache_drain_safe_cpu(zone); + cache_drain_safe_cpu(zone, NULL); else - zone_foreach(cache_drain_safe_cpu); + zone_foreach(cache_drain_safe_cpu, NULL); } thread_lock(curthread); sched_unbind(curthread); @@ -991,8 +994,8 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain) * Shrink the zone bucket size to ensure that the per-CPU caches * don't grow too large. */ - if (zone->uz_count > zone->uz_count_min) - zone->uz_count--; + if (zone->uz_bucket_size > zone->uz_bucket_size_min) + zone->uz_bucket_size--; } static void @@ -1121,14 +1124,14 @@ out: } static void -zone_drain(uma_zone_t zone) +zone_drain(uma_zone_t zone, void *unused) { zone_reclaim(zone, M_NOWAIT, true); } static void -zone_trim(uma_zone_t zone) +zone_trim(uma_zone_t zone, void *unused) { zone_reclaim(zone, M_NOWAIT, false); @@ -1818,7 +1821,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) } static void -zone_alloc_counters(uma_zone_t zone) +zone_alloc_counters(uma_zone_t zone, void *unused) { zone->uz_allocs = counter_u64_alloc(M_WAITOK); @@ -1826,6 +1829,169 @@ zone_alloc_counters(uma_zone_t zone) zone->uz_fails = counter_u64_alloc(M_WAITOK); } +#define UMA_MAX_DUP 999 +static void +zone_alloc_sysctl(uma_zone_t zone, void *unused) +{ + uma_zone_domain_t zdom; + uma_keg_t keg; + struct sysctl_oid *oid, *domainoid; + int domains, i; + static const char *nokeg = "cache zone"; + char *c; + + /* + * Make a sysctl safe copy of the zone name by removing + * any special characters and handling dups by appending + * an index. + */ + if (zone->uz_namecnt != 0) { + if (zone->uz_namecnt > UMA_MAX_DUP) + zone->uz_namecnt = UMA_MAX_DUP; + zone->uz_ctlname = malloc(strlen(zone->uz_name) + + sizeof(__XSTRING(UMA_MAX_DUP)) + 1 , M_UMA, M_WAITOK); + sprintf(zone->uz_ctlname, "%s_%d", zone->uz_name, + zone->uz_namecnt); + } else + zone->uz_ctlname = strdup(zone->uz_name, M_UMA); + for (c = zone->uz_ctlname; *c != '\0'; c++) + if (strchr("./\\ -", *c) != NULL) + *c = '_'; + + /* + * Basic parameters at the root. + */ + zone->uz_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_vm_uma), + OID_AUTO, zone->uz_ctlname, CTLFLAG_RD, NULL, ""); + oid = zone->uz_oid; + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "size", CTLFLAG_RD, &zone->uz_size, 0, "Allocation size"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "flags", CTLFLAG_RD, &zone->uz_flags, 0, + "Allocator configuration flags"); + SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "bucket_size", CTLFLAG_RD, &zone->uz_bucket_size, 0, + "Desired per-cpu cache size"); + SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "bucket_size_max", CTLFLAG_RD, &zone->uz_bucket_size_max, 0, + "Maximum allowed per-cpu cache size"); + + /* + * keg if present. + */ + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, + "keg", CTLFLAG_RD, NULL, ""); + keg = zone->uz_keg; + if ((zone->uz_flags & UMA_ZFLAG_CACHEONLY) == 0) { + SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "name", CTLFLAG_RD, keg->uk_name, "Keg name"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "rsize", CTLFLAG_RD, &keg->uk_rsize, 0, + "Real object size with alignment"); + SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "ppera", CTLFLAG_RD, &keg->uk_ppera, 0, + "pages per-slab allocation"); + SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "ipers", CTLFLAG_RD, &keg->uk_ipers, 0, + "items available per-slab"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "align", CTLFLAG_RD, &keg->uk_align, 0, + "item alignment mask"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "pages", CTLFLAG_RD, &keg->uk_pages, 0, + "Total pages currently allocated from VM"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "free", CTLFLAG_RD, &keg->uk_free, 0, + "items free in the slab layer"); + } else + SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "name", CTLFLAG_RD, nokeg, "Keg name"); + + /* + * Information about zone limits. + */ + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, + "limit", CTLFLAG_RD, NULL, ""); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "items", CTLFLAG_RD, &zone->uz_items, 0, + "current number of cached items"); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "max_items", CTLFLAG_RD, &zone->uz_max_items, 0, + "Maximum number of cached items"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "sleepers", CTLFLAG_RD, &zone->uz_sleepers, 0, + "Number of threads sleeping at limit"); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "sleeps", CTLFLAG_RD, &zone->uz_sleeps, 0, + "Total zone limit sleeps"); + + /* + * Per-domain information. + */ + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) + domains = vm_ndomains; + else + domains = 1; + domainoid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), + OID_AUTO, "domain", CTLFLAG_RD, NULL, ""); + for (i = 0; i < domains; i++) { + zdom = &zone->uz_domain[i]; + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(domainoid), + OID_AUTO, VM_DOMAIN(i)->vmd_name, CTLFLAG_RD, NULL, ""); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "nitems", CTLFLAG_RD, &zdom->uzd_nitems, + "number of items in this domain"); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "imax", CTLFLAG_RD, &zdom->uzd_imax, + "maximum item count in this period"); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "imin", CTLFLAG_RD, &zdom->uzd_imin, + "minimum item count in this period"); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "wss", CTLFLAG_RD, &zdom->uzd_wss, + "Working set size"); + } + + /* + * General statistics. + */ + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, + "stats", CTLFLAG_RD, NULL, ""); + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "current", CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, + zone, 1, sysctl_handle_uma_zone_cur, "I", + "Current number of allocated items"); + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "allocs", CTLFLAG_RD | CTLTYPE_U64 | CTLFLAG_MPSAFE, + zone, 0, sysctl_handle_uma_zone_allocs, "QU", + "Total allocation calls"); + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "frees", CTLFLAG_RD | CTLTYPE_U64 | CTLFLAG_MPSAFE, + zone, 0, sysctl_handle_uma_zone_frees, "QU", + "Total free calls"); + SYSCTL_ADD_COUNTER_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "fails", CTLFLAG_RD, &zone->uz_fails, + "Number of allocation failures"); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "xdomain", CTLFLAG_RD, &zone->uz_xdomain, 0, + "Free calls from the wrong domain"); +} + +struct uma_zone_count { + const char *name; + int count; +}; + +static void +zone_count(uma_zone_t zone, void *arg) +{ + struct uma_zone_count *cnt; + + cnt = arg; + if (strcmp(zone->uz_name, cnt->name) == 0) + cnt->count++; +} + /* * Zone header ctor. This initializes all fields, locks, etc. * @@ -1835,6 +2001,7 @@ zone_alloc_counters(uma_zone_t zone) static int zone_ctor(void *mem, int size, void *udata, int flags) { + struct uma_zone_count cnt; struct uma_zctor_args *arg = udata; uma_zone_t zone = mem; uma_zone_t z; @@ -1849,9 +2016,9 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_fini = NULL; zone->uz_sleeps = 0; zone->uz_xdomain = 0; - zone->uz_count = 0; - zone->uz_count_min = 0; - zone->uz_count_max = BUCKET_MAX; + zone->uz_bucket_size = 0; + zone->uz_bucket_size_min = 0; + zone->uz_bucket_size_max = BUCKET_MAX; zone->uz_flags = 0; zone->uz_warning = NULL; /* The domain structures follow the cpu structures. */ @@ -1859,13 +2026,11 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_bkt_max = ULONG_MAX; timevalclear(&zone->uz_ratecheck); - if (__predict_true(booted == BOOT_RUNNING)) - zone_alloc_counters(zone); - else { - zone->uz_allocs = EARLY_COUNTER; - zone->uz_frees = EARLY_COUNTER; - zone->uz_fails = EARLY_COUNTER; - } + /* Count the number of duplicate names. */ + cnt.name = arg->name; + cnt.count = 0; + zone_foreach(zone_count, &cnt); + zone->uz_namecnt = cnt.count; for (i = 0; i < vm_ndomains; i++) TAILQ_INIT(&zone->uz_domain[i].uzd_buckets); @@ -1903,6 +2068,8 @@ zone_ctor(void *mem, int size, void *udata, int flags) keg = arg->keg; if (arg->flags & UMA_ZONE_SECONDARY) { + KASSERT((zone->uz_flags & UMA_ZONE_SECONDARY) == 0, + ("Secondary zone requested UMA_ZFLAG_INTERNAL")); KASSERT(arg->keg != NULL, ("Secondary zone on zero'd keg")); zone->uz_init = arg->uminit; zone->uz_fini = arg->fini; @@ -1939,35 +2106,36 @@ zone_ctor(void *mem, int size, void *udata, int flags) return (error); } + /* Inherit properties from the keg. */ zone->uz_keg = keg; zone->uz_size = keg->uk_size; zone->uz_flags |= (keg->uk_flags & (UMA_ZONE_INHERIT | UMA_ZFLAG_INHERIT)); - /* - * Some internal zones don't have room allocated for the per cpu - * caches. If we're internal, bail out here. - */ - if (keg->uk_flags & UMA_ZFLAG_INTERNAL) { - KASSERT((zone->uz_flags & UMA_ZONE_SECONDARY) == 0, - ("Secondary zone requested UMA_ZFLAG_INTERNAL")); - return (0); +out: + if (__predict_true(booted == BOOT_RUNNING)) { + zone_alloc_counters(zone, NULL); + zone_alloc_sysctl(zone, NULL); + } else { + zone->uz_allocs = EARLY_COUNTER; + zone->uz_frees = EARLY_COUNTER; + zone->uz_fails = EARLY_COUNTER; } -out: KASSERT((arg->flags & (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET)) != (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET), ("Invalid zone flag combination")); - if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0) { - zone->uz_count = BUCKET_MAX; - } else if ((arg->flags & UMA_ZONE_MINBUCKET) != 0) { - zone->uz_count = BUCKET_MIN; - zone->uz_count_max = BUCKET_MIN; - } else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0) - zone->uz_count = 0; + if (arg->flags & UMA_ZFLAG_INTERNAL) + zone->uz_bucket_size_max = zone->uz_bucket_size = 0; + if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0) + zone->uz_bucket_size = BUCKET_MAX; + else if ((arg->flags & UMA_ZONE_MINBUCKET) != 0) + zone->uz_bucket_size_max = zone->uz_bucket_size = BUCKET_MIN; + else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0) + zone->uz_bucket_size = 0; else - zone->uz_count = bucket_select(zone->uz_size); - zone->uz_count_min = zone->uz_count; + zone->uz_bucket_size = bucket_select(zone->uz_size); + zone->uz_bucket_size_min = zone->uz_bucket_size; return (0); } @@ -2013,6 +2181,8 @@ zone_dtor(void *arg, int size, void *udata) zone = (uma_zone_t)arg; + sysctl_remove_oid(zone->uz_oid, 1, 1); + if (!(zone->uz_flags & UMA_ZFLAG_INTERNAL)) cache_drain(zone); @@ -2039,6 +2209,7 @@ zone_dtor(void *arg, int size, void *udata) counter_u64_free(zone->uz_allocs); counter_u64_free(zone->uz_frees); counter_u64_free(zone->uz_fails); + free(zone->uz_ctlname, M_UMA); if (zone->uz_lockptr == &zone->uz_lock) ZONE_LOCK_FINI(zone); } @@ -2054,7 +2225,7 @@ zone_dtor(void *arg, int size, void *udata) * Nothing */ static void -zone_foreach(void (*zfunc)(uma_zone_t)) +zone_foreach(void (*zfunc)(uma_zone_t, void *arg), void *arg) { uma_keg_t keg; uma_zone_t zone; @@ -2068,10 +2239,10 @@ zone_foreach(void (*zfunc)(uma_zone_t)) rw_rlock(&uma_rwlock); LIST_FOREACH(keg, &uma_kegs, uk_link) { LIST_FOREACH(zone, &keg->uk_zones, uz_link) - zfunc(zone); + zfunc(zone, arg); } LIST_FOREACH(zone, &uma_cachezones, uz_link) - zfunc(zone); + zfunc(zone, arg); if (__predict_true(booted == BOOT_RUNNING)) rw_runlock(&uma_rwlock); } @@ -2249,7 +2420,8 @@ uma_startup3(void) uma_dbg_cnt = counter_u64_alloc(M_WAITOK); uma_skip_cnt = counter_u64_alloc(M_WAITOK); #endif - zone_foreach(zone_alloc_counters); + zone_foreach(zone_alloc_counters, NULL); + zone_foreach(zone_alloc_sysctl, NULL); callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); booted = BOOT_RUNNING; @@ -2665,7 +2837,7 @@ cache_alloc(uma_zone_t zone, uma_cache_t cache, void * critical_enter(); /* Short-circuit for zones without buckets and low memory. */ - if (zone->uz_count == 0 || bucketdisable) + if (zone->uz_bucket_size == 0 || bucketdisable) return (false); cpu = curcpu; @@ -2702,8 +2874,8 @@ cache_alloc(uma_zone_t zone, uma_cache_t cache, void * * We bump the uz count when the cache size is insufficient to * handle the working set. */ - if (lockfail && zone->uz_count < zone->uz_count_max) - zone->uz_count++; + if (lockfail && zone->uz_bucket_size < zone->uz_bucket_size_max) + zone->uz_bucket_size++; /* * Fill a bucket and attempt to use it as the alloc bucket. @@ -3005,11 +3177,11 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do if (zone->uz_max_items > 0) { if (zone->uz_items >= zone->uz_max_items) return (false); - maxbucket = MIN(zone->uz_count, + maxbucket = MIN(zone->uz_bucket_size, zone->uz_max_items - zone->uz_items); zone->uz_items += maxbucket; } else - maxbucket = zone->uz_count; + maxbucket = zone->uz_bucket_size; ZONE_UNLOCK(zone); /* Don't wait for buckets, preserve caller's NOVM setting. */ @@ -3285,8 +3457,8 @@ zone_free_bucket(uma_zone_t zone, uma_bucket_t bucket, if (ZONE_TRYLOCK(zone) == 0) { /* Record contention to size the buckets. */ ZONE_LOCK(zone); - if (zone->uz_count < zone->uz_count_max) - zone->uz_count++; + if (zone->uz_bucket_size < zone->uz_bucket_size_max) + zone->uz_bucket_size++; } CTR3(KTR_UMA, @@ -3323,7 +3495,7 @@ cache_free(uma_zone_t zone, uma_cache_t cache, void *u CRITICAL_ASSERT(curthread); - if (zone->uz_count == 0 || bucketdisable) + if (zone->uz_bucket_size == 0 || bucketdisable) return false; cpu = curcpu; @@ -3523,9 +3695,9 @@ uma_zone_set_max(uma_zone_t zone, int nitems) ZONE_LOCK(zone); ubz = bucket_zone_max(zone, nitems); count = ubz != NULL ? ubz->ubz_entries : 0; - zone->uz_count_max = zone->uz_count = count; - if (zone->uz_count_min > zone->uz_count_max) - zone->uz_count_min = zone->uz_count_max; + zone->uz_bucket_size_max = zone->uz_bucket_size = count; + if (zone->uz_bucket_size_min > zone->uz_bucket_size_max) + zone->uz_bucket_size_min = zone->uz_bucket_size_max; zone->uz_max_items = nitems; ZONE_UNLOCK(zone); @@ -3549,12 +3721,12 @@ uma_zone_set_maxcache(uma_zone_t zone, int nitems) bpcpu++; #endif nitems -= ubz->ubz_entries * bpcpu * mp_ncpus; - zone->uz_count_max = ubz->ubz_entries; + zone->uz_bucket_size_max = ubz->ubz_entries; } else { - zone->uz_count_max = zone->uz_count = 0; + zone->uz_bucket_size_max = zone->uz_bucket_size = 0; } - if (zone->uz_count_min > zone->uz_count_max) - zone->uz_count_min = zone->uz_count_max; + if (zone->uz_bucket_size_min > zone->uz_bucket_size_max) + zone->uz_bucket_size_min = zone->uz_bucket_size_max; zone->uz_bkt_max = nitems; ZONE_UNLOCK(zone); } @@ -3602,20 +3774,71 @@ uma_zone_get_cur(uma_zone_t zone) ZONE_LOCK(zone); nitems = counter_u64_fetch(zone->uz_allocs) - counter_u64_fetch(zone->uz_frees); - CPU_FOREACH(i) { - /* - * See the comment in uma_vm_zone_stats() regarding the - * safety of accessing the per-cpu caches. With the zone lock - * held, it is safe, but can potentially result in stale data. - */ - nitems += zone->uz_cpu[i].uc_allocs - - zone->uz_cpu[i].uc_frees; + if ((zone->uz_flags & UMA_ZFLAG_INTERNAL) == 0) { + CPU_FOREACH(i) { + /* + * See the comment in uma_vm_zone_stats() regarding + * the safety of accessing the per-cpu caches. With + * the zone lock held, it is safe, but can potentially + * result in stale data. + */ + nitems += zone->uz_cpu[i].uc_allocs - + zone->uz_cpu[i].uc_frees; + } } ZONE_UNLOCK(zone); return (nitems < 0 ? 0 : nitems); } +static uint64_t +uma_zone_get_allocs(uma_zone_t zone) +{ + uint64_t nitems; + u_int i; + + ZONE_LOCK(zone); + nitems = counter_u64_fetch(zone->uz_allocs); + if ((zone->uz_flags & UMA_ZFLAG_INTERNAL) == 0) { + CPU_FOREACH(i) { + /* + * See the comment in uma_vm_zone_stats() regarding + * the safety of accessing the per-cpu caches. With + * the zone lock held, it is safe, but can potentially + * result in stale data. + */ + nitems += zone->uz_cpu[i].uc_allocs; + } + } + ZONE_UNLOCK(zone); + + return (nitems); +} + +static uint64_t +uma_zone_get_frees(uma_zone_t zone) +{ + uint64_t nitems; + u_int i; + + ZONE_LOCK(zone); + nitems = counter_u64_fetch(zone->uz_frees); + if ((zone->uz_flags & UMA_ZFLAG_INTERNAL) == 0) { + CPU_FOREACH(i) { + /* + * See the comment in uma_vm_zone_stats() regarding + * the safety of accessing the per-cpu caches. With + * the zone lock held, it is safe, but can potentially + * result in stale data. + */ + nitems += zone->uz_cpu[i].uc_frees; + } + } + ZONE_UNLOCK(zone); + + return (nitems); +} + /* See uma.h */ void uma_zone_set_init(uma_zone_t zone, uma_init uminit) @@ -3800,14 +4023,14 @@ uma_reclaim(int req) switch (req) { case UMA_RECLAIM_TRIM: - zone_foreach(zone_trim); + zone_foreach(zone_trim, NULL); break; case UMA_RECLAIM_DRAIN: case UMA_RECLAIM_DRAIN_CPU: - zone_foreach(zone_drain); + zone_foreach(zone_drain, NULL); if (req == UMA_RECLAIM_DRAIN_CPU) { pcpu_cache_drain_safe(NULL); - zone_foreach(zone_drain); + zone_foreach(zone_drain, NULL); } break; default: @@ -3819,7 +4042,7 @@ uma_reclaim(int req) * we visit again so that we can free pages that are empty once other * zones are drained. We have to do the same for buckets. */ - zone_drain(slabzone); + zone_drain(slabzone, NULL); bucket_zone_drain(); sx_xunlock(&uma_reclaim_lock); } @@ -3859,14 +4082,14 @@ uma_zone_reclaim(uma_zone_t zone, int req) switch (req) { case UMA_RECLAIM_TRIM: - zone_trim(zone); + zone_trim(zone, NULL); break; case UMA_RECLAIM_DRAIN: - zone_drain(zone); + zone_drain(zone, NULL); break; case UMA_RECLAIM_DRAIN_CPU: pcpu_cache_drain_safe(zone); - zone_drain(zone); + zone_drain(zone, NULL); break; default: panic("unhandled reclamation request %d", req); @@ -3977,76 +4200,6 @@ uma_avail(void) return (uma_kmem_limit - uma_size()); } -void -uma_print_stats(void) -{ - zone_foreach(uma_print_zone); -} - -static void -slab_print(uma_slab_t slab) -{ - printf("slab: keg %p, data %p, freecount %d\n", - slab->us_keg, slab->us_data, slab->us_freecount); -} - -static void -cache_print(uma_cache_t cache) -{ - printf("alloc: %p(%d), free: %p(%d), cross: %p(%d)j\n", - cache->uc_allocbucket, - cache->uc_allocbucket?cache->uc_allocbucket->ub_cnt:0, - cache->uc_freebucket, - cache->uc_freebucket?cache->uc_freebucket->ub_cnt:0, - cache->uc_crossbucket, - cache->uc_crossbucket?cache->uc_crossbucket->ub_cnt:0); -} - -static void -uma_print_keg(uma_keg_t keg) -{ - uma_domain_t dom; - uma_slab_t slab; - int i; - - printf("keg: %s(%p) size %d(%d) flags %#x ipers %d ppera %d " - "out %d free %d\n", - keg->uk_name, keg, keg->uk_size, keg->uk_rsize, keg->uk_flags, - keg->uk_ipers, keg->uk_ppera, - (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, - keg->uk_free); - for (i = 0; i < vm_ndomains; i++) { - dom = &keg->uk_domain[i]; - printf("Part slabs:\n"); - LIST_FOREACH(slab, &dom->ud_part_slab, us_link) - slab_print(slab); - printf("Free slabs:\n"); - LIST_FOREACH(slab, &dom->ud_free_slab, us_link) - slab_print(slab); - printf("Full slabs:\n"); - LIST_FOREACH(slab, &dom->ud_full_slab, us_link) - slab_print(slab); - } -} - -void -uma_print_zone(uma_zone_t zone) -{ - uma_cache_t cache; - int i; - - printf("zone: %s(%p) size %d maxitems %ju flags %#x\n", - zone->uz_name, zone, zone->uz_size, (uintmax_t)zone->uz_max_items, - zone->uz_flags); - if (zone->uz_lockptr != &zone->uz_lock) - uma_print_keg(zone->uz_keg); - CPU_FOREACH(i) { - cache = &zone->uz_cpu[i]; - printf("CPU %d Cache:\n", i); - cache_print(cache); - } -} - #ifdef DDB /* * Generate statistics across both the zone and its per-cpu cache's. Return @@ -4274,13 +4427,41 @@ sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS) int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS) { - uma_zone_t zone = *(uma_zone_t *)arg1; + uma_zone_t zone; int cur; + /* + * Some callers want to add sysctls for global zones that + * may not yet exist so they pass a pointer to a pointer. + */ + if (arg2 == 0) + zone = *(uma_zone_t *)arg1; + else + zone = arg1; cur = uma_zone_get_cur(zone); return (sysctl_handle_int(oidp, &cur, 0, req)); } +static int +sysctl_handle_uma_zone_allocs(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = arg1; + uint64_t cur; + + cur = uma_zone_get_allocs(zone); + return (sysctl_handle_64(oidp, &cur, 0, req)); +} + +static int +sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = arg1; + uint64_t cur; + + cur = uma_zone_get_frees(zone); + return (sysctl_handle_64(oidp, &cur, 0, req)); +} + #ifdef INVARIANTS static uma_slab_t uma_dbg_getslab(uma_zone_t zone, void *item) @@ -4500,7 +4681,8 @@ DB_SHOW_COMMAND(uma, db_show_uma) db_printf(fmt_entry, cur_zone->uz_name, (uintmax_t)cur_keg->uk_size, (intmax_t)used, cachefree, (uintmax_t)allocs, (uintmax_t)sleeps, - (unsigned)cur_zone->uz_count, (intmax_t)size, xdomain); + (unsigned)cur_zone->uz_bucket_size, (intmax_t)size, + xdomain); if (db_pager_quit) return; @@ -4525,7 +4707,7 @@ DB_SHOW_COMMAND(umacache, db_show_umacache) db_printf("%18s %8ju %8jd %8ld %12ju %8u\n", z->uz_name, (uintmax_t)z->uz_size, (intmax_t)(allocs - frees), cachefree, - (uintmax_t)allocs, z->uz_count); + (uintmax_t)allocs, z->uz_bucket_size); if (db_pager_quit) return; } Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Nov 27 23:19:06 2019 (r355148) +++ head/sys/vm/uma_int.h Thu Nov 28 00:19:09 2019 (r355149) @@ -338,8 +338,8 @@ struct uma_zone { uint64_t uz_items; /* Total items count */ uint64_t uz_max_items; /* Maximum number of items to alloc */ uint32_t uz_sleepers; /* Number of sleepers on memory */ - uint16_t uz_count; /* Amount of items in full bucket */ - uint16_t uz_count_max; /* Maximum amount of items there */ + uint16_t uz_bucket_size; /* Number of items in full bucket */ + uint16_t uz_bucket_size_max; /* Maximum number of bucket items */ /* Offset 64, used in bucket replenish. */ uma_import uz_import; /* Import new memory to cache. */ @@ -364,14 +364,17 @@ struct uma_zone { const char *uz_warning; /* Warning to print on failure */ struct timeval uz_ratecheck; /* Warnings rate-limiting */ struct task uz_maxaction; /* Task to run when at limit */ - uint16_t uz_count_min; /* Minimal amount of items in bucket */ + uint16_t uz_bucket_size_min; /* Min number of items in bucket */ - /* Offset 256, stats. */ + /* Offset 256+, stats and misc. */ counter_u64_t uz_allocs; /* Total number of allocations */ counter_u64_t uz_frees; /* Total number of frees */ counter_u64_t uz_fails; /* Total number of alloc failures */ uint64_t uz_sleeps; /* Total number of alloc sleeps */ uint64_t uz_xdomain; /* Total number of cross-domain frees */ + char *uz_ctlname; /* sysctl safe name string. */ + struct sysctl_oid *uz_oid; /* sysctl oid pointer. */ + int uz_namecnt; /* duplicate name count. */ /* * This HAS to be the last item because we adjust the zone size From owner-svn-src-head@freebsd.org Thu Nov 28 00:37:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B32941BCE90; Thu, 28 Nov 2019 00:37:44 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Ndyc4DMNz3JTx; Thu, 28 Nov 2019 00:37:44 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 702881DB1D; Thu, 28 Nov 2019 00:37:44 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0bib5057306; Thu, 28 Nov 2019 00:37:44 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0biva057305; Thu, 28 Nov 2019 00:37:44 GMT (envelope-from chs@FreeBSD.org) Message-Id: <201911280037.xAS0biva057305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Thu, 28 Nov 2019 00:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355150 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 355150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 00:37:44 -0000 Author: chs Date: Thu Nov 28 00:37:43 2019 New Revision: 355150 URL: https://svnweb.freebsd.org/changeset/base/355150 Log: As part of creating a snapshot, set fs->fs_fmod to 0 in the snapshot image because nothing ever changes this field for read-only mounts and we want to verify that it is still 0 when we unmount. Reviewed by: mckusick Approved by: mckusick (mentor) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 28 00:19:09 2019 (r355149) +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Nov 28 00:37:43 2019 (r355150) @@ -803,6 +803,7 @@ out1: brelse(nbp); } else { loc = blkoff(fs, fs->fs_sblockloc); + copy_fs->fs_fmod = 0; copy_fs->fs_ckhash = ffs_calc_sbhash(copy_fs); bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize); bawrite(nbp); From owner-svn-src-head@freebsd.org Thu Nov 28 00:46:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4124D1BD309; Thu, 28 Nov 2019 00:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nf8D0ydpz3KKs; Thu, 28 Nov 2019 00:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3FB21DCD5; Thu, 28 Nov 2019 00:46:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0k37f063469; Thu, 28 Nov 2019 00:46:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0k39c063468; Thu, 28 Nov 2019 00:46:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911280046.xAS0k39c063468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 28 Nov 2019 00:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355155 - head/contrib/openbsm/bin/auditd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/openbsm/bin/auditd X-SVN-Commit-Revision: 355155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 00:46:04 -0000 Author: cem Date: Thu Nov 28 00:46:03 2019 New Revision: 355155 URL: https://svnweb.freebsd.org/changeset/base/355155 Log: auditd(8): fix long-standing uninitialized memory use bug The bogus use could lead to an infinite loop depending on how fast the audit_warn script to execute. By fixing read(2) interruptibility, d060887 (r335899) revealed another bug in auditd_wait_for_events. When read is interrupted by SIGCHLD, auditd_reap_children will always return with errno set to ECHILD. But auditd_wait_for_events checks errno after that point, expecting it to be unchanged since read. As a result, it calls auditd_handle_trigger with bogus stack garbage. The result is the error message "Got unknown trigger 48." Fix by simply ignoring errno at that point; there's only one value it could've possibly had, thanks to the check up above. The best part is we've had a fix for this for like 18 months and just never merged it. Merge it now. PR: 234209 Reported by: Marie Helene Kvello-Aune (2018-12) Submitted by: asomers (2018-07) Reviewed by: me (in OpenBSM) Obtained from: OpenBSM X-MFC-With: r335899 Security: ¯\_(ツ)_/¯ Differential Revision: https://github.com/openbsm/openbsm/pull/45 Modified: head/contrib/openbsm/bin/auditd/auditd_fbsd.c Modified: head/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_fbsd.c Thu Nov 28 00:42:55 2019 (r355154) +++ head/contrib/openbsm/bin/auditd/auditd_fbsd.c Thu Nov 28 00:46:03 2019 (r355155) @@ -241,7 +241,7 @@ auditd_wait_for_events(void) auditd_config_controls(); } - if ((num == -1) && (errno == EINTR)) + if (num == -1) continue; if (num == 0) { auditd_log_err("%s: read EOF", __FUNCTION__); From owner-svn-src-head@freebsd.org Thu Nov 28 00:46:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B110F1BD38C; Thu, 28 Nov 2019 00:46:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nf8n4H03z3KSJ; Thu, 28 Nov 2019 00:46:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 761DF1DCD7; Thu, 28 Nov 2019 00:46:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0kXNG063547; Thu, 28 Nov 2019 00:46:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0kX7d063546; Thu, 28 Nov 2019 00:46:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911280046.xAS0kX7d063546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 28 Nov 2019 00:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355156 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 00:46:33 -0000 Author: cy Date: Thu Nov 28 00:46:33 2019 New Revision: 355156 URL: https://svnweb.freebsd.org/changeset/base/355156 Log: Include fin, the packet information structure (fr_info_t), in the l4sums DTrace probe, making more information available for the diagnosis of IPv6 checksum errors. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Nov 28 00:46:03 2019 (r355155) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Nov 28 00:46:33 2019 (r355156) @@ -6742,7 +6742,7 @@ ipf_checkl4sum(fin) FR_DEBUG(("checkl4sum: %hx != %hx\n", sum, hdrsum)); } #endif - DT2(l4sums, u_short, hdrsum, u_short, sum); + DT3(l4sums, u_short, hdrsum, u_short, sum, fr_info_t *, fin); #ifdef USE_INET6 if (hdrsum == sum || (sum == 0 && fin->fin_p == IPPROTO_ICMPV6)) { #else From owner-svn-src-head@freebsd.org Thu Nov 28 02:05:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F14301BFFF1; Thu, 28 Nov 2019 02:05:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Ngvv66cdz3PH3; Thu, 28 Nov 2019 02:05:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B55491EBCC; Thu, 28 Nov 2019 02:05:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS25VQx011580; Thu, 28 Nov 2019 02:05:31 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS25VLh011579; Thu, 28 Nov 2019 02:05:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911280205.xAS25VLh011579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 28 Nov 2019 02:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355157 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 355157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 02:05:32 -0000 Author: rmacklem Date: Thu Nov 28 02:05:31 2019 New Revision: 355157 URL: https://svnweb.freebsd.org/changeset/base/355157 Log: Add a cap on credential lifetime for Kerberized NFS. The kernel RPCSEC_GSS code sets the credential (called a client) lifetime to the lifetime of the Kerberos ticket, which is typically several hours. As such, when a user's credentials change such as being added to a new group, it can take several hours for this change to be recognized by the NFS server. This patch adds a sysctl called kern.rpc.gss.lifetime_max which can be set by a sysadmin to put a cap on the time to expire for the credentials, so that a sysadmin can reduce the timeout. It also fixes a bug, where time_uptime is added twice when GSS_C_INDEFINITE is returned for a lifetime. This has no effect in practice, sine Kerberos never does this. Tested by: pen@lysator.liu.se PR: 242132 Submitted by: pen@lysator.liu.se MFC after: 2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Nov 28 00:46:33 2019 (r355156) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Nov 28 02:05:31 2019 (r355157) @@ -173,6 +173,7 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_MAX 1024 u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; +u_int svc_rpc_gss_lifetime_max = 0; SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); @@ -185,6 +186,10 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_hash, CTLF &svc_rpc_gss_client_hash_size, 0, "Size of rpc-gss client hash table"); +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, lifetime_max, CTLFLAG_RW, + &svc_rpc_gss_lifetime_max, 0, + "Maximum lifetime (seconds) of rpc-gss clients"); + static u_int svc_rpc_gss_client_count; SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, &svc_rpc_gss_client_count, 0, @@ -956,8 +961,15 @@ svc_rpc_gss_accept_sec_context(struct svc_rpc_gss_clie * that out). */ if (cred_lifetime == GSS_C_INDEFINITE) - cred_lifetime = time_uptime + 24*60*60; + cred_lifetime = 24*60*60; + /* + * Cap cred_lifetime if sysctl kern.rpc.gss.lifetime_max is set. + */ + if (svc_rpc_gss_lifetime_max > 0 && cred_lifetime > + svc_rpc_gss_lifetime_max) + cred_lifetime = svc_rpc_gss_lifetime_max; + client->cl_expiration = time_uptime + cred_lifetime; /* From owner-svn-src-head@freebsd.org Thu Nov 28 02:18:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6828B1C07D3; Thu, 28 Nov 2019 02:18:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NhCJ22qcz3QDf; Thu, 28 Nov 2019 02:18:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 292C51EDAF; Thu, 28 Nov 2019 02:18:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS2IqDh018000; Thu, 28 Nov 2019 02:18:52 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS2Iqqa017999; Thu, 28 Nov 2019 02:18:52 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911280218.xAS2Iqqa017999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 28 Nov 2019 02:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355161 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 355161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 02:18:52 -0000 Author: rmacklem Date: Thu Nov 28 02:18:51 2019 New Revision: 355161 URL: https://svnweb.freebsd.org/changeset/base/355161 Log: Change r355157 to make svc_rpc_gss_lifetime_max a static. MFC after: 2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Nov 28 02:18:19 2019 (r355160) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Nov 28 02:18:51 2019 (r355161) @@ -173,7 +173,6 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_MAX 1024 u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; -u_int svc_rpc_gss_lifetime_max = 0; SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); @@ -186,6 +185,7 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_hash, CTLF &svc_rpc_gss_client_hash_size, 0, "Size of rpc-gss client hash table"); +static u_int svc_rpc_gss_lifetime_max = 0; SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, lifetime_max, CTLFLAG_RW, &svc_rpc_gss_lifetime_max, 0, "Maximum lifetime (seconds) of rpc-gss clients"); From owner-svn-src-head@freebsd.org Thu Nov 28 02:28:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A31961C0F5E; Thu, 28 Nov 2019 02:28:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NhQ53dWLz3R1V; Thu, 28 Nov 2019 02:28:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FF3C1EFAB; Thu, 28 Nov 2019 02:28:13 +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 xAS2SDom024084; Thu, 28 Nov 2019 02:28:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS2SDva024083; Thu, 28 Nov 2019 02:28:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911280228.xAS2SDva024083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Nov 2019 02:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355163 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 355163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 02:28:13 -0000 Author: mav Date: Thu Nov 28 02:28:12 2019 New Revision: 355163 URL: https://svnweb.freebsd.org/changeset/base/355163 Log: Make the code slightly more compact. There should be no functional change. MFC after: 1 week Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 02:19:41 2019 (r355162) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 02:28:12 2019 (r355163) @@ -782,37 +782,42 @@ bar_get_xlat_params(struct ntb_softc *ntb, enum ntb_ba static int intel_ntb_map_pci_bars(struct ntb_softc *ntb) { + struct ntb_pci_bar_info *bar; int rc; - ntb->bar_info[NTB_CONFIG_BAR].pci_resource_id = PCIR_BAR(0); - rc = map_mmr_bar(ntb, &ntb->bar_info[NTB_CONFIG_BAR]); + bar = &ntb->bar_info[NTB_CONFIG_BAR]; + bar->pci_resource_id = PCIR_BAR(0); + rc = map_mmr_bar(ntb, bar); if (rc != 0) goto out; - ntb->bar_info[NTB_B2B_BAR_1].pci_resource_id = PCIR_BAR(2); - rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_1]); + bar = &ntb->bar_info[NTB_B2B_BAR_1]; + bar->pci_resource_id = PCIR_BAR(2); + rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - ntb->bar_info[NTB_B2B_BAR_1].psz_off = XEON_PBAR23SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_1].ssz_off = XEON_SBAR23SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_1].pbarxlat_off = XEON_PBAR2XLAT_OFFSET; + bar->psz_off = XEON_PBAR23SZ_OFFSET; + bar->ssz_off = XEON_SBAR23SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR2XLAT_OFFSET; - ntb->bar_info[NTB_B2B_BAR_2].pci_resource_id = PCIR_BAR(4); - rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_2]); + bar = &ntb->bar_info[NTB_B2B_BAR_2]; + bar->pci_resource_id = PCIR_BAR(4); + rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - ntb->bar_info[NTB_B2B_BAR_2].psz_off = XEON_PBAR4SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_2].ssz_off = XEON_SBAR4SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_2].pbarxlat_off = XEON_PBAR4XLAT_OFFSET; + bar->psz_off = XEON_PBAR4SZ_OFFSET; + bar->ssz_off = XEON_SBAR4SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR4XLAT_OFFSET; if (!HAS_FEATURE(ntb, NTB_SPLIT_BAR)) goto out; - ntb->bar_info[NTB_B2B_BAR_3].pci_resource_id = PCIR_BAR(5); - rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_3]); - ntb->bar_info[NTB_B2B_BAR_3].psz_off = XEON_PBAR5SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_3].ssz_off = XEON_SBAR5SZ_OFFSET; - ntb->bar_info[NTB_B2B_BAR_3].pbarxlat_off = XEON_PBAR5XLAT_OFFSET; + bar = &ntb->bar_info[NTB_B2B_BAR_3]; + bar->pci_resource_id = PCIR_BAR(5); + rc = map_memory_window_bar(ntb, bar); + bar->psz_off = XEON_PBAR5SZ_OFFSET; + bar->ssz_off = XEON_SBAR5SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR5XLAT_OFFSET; out: if (rc != 0) @@ -935,15 +940,14 @@ map_memory_window_bar(struct ntb_softc *ntb, struct nt static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb) { - struct ntb_pci_bar_info *current_bar; + struct ntb_pci_bar_info *bar; int i; for (i = 0; i < NTB_MAX_BARS; i++) { - current_bar = &ntb->bar_info[i]; - if (current_bar->pci_resource != NULL) + bar = &ntb->bar_info[i]; + if (bar->pci_resource != NULL) bus_release_resource(ntb->device, SYS_RES_MEMORY, - current_bar->pci_resource_id, - current_bar->pci_resource); + bar->pci_resource_id, bar->pci_resource); } } From owner-svn-src-head@freebsd.org Thu Nov 28 02:32:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 453811C1231; Thu, 28 Nov 2019 02:32:19 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NhVq19Djz3wdK; Thu, 28 Nov 2019 02:32:19 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C71D1F154; Thu, 28 Nov 2019 02:32:19 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS2WIbG029608; Thu, 28 Nov 2019 02:32:18 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS2WHtb029602; Thu, 28 Nov 2019 02:32:17 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201911280232.xAS2WHtb029602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 28 Nov 2019 02:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm X-SVN-Commit-Revision: 355164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 02:32:19 -0000 Author: scottl Date: Thu Nov 28 02:32:17 2019 New Revision: 355164 URL: https://svnweb.freebsd.org/changeset/base/355164 Log: Remove the trm(4) driver Differential Revision: https://reviews.freebsd.org/D22575 Deleted: head/share/man/man4/trm.4 head/sys/dev/trm/ head/sys/modules/trm/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Nov 28 02:28:12 2019 (r355163) +++ head/ObsoleteFiles.inc Thu Nov 28 02:32:17 2019 (r355164) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20191128: Removal of trm(4) +OLD_FILES+=usr/share/man/man4/trm.4.gz # 20191121: Removal of sio(4) OLD_FILES+=usr/share/man/man4/sio.4.gz # 20191105: picobsd(8), et al, removed. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Nov 28 02:28:12 2019 (r355163) +++ head/share/man/man4/Makefile Thu Nov 28 02:32:17 2019 (r355164) @@ -522,7 +522,6 @@ MAN= aac.4 \ ti.4 \ timecounters.4 \ ${_tpm.4} \ - trm.4 \ tty.4 \ tun.4 \ twa.4 \ Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Nov 28 02:28:12 2019 (r355163) +++ head/sys/amd64/conf/GENERIC Thu Nov 28 02:32:17 2019 (r355164) @@ -150,7 +150,6 @@ device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device mpr # LSI-Logic MPT-Fusion 3 device sym # NCR/Symbios Logic -device trm # Tekram DC395U/UW/F DC315U adapters device isci # Intel C600 SAS controller device ocs_fc # Emulex FC adapters device pvscsi # VMware PVSCSI Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Nov 28 02:28:12 2019 (r355163) +++ head/sys/conf/NOTES Thu Nov 28 02:32:17 2019 (r355164) @@ -1511,7 +1511,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # 53C810, 53C810A, 53C815, 53C825, 53C825A, 53C860, 53C875, # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, # 53C1010-33, 53C1010-66. -# trm: Tekram DC395U/UW/F DC315U adapters. device ahc device ahd @@ -1538,7 +1537,6 @@ device mpr # LSI-Logic MPT-Fusion 3 device mps # LSI-Logic MPT-Fusion 2 device mpt # LSI-Logic MPT-Fusion device sym -device trm # The aic7xxx driver will attempt to use memory mapped I/O for all PCI # controllers that have it configured only if this option is set. Unfortunately, Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Nov 28 02:28:12 2019 (r355163) +++ head/sys/conf/files Thu Nov 28 02:32:17 2019 (r355164) @@ -3144,7 +3144,6 @@ dev/tcp_log/tcp_log_dev.c optional tcp_blackbox inet | dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux dev/tdfx/tdfx_pci.c optional tdfx pci dev/ti/if_ti.c optional ti pci -dev/trm/trm.c optional trm dev/twa/tw_cl_init.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_cl_intr.c optional twa \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Nov 28 02:28:12 2019 (r355163) +++ head/sys/i386/conf/GENERIC Thu Nov 28 02:32:17 2019 (r355164) @@ -136,7 +136,6 @@ device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device mpr # LSI-Logic MPT-Fusion 3 device sym # NCR/Symbios Logic -device trm # Tekram DC395U/UW/F DC315U adapters device isci # Intel C600 SAS controller device pvscsi # VMware PVSCSI Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Nov 28 02:28:12 2019 (r355163) +++ head/sys/modules/Makefile Thu Nov 28 02:32:17 2019 (r355164) @@ -352,7 +352,6 @@ SUBDIR= \ tmpfs \ ${_toecore} \ ${_tpm} \ - trm \ ${_twa} \ twe \ tws \ From owner-svn-src-head@freebsd.org Thu Nov 28 02:40:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A9C1C147B; Thu, 28 Nov 2019 02:40:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nhgx22QNz3wtV; Thu, 28 Nov 2019 02:40:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ACD11F16C; Thu, 28 Nov 2019 02:40:13 +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 xAS2eCZH030144; Thu, 28 Nov 2019 02:40:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS2eCX9030143; Thu, 28 Nov 2019 02:40:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911280240.xAS2eCX9030143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Nov 2019 02:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355165 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 355165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 02:40:13 -0000 Author: mav Date: Thu Nov 28 02:40:12 2019 New Revision: 355165 URL: https://svnweb.freebsd.org/changeset/base/355165 Log: Make DMAR allow Intel NTB device to access its own BAR0. I have no good explanation why it happens, but I found that in B2B mode at least Xeon v4 NTB leaks accesses to its configuration memory at BAR0 originated from the link side to its host side. DMAR predictably blocks those, making access to remote scratchpad registers in B2B mode impossible. This change creates identity mapping in DMAR covering the BAR0 addresses, making the NTB work fine with DMAR enabled. It seems like allowing single 4KB range at 32KB offset may be enough, but I don't see a reason to be so specific. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 02:32:17 2019 (r355164) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 02:40:12 2019 (r355165) @@ -219,6 +219,9 @@ struct ntb_softc { struct ntb_pci_bar_info *peer_lapic_bar; struct callout peer_msix_work; + bus_dma_tag_t bar0_dma_tag; + bus_dmamap_t bar0_dma_map; + struct callout heartbeat_timer; struct callout lr_timer; @@ -791,6 +794,29 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb) if (rc != 0) goto out; + /* + * At least on Xeon v4 NTB device leaks to host some remote side + * BAR0 writes supposed to update scratchpad registers. I am not + * sure why it happens, but it may be related to the fact that + * on a link side BAR0 is 32KB, while on a host side it is 64KB. + * Without this hack DMAR blocks those accesses as not allowed. + */ + if (bus_dma_tag_create(bus_get_dma_tag(ntb->device), 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + bar->size, 1, bar->size, 0, NULL, NULL, &ntb->bar0_dma_tag)) { + device_printf(ntb->device, "Unable to create BAR0 tag\n"); + return (ENOMEM); + } + if (bus_dmamap_create(ntb->bar0_dma_tag, 0, &ntb->bar0_dma_map)) { + device_printf(ntb->device, "Unable to create BAR0 map\n"); + return (ENOMEM); + } + if (bus_dma_dmar_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map, + bar->pbase, bar->size, 0)) { + device_printf(ntb->device, "Unable to load BAR0 map\n"); + return (ENOMEM); + } + bar = &ntb->bar_info[NTB_B2B_BAR_1]; bar->pci_resource_id = PCIR_BAR(2); rc = map_memory_window_bar(ntb, bar); @@ -943,6 +969,12 @@ intel_ntb_unmap_pci_bar(struct ntb_softc *ntb) struct ntb_pci_bar_info *bar; int i; + if (ntb->bar0_dma_map != NULL) { + bus_dmamap_unload(ntb->bar0_dma_tag, ntb->bar0_dma_map); + bus_dmamap_destroy(ntb->bar0_dma_tag, ntb->bar0_dma_map); + } + if (ntb->bar0_dma_tag != NULL) + bus_dma_tag_destroy(ntb->bar0_dma_tag); for (i = 0; i < NTB_MAX_BARS; i++) { bar = &ntb->bar_info[i]; if (bar->pci_resource != NULL) From owner-svn-src-head@freebsd.org Thu Nov 28 04:15:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A101C384A; Thu, 28 Nov 2019 04:15:17 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nknd257Fz42GM; Thu, 28 Nov 2019 04:15:17 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C4B1203D8; Thu, 28 Nov 2019 04:15:17 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS4FH9k090021; Thu, 28 Nov 2019 04:15:17 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS4FHUC090020; Thu, 28 Nov 2019 04:15:17 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911280415.xAS4FHUC090020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 28 Nov 2019 04:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355166 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 04:15:17 -0000 Author: rlibby Date: Thu Nov 28 04:15:16 2019 New Revision: 355166 URL: https://svnweb.freebsd.org/changeset/base/355166 Log: uma: move sysctl vm.uma defn out from under INVARIANTS Fix non-INVARIANTS builds after r355149. Reported by: Michael Butler Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D22588 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Nov 28 02:40:12 2019 (r355165) +++ head/sys/vm/uma_core.c Thu Nov 28 04:15:16 2019 (r355166) @@ -297,7 +297,6 @@ static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); static void uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item); -SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, "Memory allocation debugging"); @@ -315,6 +314,8 @@ SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFL #endif SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); + +SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); SYSCTL_PROC(_vm, OID_AUTO, zone_count, CTLFLAG_RD|CTLTYPE_INT, 0, 0, sysctl_vm_zone_count, "I", "Number of UMA zones"); From owner-svn-src-head@freebsd.org Thu Nov 28 04:21:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B0001C3BB0 for ; Thu, 28 Nov 2019 04:21:46 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nkx52jxdz42gp for ; Thu, 28 Nov 2019 04:21:45 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pg1-x541.google.com with SMTP id k13so12235682pgh.3 for ; Wed, 27 Nov 2019 20:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=K97w4v9Um92Ptj8m788J5wQ6uzzrVhnW7e2irBPfMHc=; b=GzTu/uuVDEbAFvXpsc1GwEDagcC4MAOgnijK2MPOztg9bAuKjusIrf9eJONlBHpb+B gD2+eIRdf596T/1KGfy+v7STbvRJp1E0KK/DIJ/NRQNgF7vXmBXe1q+mJzZ2bFjb0OnQ XDKY6Jce52FrvKBR8KpJU3oWxvlDlmd0mVOTVxTKTL+5HFvjUiU4SzrgBzDNdEsOVqcA 9xvbaNMltFIg1mnzKZFZRJsDkxHs4Bo1ILLXAEhcElDw3lI1b8jDw8KGQ/7xQY1JKf8R 7LVGocDgJLf32+tJqHRNnMSEvK94GhfWLhYdkx4y0UYEfDWgYWjSua2VuOThw61KMxw6 QPfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=K97w4v9Um92Ptj8m788J5wQ6uzzrVhnW7e2irBPfMHc=; b=TzWYYXVsE7CqCoTslaFgZha+BnZqkhH8mwFB7AumPQqtQ4mAeG1qFsDc4DoVs3JrNE wZwLfXMhx3opCljN79JFRmhEAKzUFcxt2RVSDN1bOQWCkmd9g57FlsFCXDr8hb3IM0dG onIYLkIRxzoMZuCWUuLpb/16HZvuMx62rqQhZZ1UzogJ3h6vtJL6jymmdCoN/hjhAlvj hVkRKiEn7fuvLIPubUYXJofpUR3HHBC02s21cUUaCCJ/rbGqWVHXXj8DDQsQh6ysjzRt Ienz3Ktbetemm0F76ARW+EhmTSNDoB/JED1Prz8YLbt8EAvQTtMpZgXbFO7Kvf7ZfDm/ mSBg== X-Gm-Message-State: APjAAAURL3uO+4AHnKdeBNXvPplMPJFRW4FD/5AgfzW8guRGyOJxfMRj NsRcUE2G3PzUaU3qOl9AJaQO9A== X-Google-Smtp-Source: APXvYqyXqjhIo1hK91JMX/FvtQ7mhq/wS2LD78/8T47bUetgDivV+Pc1UN+LGmXIQu+eYCfYRcX+HA== X-Received: by 2002:a63:cb50:: with SMTP id m16mr9110314pgi.425.1574914903795; Wed, 27 Nov 2019 20:21:43 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id x21sm17776486pfi.122.2019.11.27.20.21.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2019 20:21:43 -0800 (PST) Date: Wed, 27 Nov 2019 18:21:41 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Ryan Libby cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355166 - head/sys/vm In-Reply-To: <201911280415.xAS4FHUC090020@repo.freebsd.org> Message-ID: References: <201911280415.xAS4FHUC090020@repo.freebsd.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 47Nkx52jxdz42gp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=GzTu/uuV; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::541) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.80 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-1.00)[ip: (-0.75), ipnet: 2607:f8b0::/32(-2.26), asn: 15169(-1.95), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 04:21:46 -0000 Thank you. mea culpa. Jeff On Thu, 28 Nov 2019, Ryan Libby wrote: > Author: rlibby > Date: Thu Nov 28 04:15:16 2019 > New Revision: 355166 > URL: https://svnweb.freebsd.org/changeset/base/355166 > > Log: > uma: move sysctl vm.uma defn out from under INVARIANTS > > Fix non-INVARIANTS builds after r355149. > > Reported by: Michael Butler > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D22588 > > Modified: > head/sys/vm/uma_core.c > > Modified: head/sys/vm/uma_core.c > ============================================================================== > --- head/sys/vm/uma_core.c Thu Nov 28 02:40:12 2019 (r355165) > +++ head/sys/vm/uma_core.c Thu Nov 28 04:15:16 2019 (r355166) > @@ -297,7 +297,6 @@ static bool uma_dbg_zskip(uma_zone_t zone, void *mem); > static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); > static void uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item); > > -SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); > static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, > "Memory allocation debugging"); > > @@ -315,6 +314,8 @@ SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFL > #endif > > SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); > + > +SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); > > SYSCTL_PROC(_vm, OID_AUTO, zone_count, CTLFLAG_RD|CTLTYPE_INT, > 0, 0, sysctl_vm_zone_count, "I", "Number of UMA zones"); > From owner-svn-src-head@freebsd.org Thu Nov 28 04:29:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB8001C3F9D; Thu, 28 Nov 2019 04:29:47 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nl6M36Zcz435M; Thu, 28 Nov 2019 04:29:46 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id xAS4TcIo010621; Wed, 27 Nov 2019 20:29:38 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xAS4TcPo010620; Wed, 27 Nov 2019 20:29:38 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201911280429.xAS4TcPo010620@gndrsh.dnsmgr.net> Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm In-Reply-To: <201911280232.xAS2WHtb029602@repo.freebsd.org> To: Scott Long Date: Wed, 27 Nov 2019 20:29:38 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 47Nl6M36Zcz435M X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-0.99)[-0.986,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 04:29:47 -0000 > Author: scottl > Date: Thu Nov 28 02:32:17 2019 > New Revision: 355164 > URL: https://svnweb.freebsd.org/changeset/base/355164 > > Log: > Remove the trm(4) driver > > Differential Revision: https://reviews.freebsd.org/D22575 Deprecation notice to merge to stable/{12,11}? Relnotes entry? > Deleted: > head/share/man/man4/trm.4 > head/sys/dev/trm/ > head/sys/modules/trm/ > Modified: > head/ObsoleteFiles.inc > head/share/man/man4/Makefile > head/sys/amd64/conf/GENERIC > head/sys/conf/NOTES > head/sys/conf/files > head/sys/i386/conf/GENERIC > head/sys/modules/Makefile > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Thu Nov 28 02:28:12 2019 (r355163) > +++ head/ObsoleteFiles.inc Thu Nov 28 02:32:17 2019 (r355164) > @@ -38,6 +38,8 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20191128: Removal of trm(4) > +OLD_FILES+=usr/share/man/man4/trm.4.gz > # 20191121: Removal of sio(4) > OLD_FILES+=usr/share/man/man4/sio.4.gz > # 20191105: picobsd(8), et al, removed. > > Modified: head/share/man/man4/Makefile > ============================================================================== > --- head/share/man/man4/Makefile Thu Nov 28 02:28:12 2019 (r355163) > +++ head/share/man/man4/Makefile Thu Nov 28 02:32:17 2019 (r355164) > @@ -522,7 +522,6 @@ MAN= aac.4 \ > ti.4 \ > timecounters.4 \ > ${_tpm.4} \ > - trm.4 \ > tty.4 \ > tun.4 \ > twa.4 \ > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Thu Nov 28 02:28:12 2019 (r355163) > +++ head/sys/amd64/conf/GENERIC Thu Nov 28 02:32:17 2019 (r355164) > @@ -150,7 +150,6 @@ device mpt # LSI-Logic MPT-Fusion > device mps # LSI-Logic MPT-Fusion 2 > device mpr # LSI-Logic MPT-Fusion 3 > device sym # NCR/Symbios Logic > -device trm # Tekram DC395U/UW/F DC315U adapters > device isci # Intel C600 SAS controller > device ocs_fc # Emulex FC adapters > device pvscsi # VMware PVSCSI > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Thu Nov 28 02:28:12 2019 (r355163) > +++ head/sys/conf/NOTES Thu Nov 28 02:32:17 2019 (r355164) > @@ -1511,7 +1511,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) > # 53C810, 53C810A, 53C815, 53C825, 53C825A, 53C860, 53C875, > # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, > # 53C1010-33, 53C1010-66. > -# trm: Tekram DC395U/UW/F DC315U adapters. > > device ahc > device ahd > @@ -1538,7 +1537,6 @@ device mpr # LSI-Logic MPT-Fusion 3 > device mps # LSI-Logic MPT-Fusion 2 > device mpt # LSI-Logic MPT-Fusion > device sym > -device trm > > # The aic7xxx driver will attempt to use memory mapped I/O for all PCI > # controllers that have it configured only if this option is set. Unfortunately, > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Thu Nov 28 02:28:12 2019 (r355163) > +++ head/sys/conf/files Thu Nov 28 02:32:17 2019 (r355164) > @@ -3144,7 +3144,6 @@ dev/tcp_log/tcp_log_dev.c optional tcp_blackbox inet | > dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux > dev/tdfx/tdfx_pci.c optional tdfx pci > dev/ti/if_ti.c optional ti pci > -dev/trm/trm.c optional trm > dev/twa/tw_cl_init.c optional twa \ > compile-with "${NORMAL_C} -I$S/dev/twa" > dev/twa/tw_cl_intr.c optional twa \ > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Thu Nov 28 02:28:12 2019 (r355163) > +++ head/sys/i386/conf/GENERIC Thu Nov 28 02:32:17 2019 (r355164) > @@ -136,7 +136,6 @@ device mpt # LSI-Logic MPT-Fusion > device mps # LSI-Logic MPT-Fusion 2 > device mpr # LSI-Logic MPT-Fusion 3 > device sym # NCR/Symbios Logic > -device trm # Tekram DC395U/UW/F DC315U adapters > device isci # Intel C600 SAS controller > device pvscsi # VMware PVSCSI > > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Thu Nov 28 02:28:12 2019 (r355163) > +++ head/sys/modules/Makefile Thu Nov 28 02:32:17 2019 (r355164) > @@ -352,7 +352,6 @@ SUBDIR= \ > tmpfs \ > ${_toecore} \ > ${_tpm} \ > - trm \ > ${_twa} \ > twe \ > tws \ > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Nov 28 05:40:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BE491C5502; Thu, 28 Nov 2019 05:40:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nmgb02Glz45RM; Thu, 28 Nov 2019 05:40:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D85B321230; Thu, 28 Nov 2019 05:40:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS5eAph036736; Thu, 28 Nov 2019 05:40:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS5eAFC036735; Thu, 28 Nov 2019 05:40:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911280540.xAS5eAFC036735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Nov 2019 05:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355167 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 355167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 05:40:11 -0000 Author: imp Date: Thu Nov 28 05:40:10 2019 New Revision: 355167 URL: https://svnweb.freebsd.org/changeset/base/355167 Log: Remove comment. We're just going to the next node here. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Nov 28 04:15:16 2019 (r355166) +++ head/stand/efi/loader/main.c Thu Nov 28 05:40:10 2019 (r355167) @@ -741,7 +741,7 @@ parse_uefi_con_out(void) */ pci_pending = true; } - node = NextDevicePathNode(node); /* Skip the end node */ + node = NextDevicePathNode(node); } if (pci_pending && vid_seen == 0) vid_seen = ++seen; From owner-svn-src-head@freebsd.org Thu Nov 28 05:40:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 442A81C5526; Thu, 28 Nov 2019 05:40:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nmgh0SQ9z45Vc; Thu, 28 Nov 2019 05:40:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3AA321231; Thu, 28 Nov 2019 05:40:15 +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 xAS5eF7h036790; Thu, 28 Nov 2019 05:40:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS5eFm3036789; Thu, 28 Nov 2019 05:40:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911280540.xAS5eFm3036789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Nov 2019 05:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355168 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 355168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 05:40:16 -0000 Author: imp Date: Thu Nov 28 05:40:15 2019 New Revision: 355168 URL: https://svnweb.freebsd.org/changeset/base/355168 Log: Also turn of teken for RB_MULTIPLE RB_MULTIPLE without RB_SERIAL set is valid, and means 'Video first, then serial' to the kernel (so kernel messages go to both, but /etc/rc uses video console (this should be fixed, btw, but another day)). Check for RB_MULTIPLE as well as RB_SERIAL where we want to to serial things. This means we'll use the old code for emulation in these situations, which is likely best since we're outputing to both and the old code is ligher weight allowing both to keep up w/o weird scrolling things. Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Thu Nov 28 05:40:10 2019 (r355167) +++ head/stand/efi/libefi/efi_console.c Thu Nov 28 05:40:15 2019 (r355168) @@ -824,9 +824,13 @@ efi_cons_update_mode(void) * terminal emulator for efi text mode to support the menu. * While teken is too expensive to be used on serial console, the * pre-teken emulator is light enough to be used on serial console. + * + * When doing multiple consoles (both serial and video), + * also just use the old emulator. RB_MULTIPLE also implies + * we're using a serial console. */ mode = parse_uefi_con_out(); - if ((mode & RB_SERIAL) == 0) { + if ((mode & (RB_SERIAL | RB_MULTIPLE)) == 0) { if (buffer != NULL) { if (tp.tp_row == rows && tp.tp_col == cols) return (true); @@ -998,7 +1002,11 @@ efi_cons_putchar(int c) { unsigned char ch = c; - if ((mode & RB_SERIAL) != 0) { + /* + * Don't use Teken when we're doing pure serial, or a multiple console + * with video "primary" because that's also serial. + */ + if ((mode & (RB_SERIAL | RB_MULTIPLE)) != 0) { input_byte(ch); return; } From owner-svn-src-head@freebsd.org Thu Nov 28 07:49:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FEFD1C824B; Thu, 28 Nov 2019 07:49:27 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NqXk74S1z4Cvx; Thu, 28 Nov 2019 07:49:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D658022913; Thu, 28 Nov 2019 07:49:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS7nQxW013860; Thu, 28 Nov 2019 07:49:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS7nQvU013856; Thu, 28 Nov 2019 07:49:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911280749.xAS7nQvU013856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 28 Nov 2019 07:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355169 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 355169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 07:49:27 -0000 Author: jeff Date: Thu Nov 28 07:49:25 2019 New Revision: 355169 URL: https://svnweb.freebsd.org/changeset/base/355169 Log: Garbage collect the mostly unused us_keg field. Use appropriately named union members in vm_page.h to store the zone and slab. Remove some nearby dead code. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D22564 Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Nov 28 05:40:15 2019 (r355168) +++ head/sys/kern/kern_malloc.c Thu Nov 28 07:49:25 2019 (r355169) @@ -738,6 +738,7 @@ free_dbg(void **addrp, struct malloc_type *mtp) void free(void *addr, struct malloc_type *mtp) { + uma_zone_t zone; uma_slab_t slab; u_long size; @@ -749,17 +750,17 @@ free(void *addr, struct malloc_type *mtp) if (addr == NULL) return; - slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) panic("free: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); if (!(slab->us_flags & UMA_SLAB_MALLOC)) { - size = slab->us_keg->uk_size; + size = zone->uz_size; #ifdef INVARIANTS free_save_type(addr, mtp, size); #endif - uma_zfree_arg(LIST_FIRST(&slab->us_keg->uk_zones), addr, slab); + uma_zfree_arg(zone, addr, slab); } else { size = slab->us_size; uma_large_free(slab); @@ -770,6 +771,7 @@ free(void *addr, struct malloc_type *mtp) void free_domain(void *addr, struct malloc_type *mtp) { + uma_zone_t zone; uma_slab_t slab; u_long size; @@ -782,18 +784,17 @@ free_domain(void *addr, struct malloc_type *mtp) if (addr == NULL) return; - slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) panic("free_domain: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); if (!(slab->us_flags & UMA_SLAB_MALLOC)) { - size = slab->us_keg->uk_size; + size = zone->uz_size; #ifdef INVARIANTS free_save_type(addr, mtp, size); #endif - uma_zfree_domain(LIST_FIRST(&slab->us_keg->uk_zones), - addr, slab); + uma_zfree_domain(zone, addr, slab); } else { size = slab->us_size; uma_large_free(slab); @@ -807,6 +808,7 @@ free_domain(void *addr, struct malloc_type *mtp) void * realloc(void *addr, size_t size, struct malloc_type *mtp, int flags) { + uma_zone_t zone; uma_slab_t slab; unsigned long alloc; void *newaddr; @@ -834,7 +836,7 @@ realloc(void *addr, size_t size, struct malloc_type *m slab = NULL; alloc = redzone_get_size(addr); #else - slab = vtoslab((vm_offset_t)addr & ~(UMA_SLAB_MASK)); + vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); /* Sanity check */ KASSERT(slab != NULL, @@ -842,7 +844,7 @@ realloc(void *addr, size_t size, struct malloc_type *m /* Get the size of the original block */ if (!(slab->us_flags & UMA_SLAB_MALLOC)) - alloc = slab->us_keg->uk_size; + alloc = zone->uz_size; else alloc = slab->us_size; Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Nov 28 05:40:15 2019 (r355168) +++ head/sys/vm/uma_core.c Thu Nov 28 07:49:25 2019 (r355169) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2002-2005, 2009, 2013 Jeffrey Roberson + * Copyright (c) 2002-2019 Jeffrey Roberson * Copyright (c) 2004, 2005 Bosko Milekic * Copyright (c) 2004-2006 Robert N. M. Watson * All rights reserved. @@ -275,7 +275,6 @@ static uma_bucket_t bucket_alloc(uma_zone_t zone, void static void bucket_free(uma_zone_t zone, uma_bucket_t, void *); static void bucket_zone_drain(void); static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int); -static uma_slab_t zone_fetch_slab(uma_zone_t, uma_keg_t, int, int); static void *slab_alloc_item(uma_keg_t keg, uma_slab_t slab); static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, @@ -1210,9 +1209,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom if (keg->uk_flags & UMA_ZONE_VTOSLAB) for (i = 0; i < keg->uk_ppera; i++) - vsetslab((vm_offset_t)mem + (i * PAGE_SIZE), slab); + vsetzoneslab((vm_offset_t)mem + (i * PAGE_SIZE), + zone, slab); - slab->us_keg = keg; slab->us_data = mem; slab->us_freecount = keg->uk_ipers; slab->us_flags = sflags; @@ -3017,10 +3016,8 @@ restart: for (;;) { slab = keg_fetch_free_slab(keg, domain, rr, flags); - if (slab != NULL) { - MPASS(slab->us_keg == keg); + if (slab != NULL) return (slab); - } /* * M_NOVM means don't ask at all! @@ -3039,7 +3036,6 @@ restart: * at least one item. */ if (slab) { - MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_part_slab, slab, us_link); return (slab); @@ -3062,33 +3058,11 @@ restart: * fail. */ if ((slab = keg_fetch_free_slab(keg, domain, rr, flags)) != NULL) { - MPASS(slab->us_keg == keg); return (slab); } return (NULL); } -static uma_slab_t -zone_fetch_slab(uma_zone_t zone, uma_keg_t keg, int domain, int flags) -{ - uma_slab_t slab; - - if (keg == NULL) { - keg = zone->uz_keg; - KEG_LOCK(keg); - } - - for (;;) { - slab = keg_fetch_slab(keg, zone, domain, flags); - if (slab) - return (slab); - if (flags & (M_NOWAIT | M_NOVM)) - break; - } - KEG_UNLOCK(keg); - return (NULL); -} - static void * slab_alloc_item(uma_keg_t keg, uma_slab_t slab) { @@ -3096,7 +3070,6 @@ slab_alloc_item(uma_keg_t keg, uma_slab_t slab) void *item; uint8_t freei; - MPASS(keg == slab->us_keg); KEG_LOCK_ASSERT(keg); freei = BIT_FFS(SLAB_SETSIZE, &slab->us_free) - 1; @@ -3126,12 +3099,12 @@ zone_import(uma_zone_t zone, void **bucket, int max, i int i; slab = NULL; - keg = NULL; + keg = zone->uz_keg; + KEG_LOCK(keg); /* Try to keep the buckets totally full */ for (i = 0; i < max; ) { - if ((slab = zone_fetch_slab(zone, keg, domain, flags)) == NULL) + if ((slab = keg_fetch_slab(keg, zone, domain, flags)) == NULL) break; - keg = slab->us_keg; #ifdef NUMA stripe = howmany(max, vm_ndomains); #endif @@ -3157,8 +3130,7 @@ zone_import(uma_zone_t zone, void **bucket, int max, i flags &= ~M_WAITOK; flags |= M_NOWAIT; } - if (slab != NULL) - KEG_UNLOCK(keg); + KEG_UNLOCK(keg); return i; } @@ -3599,7 +3571,6 @@ slab_free_item(uma_zone_t zone, uma_slab_t slab, void keg = zone->uz_keg; MPASS(zone->uz_lockptr == &keg->uk_lock); KEG_LOCK_ASSERT(keg); - MPASS(keg == slab->us_keg); dom = &keg->uk_domain[slab->us_domain]; @@ -3642,10 +3613,8 @@ zone_release(uma_zone_t zone, void **bucket, int cnt) mem += keg->uk_pgoff; slab = (uma_slab_t)mem; } - } else { + } else slab = vtoslab((vm_offset_t)item); - MPASS(slab->us_keg == keg); - } slab_free_item(zone, slab, item); } KEG_UNLOCK(keg); @@ -3996,7 +3965,6 @@ uma_prealloc(uma_zone_t zone, int items) slab = keg_alloc_slab(keg, zone, domain, M_WAITOK, aflags); if (slab != NULL) { - MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); @@ -4134,7 +4102,7 @@ uma_large_malloc_domain(vm_size_t size, int domain, in DOMAINSET_FIXED(domain); addr = kmem_malloc_domainset(policy, size, wait); if (addr != 0) { - vsetslab(addr, slab); + vsetzoneslab(addr, NULL, slab); slab->us_data = (void *)addr; slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; slab->us_size = size; @@ -4546,7 +4514,7 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * panic("uma: item %p did not belong to zone %s\n", item, zone->uz_name); } - keg = slab->us_keg; + keg = zone->uz_keg; freei = ((uintptr_t)item - (uintptr_t)slab->us_data) / keg->uk_rsize; if (BIT_ISSET(SLAB_SETSIZE, freei, &slab->us_debugfree)) @@ -4574,7 +4542,7 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i panic("uma: Freed item %p did not belong to zone %s\n", item, zone->uz_name); } - keg = slab->us_keg; + keg = zone->uz_keg; freei = ((uintptr_t)item - (uintptr_t)slab->us_data) / keg->uk_rsize; if (freei >= keg->uk_ipers) Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Thu Nov 28 05:40:15 2019 (r355168) +++ head/sys/vm/uma_int.h Thu Nov 28 07:49:25 2019 (r355169) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2002-2005, 2009, 2013 Jeffrey Roberson + * Copyright (c) 2002-2019 Jeffrey Roberson * Copyright (c) 2004, 2005 Bosko Milekic * All rights reserved. * @@ -281,7 +281,6 @@ BITSET_DEFINE(slabbits, SLAB_SETSIZE); * store and subdivides it into individually allocatable items. */ struct uma_slab { - uma_keg_t us_keg; /* Keg we live in */ union { LIST_ENTRY(uma_slab) _us_link; /* slabs in zone */ unsigned long _us_size; /* Size of allocation */ @@ -478,16 +477,27 @@ vtoslab(vm_offset_t va) vm_page_t p; p = PHYS_TO_VM_PAGE(pmap_kextract(va)); - return ((uma_slab_t)p->plinks.s.pv); + return (p->plinks.uma.slab); } static __inline void -vsetslab(vm_offset_t va, uma_slab_t slab) +vtozoneslab(vm_offset_t va, uma_zone_t *zone, uma_slab_t *slab) { vm_page_t p; p = PHYS_TO_VM_PAGE(pmap_kextract(va)); - p->plinks.s.pv = slab; + *slab = p->plinks.uma.slab; + *zone = p->plinks.uma.zone; +} + +static __inline void +vsetzoneslab(vm_offset_t va, uma_zone_t zone, uma_slab_t slab) +{ + vm_page_t p; + + p = PHYS_TO_VM_PAGE(pmap_kextract(va)); + p->plinks.uma.slab = slab; + p->plinks.uma.zone = zone; } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Nov 28 05:40:15 2019 (r355168) +++ head/sys/vm/vm_page.h Thu Nov 28 07:49:25 2019 (r355169) @@ -220,12 +220,15 @@ struct vm_page { TAILQ_ENTRY(vm_page) q; /* page queue or free list (Q) */ struct { SLIST_ENTRY(vm_page) ss; /* private slists */ - void *pv; } s; struct { u_long p; u_long v; } memguard; + struct { + void *slab; + void *zone; + } uma; } plinks; TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */ vm_object_t object; /* which object am I in (O) */ From owner-svn-src-head@freebsd.org Thu Nov 28 08:47:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FC4E1C96BB; Thu, 28 Nov 2019 08:47:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nrqs0X21z4GTk; Thu, 28 Nov 2019 08:47:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA3EA233EB; Thu, 28 Nov 2019 08:47:36 +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 xAS8la8O049544; Thu, 28 Nov 2019 08:47:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS8laZR049542; Thu, 28 Nov 2019 08:47:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201911280847.xAS8laZR049542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 28 Nov 2019 08:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355170 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 08:47:37 -0000 Author: hselasky Date: Thu Nov 28 08:47:36 2019 New Revision: 355170 URL: https://svnweb.freebsd.org/changeset/base/355170 Log: Factor out check for mounted root file system. Differential Revision: https://reviews.freebsd.org/D22571 PR: 241639 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_linker.c head/sys/kern/subr_firmware.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Nov 28 07:49:25 2019 (r355169) +++ head/sys/kern/kern_linker.c Thu Nov 28 08:47:36 2019 (r355170) @@ -2079,13 +2079,15 @@ linker_load_module(const char *kldname, const char *mo */ KASSERT(verinfo == NULL, ("linker_load_module: verinfo" " is not NULL")); - if (rootvnode == NULL) + /* check if root file system is not mounted */ + if (rootvnode == NULL || curproc->p_fd->fd_rdir == NULL) return (ENXIO); pathname = linker_search_kld(kldname); } else { if (modlist_lookup2(modname, verinfo) != NULL) return (EEXIST); - if (rootvnode == NULL) + /* check if root file system is not mounted */ + if (rootvnode == NULL || curproc->p_fd->fd_rdir == NULL) return (ENXIO); if (kldname != NULL) pathname = strdup(kldname, M_LINKER); Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Thu Nov 28 07:49:25 2019 (r355169) +++ head/sys/kern/subr_firmware.c Thu Nov 28 08:47:36 2019 (r355170) @@ -257,7 +257,6 @@ firmware_unregister(const char *imagename) static void loadimage(void *arg, int npending) { - struct thread *td = curthread; char *imagename = arg; struct priv_fw *fp; linker_file_t result; @@ -267,11 +266,6 @@ loadimage(void *arg, int npending) mtx_lock(&firmware_mtx); mtx_unlock(&firmware_mtx); - if (td->td_proc->p_fd->fd_rdir == NULL) { - printf("%s: root not mounted yet, no way to load image\n", - imagename); - goto done; - } error = linker_reference_module(imagename, NULL, &result); if (error != 0) { printf("%s: could not load firmware image, error %d\n", From owner-svn-src-head@freebsd.org Thu Nov 28 08:48:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 422531C9775; Thu, 28 Nov 2019 08:48:06 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NrrP3y01z4GfX; Thu, 28 Nov 2019 08:48:05 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wr1-x42e.google.com with SMTP id n1so30056851wra.10; Thu, 28 Nov 2019 00:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6UCHLTjZY1rkJIolGmxR9AnnlwcCUxUkGv3drc/b/dA=; b=k7TKmYOSogtjHJnAFbtXAjp+jfHAM2gZeZeu1yYebUFFnio9CqDSrdJU3eNGo1+NwD fHXNa7ToB5XrVuIkcW+5KfXmQbg7eEc6i/WqRtZS4+CyaDZN8ws6KkMNffOVgDloT2qd Qc2FiyGTXW7Swl0nWucFYJ9mFKTdfVHYImTn54gXEdhz7DpTr5vS6AEtcFVOHwcC76wD UzdqZSmYCQ63nJvVUfSi/U5fN7MVZaK1w0jB2g+woBzmbS+e6p/eLzOaI2CONDZ6sM3X AMwIDq9Y31WA/mWQkjZhTMaYk2sXzHhekXY5z5ue4ufUvlbup3mstRWbFeEyP0b7GieI NxKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=6UCHLTjZY1rkJIolGmxR9AnnlwcCUxUkGv3drc/b/dA=; b=TVYfHE2A2WLCDN0BqthV6fu2uVm/ZLwFuntxSDyviglT7Edapt2pY4QtLtCQlWvJqm b/kdHbKYtjw9RwjN3MWJb8vdlXcqR5sl9xW9R9q048tX7c1hIorui2kWuWHzyG4yzONB zxwyqkKqSYSWLlDDPFr1OzLeEXlneEVIbToN6c1YPnLIlYSYdkIoR8gWcoWEJgZ5J5yR K9PvX7FzeYFQobun2W5cqT+nit3j44lfojcLDevWwgiT5Ekl+yyOF0r5Uhlh1ca8aLbZ ZStPqZGrcSQiJWS6QeilNM7nzp8QlgmnHZMyaqh5TuCGwZ1aKaspR7Id9QMFcnRNQ3lc Adgg== X-Gm-Message-State: APjAAAUzy7LBYz2gsan+w5PPIDDPNbTqwrLe3UXHOT3casK5Lkvym+Nv 7Pk/K2SQ7OlRd5QkEVGVQ+pIu3Hg X-Google-Smtp-Source: APXvYqzjJRT21VUTdOiYLQn2e0XYln/yKr39xux1eH2MVvU/Yv2ILQoOlEer5X9X2ED8alIRVeH4RQ== X-Received: by 2002:a5d:5044:: with SMTP id h4mr9310538wrt.4.1574930883573; Thu, 28 Nov 2019 00:48:03 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id d186sm10217607wmf.7.2019.11.28.00.48.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Nov 2019 00:48:02 -0800 (PST) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r355145 - head/sys/arm64/arm64 To: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911272033.xARKXowX014908@repo.freebsd.org> From: Michal Meloun Message-ID: Date: Thu, 28 Nov 2019 09:48:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911272033.xARKXowX014908@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47NrrP3y01z4GfX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=k7TKmYOS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::42e as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.04), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.95), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[e.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 08:48:06 -0000 On 27.11.2019 21:33, Alan Cox wrote: > Author: alc > Date: Wed Nov 27 20:33:49 2019 > New Revision: 355145 > URL: https://svnweb.freebsd.org/changeset/base/355145 > > Log: > There is no reason why we need to pin the underlying thread to its current > processor in pmap_invalidate_{all,page,range}(). These functions are using > an instruction that broadcasts the TLB invalidation to every processor, so > even if a thread migrates in the middle of one of these functions every > processor will still perform the required TLB invalidations. I think this is not the right assumption. The problem is not in TLB operations themselves, but in following 'dsb' and / or 'isb'. 'dsb' ensures that all TLB operation transmitted by the local CPU is performed and visible to other observers. But it does nothing with TLBs emitted by other CPUs. For example, if a given thread is rescheduled after all TLB operations but before 'dsb' or 'isb' is performed, then the requested synchronization does not occur at all. Michal > > Reviewed by: andrew, markj > MFC after: 10 days > Differential Revision: https://reviews.freebsd.org/D22502 > > Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Wed Nov 27 20:32:53 2019 (r355144) > +++ head/sys/arm64/arm64/pmap.c Wed Nov 27 20:33:49 2019 (r355145) > @@ -1043,7 +1043,6 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) > { > uint64_t r; > > - sched_pin(); > dsb(ishst); > if (pmap == kernel_pmap) { > r = atop(va); > @@ -1054,11 +1053,10 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) > } > dsb(ish); > isb(); > - sched_unpin(); > } > > static __inline void > -pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) > +pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) > { > uint64_t end, r, start; > > @@ -1080,20 +1078,10 @@ pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t s > } > > static __inline void > -pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) > -{ > - > - sched_pin(); > - pmap_invalidate_range_nopin(pmap, sva, eva); > - sched_unpin(); > -} > - > -static __inline void > pmap_invalidate_all(pmap_t pmap) > { > uint64_t r; > > - sched_pin(); > dsb(ishst); > if (pmap == kernel_pmap) { > __asm __volatile("tlbi vmalle1is"); > @@ -1103,7 +1091,6 @@ pmap_invalidate_all(pmap_t pmap) > } > dsb(ish); > isb(); > - sched_unpin(); > } > > /* > @@ -3114,7 +3101,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent > * lookup the physical address. > */ > pmap_clear_bits(pte, ATTR_DESCR_VALID); > - pmap_invalidate_range_nopin(pmap, va, va + size); > + pmap_invalidate_range(pmap, va, va + size); > > /* Create the new mapping */ > pmap_store(pte, newpte); > From owner-svn-src-head@freebsd.org Thu Nov 28 08:56:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 549831C9C4C; Thu, 28 Nov 2019 08:56:15 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Ns1q1cVkz4HHD; Thu, 28 Nov 2019 08:56:15 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C05B235CD; Thu, 28 Nov 2019 08:56:15 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS8uE4d055943; Thu, 28 Nov 2019 08:56:14 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS8uEeh055942; Thu, 28 Nov 2019 08:56:14 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911280856.xAS8uEeh055942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 28 Nov 2019 08:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355171 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 08:56:15 -0000 Author: jeff Date: Thu Nov 28 08:56:14 2019 New Revision: 355171 URL: https://svnweb.freebsd.org/changeset/base/355171 Log: Fix DEBUG_REDZONE build after r355169 Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Nov 28 08:47:36 2019 (r355170) +++ head/sys/kern/kern_malloc.c Thu Nov 28 08:56:14 2019 (r355171) @@ -834,6 +834,7 @@ realloc(void *addr, size_t size, struct malloc_type *m #ifdef DEBUG_REDZONE slab = NULL; + zone = NULL; alloc = redzone_get_size(addr); #else vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); From owner-svn-src-head@freebsd.org Thu Nov 28 09:17:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDB521CA4AC; Thu, 28 Nov 2019 09:17:55 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 47NsVp007Cz4JGX; Thu, 28 Nov 2019 09:17:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [192.168.42.12] (cpc91220-cmbg18-2-0-cust60.5-4.cable.virginm.net [81.104.142.61]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C07FC4E630; Thu, 28 Nov 2019 09:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1574932636; bh=8PhIzAGQUCB8zkCVuR4R9rHRIvp0aKrMR3cCNCNkvn4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=W8FXoMohxRWV/Jtu06dmpYfzCJimLZo7x9oJfwxd4c3M7BerRxtBczbWCH9syYvPX DZynZIGVihUdonds807ARsV3Ao8/5tJgrPQRvVMtdDNbzCe4WfQUVz2YBP7JT2QPLT 29oinZcRZWd5O8ZHlUavHFZGZ8A8ABNRafMmRD13kdILaH3r8BcLZBX1Xcl3fgKhC7 tKFL0tCCLnP9i6VyT+Rwy2wt7jvB7EVl9+tAk6cS4HfYbRErNZCHMFmPhJD/1N7lRW WvyMv6JhMYu+acJNhqKqDF/DmnHVojZWY37yZ20IVCa4AER6q0olNRbcmiskA5qxv+ zbiR9tmO62W3vysbdHS7Xct8pyCBAJLNRrTjN8GouLDruIdPGDj6j0lC9Lg0hhOIYO MMJIE5IOVtYZYwP3BrSForeJ2CEFXc3TY70hIBkN2PYoxM124Z9Qi1NhvWNnQEhwkb TmXnkDis20+HGTOoSvhckILpxyKPyN96L0KklyNFVsqOfv+VXaq4fDUq6DRW44Na1W PswwEUYw8VWuCWpbQgn0DM8dM3STDIl/fx0OLe0vDmF1O1Km2rXA8CV0pz+lqZhS7x WhYj2QPaiJ+luJfulDINR1m1X2lZOeHT9ldPxA85ACqoCcmQ5xQv0OXkP9nP9QKqzr JdJBfKzoMoM1oohiHxPFX/84= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r355145 - head/sys/arm64/arm64 From: Andrew Turner In-Reply-To: Date: Thu, 28 Nov 2019 09:17:15 +0000 Cc: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201911272033.xARKXowX014908@repo.freebsd.org> To: meloun.michal@gmail.com X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 47NsVp007Cz4JGX X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fubar.geek.nz header.s=mail header.b=W8FXoMoh; dmarc=pass (policy=none) header.from=fubar.geek.nz; spf=pass (mx1.freebsd.org: domain of andrew@fubar.geek.nz designates 139.59.165.16 as permitted sender) smtp.mailfrom=andrew@fubar.geek.nz X-Spamd-Result: default: False [-1.86 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[fubar.geek.nz:s=mail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[fubar.geek.nz:+]; DMARC_POLICY_ALLOW(-0.50)[fubar.geek.nz,none]; IP_SCORE(-0.96)[ip: (-4.45), ipnet: 139.59.160.0/20(-2.23), asn: 14061(1.91), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; RECEIVED_SPAMHAUS_PBL(0.00)[61.142.104.81.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:139.59.160.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 09:17:55 -0000 > On 28 Nov 2019, at 08:48, Michal Meloun = wrote: >=20 >=20 >=20 > On 27.11.2019 21:33, Alan Cox wrote: >> Author: alc >> Date: Wed Nov 27 20:33:49 2019 >> New Revision: 355145 >> URL: https://svnweb.freebsd.org/changeset/base/355145 >>=20 >> Log: >> There is no reason why we need to pin the underlying thread to its = current >> processor in pmap_invalidate_{all,page,range}(). These functions = are using >> an instruction that broadcasts the TLB invalidation to every = processor, so >> even if a thread migrates in the middle of one of these functions = every >> processor will still perform the required TLB invalidations. > I think this is not the right assumption. The problem is not in TLB > operations themselves, but in following 'dsb' and / or 'isb'. 'dsb' > ensures that all TLB operation transmitted by the local CPU is = performed > and visible to other observers. But it does nothing with TLBs emitted = by > other CPUs. > For example, if a given thread is rescheduled after all TLB operations > but before 'dsb' or 'isb' is performed, then the requested > synchronization does not occur at all. The tibi instructions need a context synchronisation point. One option = is the dsb & isb instructions, another is an exception entry. For a thread to be rescheduled it requires the timer interrupt to fire. = As an exception entry is a context synchronisation point and an = interrupt will cause an exception entry there will be such a point after = the the tibi instruction. Andrew From owner-svn-src-head@freebsd.org Thu Nov 28 09:30:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23FBF1CA874; Thu, 28 Nov 2019 09:30:19 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nsn70730z4JnF; Thu, 28 Nov 2019 09:30:19 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F1FD20029381878C3E50F72.dip0.t-ipconnect.de [IPv6:2003:cd:5f1f:d200:2938:1878:c3e5:f72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 322FA7662; Thu, 28 Nov 2019 09:30:18 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm To: Scott Long Cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911280429.xAS4TcPo010620@gndrsh.dnsmgr.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: <2637ffb0-a041-f493-830b-74e70ea92ce0@freebsd.org> Date: Thu, 28 Nov 2019 10:30:14 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911280429.xAS4TcPo010620@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 09:30:19 -0000 Am 28.11.19 um 05:29 schrieb Rodney W. Grimes: >> Author: scottl >> Date: Thu Nov 28 02:32:17 2019 >> New Revision: 355164 >> URL: https://svnweb.freebsd.org/changeset/base/355164 >> >> Log: >> Remove the trm(4) driver >> >> Differential Revision: https://reviews.freebsd.org/D22575 > > Deprecation notice to merge to stable/{12,11}? > Relnotes entry? All devices supported by the trm driver were also covered by sym, but the trm driver was provided by Tekram and it did support the configuration of the bus mode by means of a BIOS menu (but these BIOS values were also found and used by the sym driver). As long as the sym driver remains in the tree, Tekram controllers that work with trm will still be supported. A deprecation note and release notes entry to the effect that sym will attach to Tekram controllers (compiled into a custom kernel or as module) should be sufficient. I do still have some generic Symbios cards and also some Tekram cards, but lack other required components required to perform any tests with them ... Regards, STefan From owner-svn-src-head@freebsd.org Thu Nov 28 12:50:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 513671A8636; Thu, 28 Nov 2019 12:50:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NyD22DJKz4X98; Thu, 28 Nov 2019 12:50:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B3D525EF6; Thu, 28 Nov 2019 12:50:26 +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 xASCoQf0090755; Thu, 28 Nov 2019 12:50:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASCoQcL090754; Thu, 28 Nov 2019 12:50:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201911281250.xASCoQcL090754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 28 Nov 2019 12:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355172 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 355172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 12:50:26 -0000 Author: tuexen Date: Thu Nov 28 12:50:25 2019 New Revision: 355172 URL: https://svnweb.freebsd.org/changeset/base/355172 Log: Really ignore the SCTP association identifier on 1-to-1 style sockets as requiresd by the socket API specification. Thanks to Inaki Baz Castillo, who found this bug running the userland stack with valgrind and reported the issue in https://github.com/sctplab/usrsctp/issues/408 MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Nov 28 08:56:14 2019 (r355171) +++ head/sys/netinet/sctp_usrreq.c Thu Nov 28 12:50:25 2019 (r355172) @@ -1675,7 +1675,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); if (inp->idata_supported) { av->assoc_value = 1; @@ -1705,7 +1706,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_cmt_on_off; SCTP_INP_RUNLOCK(inp); @@ -1731,7 +1733,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_cc_module; SCTP_INP_RUNLOCK(inp); @@ -1776,7 +1779,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_ss_module; SCTP_INP_RUNLOCK(inp); @@ -1914,7 +1918,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_context; SCTP_INP_RUNLOCK(inp); @@ -1990,7 +1995,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sack->sack_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (sack->sack_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]); sack->sack_freq = inp->sctp_ep.sctp_sack_freq; @@ -2037,7 +2043,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.max_burst; SCTP_INP_RUNLOCK(inp); @@ -2065,7 +2072,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { ovh = SCTP_MED_OVERHEAD; @@ -2466,7 +2474,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC))) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -2694,7 +2703,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); srto->srto_initial = inp->sctp_ep.initial_rto; srto->srto_max = inp->sctp_ep.sctp_maxrto; @@ -2750,7 +2760,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life); sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times; @@ -2781,7 +2792,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); memcpy(s_info, &inp->def_send, sizeof(inp->def_send)); SCTP_INP_RUNLOCK(inp); @@ -2901,7 +2913,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (scact->scact_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (scact->scact_assoc_id == SCTP_FUTURE_ASSOC))) { /* get the endpoint active key */ SCTP_INP_RLOCK(inp); scact->scact_keynumber = inp->sctp_ep.default_keyid; @@ -2943,7 +2956,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC))) { /* get off the endpoint */ SCTP_INP_RLOCK(inp); chklist = inp->sctp_ep.local_auth_chunks; @@ -3061,7 +3075,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (event->se_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (event->se_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); event->se_on = sctp_is_feature_on(inp, event_type); SCTP_INP_RUNLOCK(inp); @@ -3134,7 +3149,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (info->snd_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (info->snd_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; @@ -3166,7 +3182,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (info->pr_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (info->pr_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); info->pr_value = inp->def_send.sinfo_timetolive; @@ -3277,7 +3294,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC))) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -3385,7 +3403,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); encaps->sue_port = inp->sctp_ep.port; SCTP_INP_RUNLOCK(inp); @@ -3412,7 +3431,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->ecn_supported; SCTP_INP_RUNLOCK(inp); @@ -3439,7 +3459,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->prsctp_supported; SCTP_INP_RUNLOCK(inp); @@ -3466,7 +3487,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->auth_supported; SCTP_INP_RUNLOCK(inp); @@ -3493,7 +3515,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->asconf_supported; SCTP_INP_RUNLOCK(inp); @@ -3520,7 +3543,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->reconfig_supported; SCTP_INP_RUNLOCK(inp); @@ -3547,7 +3571,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->nrsack_supported; SCTP_INP_RUNLOCK(inp); @@ -3574,7 +3599,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->pktdrop_supported; SCTP_INP_RUNLOCK(inp); @@ -3601,7 +3627,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = (uint32_t)inp->local_strreset_support; SCTP_INP_RUNLOCK(inp); @@ -3703,7 +3730,8 @@ flags_out: } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->max_cwnd; SCTP_INP_RUNLOCK(inp); @@ -3892,7 +3920,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->idata_supported = 0; @@ -3936,14 +3965,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->sctp_cmt_on_off = av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -3985,14 +4016,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4017,7 +4050,8 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, optsize); SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id); if (stcb == NULL) { - if (cc_opt->aid_value.assoc_id == SCTP_CURRENT_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (cc_opt->aid_value.assoc_id == SCTP_CURRENT_ASSOC)) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4068,14 +4102,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_ss_module = av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4107,7 +4143,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_CURRENT_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_CURRENT_ASSOC)) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4148,14 +4185,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->sctp_context = av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4216,8 +4255,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || - (sack->sack_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || + (sack->sack_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); if (sack->sack_delay) { inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(sack->sack_delay); @@ -4227,8 +4267,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_INP_WUNLOCK(inp); } - if ((sack->sack_assoc_id == SCTP_CURRENT_ASSOC) || - (sack->sack_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((sack->sack_assoc_id == SCTP_CURRENT_ASSOC) || + (sack->sack_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4315,8 +4356,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || - (sca->sca_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || + (sca->sca_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); shared_keys = &inp->sctp_ep.shared_keys; /* @@ -4350,8 +4392,9 @@ sctp_setopt(struct socket *so, int optname, void *optv error = sctp_insert_sharedkey(shared_keys, shared_key); SCTP_INP_WUNLOCK(inp); } - if ((sca->sca_assoc_id == SCTP_CURRENT_ASSOC) || - (sca->sca_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((sca->sca_assoc_id == SCTP_CURRENT_ASSOC) || + (sca->sca_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4462,8 +4505,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || - (scact->scact_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || + (scact->scact_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); if (sctp_auth_setactivekey_ep(inp, scact->scact_keynumber)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -4471,8 +4515,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_INP_WUNLOCK(inp); } - if ((scact->scact_assoc_id == SCTP_CURRENT_ASSOC) || - (scact->scact_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((scact->scact_assoc_id == SCTP_CURRENT_ASSOC) || + (scact->scact_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4501,8 +4546,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || - (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || + (scdel->scact_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); if (sctp_delete_sharedkey_ep(inp, scdel->scact_keynumber)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -4510,8 +4556,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_INP_WUNLOCK(inp); } - if ((scdel->scact_assoc_id == SCTP_CURRENT_ASSOC) || - (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((scdel->scact_assoc_id == SCTP_CURRENT_ASSOC) || + (scdel->scact_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4540,8 +4587,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || - (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || + (keyid->scact_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); if (sctp_deact_sharedkey_ep(inp, keyid->scact_keynumber)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -4549,8 +4597,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_INP_WUNLOCK(inp); } - if ((keyid->scact_assoc_id == SCTP_CURRENT_ASSOC) || - (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((keyid->scact_assoc_id == SCTP_CURRENT_ASSOC) || + (keyid->scact_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4579,14 +4628,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->local_strreset_support = (uint8_t)av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4934,14 +4985,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_FUTURE_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->sctp_ep.max_burst = av->assoc_value; SCTP_INP_WUNLOCK(inp); } - if ((av->assoc_id == SCTP_CURRENT_ASSOC) || - (av->assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((av->assoc_id == SCTP_CURRENT_ASSOC) || + (av->assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -4976,7 +5029,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); /* * FIXME MT: I think this is not in @@ -5187,14 +5241,16 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || - (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || + (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send))); SCTP_INP_WUNLOCK(inp); } - if ((s_info->sinfo_assoc_id == SCTP_CURRENT_ASSOC) || - (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((s_info->sinfo_assoc_id == SCTP_CURRENT_ASSOC) || + (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -5542,7 +5598,8 @@ sctp_setopt(struct socket *so, int optname, void *optv /************************NO TCB, SET TO default stuff ******************/ if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); /* * For the TOS/FLOWLABEL stuff you @@ -5633,7 +5690,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (srto->srto_initial) new_init = srto->srto_initial; @@ -5687,7 +5745,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (sasoc->sasoc_asocmaxrxt) inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt; @@ -6098,8 +6157,7 @@ sctp_setopt(struct socket *so, int optname, void *optv * sender dry events */ if ((event_type == SCTP_PCB_FLAGS_DRYEVNT) && - ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) == 0) && - ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) && + (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && ((event->se_assoc_id == SCTP_ALL_ASSOC) || (event->se_assoc_id == SCTP_CURRENT_ASSOC))) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP); @@ -6108,8 +6166,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (event->se_assoc_id == SCTP_FUTURE_ASSOC) || - (event->se_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((event->se_assoc_id == SCTP_FUTURE_ASSOC) || + (event->se_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); if (event->se_on) { sctp_feature_on(inp, event_type); @@ -6118,8 +6177,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_INP_WUNLOCK(inp); } - if ((event->se_assoc_id == SCTP_CURRENT_ASSOC) || - (event->se_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((event->se_assoc_id == SCTP_CURRENT_ASSOC) || + (event->se_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -6192,8 +6252,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (info->snd_assoc_id == SCTP_FUTURE_ASSOC) || - (info->snd_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((info->snd_assoc_id == SCTP_FUTURE_ASSOC) || + (info->snd_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); @@ -6203,8 +6264,9 @@ sctp_setopt(struct socket *so, int optname, void *optv inp->def_send.sinfo_context = info->snd_context; SCTP_INP_WUNLOCK(inp); } - if ((info->snd_assoc_id == SCTP_CURRENT_ASSOC) || - (info->snd_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((info->snd_assoc_id == SCTP_CURRENT_ASSOC) || + (info->snd_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -6246,16 +6308,18 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (info->pr_assoc_id == SCTP_FUTURE_ASSOC) || - (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)))) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_flags &= 0xfff0; inp->def_send.sinfo_flags |= info->pr_policy; inp->def_send.sinfo_timetolive = info->pr_value; SCTP_INP_WUNLOCK(inp); } - if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || - (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC))) { SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); @@ -6430,7 +6494,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); inp->sctp_ep.def_net_failure = thlds->spt_pathmaxrxt; inp->sctp_ep.def_net_pf_threshold = thlds->spt_pathpfthld; @@ -6534,7 +6599,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); inp->sctp_ep.port = encaps->sue_port; SCTP_INP_WUNLOCK(inp); @@ -6559,7 +6625,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->ecn_supported = 0; @@ -6588,7 +6655,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->prsctp_supported = 0; @@ -6617,7 +6685,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { if ((av->assoc_value == 0) && (inp->asconf_supported == 1)) { /* @@ -6656,7 +6725,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { if ((av->assoc_value != 0) && (inp->auth_supported == 0)) { /* @@ -6703,7 +6773,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->reconfig_supported = 0; @@ -6732,7 +6803,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->nrsack_supported = 0; @@ -6761,7 +6833,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); if (av->assoc_value == 0) { inp->pktdrop_supported = 0; @@ -6801,7 +6874,8 @@ sctp_setopt(struct socket *so, int optname, void *optv } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - (av->assoc_id == SCTP_FUTURE_ASSOC)) { + ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && + (av->assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); inp->max_cwnd = av->assoc_value; SCTP_INP_WUNLOCK(inp); From owner-svn-src-head@freebsd.org Thu Nov 28 13:52:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13F9C1AA771; Thu, 28 Nov 2019 13:52:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nzbm25wLz4brZ; Thu, 28 Nov 2019 13:52:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xASDqQsp022188 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 28 Nov 2019 15:52:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xASDqQsp022188 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xASDqQdV022187; Thu, 28 Nov 2019 15:52:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Nov 2019 15:52:26 +0200 From: Konstantin Belousov To: Andrew Turner Cc: meloun.michal@gmail.com, Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355145 - head/sys/arm64/arm64 Message-ID: <20191128135226.GR10580@kib.kiev.ua> References: <201911272033.xARKXowX014908@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47Nzbm25wLz4brZ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-0.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-2.76), ipnet: 2001:470::/32(-4.64), asn: 6939(-3.52), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; FREEMAIL_CC(0.00)[gmail.com]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 13:52:38 -0000 On Thu, Nov 28, 2019 at 09:17:15AM +0000, Andrew Turner wrote: > > > > On 28 Nov 2019, at 08:48, Michal Meloun wrote: > > > > > > > > On 27.11.2019 21:33, Alan Cox wrote: > >> Author: alc > >> Date: Wed Nov 27 20:33:49 2019 > >> New Revision: 355145 > >> URL: https://svnweb.freebsd.org/changeset/base/355145 > >> > >> Log: > >> There is no reason why we need to pin the underlying thread to its current > >> processor in pmap_invalidate_{all,page,range}(). These functions are using > >> an instruction that broadcasts the TLB invalidation to every processor, so > >> even if a thread migrates in the middle of one of these functions every > >> processor will still perform the required TLB invalidations. > > I think this is not the right assumption. The problem is not in TLB > > operations themselves, but in following 'dsb' and / or 'isb'. 'dsb' > > ensures that all TLB operation transmitted by the local CPU is performed > > and visible to other observers. But it does nothing with TLBs emitted by > > other CPUs. > > For example, if a given thread is rescheduled after all TLB operations > > but before 'dsb' or 'isb' is performed, then the requested > > synchronization does not occur at all. > > The tibi instructions need a context synchronisation point. One option is the dsb & isb instructions, another is an exception entry. > > For a thread to be rescheduled it requires the timer interrupt to fire. As an exception entry is a context synchronisation point and an interrupt will cause an exception entry there will be such a point after the the tibi instruction. > D5.10.2. TLB maintenance instructions, 'Ordering and completion of TLB maintenance instructions' states that DSB on the PE that issued TLBI is required. It does not state that arbitrary even causing SynchronizeContext() is enough. Also I was not able to find any explanation of SynchronizeContext(). Curiously, on IA32 exceptions are not specified to issue a serialization point, although rumors say that on all produced microarchitectures they are. From owner-svn-src-head@freebsd.org Thu Nov 28 17:01:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7650F1AF9DC; Thu, 28 Nov 2019 17:01:32 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P3nm3Krqz3JlC; Thu, 28 Nov 2019 17:01:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5669ED82; Thu, 28 Nov 2019 17:01:32 +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 xASH1W7R041618; Thu, 28 Nov 2019 17:01:32 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASH1V7P041615; Thu, 28 Nov 2019 17:01:31 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911281701.xASH1V7P041615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Nov 2019 17:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355173 - in head/sys: arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm64/rockchip conf X-SVN-Commit-Revision: 355173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 17:01:32 -0000 Author: mmel Date: Thu Nov 28 17:01:31 2019 New Revision: 355173 URL: https://svnweb.freebsd.org/changeset/base/355173 Log: Add driver for temperature sensors found in RK32898, RK3328 and RK3399 SoC's. MFC after: 3 weeks Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D22442 Added: head/sys/arm64/rockchip/rk_tsadc.c (contents, props changed) head/sys/arm64/rockchip/rk_tsadc_if.m (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/rockchip/rk_tsadc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_tsadc.c Thu Nov 28 17:01:31 2019 (r355173) @@ -0,0 +1,794 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Michal Meloun + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Thermometer and thermal zones driver for RockChip SoCs. + * Calibration data are taken from Linux, because this part of SoC + * is undocumented in TRM. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "syscon_if.h" +#include "rk_tsadc_if.h" + +/* Global registers */ +#define TSADC_USER_CON 0x000 +#define TSADC_AUTO_CON 0x004 +#define TSADC_AUTO_CON_POL_HI (1 << 8) +#define TSADC_AUTO_SRC_EN(x) (1 << (4 + (x))) +#define TSADC_AUTO_Q_SEL (1 << 1) /* V3 only */ +#define TSADC_AUTO_CON_AUTO (1 << 0) + +#define TSADC_INT_EN 0x008 +#define TSADC_INT_EN_2CRU_EN_SRC(x) (1 << (8 + (x))) +#define TSADC_INT_EN_2GPIO_EN_SRC(x) (1 << (4 + (x))) +#define TSADC_INT_PD 0x00c +#define TSADC_DATA(x) (0x20 + (x) * 0x04) +#define TSADC_COMP_INT(x) (0x30 + (x) * 0x04) +#define TSADC_COMP_INT_SRC_EN(x) (1 << (0 + (x))) +#define TSADC_COMP_SHUT(x) (0x40 + (x) * 0x04) +#define TSADC_HIGHT_INT_DEBOUNCE 0x060 +#define TSADC_HIGHT_TSHUT_DEBOUNCE 0x064 +#define TSADC_AUTO_PERIOD 0x068 +#define TSADC_AUTO_PERIOD_HT 0x06c +#define TSADC_COMP0_LOW_INT 0x080 /* V3 only */ +#define TSADC_COMP1_LOW_INT 0x084 /* V3 only */ + +/* GFR Bits */ +#define GRF_SARADC_TESTBIT 0x0e644 +#define GRF_SARADC_TESTBIT_ON (0x10001 << 2) +#define GRF_TSADC_TESTBIT_L 0x0e648 +#define GRF_TSADC_VCM_EN_L (0x10001 << 7) +#define GRF_TSADC_TESTBIT_H 0x0e64c +#define GRF_TSADC_VCM_EN_H (0x10001 << 7) +#define GRF_TSADC_TESTBIT_H_ON (0x10001 << 2) + +#define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v)) +#define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r)) + +static struct sysctl_ctx_list tsadc_sysctl_ctx; + +struct tsensor { + char *name; + int id; + int channel; +}; + +enum tsadc_type { + RK_TSADC_V2, + RK_TSADC_V3 +}; + +struct rk_calib_entry { + uint32_t raw; + int temp; +}; + +struct tsadc_calib_info { + bool decrement_mode; + struct rk_calib_entry *table; + int nentries; +}; + +struct tsadc_conf { + enum tsadc_type type; + int shutdown_temp; + int shutdown_mode; + int shutdown_pol; + struct tsensor *tsensors; + int ntsensors; + struct tsadc_calib_info calib_info; +}; + +struct tsadc_softc { + device_t dev; + struct resource *mem_res; + struct resource *irq_res; + void *irq_ih; + + clk_t tsadc_clk; + clk_t apb_pclk_clk; + hwreset_t hwreset; + struct syscon *grf; + + struct tsadc_conf *conf; + + int shutdown_temp; + int shutdown_mode; + int shutdown_pol; + + int alarm_temp; +}; + +static struct rk_calib_entry rk3288_calib_data[] = { + {3800, -40000}, + {3792, -35000}, + {3783, -30000}, + {3774, -25000}, + {3765, -20000}, + {3756, -15000}, + {3747, -10000}, + {3737, -5000}, + {3728, 0}, + {3718, 5000}, + {3708, 10000}, + {3698, 15000}, + {3688, 20000}, + {3678, 25000}, + {3667, 30000}, + {3656, 35000}, + {3645, 40000}, + {3634, 45000}, + {3623, 50000}, + {3611, 55000}, + {3600, 60000}, + {3588, 65000}, + {3575, 70000}, + {3563, 75000}, + {3550, 80000}, + {3537, 85000}, + {3524, 90000}, + {3510, 95000}, + {3496, 100000}, + {3482, 105000}, + {3467, 110000}, + {3452, 115000}, + {3437, 120000}, + {3421, 125000}, +}; + +struct tsensor rk3288_tsensors[] = { + { .channel = 0, .id = 2, .name = "reserved"}, + { .channel = 1, .id = 0, .name = "CPU"}, + { .channel = 2, .id = 1, .name = "GPU"}, +}; + +struct tsadc_conf rk3288_tsadc_conf = { + .type = RK_TSADC_V2, + .shutdown_temp = 95000, + .shutdown_mode = 1, /* GPIO */ + .shutdown_pol = 0, /* Low */ + .tsensors = rk3288_tsensors, + .ntsensors = nitems(rk3288_tsensors), + .calib_info = { + .table = rk3288_calib_data, + .nentries = nitems(rk3288_calib_data), + } +}; + +static struct rk_calib_entry rk3328_calib_data[] = { + {296, -40000}, + {304, -35000}, + {313, -30000}, + {331, -20000}, + {340, -15000}, + {349, -10000}, + {359, -5000}, + {368, 0}, + {378, 5000}, + {388, 10000}, + {398, 15000}, + {408, 20000}, + {418, 25000}, + {429, 30000}, + {440, 35000}, + {451, 40000}, + {462, 45000}, + {473, 50000}, + {485, 55000}, + {496, 60000}, + {508, 65000}, + {521, 70000}, + {533, 75000}, + {546, 80000}, + {559, 85000}, + {572, 90000}, + {586, 95000}, + {600, 100000}, + {614, 105000}, + {629, 110000}, + {644, 115000}, + {659, 120000}, + {675, 125000}, +}; + +static struct tsensor rk3328_tsensors[] = { + { .channel = 0, .id = 0, .name = "CPU"}, +}; + +static struct tsadc_conf rk3328_tsadc_conf = { + .type = RK_TSADC_V3, + .shutdown_temp = 95000, + .shutdown_mode = 0, /* CRU */ + .shutdown_pol = 0, /* Low */ + .tsensors = rk3328_tsensors, + .ntsensors = nitems(rk3328_tsensors), + .calib_info = { + .table = rk3328_calib_data, + .nentries = nitems(rk3328_calib_data), + } +}; + +static struct rk_calib_entry rk3399_calib_data[] = { + {402, -40000}, + {410, -35000}, + {419, -30000}, + {427, -25000}, + {436, -20000}, + {444, -15000}, + {453, -10000}, + {461, -5000}, + {470, 0}, + {478, 5000}, + {487, 10000}, + {496, 15000}, + {504, 20000}, + {513, 25000}, + {521, 30000}, + {530, 35000}, + {538, 40000}, + {547, 45000}, + {555, 50000}, + {564, 55000}, + {573, 60000}, + {581, 65000}, + {590, 70000}, + {599, 75000}, + {607, 80000}, + {616, 85000}, + {624, 90000}, + {633, 95000}, + {642, 100000}, + {650, 105000}, + {659, 110000}, + {668, 115000}, + {677, 120000}, + {685, 125000}, +}; + +static struct tsensor rk3399_tsensors[] = { + { .channel = 0, .id = 0, .name = "CPU"}, + { .channel = 1, .id = 1, .name = "GPU"}, +}; + +static struct tsadc_conf rk3399_tsadc_conf = { + .type = RK_TSADC_V3, + .shutdown_temp = 95000, + .shutdown_mode = 1, /* GPIO */ + .shutdown_pol = 0, /* Low */ + .tsensors = rk3399_tsensors, + .ntsensors = nitems(rk3399_tsensors), + .calib_info = { + .table = rk3399_calib_data, + .nentries = nitems(rk3399_calib_data), + } +}; + +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk3288-tsadc", (uintptr_t)&rk3288_tsadc_conf}, + {"rockchip,rk3328-tsadc", (uintptr_t)&rk3328_tsadc_conf}, + {"rockchip,rk3399-tsadc", (uintptr_t)&rk3399_tsadc_conf}, + {NULL, 0} +}; + +static uint32_t +tsadc_temp_to_raw(struct tsadc_softc *sc, int temp) +{ + struct rk_calib_entry *tbl; + int denom, ntbl, raw, i; + + tbl = sc->conf->calib_info.table; + ntbl = sc->conf->calib_info.nentries; + + if (temp <= tbl[0].temp) + return (tbl[0].raw); + + if (temp >= tbl[ntbl - 1].temp) + return (tbl[ntbl - 1].raw); + + for (i = 1; i < (ntbl - 1); i++) { + /* Exact match */ + if (temp == tbl[i].temp) + return (tbl[i].raw); + if (temp < tbl[i].temp) + break; + } + + /* + * Translated value is between i and i - 1 table entries. + * Do linear interpolation for it. + */ + raw = (int)tbl[i - 1].raw - (int)tbl[i].raw; + raw *= temp - tbl[i - 1].temp; + denom = tbl[i - 1].temp - tbl[i].temp; + raw = tbl[i - 1].raw + raw / denom; + return (raw); +} + +static int +tsadc_raw_to_temp(struct tsadc_softc *sc, uint32_t raw) +{ + struct rk_calib_entry *tbl; + int denom, ntbl, temp, i; + bool descending; + + tbl = sc->conf->calib_info.table; + ntbl = sc->conf->calib_info.nentries; + descending = tbl[0].raw > tbl[1].raw; + + if (descending) { + /* Raw column is in descending order. */ + if (raw >= tbl[0].raw) + return (tbl[0].temp); + if (raw <= tbl[ntbl - 1].raw) + return (tbl[ntbl - 1].temp); + + for (i = ntbl - 2; i > 0; i--) { + /* Exact match */ + if (raw == tbl[i].raw) + return (tbl[i].temp); + if (raw < tbl[i].raw) + break; + } + } else { + /* Raw column is in ascending order. */ + if (raw <= tbl[0].raw) + return (tbl[0].temp); + if (raw >= tbl[ntbl - 1].raw) + return (tbl[ntbl - 1].temp); + for (i = 1; i < (ntbl - 1); i++) { + /* Exact match */ + if (raw == tbl[i].raw) + return (tbl[i].temp); + if (raw < tbl[i].raw) + break; + } + } + + + /* + * Translated value is between i and i - 1 table entries. + * Do linear interpolation for it. + */ + temp = (int)tbl[i - 1].temp - (int)tbl[i].temp; + temp *= raw - tbl[i - 1].raw; + denom = tbl[i - 1].raw - tbl[i].raw; + temp = tbl[i - 1].temp + temp / denom; + return (temp); +} + +static void +tsadc_init_tsensor(struct tsadc_softc *sc, struct tsensor *sensor) +{ + uint32_t val; + + /* Shutdown mode */ + val = RD4(sc, TSADC_INT_EN); + if (sc->shutdown_mode != 0) { + /* Signal shutdown of GPIO pin */ + val &= ~TSADC_INT_EN_2CRU_EN_SRC(sensor->channel); + val |= TSADC_INT_EN_2GPIO_EN_SRC(sensor->channel); + } else { + val |= TSADC_INT_EN_2CRU_EN_SRC(sensor->channel); + val &= ~TSADC_INT_EN_2GPIO_EN_SRC(sensor->channel); + } + WR4(sc, TSADC_INT_EN, val); + + /* Shutdown temperature */ + val = tsadc_raw_to_temp(sc, sc->shutdown_temp); + WR4(sc, TSADC_COMP_SHUT(sensor->channel), val); + val = RD4(sc, TSADC_AUTO_CON); + val |= TSADC_AUTO_SRC_EN(sensor->channel); + WR4(sc, TSADC_AUTO_CON, val); + + /* Alarm temperature */ + val = tsadc_temp_to_raw(sc, sc->alarm_temp); + WR4(sc, TSADC_COMP_INT(sensor->channel), val); + val = RD4(sc, TSADC_INT_EN); + val |= TSADC_COMP_INT_SRC_EN(sensor->channel); + WR4(sc, TSADC_INT_EN, val); +} + +static void +tsadc_init(struct tsadc_softc *sc) +{ + uint32_t val; + + /* Common part */ + val = 0; /* XXX Is this right? */ + if (sc->shutdown_pol != 0) + val |= TSADC_AUTO_CON_POL_HI; + else + val &= ~TSADC_AUTO_CON_POL_HI; + if (sc->conf->type == RK_TSADC_V3) + val |= TSADC_AUTO_Q_SEL; + WR4(sc, TSADC_AUTO_CON, val); + + if (sc->conf->type == RK_TSADC_V2) { + /* V2 init */ + WR4(sc, TSADC_AUTO_PERIOD, 250); /* 250 ms */ + WR4(sc, TSADC_AUTO_PERIOD_HT, 50); /* 50 ms */ + WR4(sc, TSADC_HIGHT_INT_DEBOUNCE, 4); + WR4(sc, TSADC_HIGHT_TSHUT_DEBOUNCE, 4); + } else { + /* V3 init */ + if (sc->grf == NULL) { + /* Errata: adjust interleave to working value */ + WR4(sc, TSADC_USER_CON, 13 << 6); /* 13 clks */ + } else { + SYSCON_WRITE_4(sc->grf, GRF_TSADC_TESTBIT_L, + GRF_TSADC_VCM_EN_L); + SYSCON_WRITE_4(sc->grf, GRF_TSADC_TESTBIT_H, + GRF_TSADC_VCM_EN_H); + DELAY(30); /* 15 usec min */ + + SYSCON_WRITE_4(sc->grf, GRF_SARADC_TESTBIT, + GRF_SARADC_TESTBIT_ON); + SYSCON_WRITE_4(sc->grf, GRF_TSADC_TESTBIT_H, + GRF_TSADC_TESTBIT_H_ON); + DELAY(180); /* 90 usec min */ + } + WR4(sc, TSADC_AUTO_PERIOD, 1875); /* 2.5 ms */ + WR4(sc, TSADC_AUTO_PERIOD_HT, 1875); /* 2.5 ms */ + WR4(sc, TSADC_HIGHT_INT_DEBOUNCE, 4); + WR4(sc, TSADC_HIGHT_TSHUT_DEBOUNCE, 4); + } +} + +static int +tsadc_read_temp(struct tsadc_softc *sc, struct tsensor *sensor, int *temp) +{ + uint32_t val; + + val = RD4(sc, TSADC_DATA(sensor->channel)); + *temp = tsadc_raw_to_temp(sc, val); + +#ifdef DEBUG + printf("%s: Sensor(id: %d, ch: %d), temp: %d\n", __func__, + sensor->id, sensor->channel, *temp); + printf(" status: 0x%08X, 0x%08X\n", + RD4(sc, TSADC_USER_CON), + RD4(sc, TSADC_AUTO_CON)); + printf(" Data: 0x%08X, 0x%08X, 0x%08X\n", + RD4(sc, TSADC_DATA(sensor->channel)), + RD4(sc, TSADC_COMP_INT(sensor->channel)), + RD4(sc, TSADC_COMP_SHUT(sensor->channel))); +#endif + return (0); +} + +static int +tsadc_get_temp(device_t dev, device_t cdev, uintptr_t id, int *val) +{ + struct tsadc_softc *sc; + int i, rv; + + sc = device_get_softc(dev); + + if (id >= sc->conf->ntsensors) + return (ERANGE); + + for (i = 0; i < sc->conf->ntsensors; i++) { + if (sc->conf->tsensors->id == id) { + rv =tsadc_read_temp(sc, sc->conf->tsensors + id, val); + return (rv); + } + } + return (ERANGE); +} + +static int +tsadc_sysctl_temperature(SYSCTL_HANDLER_ARGS) +{ + struct tsadc_softc *sc; + int val; + int rv; + int id; + + /* Write request */ + if (req->newptr != NULL) + return (EINVAL); + + sc = arg1; + id = arg2; + + if (id >= sc->conf->ntsensors) + return (ERANGE); + rv = tsadc_read_temp(sc, sc->conf->tsensors + id, &val); + if (rv != 0) + return (rv); + + val = val / 100; + val += 2731; + rv = sysctl_handle_int(oidp, &val, 0, req); + return (rv); +} + +static int +tsadc_init_sysctl(struct tsadc_softc *sc) +{ + int i; + struct sysctl_oid *oid, *tmp; + + sysctl_ctx_init(&tsadc_sysctl_ctx); + /* create node for hw.temp */ + oid = SYSCTL_ADD_NODE(&tsadc_sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "temperature", + CTLFLAG_RD, NULL, ""); + if (oid == NULL) + return (ENXIO); + + /* Add sensors */ + for (i = sc->conf->ntsensors - 1; i >= 0; i--) { + tmp = SYSCTL_ADD_PROC(&tsadc_sysctl_ctx, + SYSCTL_CHILDREN(oid), OID_AUTO, sc->conf->tsensors[i].name, + CTLTYPE_INT | CTLFLAG_RD, sc, i, + tsadc_sysctl_temperature, "IK", "SoC Temperature"); + if (tmp == NULL) + return (ENXIO); + } + + return (0); +} + +static int +tsadc_intr(void *arg) +{ + struct tsadc_softc *sc; + uint32_t val; + + sc = (struct tsadc_softc *)arg; + + val = RD4(sc, TSADC_INT_PD); + WR4(sc, TSADC_INT_PD, val); + + /* XXX Handle shutdown and alarm interrupts. */ + if (val & 0x00F0) { + device_printf(sc->dev, "Alarm: device temperature " + "is above of shutdown level.\n"); + } else if (val & 0x000F) { + device_printf(sc->dev, "Alarm: device temperature " + "is above of alarm level.\n"); + } + return (FILTER_HANDLED); +} + +static int +tsadc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RockChip temperature sensors"); + return (BUS_PROBE_DEFAULT); +} + +static int +tsadc_attach(device_t dev) +{ + struct tsadc_softc *sc; + phandle_t node; + uint32_t val; + int i, rid, rv; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(sc->dev); + sc->conf = (struct tsadc_conf *) + ofw_bus_search_compatible(dev, compat_data)->ocd_data; + sc->alarm_temp = 90000; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + goto fail; + } + + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Cannot allocate IRQ resources\n"); + goto fail; + } + + if ((bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + tsadc_intr, NULL, sc, &sc->irq_ih))) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + goto fail; + } + + /* FDT resources */ + rv = hwreset_get_by_ofw_name(dev, 0, "tsadc-apb", &sc->hwreset); + if (rv != 0) { + device_printf(dev, "Cannot get 'tsadc-apb' reset\n"); + goto fail; + } + rv = clk_get_by_ofw_name(dev, 0, "tsadc", &sc->tsadc_clk); + if (rv != 0) { + device_printf(dev, "Cannot get 'tsadc' clock: %d\n", rv); + goto fail; + } + rv = clk_get_by_ofw_name(dev, 0, "apb_pclk", &sc->apb_pclk_clk); + if (rv != 0) { + device_printf(dev, "Cannot get 'apb_pclk' clock: %d\n", rv); + goto fail; + } + + /* grf is optional */ + rv = syscon_get_by_ofw_property(dev, node, "rockchip,grf", &sc->grf); + if (rv != 0 && rv != ENOENT) { + device_printf(dev, "Cannot get 'grf' syscon: %d\n", rv); + goto fail; + } + + rv = OF_getencprop(node, "rockchip,hw-tshut-temp", + &sc->shutdown_temp, sizeof(sc->shutdown_temp)); + if (rv <= 0) + sc->shutdown_temp = sc->conf->shutdown_temp; + + rv = OF_getencprop(node, "rockchip,hw-tshut-mode", + &sc->shutdown_mode, sizeof(sc->shutdown_mode)); + if (rv <= 0) + sc->shutdown_mode = sc->conf->shutdown_mode; + + rv = OF_getencprop(node, "rockchip,hw-tshut-polarity", + &sc->shutdown_pol, sizeof(sc->shutdown_pol)); + if (rv <= 0) + sc->shutdown_pol = sc->conf->shutdown_pol; + + /* Wakeup controller */ + rv = hwreset_assert(sc->hwreset); + if (rv != 0) { + device_printf(dev, "Cannot assert reset\n"); + goto fail; + } + + /* Set the assigned clocks parent and freq */ + if (clk_set_assigned(sc->dev, node) != 0) { + device_printf(dev, "clk_set_assigned failed\n"); + goto fail; + } + + rv = clk_enable(sc->tsadc_clk); + if (rv != 0) { + device_printf(dev, "Cannot enable 'tsadc_clk' clock: %d\n", rv); + goto fail; + } + rv = clk_enable(sc->apb_pclk_clk); + if (rv != 0) { + device_printf(dev, "Cannot enable 'apb_pclk' clock: %d\n", rv); + goto fail; + } + rv = hwreset_deassert(sc->hwreset); + if (rv != 0) { + device_printf(dev, "Cannot deassert reset\n"); + goto fail; + } + + tsadc_init(sc); + for (i = 0; i < sc->conf->ntsensors; i++) + tsadc_init_tsensor(sc, sc->conf->tsensors + i); + + /* Enable auto mode */ + val = RD4(sc, TSADC_AUTO_CON); + val |= TSADC_AUTO_CON_AUTO; + WR4(sc, TSADC_AUTO_CON, val); + + rv = tsadc_init_sysctl(sc); + if (rv != 0) { + device_printf(sc->dev, "Cannot initialize sysctls\n"); + goto fail; + } + + OF_device_register_xref(OF_xref_from_node(node), dev); + return (bus_generic_attach(dev)); + +fail: + if (sc->irq_ih != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_ih); + sysctl_ctx_free(&tsadc_sysctl_ctx); + if (sc->tsadc_clk != NULL) + clk_release(sc->tsadc_clk); + if (sc->apb_pclk_clk != NULL) + clk_release(sc->apb_pclk_clk); + if (sc->hwreset != NULL) + hwreset_release(sc->hwreset); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (ENXIO); +} + +static int +tsadc_detach(device_t dev) +{ + struct tsadc_softc *sc; + sc = device_get_softc(dev); + + if (sc->irq_ih != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_ih); + sysctl_ctx_free(&tsadc_sysctl_ctx); + if (sc->tsadc_clk != NULL) + clk_release(sc->tsadc_clk); + if (sc->apb_pclk_clk != NULL) + clk_release(sc->apb_pclk_clk); + if (sc->hwreset != NULL) + hwreset_release(sc->hwreset); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (ENXIO); +} + +static device_method_t rk_tsadc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, tsadc_probe), + DEVMETHOD(device_attach, tsadc_attach), + DEVMETHOD(device_detach, tsadc_detach), + + /* TSADC interface */ + DEVMETHOD(rk_tsadc_get_temperature, tsadc_get_temp), + + DEVMETHOD_END +}; + +static devclass_t rk_tsadc_devclass; +static DEFINE_CLASS_0(rk_tsadc, rk_tsadc_driver, rk_tsadc_methods, + sizeof(struct tsadc_softc)); +EARLY_DRIVER_MODULE(rk_tsadc, simplebus, rk_tsadc_driver, + rk_tsadc_devclass, NULL, NULL, BUS_PASS_TIMER + BUS_PASS_ORDER_LAST); Added: head/sys/arm64/rockchip/rk_tsadc_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_tsadc_if.m Thu Nov 28 17:01:31 2019 (r355173) @@ -0,0 +1,43 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Michal Meloun +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include + +INTERFACE rk_tsadc; + + +/** + * Read temperature + */ +METHOD int get_temperature{ + device_t dev; + device_t consumer; + uintptr_t id; + int *val; +}; Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Nov 28 12:50:25 2019 (r355172) +++ head/sys/conf/files.arm64 Thu Nov 28 17:01:31 2019 (r355173) @@ -307,6 +307,8 @@ arm64/rockchip/rk_spi.c optional fdt rk_spi arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip_rk3328 | soc_rockchip_rk3399 arm64/rockchip/rk_typec_phy.c optional fdt rk_typec_phy soc_rockchip_rk3399 arm64/rockchip/if_dwc_rk.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 +arm64/rockchip/rk_tsadc_if.m optional fdt soc_rockchip_rk3399 +arm64/rockchip/rk_tsadc.c optional fdt soc_rockchip_rk3399 dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 From owner-svn-src-head@freebsd.org Thu Nov 28 18:28:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60BE51B242A; Thu, 28 Nov 2019 18:28:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P5kD1zqDz3Pjs; Thu, 28 Nov 2019 18:28:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 287E61C6D; Thu, 28 Nov 2019 18:28:36 +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 xASISaNj092344; Thu, 28 Nov 2019 18:28:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASISaHX092343; Thu, 28 Nov 2019 18:28:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911281828.xASISaHX092343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Nov 2019 18:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355182 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 355182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 18:28:36 -0000 Author: mav Date: Thu Nov 28 18:28:35 2019 New Revision: 355182 URL: https://svnweb.freebsd.org/changeset/base/355182 Log: Fix use-after-free in case of L2ARC prefetch failure. In case L2ARC read failed, l2arc_read_done() creates _different_ ZIO to read data from the original storage device. Unfortunately pointer to the failed ZIO remains in hdr->b_l1hdr.b_acb->acb_zio_head, and if some other read try to bump the ZIO priority, it will crash. The problem is reproducible by corrupting L2ARC content and reading some data with prefetch if l2arc_noprefetch tunable is changed to 0. With the default setting the issue is probably not reproducible now. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 28 18:18:10 2019 (r355181) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 28 18:28:35 2019 (r355182) @@ -7886,7 +7886,6 @@ l2arc_read_done(zio_t *zio) zio->io_private = hdr; arc_read_done(zio); } else { - mutex_exit(hash_lock); /* * Buffer didn't survive caching. Increment stats and * reissue to the original storage device. @@ -7909,11 +7908,17 @@ l2arc_read_done(zio_t *zio) ASSERT(!pio || pio->io_child_type == ZIO_CHILD_LOGICAL); - zio_nowait(zio_read(pio, zio->io_spa, zio->io_bp, + zio = zio_read(pio, zio->io_spa, zio->io_bp, hdr->b_l1hdr.b_pabd, zio->io_size, arc_read_done, hdr, zio->io_priority, cb->l2rcb_flags, - &cb->l2rcb_zb)); - } + &cb->l2rcb_zb); + for (struct arc_callback *acb = hdr->b_l1hdr.b_acb; + acb != NULL; acb = acb->acb_next) + acb->acb_zio_head = zio; + mutex_exit(hash_lock); + zio_nowait(zio); + } else + mutex_exit(hash_lock); } kmem_free(cb, sizeof (l2arc_read_callback_t)); From owner-svn-src-head@freebsd.org Thu Nov 28 19:30:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACC961B4B99; Thu, 28 Nov 2019 19:30:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P75w4s03z3yn3; Thu, 28 Nov 2019 19:30:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FCF62749; Thu, 28 Nov 2019 19:30:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASJUicc028599; Thu, 28 Nov 2019 19:30:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASJUfI1028585; Thu, 28 Nov 2019 19:30:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911281930.xASJUfI1028585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 28 Nov 2019 19:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355187 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/bitmain arm64/broadcom/stingray arm64/freescale arm64/intel arm64/marvell arm64/mediatek ar... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/bitmain arm64/broadcom/stingray arm64/freescale arm64/intel arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom arm... X-SVN-Commit-Revision: 355187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 19:30:44 -0000 Author: manu Date: Thu Nov 28 19:30:41 2019 New Revision: 355187 URL: https://svnweb.freebsd.org/changeset/base/355187 Log: Import DTS files from Linux 5.4 MFC after: 2 months Added: head/sys/gnu/dts/arm/aspeed-ast2600-evb.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-ast2600-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-minipack.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-minipack.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-wedge100.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-wedge100.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-wedge40.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-wedge40.dts head/sys/gnu/dts/arm/aspeed-bmc-lenovo-hr855xg2.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-lenovo-hr855xg2.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-mihawk.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-mihawk.dts head/sys/gnu/dts/arm/aspeed-g6-pinctrl.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-g6-pinctrl.dtsi head/sys/gnu/dts/arm/aspeed-g6.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/aspeed-g6.dtsi head/sys/gnu/dts/arm/imx6ul-kontron-n6310-s-43.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-kontron-n6310-s-43.dts head/sys/gnu/dts/arm/imx6ul-kontron-n6310-s.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-kontron-n6310-s.dts head/sys/gnu/dts/arm/imx6ul-kontron-n6310-som.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-kontron-n6310-som.dtsi head/sys/gnu/dts/arm/imx6ul-phytec-phycore-som.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx6ul-phytec-segin-ff-rdk-nand.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-phytec-segin-ff-rdk-nand.dts head/sys/gnu/dts/arm/imx6ul-phytec-segin-peb-eval-01.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-phytec-segin-peb-eval-01.dtsi head/sys/gnu/dts/arm/imx6ul-phytec-segin.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ul-phytec-segin.dtsi head/sys/gnu/dts/arm/imx6ull-phytec-phycore-som.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx6ull-phytec-segin-ff-rdk-emmc.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-segin-ff-rdk-emmc.dts head/sys/gnu/dts/arm/imx6ull-phytec-segin-ff-rdk-nand.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-segin-ff-rdk-nand.dts head/sys/gnu/dts/arm/imx6ull-phytec-segin-lc-rdk-nand.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-segin-lc-rdk-nand.dts head/sys/gnu/dts/arm/imx6ull-phytec-segin-peb-eval-01.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-segin-peb-eval-01.dtsi head/sys/gnu/dts/arm/imx6ull-phytec-segin.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx6ull-phytec-segin.dtsi head/sys/gnu/dts/arm/imx7d-zii-rmu2.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/imx7d-zii-rmu2.dts head/sys/gnu/dts/arm/mmp2-olpc-xo-1-75.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/mmp2-olpc-xo-1-75.dts head/sys/gnu/dts/arm/mt7629-rfb.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/mt7629-rfb.dts head/sys/gnu/dts/arm/mt7629.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/mt7629.dtsi head/sys/gnu/dts/arm/rk3229-xms6.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/rk3229-xms6.dts head/sys/gnu/dts/arm/rk3288-veyron-edp.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/rk3288-veyron-edp.dtsi head/sys/gnu/dts/arm/rk3288-veyron-fievel.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/rk3288-veyron-fievel.dts head/sys/gnu/dts/arm/rk3288-veyron-tiger.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/rk3288-veyron-tiger.dts head/sys/gnu/dts/arm/ste-ab8500.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/ste-ab8500.dtsi head/sys/gnu/dts/arm/sun8i-s3-lichee-zero-plus.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm/sun8i-s3-lichee-zero-plus.dts head/sys/gnu/dts/arm/sun8i-v3.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm/sun8i-v3.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino-emmc.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-olinuxino-emmc.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-tanix-tx6.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-tanix-tx6.dts head/sys/gnu/dts/arm64/amlogic/meson-g12-common.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12-common.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-a311d-khadas-vim3.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-a311d-khadas-vim3.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-a311d.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-a311d.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-khadas-vim3.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x-khadas-vim3.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-s922x-khadas-vim3.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-s922x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-khadas-vim3.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-sm1-khadas-vim3l.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-khadas-vim3l.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1-sei610.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-sei610.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/amlogic/meson-sm1.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1046a-frwy.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a-frwy.dts head/sys/gnu/dts/arm64/freescale/imx8mn-ddr4-evk.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mn-ddr4-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mn.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mn.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-hummingboard-pulse.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mq-hummingboard-pulse.dts head/sys/gnu/dts/arm64/freescale/imx8mq-nitrogen.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mq-nitrogen.dts head/sys/gnu/dts/arm64/freescale/imx8mq-pico-pi.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mq-pico-pi.dts head/sys/gnu/dts/arm64/freescale/imx8mq-sr-som.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8mq-sr-som.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp-ai_ml.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/freescale/imx8qxp-ai_ml.dts head/sys/gnu/dts/arm64/marvell/armada-3720-turris-mox.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/marvell/armada-3720-turris-mox.dts head/sys/gnu/dts/arm64/qcom/msm8916-longcheer-l8150.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8916-longcheer-l8150.dts head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a2015-common.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a2015-common.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a3u-eur.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a3u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a5u-eur.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a5u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8998-asus-novago-tp370ql.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8998-asus-novago-tp370ql.dts head/sys/gnu/dts/arm64/qcom/msm8998-clamshell.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8998-clamshell.dtsi head/sys/gnu/dts/arm64/qcom/msm8998-hp-envy-x2.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8998-hp-envy-x2.dts head/sys/gnu/dts/arm64/qcom/msm8998-lenovo-miix-630.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/msm8998-lenovo-miix-630.dts head/sys/gnu/dts/arm64/qcom/pm8150.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/pm8150.dtsi head/sys/gnu/dts/arm64/qcom/pm8150b.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/pm8150b.dtsi head/sys/gnu/dts/arm64/qcom/pm8150l.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/pm8150l.dtsi head/sys/gnu/dts/arm64/qcom/sdm850-lenovo-yoga-c630.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/sdm850-lenovo-yoga-c630.dts head/sys/gnu/dts/arm64/qcom/sm8150-mtp.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/sm8150-mtp.dts head/sys/gnu/dts/arm64/qcom/sm8150.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/qcom/sm8150.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-leez-p710.dts - copied unchanged from r355185, vendor/device-tree/dist/src/arm64/rockchip/rk3399-leez-p710.dts head/sys/gnu/dts/include/dt-bindings/bus/moxtet.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/bus/moxtet.h head/sys/gnu/dts/include/dt-bindings/clock/ast2600-clock.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/ast2600-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx8mn-clock.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/imx8mn-clock.h head/sys/gnu/dts/include/dt-bindings/clock/ingenic,tcu.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/ingenic,tcu.h head/sys/gnu/dts/include/dt-bindings/clock/mt6779-clk.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/mt6779-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sm8150.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-sm8150.h head/sys/gnu/dts/include/dt-bindings/clock/rk3308-cru.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/clock/rk3308-cru.h head/sys/gnu/dts/include/dt-bindings/gce/mt8183-gce.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/gce/mt8183-gce.h head/sys/gnu/dts/include/dt-bindings/interconnect/qcom,qcs404.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/interconnect/qcom,qcs404.h head/sys/gnu/dts/include/dt-bindings/memory/mt8183-larb-port.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/memory/mt8183-larb-port.h head/sys/gnu/dts/include/dt-bindings/phy/phy-lantiq-vrx200-pcie.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/phy/phy-lantiq-vrx200-pcie.h head/sys/gnu/dts/include/dt-bindings/power/meson-g12a-power.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/power/meson-g12a-power.h head/sys/gnu/dts/include/dt-bindings/power/meson-sm1-power.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/power/meson-sm1-power.h head/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8865-regulator.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/regulator/active-semi,8865-regulator.h head/sys/gnu/dts/include/dt-bindings/reset-controller/ - copied from r355185, vendor/device-tree/dist/include/dt-bindings/reset-controller/ head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-audio-reset.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/reset/amlogic,meson-g12a-audio-reset.h head/sys/gnu/dts/include/dt-bindings/reset/mt7629-resets.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/reset/mt7629-resets.h head/sys/gnu/dts/include/dt-bindings/soc/ti,sci_pm_domain.h - copied unchanged from r355185, vendor/device-tree/dist/include/dt-bindings/soc/ti,sci_pm_domain.h Deleted: head/sys/gnu/dts/arm/imx6ul-phytec-pcl063.dtsi head/sys/gnu/dts/arm/imx6ul-phytec-peb-eval-01.dtsi head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin-full.dts head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin.dtsi head/sys/gnu/dts/arm/rk3288-fennec.dts Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-cm-t335.dts head/sys/gnu/dts/arm/am335x-icev2.dts head/sys/gnu/dts/arm/am33xx-l4.dtsi head/sys/gnu/dts/arm/am3517-evm.dts head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am3874-iceboard.dts head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-l4.dtsi head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts head/sys/gnu/dts/arm/aspeed-bmc-inspur-fp5280g2.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-swift.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-vesnin.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-ariag25.dts head/sys/gnu/dts/arm/at91-ariettag25.dts head/sys/gnu/dts/arm/at91-cosino.dtsi head/sys/gnu/dts/arm/at91-cosino_mega2560.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g15.dtsi head/sys/gnu/dts/arm/at91sam9g15ek.dts head/sys/gnu/dts/arm/at91sam9g25ek.dts head/sys/gnu/dts/arm/at91sam9g35ek.dts head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x25ek.dts head/sys/gnu/dts/arm/at91sam9x35ek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi head/sys/gnu/dts/arm/at91sam9x5dm.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-a.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts head/sys/gnu/dts/arm/bcm2835-rpi-b.dts head/sys/gnu/dts/arm/bcm2835-rpi-cm1-io1.dts head/sys/gnu/dts/arm/bcm2835-rpi-cm1.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts head/sys/gnu/dts/arm/bcm2835-rpi-zero.dts head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts head/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts head/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm2837-rpi-cm3-io3.dts head/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/dra7-l4.dtsi head/sys/gnu/dts/arm/ep7211-edb7211.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4412-itop-elite.dts head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/exynos5800.dtsi head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts head/sys/gnu/dts/arm/gemini-nas4220b.dts head/sys/gnu/dts/arm/gemini-sl93512r.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx27-apf27dev.dts head/sys/gnu/dts/arm/imx27-eukrea-mbimxsd27-baseboard.dts head/sys/gnu/dts/arm/imx27-phytec-phycard-s-rdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycore-rdk.dts head/sys/gnu/dts/arm/imx53-m53menlo.dts head/sys/gnu/dts/arm/imx6-logicpd-baseboard.dtsi head/sys/gnu/dts/arm/imx6-logicpd-som.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pbab01.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sll.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-opos6uldev.dts head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-zii-rpu2.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/imx7ulp.dtsi head/sys/gnu/dts/arm/kirkwood-ts219.dtsi head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson8b-ec100.dts head/sys/gnu/dts/arm/meson8b-mxq.dts head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/nspire-classic.dtsi head/sys/gnu/dts/arm/nspire-cx.dts head/sys/gnu/dts/arm/nspire.dtsi head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap34xx.dtsi head/sys/gnu/dts/arm/omap36xx.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-l4-abe.dtsi head/sys/gnu/dts/arm/omap4-l4.dtsi head/sys/gnu/dts/arm/omap4-panda-common.dtsi head/sys/gnu/dts/arm/omap4-sdp.dts head/sys/gnu/dts/arm/omap4-var-som-om44-wlan.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/r8a77470.dtsi head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3288-evb.dtsi head/sys/gnu/dts/arm/rk3288-tinker.dtsi head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-veyron-jaq.dts head/sys/gnu/dts/arm/rk3288-veyron-jerry.dts head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts head/sys/gnu/dts/arm/rk3288-veyron-pinky.dts head/sys/gnu/dts/arm/rk3288-veyron-speedy.dts head/sys/gnu/dts/arm/rk3288-veyron.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk_nand.dts head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts head/sys/gnu/dts/arm/ste-dbx5x0.dtsi head/sys/gnu/dts/arm/ste-href-ab8500.dtsi head/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi head/sys/gnu/dts/arm/ste-href-stuib.dtsi head/sys/gnu/dts/arm/ste-href.dtsi head/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts head/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts head/sys/gnu/dts/arm/ste-nomadik-nhk15.dts head/sys/gnu/dts/arm/ste-snowball.dts head/sys/gnu/dts/arm/stm32429i-eval.dts head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp157a-dk1.dts head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c-ev1.dts head/sys/gnu/dts/arm/stm32mp157c.dtsi head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts head/sys/gnu/dts/arm/sun5i-a13-q8-tablet.dts head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-colombus.dts head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31-i7.dts head/sys/gnu/dts/arm/sun6i-a31-m9.dts head/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-cs908.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-bananapro.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-m3.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts head/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-r40.dtsi head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm/vexpress-v2m.dtsi head/sys/gnu/dts/arm/vf610-zii-cfu1.dts head/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts head/sys/gnu/dts/arm/vf610-zii-spb4.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-plus.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi head/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12a-sei510.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-odroid-n2.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p201.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-hub.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi head/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/bitmain/bm1880.dtsi head/sys/gnu/dts/arm64/broadcom/stingray/stingray-pinctrl.dtsi head/sys/gnu/dts/arm64/broadcom/stingray/stingray.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1088a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mm.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts head/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi head/sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi head/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi head/sys/gnu/dts/arm64/marvell/armada-7040-db.dts head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts head/sys/gnu/dts/arm64/marvell/armada-8040-db.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi head/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi head/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi head/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi head/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts head/sys/gnu/dts/arm64/mediatek/mt7622.dtsi head/sys/gnu/dts/arm64/mediatek/mt8183-evb.dts head/sys/gnu/dts/arm64/mediatek/mt8183.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra194.dtsi head/sys/gnu/dts/arm64/qcom/msm8996.dtsi head/sys/gnu/dts/arm64/qcom/msm8998.dtsi head/sys/gnu/dts/arm64/qcom/pm8998.dtsi head/sys/gnu/dts/arm64/qcom/pms405.dtsi head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi head/sys/gnu/dts/arm64/qcom/qcs404.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-db845c.dts head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts head/sys/gnu/dts/arm64/qcom/sdm845.dtsi head/sys/gnu/dts/arm64/renesas/hihope-common.dtsi head/sys/gnu/dts/arm64/renesas/hihope-rzg2-ex.dtsi head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi head/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts head/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi head/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts head/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts head/sys/gnu/dts/arm64/renesas/r8a7795.dtsi head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-xs.dts head/sys/gnu/dts/arm64/renesas/r8a7796.dtsi head/sys/gnu/dts/arm64/renesas/r8a77965-salvator-x.dts head/sys/gnu/dts/arm64/renesas/r8a77965-salvator-xs.dts head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi head/sys/gnu/dts/arm64/renesas/r8a77970-eagle.dts head/sys/gnu/dts/arm64/renesas/r8a77970-v3msk.dts head/sys/gnu/dts/arm64/renesas/r8a77970.dtsi head/sys/gnu/dts/arm64/renesas/r8a77980-condor.dts head/sys/gnu/dts/arm64/renesas/r8a77980-v3hsk.dts head/sys/gnu/dts/arm64/renesas/r8a77980.dtsi head/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi head/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts head/sys/gnu/dts/arm64/renesas/r8a77995.dtsi head/sys/gnu/dts/arm64/renesas/salvator-common.dtsi head/sys/gnu/dts/arm64/renesas/ulcb-kf.dtsi head/sys/gnu/dts/arm64/renesas/ulcb.dtsi head/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts head/sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts head/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi head/sys/gnu/dts/arm64/ti/k3-am65.dtsi head/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts head/sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts head/sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e.dtsi head/sys/gnu/dts/include/dt-bindings/bus/ti-sysc.h head/sys/gnu/dts/include/dt-bindings/clock/bcm2835.h head/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/imx8-clock.h head/sys/gnu/dts/include/dt-bindings/clock/jz4740-cgu.h head/sys/gnu/dts/include/dt-bindings/clock/mt8183-clk.h head/sys/gnu/dts/include/dt-bindings/clock/omap5.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-v3s-ccu.h head/sys/gnu/dts/include/dt-bindings/leds/common.h head/sys/gnu/dts/include/dt-bindings/pinctrl/k3.h head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-reset.h head/sys/gnu/dts/include/dt-bindings/reset/hisi,hi6220-resets.h head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h head/sys/gnu/dts/include/dt-bindings/reset/sun8i-v3s-ccu.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -5,23 +5,13 @@ /dts-v1/; #include "am33xx.dtsi" +#include "am335x-osd335x-common.dtsi" #include / { model = "TI AM335x BeagleBone Blue"; compatible = "ti,am335x-bone-blue", "ti,am33xx"; - cpus { - cpu@0 { - cpu0-supply = <&dcdc2_reg>; - }; - }; - - memory@80000000 { - device_type = "memory"; - reg = <0x80000000 0x20000000>; /* 512 MB */ - }; - chosen { stdout-path = &uart0; }; @@ -142,13 +132,6 @@ >; }; - i2c0_pins: pinmux_i2c0_pins { - pinctrl-single,pins = < - AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLUP, MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ - AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_INPUT_PULLUP, MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ - >; - }; - i2c2_pins: pinmux_i2c2_pins { pinctrl-single,pins = < AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLUP, MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */ @@ -328,16 +311,6 @@ }; &i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins>; - - status = "okay"; - clock-frequency = <400000>; - - tps: tps@24 { - reg = <0x24>; - }; - baseboard_eeprom: baseboard_eeprom@50 { compatible = "atmel,24c256"; reg = <0x50>; @@ -381,66 +354,13 @@ /include/ "tps65217.dtsi" &tps { - interrupts = <7>; /* NMI */ - interrupt-parent = <&intc>; + /delete-property/ ti,pmic-shutdown-controller; charger { interrupts = <0>, <1>; interrupt-names = "USB", "AC"; status = "okay"; }; - - pwrbutton { - interrupts = <2>; - status = "okay"; - }; - - regulators { - dcdc1_reg: regulator@0 { - regulator-name = "vdds_dpr"; - regulator-always-on; - }; - - dcdc2_reg: regulator@1 { - /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ - regulator-name = "vdd_mpu"; - regulator-min-microvolt = <925000>; - regulator-max-microvolt = <1351500>; - regulator-boot-on; - regulator-always-on; - }; - - dcdc3_reg: regulator@2 { - /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ - regulator-name = "vdd_core"; - regulator-min-microvolt = <925000>; - regulator-max-microvolt = <1150000>; - regulator-boot-on; - regulator-always-on; - }; - - ldo1_reg: regulator@3 { - regulator-name = "vio,vrtc,vdds"; - regulator-always-on; - }; - - ldo2_reg: regulator@4 { - regulator-name = "vdd_3v3aux"; - regulator-always-on; - }; - - ldo3_reg: regulator@5 { - regulator-name = "vdd_1v8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-always-on; - }; - - ldo4_reg: regulator@6 { - regulator-name = "vdd_3v3a"; - regulator-always-on; - }; - }; }; &mmc1 { @@ -500,14 +420,6 @@ compatible = "ti,wl1835-st"; enable-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; }; -}; - -&aes { - status = "okay"; -}; - -&sham { - status = "okay"; }; &rtc { Modified: head/sys/gnu/dts/arm/am335x-cm-t335.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-cm-t335.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am335x-cm-t335.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -44,7 +44,6 @@ regulator-name = "vwlan_fixed"; gpio = <&gpio0 20 GPIO_ACTIVE_HIGH>; /* gpio0_20 */ enable-active-high; - regulator-boot-off; }; backlight { Modified: head/sys/gnu/dts/arm/am335x-icev2.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-icev2.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am335x-icev2.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -432,7 +432,7 @@ pinctrl-0 = <&mmc0_pins_default>; }; -&gpio0 { +&gpio0_target { /* Do not idle the GPIO used for holding the VTT regulator */ ti,no-reset-on-init; ti,no-idle-on-init; Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Thu Nov 28 19:30:41 2019 (r355187) @@ -127,7 +127,7 @@ ranges = <0x0 0x5000 0x1000>; }; - target-module@7000 { /* 0x44e07000, ap 14 20.0 */ + gpio0_target: target-module@7000 { /* 0x44e07000, ap 14 20.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; ti,hwmods = "gpio1"; reg = <0x7000 0x4>, @@ -673,7 +673,6 @@ target-module@100000 { /* 0x4a100000, ap 3 08.0 */ compatible = "ti,sysc-omap4-simple", "ti,sysc"; - ti,hwmods = "cpgmac0"; reg = <0x101200 0x4>, <0x101208 0x4>, <0x101204 0x4>; @@ -719,9 +718,10 @@ davinci_mdio: mdio@1000 { compatible = "ti,cpsw-mdio","ti,davinci_mdio"; + clocks = <&cpsw_125mhz_clkctrl AM3_CPSW_125MHZ_CPGMAC0_CLKCTRL 0>; + clock-names = "fck"; #address-cells = <1>; #size-cells = <0>; - ti,hwmods = "davinci_mdio"; bus_freq = <1000000>; reg = <0x1000 0x100>; status = "disabled"; @@ -2038,7 +2038,9 @@ reg = <0xe000 0x4>, <0xe054 0x4>; reg-names = "rev", "sysc"; - ti,sysc-midle ; + ti,sysc-midle = , + , + ; ti,sysc-sidle = , , ; Modified: head/sys/gnu/dts/arm/am3517-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am3517-evm.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am3517-evm.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -124,10 +124,11 @@ }; lcd0: display@0 { - compatible = "panel-dpi"; + /* This isn't the exact LCD, but the timings meet spec */ + /* To make it work, set CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=4 */ + compatible = "newhaven,nhd-4.3-480272ef-atxl"; label = "15"; - status = "okay"; - pinctrl-names = "default"; + backlight = <&bl>; enable-gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>; /* gpio176, lcd INI */ vcc-supply = <&vdd_io_reg>; @@ -135,22 +136,6 @@ lcd_in: endpoint { remote-endpoint = <&dpi_out>; }; - }; - - panel-timing { - clock-frequency = <9000000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <3>; - hback-porch = <2>; - hsync-len = <42>; - vback-porch = <3>; - vfront-porch = <4>; - vsync-len = <11>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; }; }; Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am3517.dtsi Thu Nov 28 19:30:41 2019 (r355187) @@ -88,6 +88,30 @@ interrupts = <24>; clocks = <&hecc_ck>; }; + + /* + * On am3517 the OCP registers do not seem to be accessible + * similar to the omap34xx. Maybe SGX is permanently set to + * "OCP bypass mode", or maybe there is OCP_SYSCONFIG that is + * write-only at 0x50000e10. We detect SGX based on the SGX + * revision register instead of the unreadable OCP revision + * register. + */ + sgx_module: target-module@50000000 { + compatible = "ti,sysc-omap2", "ti,sysc"; + reg = <0x50000014 0x4>; + reg-names = "rev"; + clocks = <&sgx_fck>, <&sgx_ick>; + clock-names = "fck", "ick"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x50000000 0x4000>; + + /* + * Closed source PowerVR driver, no child device + * binding or driver in mainline + */ + }; }; }; Modified: head/sys/gnu/dts/arm/am3874-iceboard.dts ============================================================================== --- head/sys/gnu/dts/arm/am3874-iceboard.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am3874-iceboard.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -111,13 +111,13 @@ reg = <0x70>; #address-cells = <1>; #size-cells = <0>; + i2c-mux-idle-disconnect; i2c@0 { /* FMC A */ #address-cells = <1>; #size-cells = <0>; reg = <0>; - i2c-mux-idle-disconnect; }; i2c@1 { @@ -125,7 +125,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; - i2c-mux-idle-disconnect; }; i2c@2 { @@ -133,7 +132,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <2>; - i2c-mux-idle-disconnect; }; i2c@3 { @@ -141,7 +139,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <3>; - i2c-mux-idle-disconnect; }; i2c@4 { @@ -149,14 +146,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <4>; - i2c-mux-idle-disconnect; }; i2c@5 { #address-cells = <1>; #size-cells = <0>; reg = <5>; - i2c-mux-idle-disconnect; ina230@40 { compatible = "ti,ina230"; reg = <0x40>; shunt-resistor = <5000>; }; ina230@41 { compatible = "ti,ina230"; reg = <0x41>; shunt-resistor = <5000>; }; @@ -182,14 +177,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <6>; - i2c-mux-idle-disconnect; }; i2c@7 { #address-cells = <1>; #size-cells = <0>; reg = <7>; - i2c-mux-idle-disconnect; u41: pca9575@20 { compatible = "nxp,pca9575"; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am4372.dtsi Thu Nov 28 19:30:41 2019 (r355187) @@ -337,6 +337,8 @@ ti,hwmods = "dss_dispc"; clocks = <&disp_clk>; clock-names = "fck"; + + max-memory-bandwidth = <230000000>; }; rfbi: rfbi@4832a800 { Modified: head/sys/gnu/dts/arm/am437x-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am437x-l4.dtsi Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/am437x-l4.dtsi Thu Nov 28 19:30:41 2019 (r355187) @@ -512,7 +512,6 @@ target-module@100000 { /* 0x4a100000, ap 3 04.0 */ compatible = "ti,sysc-omap4-simple", "ti,sysc"; - ti,hwmods = "cpgmac0"; reg = <0x101200 0x4>, <0x101208 0x4>, <0x101204 0x4>; @@ -559,11 +558,10 @@ davinci_mdio: mdio@1000 { compatible = "ti,am4372-mdio","ti,cpsw-mdio","ti,davinci_mdio"; reg = <0x1000 0x100>; + clocks = <&cpsw_125mhz_clkctrl AM4_CPSW_125MHZ_CPGMAC0_CLKCTRL 0>; + clock-names = "fck"; #address-cells = <1>; #size-cells = <0>; - clocks = <&cpsw_125mhz_gclk>; - clock-names = "fck"; - ti,hwmods = "davinci_mdio"; bus_freq = <1000000>; status = "disabled"; }; Modified: head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -94,6 +94,17 @@ }; }; +&sdmmc { + status = "okay"; +}; + +&sdhci0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sd1_default>; +}; + /* * Enable port A as device (via the virtual hub) and port B as * host by default on the eval board. This can be easily changed Copied: head/sys/gnu/dts/arm/aspeed-ast2600-evb.dts (from r355185, vendor/device-tree/dist/src/arm/aspeed-ast2600-evb.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/aspeed-ast2600-evb.dts Thu Nov 28 19:30:41 2019 (r355187, copy of r355185, vendor/device-tree/dist/src/arm/aspeed-ast2600-evb.dts) @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright 2019 IBM Corp. + +/dts-v1/; + +#include "aspeed-g6.dtsi" + +/ { + model = "AST2600 EVB"; + compatible = "aspeed,ast2600"; + + aliases { + serial4 = &uart5; + }; + + chosen { + bootargs = "console=ttyS4,115200n8"; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; +}; + +&mdio1 { + status = "okay"; + + ethphy1: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mdio2 { + status = "okay"; + + ethphy2: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mdio3 { + status = "okay"; + + ethphy3: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mac1 { + status = "okay"; + + phy-mode = "rgmii"; + phy-handle = <ðphy1>; +}; + +&mac2 { + status = "okay"; + + phy-mode = "rgmii"; + phy-handle = <ðphy2>; +}; + +&mac3 { + status = "okay"; + + phy-mode = "rgmii"; + phy-handle = <ðphy3>; +}; + +&emmc { + status = "okay"; +}; + +&rtc { + status = "okay"; +}; Copied: head/sys/gnu/dts/arm/aspeed-bmc-facebook-minipack.dts (from r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-minipack.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/aspeed-bmc-facebook-minipack.dts Thu Nov 28 19:30:41 2019 (r355187, copy of r355185, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-minipack.dts) @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2018 Facebook Inc. +/dts-v1/; + +#include "aspeed-g5.dtsi" + +/ { + model = "Facebook Minipack 100 BMC"; + compatible = "facebook,minipack-bmc", "aspeed,ast2500"; + + aliases { + /* + * Override the default serial aliases to avoid breaking + * the legacy applications. + */ + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + + /* + * i2c switch 2-0070, pca9548, 8 child channels assigned + * with bus number 16-23. + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + + /* + * i2c switch 8-0070, pca9548, 8 child channels assigned + * with bus number 24-31. + */ + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + + /* + * i2c switch 9-0070, pca9548, 8 child channels assigned + * with bus number 32-39. + */ + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + + /* + * i2c switch 11-0070, pca9548, 8 child channels assigned + * with bus number 40-47. + */ + i2c40 = &imux40; + i2c41 = &imux41; + i2c42 = &imux42; + i2c43 = &imux43; + i2c44 = &imux44; + i2c45 = &imux45; + i2c46 = &imux46; + i2c47 = &imux47; + }; + + chosen { + stdout-path = &uart1; + bootargs = "debug console=ttyS1,9600n8 root=/dev/ram rw"; + }; + + memory@80000000 { + reg = <0x80000000 0x20000000>; + }; +}; + +&wdt1 { + status = "okay"; + aspeed,reset-type = "system"; +}; + +&wdt2 { + status = "okay"; + aspeed,reset-type = "system"; +}; + +&fmc { + status = "okay"; + flash@0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; +#include "facebook-bmc-flash-layout.dtsi" + }; +}; + +&uart1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd1_default + &pinctrl_rxd1_default + &pinctrl_ncts1_default + &pinctrl_ndsr1_default + &pinctrl_ndtr1_default + &pinctrl_nrts1_default>; +}; + +&uart2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd2_default + &pinctrl_rxd2_default>; +}; + +&uart3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd3_default + &pinctrl_rxd3_default>; +}; + +&uart4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd4_default + &pinctrl_rxd4_default>; +}; + +&uart5 { + status = "okay"; +}; + +&mac1 { + status = "okay"; + no-hw-checksum; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>; +}; + +&i2c0 { + status = "okay"; + bus-frequency = <400000>; + multi-master; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; + + i2c-switch@70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + + imux16: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux18: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux20: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux21: i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux22: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux23: i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; + multi-master; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; + + i2c-switch@70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + + imux24: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux25: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux26: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux27: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux28: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux29: i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux30: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux31: i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c9 { + status = "okay"; + + i2c-switch@70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + + imux32: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux33: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux34: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux35: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux36: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux37: i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux38: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux39: i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c10 { + status = "okay"; +}; + +&i2c11 { + status = "okay"; + + i2c-switch@70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + + imux40: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux41: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux42: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux43: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux44: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux45: i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux46: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux47: i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c12 { + status = "okay"; +}; + +&i2c13 { + status = "okay"; +}; + +&vhub { + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts Thu Nov 28 19:05:51 2019 (r355186) +++ head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts Thu Nov 28 19:30:41 2019 (r355187) @@ -12,6 +12,27 @@ aliases { serial0 = &uart1; serial4 = &uart5; + + /* + * Hardcode the bus number of i2c switches' channels to + * avoid breaking the legacy applications. + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; }; chosen { stdout-path = &uart5; @@ -25,13 +46,9 @@ iio-hwmon { compatible = "iio-hwmon"; io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, - <&adc 4>, <&adc 5>, <&adc 6>; + <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>; }; - iio-hwmon-battery { - compatible = "iio-hwmon"; - io-channels = <&adc 7>; - }; }; &fmc { @@ -124,6 +141,215 @@ &i2c1 { status = "okay"; //X24 Riser + i2c-switch@71 { + compatible = "nxp,pca9544"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x71>; + + imux16: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + ina230@45 { + compatible = "ti,ina230"; + reg = <0x45>; + }; + + tmp75@48 { + compatible = "ti,tmp75"; + reg = <0x48>; + }; + + tmp421@49 { + compatible = "ti,tmp75"; + reg = <0x49>; + }; + + eeprom@50 { + compatible = "atmel,24c64"; + reg = <0x50>; + pagesize = <32>; + }; + + i2c-switch@73 { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Nov 28 19:38:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 061611B4F23; Thu, 28 Nov 2019 19:38:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P7HP6LJjz40KN; Thu, 28 Nov 2019 19:38:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD802905; Thu, 28 Nov 2019 19:38:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASJcvuL034089; Thu, 28 Nov 2019 19:38:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASJcv3a034087; Thu, 28 Nov 2019 19:38:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911281938.xASJcv3a034087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 28 Nov 2019 19:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355188 - in head/riscv: . sifive X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/riscv: . sifive X-SVN-Commit-Revision: 355188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 19:38:58 -0000 Author: manu Date: Thu Nov 28 19:38:57 2019 New Revision: 355188 URL: https://svnweb.freebsd.org/changeset/base/355188 Log: Import riscv DTS files Requested by: mhorne Added: head/riscv/ - copied from r355184, vendor/device-tree/dist/src/riscv/ Replaced: head/riscv/sifive/fu540-c000.dtsi - copied unchanged from r355185, vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi head/riscv/sifive/hifive-unleashed-a00.dts - copied unchanged from r355185, vendor/device-tree/dist/src/riscv/sifive/hifive-unleashed-a00.dts Copied: head/riscv/sifive/fu540-c000.dtsi (from r355185, vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/riscv/sifive/fu540-c000.dtsi Thu Nov 28 19:38:57 2019 (r355188, copy of r355185, vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi) @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2018-2019 SiFive, Inc */ + +/dts-v1/; + +#include + +/ { + #address-cells = <2>; + #size-cells = <2>; + compatible = "sifive,fu540-c000", "sifive,fu540"; + + aliases { + serial0 = &uart0; + serial1 = &uart1; + ethernet0 = ð0; + }; + + chosen { + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu0: cpu@0 { + compatible = "sifive,e51", "sifive,rocket0", "riscv"; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <128>; + i-cache-size = <16384>; + reg = <0>; + riscv,isa = "rv64imac"; + status = "disabled"; + cpu0_intc: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu1: cpu@1 { + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; + mmu-type = "riscv,sv39"; + reg = <1>; + riscv,isa = "rv64imafdc"; + tlb-split; + cpu1_intc: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu2: cpu@2 { + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; + mmu-type = "riscv,sv39"; + reg = <2>; + riscv,isa = "rv64imafdc"; + tlb-split; + cpu2_intc: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu3: cpu@3 { + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; + mmu-type = "riscv,sv39"; + reg = <3>; + riscv,isa = "rv64imafdc"; + tlb-split; + cpu3_intc: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu4: cpu@4 { + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; + mmu-type = "riscv,sv39"; + reg = <4>; + riscv,isa = "rv64imafdc"; + tlb-split; + cpu4_intc: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + }; + soc { + #address-cells = <2>; + #size-cells = <2>; + compatible = "sifive,fu540-c000", "sifive,fu540", "simple-bus"; + ranges; + plic0: interrupt-controller@c000000 { + #interrupt-cells = <1>; + compatible = "sifive,plic-1.0.0"; + reg = <0x0 0xc000000 0x0 0x4000000>; + riscv,ndev = <53>; + interrupt-controller; + interrupts-extended = < + &cpu0_intc 0xffffffff + &cpu1_intc 0xffffffff &cpu1_intc 9 + &cpu2_intc 0xffffffff &cpu2_intc 9 + &cpu3_intc 0xffffffff &cpu3_intc 9 + &cpu4_intc 0xffffffff &cpu4_intc 9>; + }; + prci: clock-controller@10000000 { + compatible = "sifive,fu540-c000-prci"; + reg = <0x0 0x10000000 0x0 0x1000>; + clocks = <&hfclk>, <&rtcclk>; + #clock-cells = <1>; + }; + uart0: serial@10010000 { + compatible = "sifive,fu540-c000-uart", "sifive,uart0"; + reg = <0x0 0x10010000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <4>; + clocks = <&prci PRCI_CLK_TLCLK>; + status = "disabled"; + }; + uart1: serial@10011000 { + compatible = "sifive,fu540-c000-uart", "sifive,uart0"; + reg = <0x0 0x10011000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <5>; + clocks = <&prci PRCI_CLK_TLCLK>; + status = "disabled"; + }; + i2c0: i2c@10030000 { + compatible = "sifive,fu540-c000-i2c", "sifive,i2c0"; + reg = <0x0 0x10030000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <50>; + clocks = <&prci PRCI_CLK_TLCLK>; + reg-shift = <2>; + reg-io-width = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + qspi0: spi@10040000 { + compatible = "sifive,fu540-c000-spi", "sifive,spi0"; + reg = <0x0 0x10040000 0x0 0x1000 + 0x0 0x20000000 0x0 0x10000000>; + interrupt-parent = <&plic0>; + interrupts = <51>; + clocks = <&prci PRCI_CLK_TLCLK>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + qspi1: spi@10041000 { + compatible = "sifive,fu540-c000-spi", "sifive,spi0"; + reg = <0x0 0x10041000 0x0 0x1000 + 0x0 0x30000000 0x0 0x10000000>; + interrupt-parent = <&plic0>; + interrupts = <52>; + clocks = <&prci PRCI_CLK_TLCLK>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + qspi2: spi@10050000 { + compatible = "sifive,fu540-c000-spi", "sifive,spi0"; + reg = <0x0 0x10050000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <6>; + clocks = <&prci PRCI_CLK_TLCLK>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + eth0: ethernet@10090000 { + compatible = "sifive,fu540-c000-gem"; + interrupt-parent = <&plic0>; + interrupts = <53>; + reg = <0x0 0x10090000 0x0 0x2000 + 0x0 0x100a0000 0x0 0x1000>; + local-mac-address = [00 00 00 00 00 00]; + clock-names = "pclk", "hclk"; + clocks = <&prci PRCI_CLK_GEMGXLPLL>, + <&prci PRCI_CLK_GEMGXLPLL>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + pwm0: pwm@10020000 { + compatible = "sifive,fu540-c000-pwm", "sifive,pwm0"; + reg = <0x0 0x10020000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <42 43 44 45>; + clocks = <&prci PRCI_CLK_TLCLK>; + #pwm-cells = <3>; + status = "disabled"; + }; + pwm1: pwm@10021000 { + compatible = "sifive,fu540-c000-pwm", "sifive,pwm0"; + reg = <0x0 0x10021000 0x0 0x1000>; + interrupt-parent = <&plic0>; + interrupts = <46 47 48 49>; + clocks = <&prci PRCI_CLK_TLCLK>; + #pwm-cells = <3>; + status = "disabled"; + }; + + }; +}; Copied: head/riscv/sifive/hifive-unleashed-a00.dts (from r355185, vendor/device-tree/dist/src/riscv/sifive/hifive-unleashed-a00.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/riscv/sifive/hifive-unleashed-a00.dts Thu Nov 28 19:38:57 2019 (r355188, copy of r355185, vendor/device-tree/dist/src/riscv/sifive/hifive-unleashed-a00.dts) @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2018-2019 SiFive, Inc */ + +#include "fu540-c000.dtsi" + +/* Clock frequency (in Hz) of the PCB crystal for rtcclk */ +#define RTCCLK_FREQ 1000000 + +/ { + #address-cells = <2>; + #size-cells = <2>; + model = "SiFive HiFive Unleashed A00"; + compatible = "sifive,hifive-unleashed-a00", "sifive,fu540-c000"; + + chosen { + stdout-path = "serial0"; + }; + + cpus { + timebase-frequency = ; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x0 0x80000000 0x2 0x00000000>; + }; + + soc { + }; + + hfclk: hfclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <33333333>; + clock-output-names = "hfclk"; + }; + + rtcclk: rtcclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = ; + clock-output-names = "rtcclk"; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; +}; + +&qspi0 { + status = "okay"; + flash@0 { + compatible = "issi,is25wp256", "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + }; +}; + +&qspi2 { + status = "okay"; + mmc@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + spi-max-frequency = <20000000>; + voltage-ranges = <3300 3300>; + disable-wp; + }; +}; + +ð0 { + status = "okay"; + phy-mode = "gmii"; + phy-handle = <&phy0>; + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&pwm1 { + status = "okay"; +}; From owner-svn-src-head@freebsd.org Thu Nov 28 20:17:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F79C1B5FCE; Thu, 28 Nov 2019 20:17:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P87N0Rgcz42CQ; Thu, 28 Nov 2019 20:17:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E69300A; Thu, 28 Nov 2019 20:17:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASKH3mx057799; Thu, 28 Nov 2019 20:17:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASKH3Qm057798; Thu, 28 Nov 2019 20:17:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911282017.xASKH3Qm057798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 28 Nov 2019 20:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355190 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 355190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 20:17:04 -0000 Author: manu Date: Thu Nov 28 20:17:03 2019 New Revision: 355190 URL: https://svnweb.freebsd.org/changeset/base/355190 Log: arm64: rockchip: tsadc: Do not free the sysctl context is it wasn't created MFC after: 3 weeks X-MFC-With: r355173 Modified: head/sys/arm64/rockchip/rk_tsadc.c Modified: head/sys/arm64/rockchip/rk_tsadc.c ============================================================================== --- head/sys/arm64/rockchip/rk_tsadc.c Thu Nov 28 20:09:19 2019 (r355189) +++ head/sys/arm64/rockchip/rk_tsadc.c Thu Nov 28 20:17:03 2019 (r355190) @@ -728,16 +728,17 @@ tsadc_attach(device_t dev) rv = tsadc_init_sysctl(sc); if (rv != 0) { device_printf(sc->dev, "Cannot initialize sysctls\n"); - goto fail; + goto fail_sysctl; } OF_device_register_xref(OF_xref_from_node(node), dev); return (bus_generic_attach(dev)); +fail_sysctl: + sysctl_ctx_free(&tsadc_sysctl_ctx); fail: if (sc->irq_ih != NULL) bus_teardown_intr(dev, sc->irq_res, sc->irq_ih); - sysctl_ctx_free(&tsadc_sysctl_ctx); if (sc->tsadc_clk != NULL) clk_release(sc->tsadc_clk); if (sc->apb_pclk_clk != NULL) From owner-svn-src-head@freebsd.org Thu Nov 28 20:46:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F09AE1B7664; Thu, 28 Nov 2019 20:46:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P8nD65MXz44V1; Thu, 28 Nov 2019 20:46:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B45EE3753; Thu, 28 Nov 2019 20:46:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASKkOnN075260; Thu, 28 Nov 2019 20:46:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASKkOXD075259; Thu, 28 Nov 2019 20:46:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911282046.xASKkOXD075259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 28 Nov 2019 20:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355191 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 355191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 20:46:25 -0000 Author: manu Date: Thu Nov 28 20:46:24 2019 New Revision: 355191 URL: https://svnweb.freebsd.org/changeset/base/355191 Log: arm64: rockchip: rk3328: Add TSADC clocks Add the clocks so we can use the rk_tsadc driver to monitor the cpu temperature. Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Nov 28 20:17:03 2019 (r355190) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Nov 28 20:46:24 2019 (r355191) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C1 206 #define PCLK_I2C2 207 #define PCLK_I2C3 208 +#define PCLK_TSADC 213 #define HCLK_SDMMC 317 #define HCLK_SDIO 318 #define HCLK_EMMC 319 @@ -91,6 +92,8 @@ static struct rk_cru_gate rk3328_gates[] = { CRU_GATE(PCLK_I2C1, "pclk_i2c1", "pclk_bus", 0x23C, 0) CRU_GATE(PCLK_I2C2, "pclk_i2c2", "pclk_bus", 0x23C, 1) CRU_GATE(PCLK_I2C3, "pclk_i2c3", "pclk_bus", 0x23C, 2) + CRU_GATE(PCLK_TSADC, "pclk_tsadc", "pclk_bus", 0x23C, 14) + CRU_GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_bus", 0x240, 7) CRU_GATE(PCLK_GPIO1, "pclk_gpio1", "pclk_bus", 0x240, 8) CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9) @@ -731,6 +734,22 @@ static struct rk_clk_composite_def pclk_bus_pre = { .flags = RK_CLK_COMPOSITE_HAVE_GATE, }; +/* CRU_CLKSEL_CON22 */ + +#define SCLK_TSADC 36 + +static const char *clk_tsadc_parents[] = {"xin24m"}; +static struct rk_clk_composite_def clk_tsadc = { + .clkdef = { + .id = SCLK_TSADC, + .name = "clk_tsadc", + .parent_names = clk_tsadc_parents, + .parent_cnt = nitems(clk_tsadc_parents), + }, + .div_shift = 0, + .div_width = 9, +}; + /* CRU_CLKSEL_CON28 */ #define ACLK_PERI_PRE 137 @@ -1011,6 +1030,10 @@ static struct rk_clk rk3328_clks[] = { .clk.armclk = &armclk, }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &clk_tsadc, + }, { .type = RK_CLK_COMPOSITE, .clk.composite = &aclk_peri_pre, From owner-svn-src-head@freebsd.org Thu Nov 28 21:09:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C41611B841F for ; Thu, 28 Nov 2019 21:09:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-22.consmr.mail.gq1.yahoo.com (sonic301-22.consmr.mail.gq1.yahoo.com [98.137.64.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47P9HQ6KWFz45px for ; Thu, 28 Nov 2019 21:09:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: InjXviUVM1kToZR51lcPXy.WowW2NOsJ.j.ubeEv2.mln0dV_lOsKS4HqjU2OZK Xu7ZB_Cbm5aQXlaTmADzWrE_bK.JoXwL467DV.J9Z._i8FjHsUzN_RaTBGtZlhQccUDW1S9r0kz4 069VpgVzWhDXPbj6EhjX9LWsW38xZkhgdgZiGIV2XPKxdTn4CZ1ibhqOAB3_hZWIVlqx.O6GVQxn 4Hm46ynZgQRsrQWzUiWYnqVI2uyZosS0haxSyXSvtWxuLJTr5DUw.Qf5nj4i.2Cau_uKHZnLZj1R _6D3mGU2pOO9YMU3KylDnjelNKy6F3iwo2jJcMumKWRlYwZXIj4f9fGahoCBS9Wj.N3yvLPz.r_u 3jEQ4ZCl8f1YCMUSYGWBzDctSDmakaSsZixwuGkz_mfCa6NpjydPxP.h2yZKkFdcHQ8fIj.eAqiv rlPDcqsxl9WfLZwn3l0e18RI.OPTs5z8lT_xvP6._Yli528ZRYkjTMtdGCGja_DW7H_KcgB9S0Z5 RcOIYymUCBQQuIFo7UuPqucWMLOcOdOIzr4Lvi_.6xAYtyUMx961vUCNeW5YbAjI5krAmzRvl_bt D89GhMqR7ST6qj_AjvLDDdDBydEl30HopqYKCSvp_X.sTg7I2WffN7NtgJY8l5wyDXyj29M81wzO O6aLOX1_PQZOseILm.UA9dlksDlpSo1nXxEYZpIr5E0n9dNFpJHAzkH2RUX1cy5O4pJ._Y9IeHCj Rn0pH23kvf9cBLyL0gj0DMOQ1uOdHKFwkSfVOeUBq.H4mcaCxIVjloPPW.LYwEtKxhfcuTLhkrwI C2FCU1bWSIpariaKlKA7hCU7aeoZARBWHeOlN7o4ol5_y3HaEkwqzdebT5lQv4N9GJy016Faa_3J M5YFTnZkVIy9_HvY10usJTRu87fG6xpYBcrdz5lycHRwVBBRV8mWUcJVjF.iaF7yhSs5GtrcA7X1 jNdfjUQ2n3Wr1jZUEmqUVZVOAVG1_td39b.cQYGo.uFJCgFfdeo2Rtqst4K05vKHT71d.6w6HJrJ CA1UJXe7KZjH_bRqF4DWEDSnWr2gTutRnkTSCn1l4LUN9pbCmvJxJIQUVseOS1TApSr28owISuu2 _bePWHk.kddpcrj.t.5BWwR1Jt8UA63jA8r67l0fE9puq3Y_RIuVVaJerDpfKQ_Th1q1YwXMcg78 fM24zezcB1.OZhffwNdccDDiaknZJ92xR8FytWnYgkXsDpaCHWg1MfS7R5kmDtVa6.q2X8qcdbOl g1kdJdWlBrfD74eCfhrH0jjozpytxUtuEGLSyMwKMUG.x99jarZb1uv50TbyWKrOWt5HjdWiN99s bIRCEX9OZaOPszvl32gShu6lz0iGikUfzipjoSaFgsU59sW2a3dsRRtvIRMNvrFx2G3Doih3Qk4U eB0ygmdk9d4JUcDp3LXy78B6neQpvKD0AI6a1 Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Nov 2019 21:09:04 +0000 Received: by smtp402.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 17ff6fe9fcd5c78ff9a126d9173bdbad; Thu, 28 Nov 2019 21:08:59 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r352558 - head/usr.bin/top Message-Id: <1BDFB387-930D-4F4D-8729-A5850F1C15B9@yahoo.com> Date: Thu, 28 Nov 2019 13:08:57 -0800 To: "daichi@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3601.0.10) References: <1BDFB387-930D-4F4D-8729-A5850F1C15B9.ref@yahoo.com> X-Rspamd-Queue-Id: 47P9HQ6KWFz45px X-Spamd-Bar: / X-Spamd-Result: default: False [0.64 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.43), ipnet: 98.137.64.0/21(0.87), asn: 36647(0.70), country: US(-0.05)]; NEURAL_SPAM_MEDIUM(0.40)[0.405,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.74)[0.736,0]; RCVD_IN_DNSWL_NONE(0.00)[148.64.137.98.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 21:09:07 -0000 > Author: daichi > Date: Fri Sep 20 17:37:23 2019 > New Revision: 352558 > URL: > https://svnweb.freebsd.org/changeset/base/352558 > > > Log: > top(1): support multibyte characters in command names (ARGV array) > depending on locale. > > - add setlocale() > - remove printable() function > - add VIS_OCTAL and VIS_SAFE to the flag of strvisx() to display > non-printable characters that do not use C-style backslash sequences > in three digit octal sequence, or remove it > > This change allows multibyte characters to be displayed according to > locale. If it is recognized as a non-display character according to the > locale, it is displayed in three digit octal sequence. > Initially picking on tab characters as an example of what is probably a somewhat broader issue . . . Ever since this change, characters like tabs that do not fit in the next character cell when output, but for which they are !isprintable(...), now mess up the top display. Again using tab as an example: line wrapping from the text having been shifted over by more than one character cell. top does not track the line wrapping result in how it decides what to output for the following display updates. As stands I type "hh" to referesh the display when I care about clearing up the messy display. The removed !isprintable handling functionality had its uses and an alternative is needed for some types of characters if the display is not to be messed up by what some command lines that are echoed have in them. I picked on tab because it was obviously involved in some examples that I watched update. I'm not claiming tab is the only character that ends up with e cursor in an unexpected place now. In fact . . . Looking around I found: VIS_SAFE Only encode "unsafe" characters. Unsafe means control char- acters which may cause common terminals to perform unexpected functions. Currently this form allows space, tab, newline, backspace, bell, and return - in addition to all graphic characters - unencoded. So tab, newline, backspace, bell, and return are not encoded or replaced now but do not have top's expected cursor position result. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Nov 28 21:22:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 427B61B8D09; Thu, 28 Nov 2019 21:22:05 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P9ZP16Yrz4703; Thu, 28 Nov 2019 21:22:05 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0713DF0; Thu, 28 Nov 2019 21:22:05 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASLM4c0098489; Thu, 28 Nov 2019 21:22:04 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASLM4k1098488; Thu, 28 Nov 2019 21:22:04 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201911282122.xASLM4k1098488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Thu, 28 Nov 2019 21:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355192 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 355192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 21:22:05 -0000 Author: grog Date: Thu Nov 28 21:22:04 2019 New Revision: 355192 URL: https://svnweb.freebsd.org/changeset/base/355192 Log: Clarify name of Pau Casals (it's Catalonian) Get correct birthday (from Wikipedia). Modified: head/usr.bin/calendar/calendars/calendar.music Modified: head/usr.bin/calendar/calendars/calendar.music ============================================================================== --- head/usr.bin/calendar/calendars/calendar.music Thu Nov 28 20:46:24 2019 (r355191) +++ head/usr.bin/calendar/calendars/calendar.music Thu Nov 28 21:22:04 2019 (r355192) @@ -186,7 +186,7 @@ 10/20 Three members of Lynyrd Skynyrd die in a plane crash, 1977 10/21 Jesus Christ Super Star debuted on Broadway, 1971 10/22 Franz Liszt born, 1811 -10/22 Pablo Casals dies in Puerto Rico, 1973 +10/22 Pau (Pablo) Casals dies in Puerto Rico, 1973 10/25 Georges Bizet is born in Paris, France, 1838 10/25 Jon Anderson (Yes) is born in Lancashire, England, 1944 10/25 The Rolling Stones appear on The Ed Sullivan Show, 1964 @@ -215,7 +215,6 @@ 11/26 Cream performs their farewell concert at Royal Albert Hall, 1968 11/26 Paul Hindemith is born in Hanau, Germany, 1895 11/27 Jimi Hendrix (Johnny Allen Hendrix) is born in Seattle, 1942 -11/29 Pau Casals born in Vendrell, 1876 11/30 George Harrison dies at 13:30 in L.A., 2001 12/04 Frank Zappa dies in his Laurel Canyon home shortly before 18:00, 1993 12/05 Wolfgang Amadeus Mozart dies in Vienna, Austria, 1791 @@ -235,6 +234,7 @@ 12/23 Joe Strummer (born John Mellor) dies in Broomfield, England, 2002 12/28 Edgar Winter is born in Beaumont, Texas, 1946 12/28 Paul Hindemith dies in Frankfurt/Main, Germany, 1963 +12/29 Pau (Pablo) Casals born in Vendrell, 1876 12/31 Jimi Hendrix introduces the Band of Gypsies at the Fillmore East, 1969 #endif /* !_calendar_music_ */ From owner-svn-src-head@freebsd.org Thu Nov 28 21:50:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBCD01B9B91; Thu, 28 Nov 2019 21:50:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PBCG62H5z48Pw; Thu, 28 Nov 2019 21:50:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF143430C; Thu, 28 Nov 2019 21:50:34 +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 xASLoYc0010880; Thu, 28 Nov 2019 21:50:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASLoYxd010879; Thu, 28 Nov 2019 21:50:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201911282150.xASLoYxd010879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 28 Nov 2019 21:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355193 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 355193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 21:50:35 -0000 Author: ian Date: Thu Nov 28 21:50:34 2019 New Revision: 355193 URL: https://svnweb.freebsd.org/changeset/base/355193 Log: Implement the ofw_bus_get_node method in the imx_gpio driver so that ofw_gpiobus can find its fdt metadata and instantiate child devices. Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Thu Nov 28 21:22:04 2019 (r355192) +++ head/sys/arm/freescale/imx/imx_gpio.c Thu Nov 28 21:50:34 2019 (r355193) @@ -865,6 +865,15 @@ imx51_gpio_detach(device_t dev) return(0); } +static phandle_t +imx51_gpio_get_node(device_t bus, device_t dev) +{ + /* + * Share controller node with gpiobus device + */ + return ofw_bus_get_node(bus); +} + static device_method_t imx51_gpio_methods[] = { DEVMETHOD(device_probe, imx51_gpio_probe), DEVMETHOD(device_attach, imx51_gpio_attach), @@ -881,6 +890,9 @@ static device_method_t imx51_gpio_methods[] = { DEVMETHOD(pic_post_ithread, gpio_pic_post_ithread), DEVMETHOD(pic_pre_ithread, gpio_pic_pre_ithread), #endif + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, imx51_gpio_get_node), /* GPIO protocol */ DEVMETHOD(gpio_get_bus, imx51_gpio_get_bus), From owner-svn-src-head@freebsd.org Thu Nov 28 23:34:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44D241BBF63; Thu, 28 Nov 2019 23:34:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PDW515Fnz4DXP; Thu, 28 Nov 2019 23:34:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09E9E56BF; Thu, 28 Nov 2019 23:34:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASNYOlx074924; Thu, 28 Nov 2019 23:34:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASNYONf074920; Thu, 28 Nov 2019 23:34:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911282334.xASNYONf074920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 28 Nov 2019 23:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355194 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 355194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Nov 2019 23:34:25 -0000 Author: rmacklem Date: Thu Nov 28 23:34:23 2019 New Revision: 355194 URL: https://svnweb.freebsd.org/changeset/base/355194 Log: Fix two races while handling nfsuserd daemon start/stop. A crash was reported where the nr_client field was NULL during an upcall to the nfsuserd daemon. Since nr_client == NULL only occurs when the nfsuserd daemon is being shut down, it appeared to be caused by a race between doing an upcall and the daemon shutting down. By inspection two races were identified: 1 - The nfsrv_nfsuserd variable is used to indicate whether or not the daemon is running. However it did not handle the intermediate phase where the daemon is starting or stopping. This was fixed by making nfsrv_nfsuserd tri-state and having the functions that are called during start/stop to obey the intermediate state. 2 - nfsrv_nfsuserd was checked to see that the daemon was running at the beginning of an upcall, but nothing prevented the daemon from being shut down while an upcall was still in progress. This race probably caused the crash. The patch fixes this by adding a count of upcalls in progress and having the shut down function delay until this count goes to zero before getting rid of nr_client and related data used by an upcall. Tested by: avg (Panzura QA) Reported by: avg Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22377 Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Nov 28 21:50:34 2019 (r355193) +++ head/sys/fs/nfs/nfs.h Thu Nov 28 23:34:23 2019 (r355194) @@ -797,6 +797,9 @@ struct nfsslot { struct mbuf *nfssl_reply; }; +/* Enumerated type for nfsuserd state. */ +typedef enum { NOTRUNNING=0, STARTSTOP=1, RUNNING=2 } nfsuserd_state; + #endif /* _KERNEL */ #endif /* _NFS_NFS_H */ Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Nov 28 21:50:34 2019 (r355193) +++ head/sys/fs/nfs/nfs_commonport.c Thu Nov 28 23:34:23 2019 (r355194) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include extern int nfscl_ticks; -extern int nfsrv_nfsuserd; +extern nfsuserd_state nfsrv_nfsuserd; extern struct nfssockreq nfsrv_nfsuserdsock; extern void (*nfsd_call_recall)(struct vnode *, int, struct ucred *, struct thread *); @@ -774,7 +774,7 @@ nfscommon_modevent(module_t mod, int type, void *data) break; case MOD_UNLOAD: - if (newnfs_numnfsd != 0 || nfsrv_nfsuserd != 0 || + if (newnfs_numnfsd != 0 || nfsrv_nfsuserd != NOTRUNNING || nfs_numnfscbd != 0) { error = EBUSY; break; Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Nov 28 21:50:34 2019 (r355193) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Nov 28 23:34:23 2019 (r355194) @@ -64,7 +64,8 @@ struct timeval nfsboottime; /* Copy boottime once, so int nfscl_ticks; int nfsrv_useacl = 1; struct nfssockreq nfsrv_nfsuserdsock; -int nfsrv_nfsuserd = 0; +nfsuserd_state nfsrv_nfsuserd = NOTRUNNING; +static int nfsrv_userdupcalls = 0; struct nfsreqhead nfsd_reqq; uid_t nfsrv_defaultuid = UID_NOBODY; gid_t nfsrv_defaultgid = GID_NOGROUP; @@ -3522,18 +3523,22 @@ nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPRO int error; NFSLOCKNAMEID(); - if (nfsrv_nfsuserd) { + if (nfsrv_nfsuserd != NOTRUNNING) { NFSUNLOCKNAMEID(); error = EPERM; goto out; } - nfsrv_nfsuserd = 1; - NFSUNLOCKNAMEID(); + nfsrv_nfsuserd = STARTSTOP; /* * Set up the socket record and connect. + * Set nr_client NULL before unlocking, just to ensure that no other + * process/thread/core will use a bogus old value. This could only + * occur if the use of the nameid lock to protect nfsrv_nfsuserd is + * broken. */ rp = &nfsrv_nfsuserdsock; rp->nr_client = NULL; + NFSUNLOCKNAMEID(); rp->nr_sotype = SOCK_DGRAM; rp->nr_soproto = IPPROTO_UDP; rp->nr_lock = (NFSR_RESERVEDPORT | NFSR_LOCALHOST); @@ -3569,9 +3574,15 @@ nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPRO rp->nr_vers = RPCNFSUSERD_VERS; if (error == 0) error = newnfs_connect(NULL, rp, NFSPROCCRED(p), p, 0); - if (error) { + if (error == 0) { + NFSLOCKNAMEID(); + nfsrv_nfsuserd = RUNNING; + NFSUNLOCKNAMEID(); + } else { free(rp->nr_nam, M_SONAME); - nfsrv_nfsuserd = 0; + NFSLOCKNAMEID(); + nfsrv_nfsuserd = NOTRUNNING; + NFSUNLOCKNAMEID(); } out: NFSEXITCODE(error); @@ -3586,14 +3597,21 @@ nfsrv_nfsuserddelport(void) { NFSLOCKNAMEID(); - if (nfsrv_nfsuserd == 0) { + if (nfsrv_nfsuserd != RUNNING) { NFSUNLOCKNAMEID(); return; } - nfsrv_nfsuserd = 0; + nfsrv_nfsuserd = STARTSTOP; + /* Wait for all upcalls to complete. */ + while (nfsrv_userdupcalls > 0) + msleep(&nfsrv_userdupcalls, NFSNAMEIDMUTEXPTR, PVFS, + "nfsupcalls", 0); NFSUNLOCKNAMEID(); newnfs_disconnect(&nfsrv_nfsuserdsock); free(nfsrv_nfsuserdsock.nr_nam, M_SONAME); + NFSLOCKNAMEID(); + nfsrv_nfsuserd = NOTRUNNING; + NFSUNLOCKNAMEID(); } /* @@ -3612,12 +3630,19 @@ nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char int error; NFSLOCKNAMEID(); - if (nfsrv_nfsuserd == 0) { + if (nfsrv_nfsuserd != RUNNING) { NFSUNLOCKNAMEID(); error = EPERM; goto out; } + /* + * Maintain a count of upcalls in progress, so that nfsrv_X() + * can wait until no upcalls are in progress. + */ + nfsrv_userdupcalls++; NFSUNLOCKNAMEID(); + KASSERT(nfsrv_userdupcalls > 0, + ("nfsrv_getuser: non-positive upcalls")); nd = &nfsd; cred = newnfs_getcred(); nd->nd_flag = ND_GSSINITREPLY; @@ -3636,6 +3661,10 @@ nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char } error = newnfs_request(nd, NULL, NULL, &nfsrv_nfsuserdsock, NULL, NULL, cred, RPCPROG_NFSUSERD, RPCNFSUSERD_VERS, NULL, 0, NULL, NULL); + NFSLOCKNAMEID(); + if (--nfsrv_userdupcalls == 0 && nfsrv_nfsuserd == STARTSTOP) + wakeup(&nfsrv_userdupcalls); + NFSUNLOCKNAMEID(); NFSFREECRED(cred); if (!error) { mbuf_freem(nd->nd_mrep); Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Nov 28 21:50:34 2019 (r355193) +++ head/sys/fs/nfs/nfsport.h Thu Nov 28 23:34:23 2019 (r355194) @@ -669,6 +669,7 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSLOCKSOCK() mtx_lock(&nfs_slock_mutex) #define NFSUNLOCKSOCK() mtx_unlock(&nfs_slock_mutex) #define NFSNAMEIDMUTEX extern struct mtx nfs_nameid_mutex +#define NFSNAMEIDMUTEXPTR (&nfs_nameid_mutex) #define NFSLOCKNAMEID() mtx_lock(&nfs_nameid_mutex) #define NFSUNLOCKNAMEID() mtx_unlock(&nfs_nameid_mutex) #define NFSNAMEIDREQUIRED() mtx_assert(&nfs_nameid_mutex, MA_OWNED) From owner-svn-src-head@freebsd.org Fri Nov 29 02:06:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D4E61BFC5D; Fri, 29 Nov 2019 02:06:46 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PHtt0C2dz4Lx8; Fri, 29 Nov 2019 02:06:46 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB78D7169; Fri, 29 Nov 2019 02:06:45 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT26jGN064360; Fri, 29 Nov 2019 02:06:45 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT26jBg064359; Fri, 29 Nov 2019 02:06:45 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201911290206.xAT26jBg064359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 29 Nov 2019 02:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355201 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 02:06:46 -0000 Author: dougm Date: Fri Nov 29 02:06:45 2019 New Revision: 355201 URL: https://svnweb.freebsd.org/changeset/base/355201 Log: Functions that call vm_map_splay_merge sometimes set data fields (e.g. root->left = NULL) to affect the behavior of that function. This change stops that data manipulation, and instead calls a pair of functions, one for the left direction and the other for the right, with the function called depending whether or not we currently null the root child in that direction to control the behavior of vm_map_splay_merge. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22589 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Nov 29 01:00:06 2019 (r355200) +++ head/sys/vm/vm_map.c Fri Nov 29 02:06:45 2019 (r355201) @@ -993,6 +993,13 @@ vm_map_entry_pred(vm_map_entry_t entry) /* vm_map_entry_succ is defined in vm_map.h. */ +static inline vm_size_t +vm_size_max(vm_size_t a, vm_size_t b) +{ + + return (a > b ? a : b); +} + #define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ vm_size_t max_free; \ \ @@ -1012,7 +1019,8 @@ vm_map_entry_pred(vm_map_entry_t entry) root->left = y->right; \ y->right = root; \ if (max_free < y->max_free) \ - root->max_free = max_free = MAX(max_free, \ + root->max_free = max_free = \ + vm_size_max(max_free, \ vm_map_entry_max_free_left(root, y)); \ root = y; \ y = root->left; \ @@ -1045,7 +1053,8 @@ vm_map_entry_pred(vm_map_entry_t entry) root->right = y->left; \ y->left = root; \ if (max_free < y->max_free) \ - root->max_free = max_free = MAX(max_free, \ + root->max_free = max_free = \ + vm_size_max(max_free, \ vm_map_entry_max_free_right(root, y)); \ root = y; \ y = root->right; \ @@ -1127,53 +1136,117 @@ vm_map_entry_swap(vm_map_entry_t *a, vm_map_entry_t *b * Walk back up the two spines, flip the pointers and set max_free. The * subtrees of the root go at the bottom of llist and rlist. */ -static void -vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, - vm_map_entry_t llist, vm_map_entry_t rlist) +static vm_size_t +vm_map_splay_merge_left_walk(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t tail, vm_size_t max_free, vm_map_entry_t llist) { - vm_map_entry_t prev; - vm_size_t max_free_left, max_free_right; + do { + /* + * The max_free values of the children of llist are in + * llist->max_free and max_free. Update with the + * max value. + */ + llist->max_free = max_free = + vm_size_max(llist->max_free, max_free); + vm_map_entry_swap(&llist->right, &tail); + vm_map_entry_swap(&tail, &llist); + } while (llist != header); + root->left = tail; + return (max_free); +} - max_free_left = vm_map_entry_max_free_left(root, llist); - if (llist != &map->header) { - prev = root->left; - do { - /* - * The max_free values of the children of llist are in - * llist->max_free and max_free_left. Update with the - * max value. - */ - llist->max_free = max_free_left = - MAX(llist->max_free, max_free_left); - vm_map_entry_swap(&llist->right, &prev); - vm_map_entry_swap(&prev, &llist); - } while (llist != &map->header); - root->left = prev; +/* + * When llist is known to be the predecessor of root. + */ +static inline vm_size_t +vm_map_splay_merge_pred(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t llist) +{ + vm_size_t max_free; + + max_free = root->start - llist->end; + if (llist != header) { + max_free = vm_map_splay_merge_left_walk(header, root, + NULL, max_free, llist); + } else { + root->left = NULL; } - max_free_right = vm_map_entry_max_free_right(root, rlist); - if (rlist != &map->header) { - prev = root->right; - do { - /* - * The max_free values of the children of rlist are in - * rlist->max_free and max_free_right. Update with the - * max value. - */ - rlist->max_free = max_free_right = - MAX(rlist->max_free, max_free_right); - vm_map_entry_swap(&rlist->left, &prev); - vm_map_entry_swap(&prev, &rlist); - } while (rlist != &map->header); - root->right = prev; - } - root->max_free = MAX(max_free_left, max_free_right); - map->root = root; -#ifdef DIAGNOSTIC - ++map->nupdates; -#endif + return (max_free); } /* + * When llist may or may not be the predecessor of root. + */ +static inline vm_size_t +vm_map_splay_merge_left(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t llist) +{ + vm_size_t max_free; + + max_free = vm_map_entry_max_free_left(root, llist); + if (llist != header) { + max_free = vm_map_splay_merge_left_walk(header, root, + root->left, max_free, llist); + } + return (max_free); +} + +static vm_size_t +vm_map_splay_merge_right_walk(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t tail, vm_size_t max_free, vm_map_entry_t rlist) +{ + do { + /* + * The max_free values of the children of rlist are in + * rlist->max_free and max_free. Update with the + * max value. + */ + rlist->max_free = max_free = + vm_size_max(rlist->max_free, max_free); + vm_map_entry_swap(&rlist->left, &tail); + vm_map_entry_swap(&tail, &rlist); + } while (rlist != header); + root->right = tail; + return (max_free); +} + +/* + * When rlist is known to be the succecessor of root. + */ +static inline vm_size_t +vm_map_splay_merge_succ(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t rlist) +{ + vm_size_t max_free; + + max_free = rlist->start - root->end; + if (rlist != header) { + max_free = vm_map_splay_merge_right_walk(header, root, + NULL, max_free, rlist); + } else { + root->right = NULL; + } + return (max_free); +} + +/* + * When rlist may or may not be the succecessor of root. + */ +static inline vm_size_t +vm_map_splay_merge_right(vm_map_entry_t header, vm_map_entry_t root, + vm_map_entry_t rlist) +{ + vm_size_t max_free; + + max_free = vm_map_entry_max_free_right(root, rlist); + if (rlist != header) { + max_free = vm_map_splay_merge_right_walk(header, root, + root->right, max_free, rlist); + } + return (max_free); +} + +/* * vm_map_splay: * * The Sleator and Tarjan top-down splay algorithm with the @@ -1193,32 +1266,38 @@ vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, static vm_map_entry_t vm_map_splay(vm_map_t map, vm_offset_t addr) { - vm_map_entry_t llist, rlist, root; + vm_map_entry_t header, llist, rlist, root; + vm_size_t max_free_left, max_free_right; + header = &map->header; root = vm_map_splay_split(map, addr, 0, &llist, &rlist); if (root != NULL) { - /* do nothing */ - } else if (llist != &map->header) { + max_free_left = vm_map_splay_merge_left(header, root, llist); + max_free_right = vm_map_splay_merge_right(header, root, rlist); + } else if (llist != header) { /* * Recover the greatest node in the left * subtree and make it the root. */ root = llist; llist = root->right; - root->right = NULL; - } else if (rlist != &map->header) { + max_free_left = vm_map_splay_merge_left(header, root, llist); + max_free_right = vm_map_splay_merge_succ(header, root, rlist); + } else if (rlist != header) { /* * Recover the least node in the right * subtree and make it the root. */ root = rlist; rlist = root->left; - root->left = NULL; + max_free_left = vm_map_splay_merge_pred(header, root, llist); + max_free_right = vm_map_splay_merge_right(header, root, rlist); } else { /* There is no root. */ return (NULL); } - vm_map_splay_merge(map, root, llist, rlist); + root->max_free = vm_size_max(max_free_left, max_free_right); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); return (root); } @@ -1231,21 +1310,25 @@ vm_map_splay(vm_map_t map, vm_offset_t addr) static void vm_map_entry_link(vm_map_t map, vm_map_entry_t entry) { - vm_map_entry_t llist, rlist, root; + vm_map_entry_t header, llist, rlist, root; CTR3(KTR_VM, "vm_map_entry_link: map %p, nentries %d, entry %p", map, map->nentries, entry); VM_MAP_ASSERT_LOCKED(map); map->nentries++; + header = &map->header; root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root == NULL, ("vm_map_entry_link: link object already mapped")); entry->prev = llist; entry->next = rlist; llist->next = rlist->prev = entry; - entry->left = entry->right = NULL; - vm_map_splay_merge(map, entry, llist, rlist); + root = entry; + root->max_free = vm_size_max( + vm_map_splay_merge_pred(header, root, llist), + vm_map_splay_merge_succ(header, root, rlist)); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); } @@ -1258,9 +1341,11 @@ static void vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry, enum unlink_merge_type op) { - vm_map_entry_t llist, rlist, root, y; + vm_map_entry_t header, llist, rlist, root, y; + vm_size_t max_free_left, max_free_right; VM_MAP_ASSERT_LOCKED(map); + header = &map->header; root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root != NULL, ("vm_map_entry_unlink: unlink object not mapped")); @@ -1271,23 +1356,24 @@ vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry rlist->start = root->start; rlist->offset = root->offset; } - if (llist != &map->header) { + if (llist != header) { root = llist; llist = root->right; - root->right = NULL; - } else if (rlist != &map->header) { + max_free_left = vm_map_splay_merge_left(header, root, llist); + max_free_right = vm_map_splay_merge_succ(header, root, rlist); + } else if (rlist != header) { root = rlist; rlist = root->left; - root->left = NULL; + max_free_left = vm_map_splay_merge_pred(header, root, llist); + max_free_right = vm_map_splay_merge_right(header, root, rlist); } else root = NULL; y = entry->next; y->prev = entry->prev; y->prev->next = y; if (root != NULL) - vm_map_splay_merge(map, root, llist, rlist); - else - map->root = NULL; + root->max_free = vm_size_max(max_free_left, max_free_right); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); map->nentries--; CTR3(KTR_VM, "vm_map_entry_unlink: map %p, nentries %d, entry %p", map, @@ -1305,15 +1391,18 @@ vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry static void vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry, vm_size_t grow_amount) { - vm_map_entry_t llist, rlist, root; + vm_map_entry_t header, llist, rlist, root; VM_MAP_ASSERT_LOCKED(map); + header = &map->header; root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root != NULL, ("%s: resize object not mapped", __func__)); vm_map_splay_findnext(root, &rlist); - root->right = NULL; entry->end += grow_amount; - vm_map_splay_merge(map, root, llist, rlist); + root->max_free = vm_size_max( + vm_map_splay_merge_left(header, root, llist), + vm_map_splay_merge_succ(header, root, rlist)); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); CTR4(KTR_VM, "%s: map %p, nentries %d, entry %p", __func__, map, map->nentries, entry); @@ -1335,16 +1424,17 @@ vm_map_lookup_entry( vm_offset_t address, vm_map_entry_t *entry) /* OUT */ { - vm_map_entry_t cur, lbound; + vm_map_entry_t cur, header, lbound; boolean_t locked; /* * If the map is empty, then the map entry immediately preceding * "address" is the map's header. */ + header = &map->header; cur = map->root; if (cur == NULL) { - *entry = &map->header; + *entry = header; return (FALSE); } if (address >= cur->start && cur->end > address) { @@ -1371,7 +1461,7 @@ vm_map_lookup_entry( * immediately before or after "address". */ if (address < cur->start) { - *entry = &map->header; + *entry = header; return (FALSE); } *entry = cur; @@ -1381,7 +1471,7 @@ vm_map_lookup_entry( * Since the map is only locked for read access, perform a * standard binary search tree lookup for "address". */ - lbound = &map->header; + lbound = header; do { if (address < cur->start) { cur = cur->left; @@ -1631,8 +1721,8 @@ charged: vm_offset_t vm_map_findspace(vm_map_t map, vm_offset_t start, vm_size_t length) { - vm_map_entry_t llist, rlist, root, y; - vm_size_t left_length; + vm_map_entry_t header, llist, rlist, root, y; + vm_size_t left_length, max_free_left, max_free_right; vm_offset_t gap_end; /* @@ -1654,22 +1744,28 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s * enough; otherwise set gap_end to start skip gap-checking and move * directly to a search of the right subtree. */ + header = &map->header; root = vm_map_splay_split(map, start, length, &llist, &rlist); gap_end = rlist->start; if (root != NULL) { start = root->end; if (root->right != NULL) gap_end = start; - } else if (rlist != &map->header) { + max_free_left = vm_map_splay_merge_left(header, root, llist); + max_free_right = vm_map_splay_merge_right(header, root, rlist); + } else if (rlist != header) { root = rlist; rlist = root->left; - root->left = NULL; + max_free_left = vm_map_splay_merge_pred(header, root, llist); + max_free_right = vm_map_splay_merge_right(header, root, rlist); } else { root = llist; llist = root->right; - root->right = NULL; + max_free_left = vm_map_splay_merge_left(header, root, llist); + max_free_right = vm_map_splay_merge_succ(header, root, rlist); } - vm_map_splay_merge(map, root, llist, rlist); + root->max_free = vm_size_max(max_free_left, max_free_right); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); if (length <= gap_end - start) return (start); @@ -1681,7 +1777,7 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s /* * Splay for the least large-enough gap in the right subtree. */ - llist = rlist = &map->header; + llist = rlist = header; for (left_length = 0;; left_length = vm_map_entry_max_free_left(root, llist)) { if (length <= left_length) @@ -1695,18 +1791,20 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s } root = llist; llist = root->right; - root->right = NULL; - if (rlist != &map->header) { + max_free_left = vm_map_splay_merge_left(header, root, llist); + if (rlist == header) { + root->max_free = vm_size_max(max_free_left, + vm_map_splay_merge_succ(header, root, rlist)); + } else { y = rlist; rlist = y->left; - y->left = NULL; - vm_map_splay_merge(map, y, &map->header, rlist); - y->max_free = MAX( - vm_map_entry_max_free_left(y, root), - vm_map_entry_max_free_right(y, &map->header)); + y->max_free = vm_size_max( + vm_map_splay_merge_pred(root, y, root), + vm_map_splay_merge_right(header, y, rlist)); root->right = y; + root->max_free = vm_size_max(max_free_left, y->max_free); } - vm_map_splay_merge(map, root, llist, &map->header); + map->root = root; VM_MAP_ASSERT_CONSISTENT(map); return (root->end); } @@ -4858,6 +4956,9 @@ _vm_map_assert_consistent(vm_map_t map, int check) vm_map_entry_t entry, prev; vm_size_t max_left, max_right; +#ifdef DIAGNOSTIC + ++map->nupdates; +#endif if (enable_vmmap_check != check) return; From owner-svn-src-head@freebsd.org Fri Nov 29 03:14:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A4381C15D8; Fri, 29 Nov 2019 03:14:12 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PKNg6CNBz4Pqr; Fri, 29 Nov 2019 03:14:11 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EB127EBC; Fri, 29 Nov 2019 03:14:11 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT3EBeB006375; Fri, 29 Nov 2019 03:14:11 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT3EAU6006371; Fri, 29 Nov 2019 03:14:10 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911290314.xAT3EAU6006371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 29 Nov 2019 03:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355203 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 355203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 03:14:12 -0000 Author: jeff Date: Fri Nov 29 03:14:10 2019 New Revision: 355203 URL: https://svnweb.freebsd.org/changeset/base/355203 Log: Handle large mallocs by going directly to kmem. Taking a detour through UMA does not provide any additional value. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D22563 Modified: head/sys/kern/kern_malloc.c head/sys/vm/memguard.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Nov 29 02:16:45 2019 (r355202) +++ head/sys/kern/kern_malloc.c Fri Nov 29 03:14:10 2019 (r355203) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -552,6 +555,52 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_ #endif /* + * Handle large allocations and frees by using kmem_malloc directly. + */ +static inline bool +malloc_large_slab(uma_slab_t slab) +{ + uintptr_t va; + + va = (uintptr_t)slab; + return ((va & 1) != 0); +} + +static inline size_t +malloc_large_size(uma_slab_t slab) +{ + uintptr_t va; + + va = (uintptr_t)slab; + return (va >> 1); +} + +static caddr_t +malloc_large(size_t *size, struct domainset *policy, int flags) +{ + vm_offset_t va; + size_t sz; + + sz = roundup(*size, PAGE_SIZE); + va = kmem_malloc_domainset(policy, sz, flags); + if (va != 0) { + /* The low bit is unused for slab pointers. */ + vsetzoneslab(va, NULL, (void *)((sz << 1) | 1)); + uma_total_inc(sz); + *size = sz; + } + return ((caddr_t)va); +} + +static void +free_large(void *addr, size_t size) +{ + + kmem_free((vm_offset_t)addr, size); + uma_total_dec(size); +} + +/* * malloc: * * Allocate a block of memory. @@ -588,9 +637,7 @@ void * size = zone->uz_size; malloc_type_zone_allocated(mtp, va == NULL ? 0 : size, indx); } else { - size = roundup(size, PAGE_SIZE); - zone = NULL; - va = uma_large_malloc(size, flags); + va = malloc_large(&size, DOMAINSET_RR(), flags); malloc_type_allocated(mtp, va == NULL ? 0 : size); } if (flags & M_WAITOK) @@ -605,46 +652,27 @@ void * } static void * -malloc_domain(size_t size, struct malloc_type *mtp, int domain, int flags) +malloc_domain(size_t size, int *indxp, struct malloc_type *mtp, int domain, + int flags) { int indx; caddr_t va; uma_zone_t zone; -#if defined(DEBUG_REDZONE) - unsigned long osize = size; -#endif -#ifdef MALLOC_DEBUG - va = NULL; - if (malloc_dbg(&va, &size, mtp, flags) != 0) - return (va); -#endif - if (size <= kmem_zmax && (flags & M_EXEC) == 0) { - if (size & KMEM_ZMASK) - size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; - indx = kmemsize[size >> KMEM_ZSHIFT]; - zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; + KASSERT(size <= kmem_zmax && (flags & M_EXEC) == 0, + ("malloc_domain: Called with bad flag / size combination.")); + if (size & KMEM_ZMASK) + size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; + indx = kmemsize[size >> KMEM_ZSHIFT]; + zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; #ifdef MALLOC_PROFILE - krequests[size >> KMEM_ZSHIFT]++; + krequests[size >> KMEM_ZSHIFT]++; #endif - va = uma_zalloc_domain(zone, NULL, domain, flags); - if (va != NULL) - size = zone->uz_size; - malloc_type_zone_allocated(mtp, va == NULL ? 0 : size, indx); - } else { - size = roundup(size, PAGE_SIZE); - zone = NULL; - va = uma_large_malloc_domain(size, domain, flags); - malloc_type_allocated(mtp, va == NULL ? 0 : size); - } - if (flags & M_WAITOK) - KASSERT(va != NULL, ("malloc(M_WAITOK) returned NULL")); - else if (va == NULL) - t_malloc_fail = time_uptime; -#ifdef DEBUG_REDZONE + va = uma_zalloc_domain(zone, NULL, domain, flags); if (va != NULL) - va = redzone_setup(va, osize); -#endif + size = zone->uz_size; + *indxp = indx; + return ((void *) va); } @@ -653,16 +681,39 @@ malloc_domainset(size_t size, struct malloc_type *mtp, int flags) { struct vm_domainset_iter di; - void *ret; + caddr_t ret; int domain; + int indx; - vm_domainset_iter_policy_init(&di, ds, &domain, &flags); - do { - ret = malloc_domain(size, mtp, domain, flags); - if (ret != NULL) - break; - } while (vm_domainset_iter_policy(&di, &domain) == 0); +#if defined(DEBUG_REDZONE) + unsigned long osize = size; +#endif +#ifdef MALLOC_DEBUG + ret= NULL; + if (malloc_dbg(&ret, &size, mtp, flags) != 0) + return (ret); +#endif + if (size <= kmem_zmax && (flags & M_EXEC) == 0) { + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); + do { + ret = malloc_domain(size, &indx, mtp, domain, flags); + } while (ret == NULL && + vm_domainset_iter_policy(&di, &domain) == 0); + malloc_type_zone_allocated(mtp, ret == NULL ? 0 : size, indx); + } else { + /* Policy is handled by kmem. */ + ret = malloc_large(&size, ds, flags); + malloc_type_allocated(mtp, ret == NULL ? 0 : size); + } + if (flags & M_WAITOK) + KASSERT(ret != NULL, ("malloc(M_WAITOK) returned NULL")); + else if (ret == NULL) + t_malloc_fail = time_uptime; +#ifdef DEBUG_REDZONE + if (ret != NULL) + ret = redzone_setup(ret, osize); +#endif return (ret); } @@ -755,15 +806,15 @@ free(void *addr, struct malloc_type *mtp) panic("free: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (!(slab->us_flags & UMA_SLAB_MALLOC)) { + if (__predict_true(!malloc_large_slab(slab))) { size = zone->uz_size; #ifdef INVARIANTS free_save_type(addr, mtp, size); #endif uma_zfree_arg(zone, addr, slab); } else { - size = slab->us_size; - uma_large_free(slab); + size = malloc_large_size(slab); + free_large(addr, size); } malloc_type_freed(mtp, size); } @@ -789,15 +840,15 @@ free_domain(void *addr, struct malloc_type *mtp) panic("free_domain: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (!(slab->us_flags & UMA_SLAB_MALLOC)) { + if (__predict_true(!malloc_large_slab(slab))) { size = zone->uz_size; #ifdef INVARIANTS free_save_type(addr, mtp, size); #endif uma_zfree_domain(zone, addr, slab); } else { - size = slab->us_size; - uma_large_free(slab); + size = malloc_large_size(slab); + free_large(addr, size); } malloc_type_freed(mtp, size); } @@ -844,10 +895,10 @@ realloc(void *addr, size_t size, struct malloc_type *m ("realloc: address %p out of range", (void *)addr)); /* Get the size of the original block */ - if (!(slab->us_flags & UMA_SLAB_MALLOC)) + if (!malloc_large_slab(slab)) alloc = zone->uz_size; else - alloc = slab->us_size; + alloc = malloc_large_size(slab); /* Reuse the original block if appropriate */ if (size <= alloc Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Fri Nov 29 02:16:45 2019 (r355202) +++ head/sys/vm/memguard.c Fri Nov 29 03:14:10 2019 (r355203) @@ -311,7 +311,7 @@ memguard_alloc(unsigned long req_size, int flags) * When we pass our memory limit, reject sub-page allocations. * Page-size and larger allocations will use the same amount * of physical memory whether we allocate or hand off to - * uma_large_alloc(), so keep those. + * malloc_large(), so keep those. */ if (vmem_size(memguard_arena, VMEM_ALLOC) >= memguard_physlimit && req_size < PAGE_SIZE) { Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Fri Nov 29 02:16:45 2019 (r355202) +++ head/sys/vm/uma.h Fri Nov 29 03:14:10 2019 (r355203) @@ -615,7 +615,6 @@ void uma_zone_set_freef(uma_zone_t zone, uma_free free #define UMA_SLAB_KERNEL 0x04 /* Slab alloced from kmem */ #define UMA_SLAB_PRIV 0x08 /* Slab alloced from priv allocator */ #define UMA_SLAB_OFFP 0x10 /* Slab is managed separately */ -#define UMA_SLAB_MALLOC 0x20 /* Slab is a large malloc slab */ /* 0x02, 0x40, and 0x80 are available */ /* Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Nov 29 02:16:45 2019 (r355202) +++ head/sys/vm/uma_core.c Fri Nov 29 03:14:10 2019 (r355203) @@ -149,10 +149,10 @@ static struct sx uma_reclaim_lock; * kmem soft limit, initialized by uma_set_limit(). Ensure that early * allocations don't trigger a wakeup of the reclaim thread. */ -static unsigned long uma_kmem_limit = LONG_MAX; +unsigned long uma_kmem_limit = LONG_MAX; SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_limit, CTLFLAG_RD, &uma_kmem_limit, 0, "UMA kernel memory soft limit"); -static unsigned long uma_kmem_total; +unsigned long uma_kmem_total; SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD, &uma_kmem_total, 0, "UMA kernel memory usage"); @@ -326,22 +326,6 @@ static int zone_warnings = 1; SYSCTL_INT(_vm, OID_AUTO, zone_warnings, CTLFLAG_RWTUN, &zone_warnings, 0, "Warn when UMA zones becomes full"); -/* Adjust bytes under management by UMA. */ -static inline void -uma_total_dec(unsigned long size) -{ - - atomic_subtract_long(&uma_kmem_total, size); -} - -static inline void -uma_total_inc(unsigned long size) -{ - - if (atomic_fetchadd_long(&uma_kmem_total, size) > uma_kmem_limit) - uma_reclaim_wakeup(); -} - /* * This routine checks to see whether or not it's safe to enable buckets. */ @@ -4081,57 +4065,6 @@ int uma_zone_exhausted_nolock(uma_zone_t zone) { return (zone->uz_sleepers > 0); -} - -void * -uma_large_malloc_domain(vm_size_t size, int domain, int wait) -{ - struct domainset *policy; - vm_offset_t addr; - uma_slab_t slab; - - if (domain != UMA_ANYDOMAIN) { - /* avoid allocs targeting empty domains */ - if (VM_DOMAIN_EMPTY(domain)) - domain = UMA_ANYDOMAIN; - } - slab = zone_alloc_item(slabzone, NULL, domain, wait); - if (slab == NULL) - return (NULL); - policy = (domain == UMA_ANYDOMAIN) ? DOMAINSET_RR() : - DOMAINSET_FIXED(domain); - addr = kmem_malloc_domainset(policy, size, wait); - if (addr != 0) { - vsetzoneslab(addr, NULL, slab); - slab->us_data = (void *)addr; - slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; - slab->us_size = size; - slab->us_domain = vm_phys_domain(PHYS_TO_VM_PAGE( - pmap_kextract(addr))); - uma_total_inc(size); - } else { - zone_free_item(slabzone, slab, NULL, SKIP_NONE); - } - - return ((void *)addr); -} - -void * -uma_large_malloc(vm_size_t size, int wait) -{ - - return uma_large_malloc_domain(size, UMA_ANYDOMAIN, wait); -} - -void -uma_large_free(uma_slab_t slab) -{ - - KASSERT((slab->us_flags & UMA_SLAB_KERNEL) != 0, - ("uma_large_free: Memory not allocated with uma_large_malloc.")); - kmem_free((vm_offset_t)slab->us_data, slab->us_size); - uma_total_dec(slab->us_size); - zone_free_item(slabzone, slab, NULL, SKIP_NONE); } static void Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Fri Nov 29 02:16:45 2019 (r355202) +++ head/sys/vm/uma_int.h Fri Nov 29 03:14:10 2019 (r355203) @@ -281,10 +281,7 @@ BITSET_DEFINE(slabbits, SLAB_SETSIZE); * store and subdivides it into individually allocatable items. */ struct uma_slab { - union { - LIST_ENTRY(uma_slab) _us_link; /* slabs in zone */ - unsigned long _us_size; /* Size of allocation */ - } us_type; + LIST_ENTRY(uma_slab) us_link; /* slabs in zone */ SLIST_ENTRY(uma_slab) us_hlink; /* Link for hash table */ uint8_t *us_data; /* First item */ struct slabbits us_free; /* Free bitmask. */ @@ -296,9 +293,6 @@ struct uma_slab { uint8_t us_domain; /* Backing NUMA domain. */ }; -#define us_link us_type._us_link -#define us_size us_type._us_size - #if MAXMEMDOM >= 255 #error "Slab domain type insufficient" #endif @@ -402,9 +396,6 @@ struct uma_zone { #ifdef _KERNEL /* Internal prototypes */ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); -void *uma_large_malloc(vm_size_t size, int wait); -void *uma_large_malloc_domain(vm_size_t size, int domain, int wait); -void uma_large_free(uma_slab_t slab); /* Lock Macros */ @@ -498,6 +489,25 @@ vsetzoneslab(vm_offset_t va, uma_zone_t zone, uma_slab p = PHYS_TO_VM_PAGE(pmap_kextract(va)); p->plinks.uma.slab = slab; p->plinks.uma.zone = zone; +} + +extern unsigned long uma_kmem_limit; +extern unsigned long uma_kmem_total; + +/* Adjust bytes under management by UMA. */ +static inline void +uma_total_dec(unsigned long size) +{ + + atomic_subtract_long(&uma_kmem_total, size); +} + +static inline void +uma_total_inc(unsigned long size) +{ + + if (atomic_fetchadd_long(&uma_kmem_total, size) > uma_kmem_limit) + uma_reclaim_wakeup(); } /* From owner-svn-src-head@freebsd.org Fri Nov 29 03:31:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F0C11C1B8E; Fri, 29 Nov 2019 03:31:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PKn00RPVz4QVf; Fri, 29 Nov 2019 03:31:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E76808111; Fri, 29 Nov 2019 03:31:47 +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 xAT3VlPl016553; Fri, 29 Nov 2019 03:31:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT3VlHO016552; Fri, 29 Nov 2019 03:31:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911290331.xAT3VlHO016552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 29 Nov 2019 03:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355204 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 355204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 03:31:48 -0000 Author: cem Date: Fri Nov 29 03:31:47 2019 New Revision: 355204 URL: https://svnweb.freebsd.org/changeset/base/355204 Log: Fix braino in previous bugfix r300174 The previous revision missed the exact same error in a copy paste block of the same code in another function. Fix the identical case, too. A DHCP client identifier is simply the hardware type (one byte) concatenated with the hardware address (some variable number of bytes, but at most 16). Limit the size of the temporary buffer to match and the rest of the calculations shake out correctly. PR: 238022 Reported by: Young Submitted by: Young MFC after: I don't plan to but you should feel free Security: yes Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Fri Nov 29 03:14:10 2019 (r355203) +++ head/sbin/dhclient/dhclient.c Fri Nov 29 03:31:47 2019 (r355204) @@ -1782,7 +1782,7 @@ make_request(struct interface_info *ip, struct client_ } /* set unique client identifier */ - char client_ident[sizeof(struct hardware)]; + char client_ident[sizeof(ip->hw_address.haddr) + 1]; if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? ip->hw_address.hlen : sizeof(client_ident)-1; From owner-svn-src-head@freebsd.org Fri Nov 29 03:51:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E598C1C2092; Fri, 29 Nov 2019 03:51:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PLC95YScz4R6w; Fri, 29 Nov 2019 03:51:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2088854E; Fri, 29 Nov 2019 03:51:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT3p1C5024950; Fri, 29 Nov 2019 03:51:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT3p1Tq024949; Fri, 29 Nov 2019 03:51:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911290351.xAT3p1Tq024949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 29 Nov 2019 03:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355205 - head/sys/dev/snp X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/snp X-SVN-Commit-Revision: 355205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 03:51:02 -0000 Author: kevans Date: Fri Nov 29 03:51:01 2019 New Revision: 355205 URL: https://svnweb.freebsd.org/changeset/base/355205 Log: snp: don't reference tp->t_mtx directly This is the only part of snp(4) that pokes around in struct tty directly; replace it with the tty_getlock accessor to avoid struct tty internals. Modified: head/sys/dev/snp/snp.c Modified: head/sys/dev/snp/snp.c ============================================================================== --- head/sys/dev/snp/snp.c Fri Nov 29 03:31:47 2019 (r355204) +++ head/sys/dev/snp/snp.c Fri Nov 29 03:51:01 2019 (r355205) @@ -178,7 +178,7 @@ snp_read(struct cdev *dev, struct uio *uio, int flag) error = EWOULDBLOCK; break; } - error = cv_wait_sig(&ss->snp_outwait, tp->t_mtx); + error = cv_wait_sig(&ss->snp_outwait, tty_getlock(tp)); if (error != 0) break; if (tty_gone(tp)) { From owner-svn-src-head@freebsd.org Fri Nov 29 03:56:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF23C1C2333; Fri, 29 Nov 2019 03:56:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PLJx67SMz4RVm; Fri, 29 Nov 2019 03:56:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5E7D85E4; Fri, 29 Nov 2019 03:56:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT3u1uH029680; Fri, 29 Nov 2019 03:56:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT3u1hU029679; Fri, 29 Nov 2019 03:56:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911290356.xAT3u1hU029679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 29 Nov 2019 03:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355206 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 03:56:02 -0000 Author: kevans Date: Fri Nov 29 03:56:01 2019 New Revision: 355206 URL: https://svnweb.freebsd.org/changeset/base/355206 Log: tty_pts: don't rely on tty header pollution for sys/mutex.h tty_pts.c relies on sys/tty.h for sys/mutex.h. Include it directly instead of relying on this pollution to ease the diff for anyone that wants to try converting the tty lock to anything other than a mutex. Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Fri Nov 29 03:51:01 2019 (r355205) +++ head/sys/kern/tty_pts.c Fri Nov 29 03:56:01 2019 (r355206) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Fri Nov 29 06:25:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15F941C4F93; Fri, 29 Nov 2019 06:25:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PPcv6hglz4Wym; Fri, 29 Nov 2019 06:25:03 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4E39A02B; Fri, 29 Nov 2019 06:25:03 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT6P3nu017502; Fri, 29 Nov 2019 06:25:03 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT6P3G0017501; Fri, 29 Nov 2019 06:25:03 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911290625.xAT6P3G0017501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 29 Nov 2019 06:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355207 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 06:25:04 -0000 Author: rlibby Date: Fri Nov 29 06:25:03 2019 New Revision: 355207 URL: https://svnweb.freebsd.org/changeset/base/355207 Log: ktls_session zone: don't need to specify uma trash The use of the uma trash procedures is automatic, there's no need to pass them explicitly here. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22582 Modified: head/sys/kern/uipc_ktls.c Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Fri Nov 29 03:56:01 2019 (r355206) +++ head/sys/kern/uipc_ktls.c Fri Nov 29 06:25:03 2019 (r355207) @@ -357,11 +357,7 @@ ktls_init(void *dummy __unused) ktls_session_zone = uma_zcreate("ktls_session", sizeof(struct ktls_session), -#ifdef INVARIANTS - trash_ctor, trash_dtor, trash_init, trash_fini, -#else NULL, NULL, NULL, NULL, -#endif UMA_ALIGN_CACHE, 0); /* From owner-svn-src-head@freebsd.org Fri Nov 29 06:25:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79B2B1C4FB7; Fri, 29 Nov 2019 06:25:08 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PPd02dz6z4X1h; Fri, 29 Nov 2019 06:25:08 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F272A02C; Fri, 29 Nov 2019 06:25:08 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT6P8ex017553; Fri, 29 Nov 2019 06:25:08 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT6P8e8017552; Fri, 29 Nov 2019 06:25:08 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201911290625.xAT6P8e8017552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 29 Nov 2019 06:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355208 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 355208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 06:25:08 -0000 Author: rlibby Date: Fri Nov 29 06:25:07 2019 New Revision: 355208 URL: https://svnweb.freebsd.org/changeset/base/355208 Log: kern.mk: -Wno-error=stringop-overflow for gcc due to false positives Demote gcc's Wstringop-overflow to Wno-error due to false positives. E.g. the riscv64 build with gcc 8.3.0 has been failing with this warning since r355062 [1]. A bug has been filed with gcc [2]. The warning was first introduced in gcc 7.1 [3]. Hopefully we can avoiding suppressing the warning in future gcc versions. [1] https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/16691/ [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92718 [3] https://gcc.gnu.org/wiki/WarningHistory Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22603 Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Nov 29 06:25:03 2019 (r355207) +++ head/sys/conf/kern.mk Fri Nov 29 06:25:07 2019 (r355208) @@ -61,6 +61,9 @@ CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=shift-overflow \ -Wno-error=tautological-compare .endif +.if ${COMPILER_VERSION} >= 70100 +CWARNEXTRA+= -Wno-error=stringop-overflow +.endif .if ${COMPILER_VERSION} >= 70200 CWARNEXTRA+= -Wno-error=memset-elt-size .endif From owner-svn-src-head@freebsd.org Fri Nov 29 07:16:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CC221C666A; Fri, 29 Nov 2019 07:16:38 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PQmP0SRdz4ZGP; Fri, 29 Nov 2019 07:16:36 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wr1-x433.google.com with SMTP id z3so33716439wru.3; Thu, 28 Nov 2019 23:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XxeM5OPYxgpxW10XRqN0eO1gnyk/ejyjBsVnCDkSgBU=; b=cwDlKCH6E2f2LD28gaNTvUpmIupfU7AOcMQ2JeHWbVk3UQuKBjFJJujoj8iUg0wPb6 z148HiRNvj+v+fGJ18O6LyrJAX5dv3fyB3bllv4zQmZXBOSOYAv5/YX9HBk5XFAEA++5 oubw28Oxe8SVKNWYSeG9m++6vK4qeOFu51LD8ER3kSc+B9l3DqFtm03AqVnFr8sIqzfQ J8fMZK6sbZ4aD1jIlBq/fulPtR0XGenuuvKiF5n8zqkYRUgollE5uWIUhZgmy0BUqiYu Z2N5tjyfAhRqdbdCsXmxqLUYn49rgJQUvKa3jKybvqduOXadj2u/IsfyGHtgT7Mlzgu2 DosA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=XxeM5OPYxgpxW10XRqN0eO1gnyk/ejyjBsVnCDkSgBU=; b=F32qTB9hNQPf+5dxe3gJzJN2Rbs0Dal5Y3dFy0g2hZn9O47uE3L+s89cJdI0ZFTCu2 MykurCGNlBuhUD+0GM5kmBb5y107BIlmcKvGe8RhyLndVl9x2JYdHtkJHAwSGPI/f7yi hhxdW5FDOu+ArZkEzXc5Ytea8DJVe/bNrwop4112UNEpxUheGV+STl/mjao28JtSIQNc rkgiEd5+PBuKhJ8qc2Qe+hRLr8OiAOUyQiDxnG4loJUQEOQW+BVGD/lWP2wk++Uus8oF 76UInI+8IROk+USAmqSWss/gXpJXGvkn1r95//taSyq29KVVJUXi0IGaS7UVh49d6gJv 10tw== X-Gm-Message-State: APjAAAXQbMDfJi+ku+VsYwYqox8Mcf7Niexutj75ga6ULJFXqWo0R8FD ZkOgWUQCgZ6F2YUceCiBjuLQstlisHo= X-Google-Smtp-Source: APXvYqxB/KaZI3yo6mmeWD65Xdb0v8UpAlopU4kL/l6cuOZ54AwIAp1kV77K37KWITiv1OVYrSUIxg== X-Received: by 2002:a5d:6b4d:: with SMTP id x13mr49788595wrw.96.1575011794915; Thu, 28 Nov 2019 23:16:34 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id s8sm25921807wrt.57.2019.11.28.23.16.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Nov 2019 23:16:34 -0800 (PST) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r354347 - in head: contrib/compiler-rt/lib/builtins contrib/libunwind/include lib/libcompiler_rt lib/libgcc_s lib/libgcc_s/arm To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911050320.xA53Keqi072895@repo.freebsd.org> From: Michal Meloun Message-ID: <398883fa-121e-9637-77a2-ee34e2b62609@gmail.com> Date: Fri, 29 Nov 2019 08:16:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911050320.xA53Keqi072895@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47PQmP0SRdz4ZGP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cwDlKCH6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.13), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.94), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[3.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 07:16:38 -0000 On 05.11.2019 4:20, Conrad Meyer wrote: > Author: cem > Date: Tue Nov 5 03:20:40 2019 > New Revision: 354347 > URL: https://svnweb.freebsd.org/changeset/base/354347 > > Log: > Fix llvm-libunwind userspace build on ARM > > GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or > EHABI or whatever it's called. Export the same ones from LLVM-libunwind's > libgcc_s, on ARM. As part of this, convert libgcc_s from a direct > Version.map to one constructed from component Symbol.map files. This allows > the ARM-specific Symbol.map to be included only on ARM. > > Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match > non-ARM definitions and ARM-specific expectations in libcxxrt / > libcompiler_rt. > > No functional change intended for non-ARM architectures. > > This commit does not actually flip the switch for ARM defaults from libgcc > to llvm-libunwind, but makes it possible (to compile, anyway). This broke ABI for arm. Unlike of all other platforms, _Unwind_Backtrace should be exported with GCC_4.3.0 version. More over we should also hold GCC_3.3 version for compatibility with FBSD11. Please, see r318024 for more details. Thanks, Michal > > Added: > head/lib/libgcc_s/Symbol.map > - copied, changed from r354346, head/lib/libgcc_s/Version.map > head/lib/libgcc_s/Versions.def (contents, props changed) > head/lib/libgcc_s/arm/ > head/lib/libgcc_s/arm/Symbol.map (contents, props changed) > Deleted: > head/lib/libgcc_s/Version.map > Modified: > head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c > head/contrib/libunwind/include/unwind.h > head/lib/libcompiler_rt/Makefile > head/lib/libgcc_s/Makefile > > Modified: head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c > ============================================================================== > --- head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 02:30:41 2019 (r354346) > +++ head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 03:20:40 2019 (r354347) > @@ -9,8 +9,23 @@ > #include "int_lib.h" > > #include > +/* > + * XXX On FreeBSD, this file is compiled into three libraries: > + * - libcompiler_rt > + * - libgcc_eh > + * - libgcc_s > + * > + * In the former, the include path points to the contrib/libcxxrt/unwind-arm.h > + * copy of unwind.h. In the latter, the include path points to the > + * contrib/libunwind/include/unwind.h header (LLVM libunwind). > + * > + * Neither (seemingly redundant) variant of unwind.h needs the redefinitions > + * provided in the "helpful" header below, and libcxxrt's unwind-arm.h provides > + * *no* useful distinguishing macros, so just forcibly disable the helper > + * header on FreeBSD. > + */ > #if defined(__arm__) && !defined(__ARM_DWARF_EH__) && \ > - !defined(__USING_SJLJ_EXCEPTIONS__) > + !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__FreeBSD__) > // When building with older compilers (e.g. clang <3.9), it is possible that we > // have a version of unwind.h which does not provide the EHABI declarations > // which are quired for the C personality to conform to the specification. In > > Modified: head/contrib/libunwind/include/unwind.h > ============================================================================== > --- head/contrib/libunwind/include/unwind.h Tue Nov 5 02:30:41 2019 (r354346) > +++ head/contrib/libunwind/include/unwind.h Tue Nov 5 03:20:40 2019 (r354347) > @@ -66,12 +66,16 @@ static const _Unwind_State _US_ACTION_MASK > static const _Unwind_State _US_FORCE_UNWIND = 8; > > typedef uint32_t _Unwind_EHT_Header; > +/* > + * gcc_personality_v0 references 'struct _Unwind_Exception' all over the place. > + * Nothing in libunwind cares about 'struct _Unwind_Control_Block,' so make it > + * the alias of struct _Unwind_Exception, instead of the other way around. > + */ > +struct _Unwind_Exception; > +typedef struct _Unwind_Exception _Unwind_Exception; > +typedef struct _Unwind_Exception _Unwind_Control_Block; /* Alias */ > > -struct _Unwind_Control_Block; > -typedef struct _Unwind_Control_Block _Unwind_Control_Block; > -typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */ > - > -struct _Unwind_Control_Block { > +struct _Unwind_Exception { > uint64_t exception_class; > void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*); > > > Modified: head/lib/libcompiler_rt/Makefile > ============================================================================== > --- head/lib/libcompiler_rt/Makefile Tue Nov 5 02:30:41 2019 (r354346) > +++ head/lib/libcompiler_rt/Makefile Tue Nov 5 03:20:40 2019 (r354347) > @@ -12,10 +12,6 @@ CFLAGS+= -fvisibility=hidden > CFLAGS+= -DVISIBILITY_HIDDEN > CFLAGS+= -I${SRCTOP}/contrib/libcxxrt > > -.if ${COMPILER_TYPE} == "clang" > -CWARNFLAGS.gcc_personality_v0.c+= -Wno-typedef-redefinition > -.endif > - > # gcc has incompatible internal declarations for __divtc3 and __multc3, but has > # no option to silence its warning, so make warnings non-fatal. > NO_WERROR.gcc= > > Modified: head/lib/libgcc_s/Makefile > ============================================================================== > --- head/lib/libgcc_s/Makefile Tue Nov 5 02:30:41 2019 (r354346) > +++ head/lib/libgcc_s/Makefile Tue Nov 5 03:20:40 2019 (r354347) > @@ -4,12 +4,22 @@ PACKAGE= clibs > SHLIB_NAME= libgcc_s.so.1 > SHLIBDIR?= /lib > > +.include > + > MK_SSP= no > WARNS?= 2 > > LDFLAGS+= -nodefaultlibs > LIBADD+= c > -VERSION_MAP= ${.CURDIR}/Version.map > + > +.if ${MK_SYMVER} == "yes" > +VERSION_DEF= ${.CURDIR}/Versions.def > +SYMBOL_MAPS= ${.CURDIR}/Symbol.map > +# Export ARM AEABI unwind routines needed by libc and libthr. > +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) > +SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map > +.endif > +.endif > > .include "../libcompiler_rt/Makefile.inc" > .include "../libgcc_eh/Makefile.inc" > > Copied and modified: head/lib/libgcc_s/Symbol.map (from r354346, head/lib/libgcc_s/Version.map) > ============================================================================== > --- head/lib/libgcc_s/Version.map Tue Nov 5 02:30:41 2019 (r354346, copy source) > +++ head/lib/libgcc_s/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) > @@ -3,7 +3,6 @@ > */ > > GCC_3.0 { > -global: > __absvdi2; > __absvsi2; > __addvdi3; > @@ -84,8 +83,6 @@ global: > _Unwind_Resume; > _Unwind_SetGR; > _Unwind_SetIP; > -local: > - *; > }; > > GCC_3.3 { > @@ -93,11 +90,11 @@ GCC_3.3 { > _Unwind_FindEnclosingFunction; > _Unwind_GetCFA; > _Unwind_Resume_or_Rethrow; > -} GCC_3.0; > +}; > > GCC_3.3.1 { > __gcc_personality_v0; > -} GCC_3.3; > +}; > > GCC_3.4 { > __clzdi2; > @@ -112,11 +109,11 @@ GCC_3.4 { > __popcountdi2; > __popcountsi2; > __popcountti2; > -} GCC_3.3.1; > +}; > > GCC_3.4.2 { > __enable_execute_stack; > -} GCC_3.4; > +}; > > GCC_3.4.4 { > __absvti2; > @@ -124,7 +121,7 @@ GCC_3.4.4 { > __mulvti3; > __negvti2; > __subvti3; > -} GCC_3.4.2; > +}; > > GCC_4.0.0 { > __divdc3; > @@ -136,7 +133,7 @@ GCC_4.0.0 { > __powidf2; > __powisf2; > __powixf2; > -} GCC_3.4.4; > +}; > > GCC_4.2.0 { > __floatundidf; > @@ -146,9 +143,9 @@ GCC_4.2.0 { > __floatuntisf; > __floatuntixf; > _Unwind_GetIPInfo; > -} GCC_4.0.0; > +}; > > GCC_4.3.0 { > __bswapdi2; > __bswapsi2; > -} GCC_4.2.0; > +}; > > Added: head/lib/libgcc_s/Versions.def > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libgcc_s/Versions.def Tue Nov 5 03:20:40 2019 (r354347) > @@ -0,0 +1,31 @@ > +# $FreeBSD$ > + > +GCC_3.0 { > +}; > + > +GCC_3.3 { > +} GCC_3.0; > + > +GCC_3.3.1 { > +} GCC_3.3; > + > +GCC_3.4 { > +} GCC_3.3.1; > + > +GCC_3.4.2 { > +} GCC_3.4; > + > +GCC_3.4.4 { > +} GCC_3.4.2; > + > +GCC_3.5 { > +} GCC_3.4.4; > + > +GCC_4.0.0 { > +} GCC_3.5; > + > +GCC_4.2.0 { > +} GCC_4.0.0; > + > +GCC_4.3.0 { > +} GCC_4.2.0; > > Added: head/lib/libgcc_s/arm/Symbol.map > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libgcc_s/arm/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) > @@ -0,0 +1,12 @@ > +/* > + * $FreeBSD$ > + */ > + > +GCC_3.5 { > + _Unwind_VRS_Get; > + _Unwind_VRS_Set; > + __aeabi_unwind_cpp_pr0; > + __aeabi_unwind_cpp_pr1; > + __aeabi_unwind_cpp_pr2; > + __gnu_unwind_frame; > +}; > From owner-svn-src-head@freebsd.org Fri Nov 29 11:34:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F4D11ACF5B; Fri, 29 Nov 2019 11:34:12 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PXTc2p5Wz3Jv4; Fri, 29 Nov 2019 11:34:12 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 434B8D8DF; Fri, 29 Nov 2019 11:34:12 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATBYCgP000164; Fri, 29 Nov 2019 11:34:12 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATBYCH5000163; Fri, 29 Nov 2019 11:34:12 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201911291134.xATBYCH5000163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 29 Nov 2019 11:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355209 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 355209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 11:34:12 -0000 Author: luporl Date: Fri Nov 29 11:34:11 2019 New Revision: 355209 URL: https://svnweb.freebsd.org/changeset/base/355209 Log: [PPC] Remove extra \0 char inserted on vty by QEMU Since version 2.11.0, QEMU became bug-compatible with PowerVM's vty implementation, by inserting a \0 after every \r going to the guest. Guests are expected to workaround this issue by removing every \0 immediately following a \r. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22171 Modified: head/sys/powerpc/pseries/phyp_console.c Modified: head/sys/powerpc/pseries/phyp_console.c ============================================================================== --- head/sys/powerpc/pseries/phyp_console.c Fri Nov 29 06:25:07 2019 (r355208) +++ head/sys/powerpc/pseries/phyp_console.c Fri Nov 29 11:34:11 2019 (r355209) @@ -287,6 +287,7 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer { int err; int hdr = 0; + uint64_t i, j; uart_lock(&sc->sc_mtx); if (sc->inbuflen == 0) { @@ -297,7 +298,7 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer uart_unlock(&sc->sc_mtx); return (-1); } - hdr = 1; + hdr = 1; } if (sc->inbuflen == 0) { @@ -305,15 +306,35 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer return (0); } - if (bufsize > sc->inbuflen) - bufsize = sc->inbuflen; - if ((sc->protocol == HVTERMPROT) && (hdr == 1)) { sc->inbuflen = sc->inbuflen - 4; /* The VTERM protocol has a 4 byte header, skip it here. */ memmove(&sc->phyp_inbuf.str[0], &sc->phyp_inbuf.str[4], sc->inbuflen); } + + /* + * Since version 2.11.0, QEMU became bug-compatible with + * PowerVM's vty implementation, by inserting a \0 after + * every \r going to the guest. Guests are expected to + * workaround this issue by removing every \0 immediately + * following a \r. + */ + if (hdr == 1) { + for (i = 0, j = 0; i < sc->inbuflen; i++, j++) { + if (i > j) + sc->phyp_inbuf.str[j] = sc->phyp_inbuf.str[i]; + + if (sc->phyp_inbuf.str[i] == '\r' && + i < sc->inbuflen - 1 && + sc->phyp_inbuf.str[i + 1] == '\0') + i++; + } + sc->inbuflen -= i - j; + } + + if (bufsize > sc->inbuflen) + bufsize = sc->inbuflen; memcpy(buffer, sc->phyp_inbuf.str, bufsize); sc->inbuflen -= bufsize; From owner-svn-src-head@freebsd.org Fri Nov 29 13:55:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C0921B1448; Fri, 29 Nov 2019 13:55:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pbd86YgYz3RHP; Fri, 29 Nov 2019 13:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46BAF1E9; Fri, 29 Nov 2019 13:55:56 +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 xATDtud7082667; Fri, 29 Nov 2019 13:55:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATDtuVp082666; Fri, 29 Nov 2019 13:55:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911291355.xATDtuVp082666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 Nov 2019 13:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355210 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 355210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 13:55:57 -0000 Author: kib Date: Fri Nov 29 13:55:56 2019 New Revision: 355210 URL: https://svnweb.freebsd.org/changeset/base/355210 Log: In nfs_lock(), recheck vp->v_data after lock before accessing it. We might race with reclaim, and then this is no longer a nfs vnode, in which case we do not need to handle deferred vnode_pager_setsize() either. Reported by: rk@ronald.org PR: 242184 Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Nov 29 11:34:11 2019 (r355209) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Nov 29 13:55:56 2019 (r355210) @@ -312,6 +312,8 @@ nfs_lock(struct vop_lock1_args *ap) if (error != 0 || vp->v_op != &newnfs_vnodeops) return (error); np = VTONFS(vp); + if (np == NULL) + return (0); NFSLOCKNODE(np); if ((np->n_flag & NVNSETSZSKIP) == 0 || (lktype != LK_SHARED && lktype != LK_EXCLUSIVE && lktype != LK_UPGRADE && @@ -345,6 +347,9 @@ nfs_lock(struct vop_lock1_args *ap) error = VOP_LOCK1_APV(&default_vnodeops, ap); if (error != 0 || vp->v_op != &newnfs_vnodeops) return (error); + if (vp->v_data == NULL) + goto downgrade; + MPASS(vp->v_data == np); NFSLOCKNODE(np); if ((np->n_flag & NVNSETSZSKIP) == 0) { NFSUNLOCKNODE(np); From owner-svn-src-head@freebsd.org Fri Nov 29 14:02:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FFF01B17F4; Fri, 29 Nov 2019 14:02:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pbmn3LnSz3x0m; Fri, 29 Nov 2019 14:02:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C3A9F3CD; Fri, 29 Nov 2019 14:02:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATE2Xll088611; Fri, 29 Nov 2019 14:02:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATE2WTZ088608; Fri, 29 Nov 2019 14:02:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911291402.xATE2WTZ088608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 Nov 2019 14:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355211 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Commit-Revision: 355211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 14:02:33 -0000 Author: kib Date: Fri Nov 29 14:02:32 2019 New Revision: 355211 URL: https://svnweb.freebsd.org/changeset/base/355211 Log: Add a VN_OPEN_INVFS flag. vn_open_cred() assumes that it is called from the top-level of a VFS syscall. Writers must call bwillwrite() before locking any VFS resource to wait for cleanup of dirty buffers. ZFS getextattr() and setextattr() VOPs do call vn_open_cred(), which results in wait for unrelated buffers while owning ZFS vnode lock (and ZFS does not use buffer cache). VN_OPEN_INVFS allows caller to skip bwillwrite. Note that ZFS is still incorrect there, because it starts write on an mp and locks a vnode while holding another vnode lock. Reported by: Willem Jan Withagen Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 29 13:55:56 2019 (r355210) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 29 14:02:32 2019 (r355211) @@ -5490,7 +5490,7 @@ vop_getextattr { flags = FREAD; NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, attrname, xvp, td); - error = vn_open_cred(&nd, &flags, 0, 0, ap->a_cred, NULL); + error = vn_open_cred(&nd, &flags, VN_OPEN_INVFS, 0, ap->a_cred, NULL); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { @@ -5627,7 +5627,8 @@ vop_setextattr { flags = FFLAGS(O_WRONLY | O_CREAT); NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, attrname, xvp, td); - error = vn_open_cred(&nd, &flags, 0600, 0, ap->a_cred, NULL); + error = vn_open_cred(&nd, &flags, 0600, VN_OPEN_INVFS, ap->a_cred, + NULL); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Nov 29 13:55:56 2019 (r355210) +++ head/sys/kern/vfs_vnops.c Fri Nov 29 14:02:32 2019 (r355211) @@ -219,7 +219,8 @@ restart: ndp->ni_cnd.cn_flags |= AUDITVNODE1; if (vn_open_flags & VN_OPEN_NOCAPCHECK) ndp->ni_cnd.cn_flags |= NOCAPCHECK; - bwillwrite(); + if ((vn_open_flags & VN_OPEN_INVFS) == 0) + bwillwrite(); if ((error = namei(ndp)) != 0) return (error); if (ndp->ni_vp == NULL) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Nov 29 13:55:56 2019 (r355210) +++ head/sys/sys/vnode.h Fri Nov 29 14:02:32 2019 (r355211) @@ -579,6 +579,7 @@ typedef void vop_getpages_iodone_t(void *, vm_page_t * #define VN_OPEN_NOAUDIT 0x00000001 #define VN_OPEN_NOCAPCHECK 0x00000002 #define VN_OPEN_NAMECACHE 0x00000004 +#define VN_OPEN_INVFS 0x00000008 /* * Public vnode manipulation functions. From owner-svn-src-head@freebsd.org Fri Nov 29 14:46:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 323921B2893; Fri, 29 Nov 2019 14:46:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PclB0ZKZz4078; Fri, 29 Nov 2019 14:46:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBD7BFAE6; Fri, 29 Nov 2019 14:46:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATEkDtv013120; Fri, 29 Nov 2019 14:46:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATEkDmo013119; Fri, 29 Nov 2019 14:46:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911291446.xATEkDmo013119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 29 Nov 2019 14:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355212 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 14:46:14 -0000 Author: kevans Date: Fri Nov 29 14:46:13 2019 New Revision: 355212 URL: https://svnweb.freebsd.org/changeset/base/355212 Log: tty_rel_gone: add locking assertion We already assert the lock is held later during tty_rel_free(), but it is arguably good form to clarify locking expectations here as well at the top-level that other drivers use. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Nov 29 14:02:32 2019 (r355211) +++ head/sys/kern/tty.c Fri Nov 29 14:46:13 2019 (r355212) @@ -1180,6 +1180,7 @@ void tty_rel_gone(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); /* Simulate carrier removal. */ From owner-svn-src-head@freebsd.org Fri Nov 29 16:14:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E6451B4DB7; Fri, 29 Nov 2019 16:14:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pfj46hCNz4487; Fri, 29 Nov 2019 16:14:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8A0618AFA; Fri, 29 Nov 2019 16:14:32 +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 xATGEWoL066354; Fri, 29 Nov 2019 16:14:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATGEWeB066352; Fri, 29 Nov 2019 16:14:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911291614.xATGEWeB066352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 29 Nov 2019 16:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355213 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 355213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 16:14:33 -0000 Author: andrew Date: Fri Nov 29 16:14:32 2019 New Revision: 355213 URL: https://svnweb.freebsd.org/changeset/base/355213 Log: Use the VM_MEMATTR macros to describe the MAIR offsets. Remove the duplicate macros that defined a subset of the VM_MEMATTR values. While here use VM_MEMATTR macros when filling in the MAIR register. Reviewed by: alc, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22241 Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Fri Nov 29 14:46:13 2019 (r355212) +++ head/sys/arm64/arm64/locore.S Fri Nov 29 16:14:32 2019 (r355213) @@ -34,6 +34,7 @@ #include #include #include +#include #include #define VIRT_BITS 48 @@ -42,10 +43,6 @@ .globl kernbase .set kernbase, KERNBASE -#define DEVICE_MEM 0 -#define NORMAL_UNCACHED 1 -#define NORMAL_MEM 2 - /* * We assume: * MMU on with an identity map, or off @@ -396,7 +393,7 @@ create_pagetables: /* Create the kernel space L2 table */ mov x6, x26 - mov x7, #NORMAL_MEM + mov x7, #VM_MEMATTR_WRITE_BACK mov x8, #(KERNBASE & L2_BLOCK_MASK) mov x9, x28 bl build_l2_block_pagetable @@ -433,15 +430,17 @@ create_pagetables: mov x6, x27 /* The initial page table */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create a table for the UART */ - mov x7, #(ATTR_nG | ATTR_IDX(DEVICE_MEM)) + mov x7, #(ATTR_nG | ATTR_IDX(VM_MEMATTR_DEVICE)) mov x8, #(SOCDEV_VA) /* VA start */ mov x9, #(SOCDEV_PA) /* PA start */ mov x10, #1 bl build_l1_block_pagetable #endif - /* Create the VA = PA map */ - mov x7, #(ATTR_nG | ATTR_IDX(NORMAL_UNCACHED)) + /* + * Create the VA = PA map + */ + mov x7, #(ATTR_nG | ATTR_IDX(VM_MEMATTR_UNCACHEABLE)) mov x9, x27 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 @@ -658,10 +657,10 @@ start_mmu: .align 3 mair: - .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, 0) | \ - MAIR_ATTR(MAIR_NORMAL_NC, 1) | \ - MAIR_ATTR(MAIR_NORMAL_WB, 2) | \ - MAIR_ATTR(MAIR_NORMAL_WT, 3) + .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, VM_MEMATTR_DEVICE) | \ + MAIR_ATTR(MAIR_NORMAL_NC, VM_MEMATTR_UNCACHEABLE) | \ + MAIR_ATTR(MAIR_NORMAL_WB, VM_MEMATTR_WRITE_BACK) | \ + MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) tcr: .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Nov 29 14:46:13 2019 (r355212) +++ head/sys/arm64/arm64/pmap.c Fri Nov 29 16:14:32 2019 (r355213) @@ -169,14 +169,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -/* - * These are configured by the mair_el1 register. This is set up in locore.S - */ -#define DEVICE_MEMORY 0 -#define UNCACHED_MEMORY 1 -#define CACHED_MEMORY 2 - - #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else @@ -707,7 +699,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi KASSERT(l2_slot != 0, ("...")); pmap_store(&l2[l2_slot], (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | - ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); + ATTR_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); } KASSERT(va == (pa - dmap_phys_base + DMAP_MIN_ADDRESS), ("...")); @@ -719,7 +711,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); pmap_store(&pagetable_dmap[l1_slot], (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | - ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); + ATTR_IDX(VM_MEMATTR_WRITE_BACK) | L1_BLOCK); } /* Create L2 mappings at the end of the region */ @@ -744,7 +736,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi l2_slot = pmap_l2_index(va); pmap_store(&l2[l2_slot], (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | - ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); + ATTR_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); } } @@ -1268,7 +1260,7 @@ void pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) { - pmap_kenter(sva, size, pa, DEVICE_MEMORY); + pmap_kenter(sva, size, pa, VM_MEMATTR_DEVICE); } /* @@ -3275,7 +3267,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v L3_PAGE); if ((prot & VM_PROT_WRITE) == 0) new_l3 |= ATTR_AP(ATTR_AP_RO); - if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) + if ((prot & VM_PROT_EXECUTE) == 0 || + m->md.pv_memattr == VM_MEMATTR_DEVICE) new_l3 |= ATTR_XN; if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= ATTR_SW_WIRED; @@ -3543,7 +3536,8 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page new_l2 |= ATTR_SW_MANAGED; new_l2 &= ~ATTR_AF; } - if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) + if ((prot & VM_PROT_EXECUTE) == 0 || + m->md.pv_memattr == VM_MEMATTR_DEVICE) new_l2 |= ATTR_XN; if (va < VM_MAXUSER_ADDRESS) new_l2 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; @@ -3845,7 +3839,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); l3_val = pa | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | ATTR_AP(ATTR_AP_RO) | L3_PAGE; - if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) + if ((prot & VM_PROT_EXECUTE) == 0 || + m->md.pv_memattr == VM_MEMATTR_DEVICE) l3_val |= ATTR_XN; if (va < VM_MAXUSER_ADDRESS) l3_val |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; @@ -5223,7 +5218,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) l2 = pmap_l1_to_l2(pde, va); pmap_load_store(l2, pa | ATTR_DEFAULT | ATTR_XN | - ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); + ATTR_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); va += L2_SIZE; pa += L2_SIZE; @@ -5247,7 +5242,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) /* L3 table is linked */ va = trunc_page(va); pa = trunc_page(pa); - pmap_kenter(va, size, pa, CACHED_MEMORY); + pmap_kenter(va, size, pa, VM_MEMATTR_WRITE_BACK); } return ((void *)(va + offset)); @@ -5433,7 +5428,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size l3 = pmap_load(pte); l3 &= ~ATTR_IDX_MASK; l3 |= ATTR_IDX(mode); - if (mode == DEVICE_MEMORY) + if (mode == VM_MEMATTR_DEVICE) l3 |= ATTR_XN; pmap_update_entry(kernel_pmap, pte, l3, tmpva, @@ -5509,7 +5504,8 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_ if (tmpl1 != 0) { pmap_kenter(tmpl1, PAGE_SIZE, - DMAP_TO_PHYS((vm_offset_t)l1) & ~L3_OFFSET, CACHED_MEMORY); + DMAP_TO_PHYS((vm_offset_t)l1) & ~L3_OFFSET, + VM_MEMATTR_WRITE_BACK); l1 = (pt_entry_t *)(tmpl1 + ((vm_offset_t)l1 & PAGE_MASK)); } @@ -5651,7 +5647,8 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ */ if (tmpl2 != 0) { pmap_kenter(tmpl2, PAGE_SIZE, - DMAP_TO_PHYS((vm_offset_t)l2) & ~L3_OFFSET, CACHED_MEMORY); + DMAP_TO_PHYS((vm_offset_t)l2) & ~L3_OFFSET, + VM_MEMATTR_WRITE_BACK); l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK)); } From owner-svn-src-head@freebsd.org Fri Nov 29 18:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47B081B7843; Fri, 29 Nov 2019 18:05:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pj9b1Cqyz4997; Fri, 29 Nov 2019 18:05:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D2BC19E91; Fri, 29 Nov 2019 18:05:55 +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 xATI5spN030947; Fri, 29 Nov 2019 18:05:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATI5sds030946; Fri, 29 Nov 2019 18:05:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201911291805.xATI5sds030946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 29 Nov 2019 18:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355214 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 18:05:55 -0000 Author: ian Date: Fri Nov 29 18:05:54 2019 New Revision: 355214 URL: https://svnweb.freebsd.org/changeset/base/355214 Log: Ignore "gpio-hog" nodes when instantiating ofw_gpiobus children. Also, in ofw_gpiobus_probe() return BUS_PROBE_DEFAULT rather than 0; we are not the only possible driver to handle this device, we're just slightly better than the base gpiobus (which probes at BUS_PROBE_GENERIC). In the time since this code was first written, the gpio controller bindings aquired the concept of a "hog" node which could be used to preset one or more gpio pins as input or output at a specified level. This change doesn't fully implement the hogging concept, it just filters out hog nodes when instantiating child devices by scanning for child nodes in the fdt data. The whole concept of having child nodes under the controller node is not supported by the standard bindings, and appears to be a freebsd extension, probably left over from the days when we had no support for cross-tree phandle references in the fdt data. Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Fri Nov 29 16:14:32 2019 (r355213) +++ head/sys/dev/gpio/ofw_gpiobus.c Fri Nov 29 18:05:54 2019 (r355214) @@ -492,7 +492,7 @@ ofw_gpiobus_probe(device_t dev) return (ENXIO); device_set_desc(dev, "OFW GPIO bus"); - return (0); + return (BUS_PROBE_DEFAULT); } static int @@ -511,6 +511,8 @@ ofw_gpiobus_attach(device_t dev) */ for (child = OF_child(ofw_bus_get_node(dev)); child != 0; child = OF_peer(child)) { + if (OF_hasprop(child, "gpio-hog")) + continue; if (!OF_hasprop(child, "gpios")) continue; if (ofw_gpiobus_add_fdt_child(dev, NULL, child) == NULL) From owner-svn-src-head@freebsd.org Fri Nov 29 18:25:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D5381B84E2; Fri, 29 Nov 2019 18:25:49 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PjcW4d2Wz4BRb; Fri, 29 Nov 2019 18:25:47 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102860.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xATIMW5O031601; Fri, 29 Nov 2019 12:25:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=zE2UItqtwegBmJzdbha7R7qiSh9v0MvKt+2x9e+O3wE=; b=OYCOLn2Wuq+O428xwWRUvljcJxFGoH/MRCQEXqtfgT/In5NmKOnlrjMnEhjtzjlisxjP 4vRLH/eti9ust7UC3NoVDtjUjmUjDIFakkSok9/mUnQvWiW/lt7nGl8xor+zfEl2USRN aiPBKP6eRaEM8f/SKDuAk4mF4AqaDPGk2tjhAIDLFyNyckGcFcWEJ2WJLwpZrLKNIHBW cxqxsmLhyWFrNxeBJfCAchR3le+TxeUnGBJCW0g6rdH2k4XXOZpv5Fi4gcXzMCiikVxA YMEhFowcc1qNWwq6+e6skZ08DwLywNdO69uMsT9ilf1hKMJg8kOPlfnUP7uRXw1owfxf hA== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2whd1b2yve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Nov 2019 12:25:44 -0600 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id B700A460E2B; Fri, 29 Nov 2019 12:25:43 -0600 (CST) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id B595B460DD3; Fri, 29 Nov 2019 12:25:43 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 8YODFDtQWglz; Fri, 29 Nov 2019 12:25:43 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 43240460E14; Fri, 29 Nov 2019 12:25:43 -0600 (CST) Subject: Re: svn commit: r355145 - head/sys/arm64/arm64 To: Konstantin Belousov , Andrew Turner Cc: meloun.michal@gmail.com, Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911272033.xARKXowX014908@repo.freebsd.org> <20191128135226.GR10580@kib.kiev.ua> From: Alan Cox Message-ID: <2b74e0f9-ee3e-4025-4099-4b77458654e9@rice.edu> Date: Fri, 29 Nov 2019 12:25:42 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191128135226.GR10580@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-29_06:2019-11-29,2019-11-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 mlxlogscore=863 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911290157 X-Rspamd-Queue-Id: 47PjcW4d2Wz4BRb X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rice.edu header.s=ricemail header.b=OYCOLn2W; dmarc=pass (policy=none) header.from=rice.edu; spf=pass (mx1.freebsd.org: domain of alc@rice.edu designates 148.163.153.244 as permitted sender) smtp.mailfrom=alc@rice.edu X-Spamd-Result: default: False [-6.89 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:a32.spf.rice.edu]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[rice.edu:+]; DMARC_POLICY_ALLOW(-0.50)[rice.edu,none]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.29)[ip: (-9.83), ipnet: 148.163.152.0/22(-4.71), asn: 22843(-1.86), country: US(-0.05)]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[244.153.163.148.list.dnswl.org : 127.0.3.1]; ASN(0.00)[asn:22843, ipnet:148.163.152.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[rice.edu:s=ricemail]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[rice.edu.dwl.dnswl.org : 127.0.11.2]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com]; SUSPICIOUS_RECIPS(1.50)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 18:25:49 -0000 On 11/28/19 7:52 AM, Konstantin Belousov wrote: > On Thu, Nov 28, 2019 at 09:17:15AM +0000, Andrew Turner wrote: >> >>> On 28 Nov 2019, at 08:48, Michal Meloun wrote: >>> >>> >>> >>> On 27.11.2019 21:33, Alan Cox wrote: >>>> Author: alc >>>> Date: Wed Nov 27 20:33:49 2019 >>>> New Revision: 355145 >>>> URL: https://svnweb.freebsd.org/changeset/base/355145 >>>> >>>> Log: >>>> There is no reason why we need to pin the underlying thread to its current >>>> processor in pmap_invalidate_{all,page,range}(). These functions are using >>>> an instruction that broadcasts the TLB invalidation to every processor, so >>>> even if a thread migrates in the middle of one of these functions every >>>> processor will still perform the required TLB invalidations. >>> I think this is not the right assumption. The problem is not in TLB >>> operations themselves, but in following 'dsb' and / or 'isb'. 'dsb' >>> ensures that all TLB operation transmitted by the local CPU is performed >>> and visible to other observers. But it does nothing with TLBs emitted by >>> other CPUs. >>> For example, if a given thread is rescheduled after all TLB operations >>> but before 'dsb' or 'isb' is performed, then the requested >>> synchronization does not occur at all. >> The tibi instructions need a context synchronisation point. One option is the dsb & isb instructions, another is an exception entry. >> >> For a thread to be rescheduled it requires the timer interrupt to fire. As an exception entry is a context synchronisation point and an interrupt will cause an exception entry there will be such a point after the the tibi instruction. >> > D5.10.2. TLB maintenance instructions, 'Ordering and completion of > TLB maintenance instructions' states that DSB on the PE that issued > TLBI is required. It does not state that arbitrary even causing > SynchronizeContext() is enough. > > Also I was not able to find any explanation of SynchronizeContext(). The entry for "Context Synchronization Events" in the Glossary on page 7460 provides the best explanation that I've found.  The first three listed events are an isb instruction, taking an exception, and returning from an exception.  However, there is nothing here to suggest that taking or returning from an exception can take the place of a dsb instruction. (On a related note, I'll observe that Linux does not perform an isb instruction during TLB invalidation unless it is changing a leaf in the kernel page table.  For changes to user-space page tables, they appear to be assuming that the return to user-space will suffice to resync the user-space instruction stream.) > Curiously, on IA32 exceptions are not specified to issue a serialization > point, although rumors say that on all produced microarchitectures they are. This issue has similarities to the one that we discussed in https://reviews.freebsd.org/D22007.  For example, on a context switch we will perform a dsb instruction in pmap_activate_int() unless we are switching to a thread within the same address space.  Moreover, that dsb instruction will be performed before the lock on the old thread is released.  So, in this case, we are guaranteed that any previously issued tlbi instructions are completed before the thread can be restarted on another processor. However, if we are simply switching between threads within the same address space, we are not performing a dsb instruction.  And, my error was believing that the memory barriers inherent to the locking operations on the thread during context switches would be sufficient to ensure that all of the tlbi instructions on the initial processor would have completed before the dsb instruction on the eventual processor finishing the pmap_invalidate_*() completed. After further reading, I'm afraid that we have a similar issue with cache management functions, like cpu_icache_sync_range(). Quoting K11.5.2, "The ARMv8 architecture requires a PE that executes an instruction cache maintenance instruction to execute a DSB instruction to ensure completion of the maintenance operation."  So, we have a similar problem if we are preempted during the cpu_icache_sync_range() calls from pmap_enter(), pmap_enter_quick(), and pmap_sync_icache().  Unless we are switching to a different address space, we are not guaranteed to perform a dsb instruction on the initial processor. Moreover, we are configuring the processor in locore.S so that user-space can directly perform "ic ivau" instructions.  (See SCTLR_UCI in sctlr_set.)  So, I'm inclined to say that we should handle this issue analogously to r354630 on amd64: Index: arm64/arm64/pmap.c =================================================================== --- arm64/arm64/pmap.c  (revision 355145) +++ arm64/arm64/pmap.c  (working copy) @@ -5853,8 +5853,11 @@ pmap_activate_int(pmap_t pmap)         KASSERT(PCPU_GET(curpmap) != NULL, ("no active pmap"));         KASSERT(pmap != kernel_pmap, ("kernel pmap activation")); -       if (pmap == PCPU_GET(curpmap)) +       if (pmap == PCPU_GET(curpmap)) { +               /* XXXExplain why. */ +               dsb(ish);                 return (false); +       }         /*          * Ensure that the store to curpmap is globally visible before the From owner-svn-src-head@freebsd.org Fri Nov 29 19:47:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA6261BA519; Fri, 29 Nov 2019 19:47:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PlR0440Zz4FhK; Fri, 29 Nov 2019 19:47:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F02B1B072; Fri, 29 Nov 2019 19:47:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATJleAs089578; Fri, 29 Nov 2019 19:47:40 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATJleHg089577; Fri, 29 Nov 2019 19:47:40 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911291947.xATJleHg089577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 29 Nov 2019 19:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355215 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 19:47:40 -0000 Author: jeff Date: Fri Nov 29 19:47:40 2019 New Revision: 355215 URL: https://svnweb.freebsd.org/changeset/base/355215 Log: Fix a perf regression from r355122. We can use a shared lock to drop the last ref on vnodes. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22565 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Nov 29 18:05:54 2019 (r355214) +++ head/sys/vm/vm_object.c Fri Nov 29 19:47:40 2019 (r355215) @@ -520,15 +520,22 @@ static void vm_object_vndeallocate(vm_object_t object) { struct vnode *vp = (struct vnode *) object->handle; + bool last; KASSERT(object->type == OBJT_VNODE, ("vm_object_vndeallocate: not a vnode object")); KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); + /* Object lock to protect handle lookup. */ + last = refcount_release(&object->ref_count); + VM_OBJECT_RUNLOCK(object); + + if (!last) + return; + if (!umtx_shm_vnobj_persistent) umtx_shm_object_terminated(object); - VM_OBJECT_WUNLOCK(object); /* vrele may need the vnode lock. */ vrele(vp); } @@ -548,7 +555,7 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t robject, temp; - bool last, released; + bool released; while (object != NULL) { /* @@ -565,18 +572,22 @@ vm_object_deallocate(vm_object_t object) if (released) return; - VM_OBJECT_WLOCK(object); - KASSERT(object->ref_count != 0, - ("vm_object_deallocate: object deallocated too many times: %d", object->type)); - - last = refcount_release(&object->ref_count); if (object->type == OBJT_VNODE) { - if (last) + VM_OBJECT_RLOCK(object); + if (object->type == OBJT_VNODE) { vm_object_vndeallocate(object); - else - VM_OBJECT_WUNLOCK(object); - return; + return; + } + VM_OBJECT_RUNLOCK(object); } + + VM_OBJECT_WLOCK(object); + KASSERT(object->ref_count > 0, + ("vm_object_deallocate: object deallocated too many times: %d", + object->type)); + + if (refcount_release(&object->ref_count)) + goto doterm; if (object->ref_count > 1) { VM_OBJECT_WUNLOCK(object); return; From owner-svn-src-head@freebsd.org Fri Nov 29 19:49:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09AC51BA5F0; Fri, 29 Nov 2019 19:49:21 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PlSw6SNfz4FqT; Fri, 29 Nov 2019 19:49:20 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C20A11B07A; Fri, 29 Nov 2019 19:49:20 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATJnKNu089690; Fri, 29 Nov 2019 19:49:20 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATJnK5f089689; Fri, 29 Nov 2019 19:49:20 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911291949.xATJnK5f089689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 29 Nov 2019 19:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355216 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 19:49:21 -0000 Author: jeff Date: Fri Nov 29 19:49:20 2019 New Revision: 355216 URL: https://svnweb.freebsd.org/changeset/base/355216 Log: Avoid acquiring the object lock if color is already set. It can not be unset until the object is recycled so this check is stable. Now that we can acquire the ref without a lock it is not necessary to group these operations and we can avoid it entirely in many cases. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22565 Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Fri Nov 29 19:47:40 2019 (r355215) +++ head/sys/vm/vm_mmap.c Fri Nov 29 19:49:20 2019 (r355216) @@ -1325,12 +1325,14 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, } else { KASSERT(obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP, ("wrong object type")); - VM_OBJECT_WLOCK(obj); - vm_object_reference_locked(obj); + vm_object_reference(obj); #if VM_NRESERVLEVEL > 0 - vm_object_color(obj, 0); + if ((obj->flags & OBJ_COLORED) == 0) { + VM_OBJECT_WLOCK(obj); + vm_object_color(obj, 0); + VM_OBJECT_WUNLOCK(obj); + } #endif - VM_OBJECT_WUNLOCK(obj); } *objp = obj; *flagsp = flags; From owner-svn-src-head@freebsd.org Fri Nov 29 19:57:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BB6C1BA8D2; Fri, 29 Nov 2019 19:57:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Plfk3QcDz4GJR; Fri, 29 Nov 2019 19:57:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EA721B242; Fri, 29 Nov 2019 19:57:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATJvosl095704; Fri, 29 Nov 2019 19:57:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATJvo2g095703; Fri, 29 Nov 2019 19:57:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201911291957.xATJvo2g095703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 29 Nov 2019 19:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355217 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 19:57:50 -0000 Author: jeff Date: Fri Nov 29 19:57:49 2019 New Revision: 355217 URL: https://svnweb.freebsd.org/changeset/base/355217 Log: Restore swap space accounting for non-anonymous swap objects. This was broken in r355082. Reduce some locking in nearby related object type checks. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22565 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Nov 29 19:49:20 2019 (r355216) +++ head/sys/vm/vm_map.c Fri Nov 29 19:57:49 2019 (r355217) @@ -2445,9 +2445,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; - VM_OBJECT_RLOCK(object); if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { - VM_OBJECT_RUNLOCK(object); VM_OBJECT_WLOCK(object); if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { pmap_object_init_pt(map->pmap, addr, object, pindex, @@ -2456,7 +2454,8 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p return; } VM_OBJECT_LOCK_DOWNGRADE(object); - } + } else + VM_OBJECT_RLOCK(object); psize = atop(size); if (psize + pindex > object->size) { @@ -2623,6 +2622,8 @@ again: continue; } + if (obj->type != OBJT_DEFAULT && obj->type != OBJT_SWAP) + continue; VM_OBJECT_WLOCK(obj); if (obj->type != OBJT_DEFAULT && obj->type != OBJT_SWAP) { VM_OBJECT_WUNLOCK(obj); @@ -3809,14 +3810,14 @@ vm_map_check_protection(vm_map_t map, vm_offset_t star /* * - * vm_map_copy_anon_object: + * vm_map_copy_swap_object: * - * Copies an anonymous object from an existing map entry to a + * Copies a swap-backed object from an existing map entry to a * new one. Carries forward the swap charge. May change the * src object on return. */ static void -vm_map_copy_anon_object(vm_map_entry_t src_entry, vm_map_entry_t dst_entry, +vm_map_copy_swap_object(vm_map_entry_t src_entry, vm_map_entry_t dst_entry, vm_offset_t size, vm_ooffset_t *fork_charge) { vm_object_t src_object; @@ -3898,8 +3899,9 @@ vm_map_copy_entry( */ size = src_entry->end - src_entry->start; if ((src_object = src_entry->object.vm_object) != NULL) { - if ((src_object->flags & OBJ_ANON) != 0) { - vm_map_copy_anon_object(src_entry, dst_entry, + if (src_object->type == OBJT_DEFAULT || + src_object->type == OBJT_SWAP) { + vm_map_copy_swap_object(src_entry, dst_entry, size, fork_charge); /* May have split/collapsed, reload obj. */ src_object = src_entry->object.vm_object; From owner-svn-src-head@freebsd.org Fri Nov 29 23:04:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55C541BF30A; Fri, 29 Nov 2019 23:04:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PqpQ1MD6z4Q28; Fri, 29 Nov 2019 23:04:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11DC51D41B; Fri, 29 Nov 2019 23:04:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xATN4jDf006932; Fri, 29 Nov 2019 23:04:45 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xATN4jxD006931; Fri, 29 Nov 2019 23:04:45 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201911292304.xATN4jxD006931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Fri, 29 Nov 2019 23:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355218 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 355218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 29 Nov 2019 23:04:46 -0000 Author: grog Date: Fri Nov 29 23:04:45 2019 New Revision: 355218 URL: https://svnweb.freebsd.org/changeset/base/355218 Log: Correct date and time of George Harrison's death. Source: https://www.beatlesbible.com/2001/11/29/george-harrison-dies/ Modified: head/usr.bin/calendar/calendars/calendar.music Modified: head/usr.bin/calendar/calendars/calendar.music ============================================================================== --- head/usr.bin/calendar/calendars/calendar.music Fri Nov 29 19:57:49 2019 (r355217) +++ head/usr.bin/calendar/calendars/calendar.music Fri Nov 29 23:04:45 2019 (r355218) @@ -215,7 +215,7 @@ 11/26 Cream performs their farewell concert at Royal Albert Hall, 1968 11/26 Paul Hindemith is born in Hanau, Germany, 1895 11/27 Jimi Hendrix (Johnny Allen Hendrix) is born in Seattle, 1942 -11/30 George Harrison dies at 13:30 in L.A., 2001 +11/29 George Harrison dies at 13:20 in Los Angeles, California, 2001 12/04 Frank Zappa dies in his Laurel Canyon home shortly before 18:00, 1993 12/05 Wolfgang Amadeus Mozart dies in Vienna, Austria, 1791 12/06 First sound recording made by Thomas Edison, 1877 From owner-svn-src-head@freebsd.org Sat Nov 30 05:57:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA0FA1C95FD; Sat, 30 Nov 2019 05:57:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Q0z65RN9z3G4s; Sat, 30 Nov 2019 05:57:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97A0E21E95; Sat, 30 Nov 2019 05:57:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAU5vsqD050849; Sat, 30 Nov 2019 05:57:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAU5vsMU050848; Sat, 30 Nov 2019 05:57:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201911300557.xAU5vsMU050848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 30 Nov 2019 05:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355222 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 355222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 05:57:55 -0000 Author: delphij Date: Sat Nov 30 05:57:54 2019 New Revision: 355222 URL: https://svnweb.freebsd.org/changeset/base/355222 Log: Use strlcat(). MFC after: 2 weeks Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Sat Nov 30 05:43:24 2019 (r355221) +++ head/sbin/ipfw/dummynet.c Sat Nov 30 05:57:54 2019 (r355222) @@ -497,7 +497,7 @@ print_flowset_parms(struct dn_fs *fs, char *prefix) fs->max_th, 1.0 * fs->max_p / (double)(1 << SCALE_RED)); if (fs->flags & DN_IS_ECN) - strncat(red, " (ecn)", 6); + strlcat(red, " (ecn)", sizeof(red)); #ifdef NEW_AQM /* get AQM parameters */ } else if (fs->flags & DN_IS_AQM) { From owner-svn-src-head@freebsd.org Sat Nov 30 09:11:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EB4C1CD558; Sat, 30 Nov 2019 09:11:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Q5GT3zmrz3PSg; Sat, 30 Nov 2019 09:11:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C1982410C; Sat, 30 Nov 2019 09:11:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAU9BTFR066432; Sat, 30 Nov 2019 09:11:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAU9BSFU066428; Sat, 30 Nov 2019 09:11:28 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911300911.xAU9BSFU066428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 30 Nov 2019 09:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355224 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 355224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 09:11:29 -0000 Author: tsoome Date: Sat Nov 30 09:11:28 2019 New Revision: 355224 URL: https://svnweb.freebsd.org/changeset/base/355224 Log: loader.efi: efipart needs better support detecting nested partitions Just as disks can have nested partitions, the same happens with cd devices, so we need to detect device paths and make sure we will not mix the handles. To address this: we fetch handle array and create linked list of block devices. we walk the list and detect parent devices and set children pd_parent. for {fd, cd, hd}, we walk device list and pick up our devices and store to corresponding list. We make sure we store parent device first. For sorting we use 3 steps: We check for floppy, we check for cd and then everything else must be hd. In general, it seems the floppy devices have no parent. CD can have both parents and children (multiple boot entries, partitions from the hybrid disk image). Tested by: cross+freebsd@distal.com on Cisco UCS systems, C200 series (C220M5, C240M4). Also on MBP with UEFI 1.10 Reported by: Chriss Ross MFC after: 1w Differential Revision: https://reviews.freebsd.org/D22553 Modified: head/stand/efi/include/efidevp.h head/stand/efi/include/efilib.h head/stand/efi/libefi/devpath.c head/stand/efi/libefi/efipart.c Modified: head/stand/efi/include/efidevp.h ============================================================================== --- head/stand/efi/include/efidevp.h Sat Nov 30 06:02:13 2019 (r355223) +++ head/stand/efi/include/efidevp.h Sat Nov 30 09:11:28 2019 (r355224) @@ -288,6 +288,14 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_UTF8 \ { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } +/* Device Logical Unit SubType. */ +#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11 +typedef struct { + EFI_DEVICE_PATH Header; + /* Logical Unit Number for the interface. */ + UINT8 Lun; +} DEVICE_LOGICAL_UNIT_DEVICE_PATH; + #define MSG_SATA_DP 0x12 typedef struct _SATA_DEVICE_PATH { EFI_DEVICE_PATH Header; Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Sat Nov 30 06:02:13 2019 (r355223) +++ head/stand/efi/include/efilib.h Sat Nov 30 09:11:28 2019 (r355224) @@ -84,6 +84,7 @@ int efi_handle_update_dev(EFI_HANDLE, struct devsw *, EFI_DEVICE_PATH *efi_lookup_image_devpath(EFI_HANDLE); EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE); +void efi_close_devpath(EFI_HANDLE); EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); Modified: head/stand/efi/libefi/devpath.c ============================================================================== --- head/stand/efi/libefi/devpath.c Sat Nov 30 06:02:13 2019 (r355223) +++ head/stand/efi/libefi/devpath.c Sat Nov 30 09:11:28 2019 (r355224) @@ -67,6 +67,16 @@ efi_lookup_devpath(EFI_HANDLE handle) return (devpath); } +void +efi_close_devpath(EFI_HANDLE handle) +{ + EFI_STATUS status; + + status = BS->CloseProtocol(handle, &DevicePathGUID, IH, NULL); + if (EFI_ERROR(status)) + printf("CloseProtocol error: %lu\n", EFI_ERROR_CODE(status)); +} + static char * efi_make_tail(char *suffix) { Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Sat Nov 30 06:02:13 2019 (r355223) +++ head/stand/efi/libefi/efipart.c Sat Nov 30 09:11:28 2019 (r355224) @@ -44,9 +44,11 @@ __FBSDID("$FreeBSD$"); static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; +typedef bool (*pd_test_cb_t)(pdinfo_t *, pdinfo_t *); static int efipart_initfd(void); static int efipart_initcd(void); static int efipart_inithd(void); +static void efipart_cdinfo_add(pdinfo_t *); static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *); @@ -209,6 +211,123 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } +static pdinfo_t * +efipart_find_parent(pdinfo_list_t *pdi, EFI_DEVICE_PATH *devpath) +{ + pdinfo_t *pd; + EFI_DEVICE_PATH *parent; + + /* We want to find direct parent */ + parent = efi_devpath_trim(devpath); + /* We should not get out of memory here but be careful. */ + if (parent == NULL) + return (NULL); + + STAILQ_FOREACH(pd, pdi, pd_link) { + /* We must have exact match. */ + if (efi_devpath_match(pd->pd_devpath, parent)) + break; + } + free(parent); + return (pd); +} + +/* + * Return true when we should ignore this device. + */ +static bool +efipart_ignore_device(EFI_HANDLE h, EFI_BLOCK_IO *blkio, + EFI_DEVICE_PATH *devpath) +{ + EFI_DEVICE_PATH *node, *parent; + + /* + * We assume the block size 512 or greater power of 2. + * Also skip devices with block size > 64k (16 is max + * ashift supported by zfs). + * iPXE is known to insert stub BLOCK IO device with + * BlockSize 1. + */ + if (blkio->Media->BlockSize < 512 || + blkio->Media->BlockSize > (1 << 16) || + !powerof2(blkio->Media->BlockSize)) { + efi_close_devpath(h); + return (true); + } + + /* Allowed values are 0, 1 and power of 2. */ + if (blkio->Media->IoAlign > 1 && + !powerof2(blkio->Media->IoAlign)) { + efi_close_devpath(h); + return (true); + } + + /* + * With device tree setup: + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x1) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x2) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3)/CDROM.. + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3)/CDROM.. + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x4) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x5) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x6) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x7) + * + * In above exmple only Unit(0x3) has media, all other nodes are + * missing media and should not be used. + * + * No media does not always mean there is no device, but in above + * case, we can not really assume there is any device. + * Therefore, if this node is USB, or this node is Unit (LUN) and + * direct parent is USB and we have no media, we will ignore this + * device. + */ + + /* Do not ignore device with media. */ + if (blkio->Media->MediaPresent) + return (false); + + node = efi_devpath_last_node(devpath); + if (node == NULL) + return (false); + + /* USB without media present */ + if (DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_USB_DP) { + efi_close_devpath(h); + return (true); + } + + parent = efi_devpath_trim(devpath); + if (parent != NULL) { + bool parent_is_usb = false; + + node = efi_devpath_last_node(parent); + if (node == NULL) { + free(parent); + return (false); + } + if (DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_USB_DP) + parent_is_usb = true; + free(parent); + + /* no media, parent is USB and devicepath is lun. */ + node = efi_devpath_last_node(devpath); + if (node == NULL) + return (false); + if (parent_is_usb && + DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_DEVICE_LOGICAL_UNIT_DP) { + efi_close_devpath(h); + return (true); + } + } + return (false); +} + int efipart_inithandles(void) { @@ -256,25 +375,9 @@ efipart_inithandles(void) continue; } - /* - * We assume the block size 512 or greater power of 2. - * Also skip devices with block size > 64k (16 is max - * ashift supported by zfs). - * iPXE is known to insert stub BLOCK IO device with - * BlockSize 1. - */ - if (blkio->Media->BlockSize < 512 || - blkio->Media->BlockSize > (1 << 16) || - !powerof2(blkio->Media->BlockSize)) { + if (efipart_ignore_device(hin[i], blkio, devpath)) continue; - } - /* Allowed values are 0, 1 and power of 2. */ - if (blkio->Media->IoAlign > 1 && - !powerof2(blkio->Media->IoAlign)) { - continue; - } - /* This is bad. */ if ((pd = calloc(1, sizeof(*pd))) == NULL) { printf("efipart_inithandles: Out of memory.\n"); @@ -289,10 +392,32 @@ efipart_inithandles(void) STAILQ_INSERT_TAIL(&pdinfo, pd, pd_link); } + /* + * Walk pdinfo and set parents based on device path. + */ + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + pd->pd_parent = efipart_find_parent(&pdinfo, pd->pd_devpath); + } free(hin); return (0); } +/* + * Get node identified by pd_test() from plist. + */ +static pdinfo_t * +efipart_get_pd(pdinfo_list_t *plist, pd_test_cb_t pd_test, pdinfo_t *data) +{ + pdinfo_t *pd; + + STAILQ_FOREACH(pd, plist, pd_link) { + if (pd_test(pd, data)) + break; + } + + return (pd); +} + static ACPI_HID_DEVICE_PATH * efipart_floppy(EFI_DEVICE_PATH *node) { @@ -310,19 +435,19 @@ efipart_floppy(EFI_DEVICE_PATH *node) return (NULL); } -static pdinfo_t * -efipart_find_parent(pdinfo_list_t *pdi, EFI_DEVICE_PATH *devpath) +static bool +efipart_testfd(pdinfo_t *fd, pdinfo_t *data __unused) { - pdinfo_t *pd, *part; + EFI_DEVICE_PATH *node; - STAILQ_FOREACH(pd, pdi, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, devpath)) - return (pd); - part = efipart_find_parent(&pd->pd_part, devpath); - if (part != NULL) - return (part); - } - return (NULL); + node = efi_devpath_last_node(fd->pd_devpath); + if (node == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (true); + + return (false); } static int @@ -332,8 +457,7 @@ efipart_initfd(void) ACPI_HID_DEVICE_PATH *acpi; pdinfo_t *parent, *fd; -restart: - STAILQ_FOREACH(fd, &pdinfo, pd_link) { + while ((fd = efipart_get_pd(&pdinfo, efipart_testfd, NULL)) != NULL) { if ((node = efi_devpath_last_node(fd->pd_devpath)) == NULL) continue; @@ -341,7 +465,7 @@ restart: continue; STAILQ_REMOVE(&pdinfo, fd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, fd->pd_devpath); + parent = fd->pd_parent; if (parent != NULL) { STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); parent->pd_alias = fd->pd_handle; @@ -353,7 +477,6 @@ restart: } fd->pd_devsw = &efipart_fddev; STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link); - goto restart; } bcache_add_dev(efiblk_pdinfo_count(&fdinfo)); @@ -366,208 +489,136 @@ restart: static void efipart_cdinfo_add(pdinfo_t *cd) { - pdinfo_t *pd, *last; + pdinfo_t *parent, *pd, *last; - STAILQ_FOREACH(pd, &cdinfo, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, cd->pd_devpath)) { - last = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); - if (last != NULL) - cd->pd_unit = last->pd_unit + 1; - else - cd->pd_unit = 0; - cd->pd_parent = pd; - cd->pd_devsw = &efipart_cddev; - STAILQ_INSERT_TAIL(&pd->pd_part, cd, pd_link); - return; + if (cd == NULL) + return; + + parent = cd->pd_parent; + /* Make sure we have parent added */ + efipart_cdinfo_add(parent); + + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + if (efi_devpath_match(pd->pd_devpath, cd->pd_devpath)) { + STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); + break; } } + if (pd == NULL) { + /* This device is already added. */ + return; + } + if (parent != NULL) { + last = STAILQ_LAST(&parent->pd_part, pdinfo, pd_link); + if (last != NULL) + cd->pd_unit = last->pd_unit + 1; + else + cd->pd_unit = 0; + cd->pd_devsw = &efipart_cddev; + STAILQ_INSERT_TAIL(&parent->pd_part, cd, pd_link); + return; + } + last = STAILQ_LAST(&cdinfo, pdinfo, pd_link); if (last != NULL) cd->pd_unit = last->pd_unit + 1; else cd->pd_unit = 0; - cd->pd_parent = NULL; cd->pd_devsw = &efipart_cddev; STAILQ_INSERT_TAIL(&cdinfo, cd, pd_link); } static bool -efipart_testcd(EFI_DEVICE_PATH *node, EFI_BLOCK_IO *blkio) +efipart_testcd(pdinfo_t *cd, pdinfo_t *data __unused) { + EFI_DEVICE_PATH *node; + + node = efi_devpath_last_node(cd->pd_devpath); + if (node == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (false); + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_CDROM_DP) { return (true); } /* cd drive without the media. */ - if (blkio->Media->RemovableMedia && - !blkio->Media->MediaPresent) { + if (cd->pd_blkio->Media->RemovableMedia && + !cd->pd_blkio->Media->MediaPresent) { return (true); } return (false); } -static void -efipart_updatecd(void) +/* + * Test if pd is parent for device. + */ +static bool +efipart_testchild(pdinfo_t *dev, pdinfo_t *pd) { - EFI_DEVICE_PATH *devpath, *node; - EFI_STATUS status; - pdinfo_t *parent, *cd; + /* device with no parent. */ + if (dev->pd_parent == NULL) + return (false); -restart: - STAILQ_FOREACH(cd, &pdinfo, pd_link) { - if ((node = efi_devpath_last_node(cd->pd_devpath)) == NULL) - continue; - - if (efipart_floppy(node) != NULL) - continue; - - /* Is parent of this device already registered? */ - parent = efipart_find_parent(&cdinfo, cd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); - efipart_cdinfo_add(cd); - goto restart; - } - - if (!efipart_testcd(node, cd->pd_blkio)) - continue; - - /* Find parent and unlink both parent and cd from pdinfo */ - STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, cd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); - efipart_cdinfo_add(parent); - } - - if (parent == NULL) - parent = efipart_find_parent(&cdinfo, cd->pd_devpath); - - /* - * If we come across a logical partition of subtype CDROM - * it doesn't refer to the CD filesystem itself, but rather - * to any usable El Torito boot image on it. In this case - * we try to find the parent device and add that instead as - * that will be the CD filesystem. - */ - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_CDROM_DP && - parent == NULL) { - parent = calloc(1, sizeof(*parent)); - if (parent == NULL) { - printf("efipart_updatecd: out of memory\n"); - /* this device is lost but try again. */ - free(cd); - goto restart; - } - - devpath = efi_devpath_trim(cd->pd_devpath); - if (devpath == NULL) { - printf("efipart_updatecd: out of memory\n"); - /* this device is lost but try again. */ - free(parent); - free(cd); - goto restart; - } - parent->pd_devpath = devpath; - status = BS->LocateDevicePath(&blkio_guid, - &parent->pd_devpath, &parent->pd_handle); - free(devpath); - if (EFI_ERROR(status)) { - printf("efipart_updatecd: error %lu\n", - EFI_ERROR_CODE(status)); - free(parent); - free(cd); - goto restart; - } - parent->pd_devpath = - efi_lookup_devpath(parent->pd_handle); - efipart_cdinfo_add(parent); - } - - efipart_cdinfo_add(cd); - goto restart; + if (efi_devpath_match(dev->pd_parent->pd_devpath, pd->pd_devpath)) { + return (true); } + return (false); } static int efipart_initcd(void) { - efipart_updatecd(); + pdinfo_t *cd; + while ((cd = efipart_get_pd(&pdinfo, efipart_testcd, NULL)) != NULL) + efipart_cdinfo_add(cd); + + /* Find all children of CD devices we did add above. */ + STAILQ_FOREACH(cd, &cdinfo, pd_link) { + pdinfo_t *child; + + for (child = efipart_get_pd(&pdinfo, efipart_testchild, cd); + child != NULL; + child = efipart_get_pd(&pdinfo, efipart_testchild, cd)) + efipart_cdinfo_add(child); + } bcache_add_dev(efiblk_pdinfo_count(&cdinfo)); return (0); } -static bool +static void efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH *node) { - pdinfo_t *pd, *ptr; + pdinfo_t *parent, *ptr; if (node == NULL) - return (false); + return; - /* Find our disk device. */ - STAILQ_FOREACH(pd, &hdinfo, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, hd->pd_devpath)) - break; - } - if (pd == NULL) - return (false); - - /* If the node is not MEDIA_HARDDRIVE_DP, it is sub-partition. */ + parent = hd->pd_parent; + /* + * If the node is not MEDIA_HARDDRIVE_DP, it is sub-partition. + * This can happen with Vendor nodes, and since we do not know + * the more about those nodes, we just count them. + */ if (DevicePathSubType(node) != MEDIA_HARDDRIVE_DP) { - STAILQ_FOREACH(ptr, &pd->pd_part, pd_link) { - if (efi_devpath_is_prefix(ptr->pd_devpath, - hd->pd_devpath)) - break; - } - /* - * ptr == NULL means we have handles in unexpected order - * and we would need to re-order the partitions later. - */ + ptr = STAILQ_LAST(&parent->pd_part, pdinfo, pd_link); if (ptr != NULL) - pd = ptr; - } - - /* Add the partition. */ - if (DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { - hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; - } else { - ptr = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); - if (ptr != NULL) hd->pd_unit = ptr->pd_unit + 1; else hd->pd_unit = 0; + } else { + hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; } - hd->pd_parent = pd; - hd->pd_devsw = &efipart_hddev; - STAILQ_INSERT_TAIL(&pd->pd_part, hd, pd_link); - return (true); -} - -static void -efipart_hdinfo_add(pdinfo_t *hd, EFI_DEVICE_PATH *node) -{ - pdinfo_t *last; - - if (efipart_hdinfo_add_node(hd, node)) - return; - - last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); - if (last != NULL) - hd->pd_unit = last->pd_unit + 1; - else - hd->pd_unit = 0; - - /* Add the disk. */ hd->pd_devsw = &efipart_hddev; - STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); + STAILQ_INSERT_TAIL(&parent->pd_part, hd, pd_link); } /* @@ -640,96 +691,75 @@ efipart_hdinfo_add_filepath(pdinfo_t *hd, FILEPATH_DEV } static void -efipart_updatehd(void) +efipart_hdinfo_add(pdinfo_t *hd) { - EFI_DEVICE_PATH *devpath, *node; - EFI_STATUS status; - pdinfo_t *parent, *hd; + pdinfo_t *parent, *pd, *last; + EFI_DEVICE_PATH *node; -restart: - STAILQ_FOREACH(hd, &pdinfo, pd_link) { - if ((node = efi_devpath_last_node(hd->pd_devpath)) == NULL) - continue; + if (hd == NULL) + return; - if (efipart_floppy(node) != NULL) - continue; + parent = hd->pd_parent; + /* Make sure we have parent added */ + efipart_hdinfo_add(parent); - if (efipart_testcd(node, hd->pd_blkio)) - continue; - - if (DevicePathType(node) == HARDWARE_DEVICE_PATH && - (DevicePathSubType(node) == HW_PCI_DP || - DevicePathSubType(node) == HW_VENDOR_DP)) { + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + if (efi_devpath_match(pd->pd_devpath, hd->pd_devpath)) { STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - efipart_hdinfo_add(hd, NULL); - goto restart; + break; } + } + if (pd == NULL) { + /* This device is already added. */ + return; + } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_FILEPATH_DP) { - STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - efipart_hdinfo_add_filepath(hd, - (FILEPATH_DEVICE_PATH *)node); - goto restart; - } + if ((node = efi_devpath_last_node(hd->pd_devpath)) == NULL) + return; - STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, hd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); - efipart_hdinfo_add(parent, NULL); - } else { - parent = efipart_find_parent(&hdinfo, hd->pd_devpath); - } + if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_FILEPATH_DP) { + efipart_hdinfo_add_filepath(hd, + (FILEPATH_DEVICE_PATH *)node); + return; + } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_HARDDRIVE_DP && - parent == NULL) { - parent = calloc(1, sizeof(*parent)); - if (parent == NULL) { - printf("efipart_updatehd: out of memory\n"); - /* this device is lost but try again. */ - free(hd); - goto restart; - } + if (parent != NULL) { + efipart_hdinfo_add_node(hd, node); + return; + } - devpath = efi_devpath_trim(hd->pd_devpath); - if (devpath == NULL) { - printf("efipart_updatehd: out of memory\n"); - /* this device is lost but try again. */ - free(parent); - free(hd); - goto restart; - } + last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); + if (last != NULL) + hd->pd_unit = last->pd_unit + 1; + else + hd->pd_unit = 0; - parent->pd_devpath = devpath; - status = BS->LocateDevicePath(&blkio_guid, - &parent->pd_devpath, &parent->pd_handle); - free(devpath); - if (EFI_ERROR(status)) { - printf("efipart_updatehd: error %lu\n", - EFI_ERROR_CODE(status)); - free(parent); - free(hd); - goto restart; - } + /* Add the disk. */ + hd->pd_devsw = &efipart_hddev; + STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); +} - parent->pd_devpath = - efi_lookup_devpath(&parent->pd_handle); +static bool +efipart_testhd(pdinfo_t *hd, pdinfo_t *data __unused) +{ + if (efipart_testfd(hd, NULL)) + return (false); - efipart_hdinfo_add(parent, NULL); - } + if (efipart_testcd(hd, NULL)) + return (false); - efipart_hdinfo_add(hd, node); - goto restart; - } + /* Anything else must be HD. */ + return (true); } static int efipart_inithd(void) { + pdinfo_t *hd; - efipart_updatehd(); + while ((hd = efipart_get_pd(&pdinfo, efipart_testhd, NULL)) != NULL) + efipart_hdinfo_add(hd); bcache_add_dev(efiblk_pdinfo_count(&hdinfo)); return (0); From owner-svn-src-head@freebsd.org Sat Nov 30 14:17:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59FE91ACC54; Sat, 30 Nov 2019 14:17:46 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QD3t1k5Dz477G; Sat, 30 Nov 2019 14:17:46 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F42A27823; Sat, 30 Nov 2019 14:17:46 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUEHkF7043070; Sat, 30 Nov 2019 14:17:46 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUEHjaO043069; Sat, 30 Nov 2019 14:17:45 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201911301417.xAUEHjaO043069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 30 Nov 2019 14:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355225 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 355225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 14:17:46 -0000 Author: bcr (doc committer) Date: Sat Nov 30 14:17:45 2019 New Revision: 355225 URL: https://svnweb.freebsd.org/changeset/base/355225 Log: Capitalize some user-visible output messages in the bectl utility. No functional changes. Approved by: imp@ MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D22330 Modified: head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Sat Nov 30 09:11:28 2019 (r355224) +++ head/sbin/bectl/bectl.c Sat Nov 30 14:17:45 2019 (r355225) @@ -68,7 +68,7 @@ usage(bool explicit) fp = explicit ? stdout : stderr; fprintf(fp, "%s", - "usage:\tbectl {-h | -? | subcommand [args...]}\n" + "Usage:\tbectl {-h | -? | subcommand [args...]}\n" #if SOON "\tbectl add (path)*\n" #endif @@ -167,10 +167,10 @@ bectl_cmd_activate(int argc, char *argv[]) /* activate logic goes here */ if ((err = be_activate(be, argv[0], temp)) != 0) /* XXX TODO: more specific error msg based on err */ - printf("did not successfully activate boot environment %s\n", + printf("Did not successfully activate boot environment %s\n", argv[0]); else - printf("successfully activated boot environment %s\n", argv[0]); + printf("Successfully activated boot environment %s\n", argv[0]); if (temp) printf("for next boot\n"); @@ -250,14 +250,14 @@ bectl_cmd_create(int argc, char *argv[]) default: if (atpos != NULL) fprintf(stderr, - "failed to create a snapshot '%s' of '%s'\n", + "Failed to create a snapshot '%s' of '%s'\n", atpos, bootenv); else if (snapname == NULL) fprintf(stderr, - "failed to create bootenv %s\n", bootenv); + "Failed to create bootenv %s\n", bootenv); else fprintf(stderr, - "failed to create bootenv %s from snapshot %s\n", + "Failed to create bootenv %s from snapshot %s\n", bootenv, snapname); } @@ -424,12 +424,12 @@ bectl_cmd_mount(int argc, char *argv[]) switch (err) { case BE_ERR_SUCCESS: - printf("successfully mounted %s at %s\n", bootenv, result_loc); + printf("Successfully mounted %s at %s\n", bootenv, result_loc); break; default: fprintf(stderr, - (argc == 3) ? "failed to mount bootenv %s at %s\n" : - "failed to mount bootenv %s at temporary path %s\n", + (argc == 3) ? "Failed to mount bootenv %s at %s\n" : + "Failed to mount bootenv %s at temporary path %s\n", bootenv, mountpoint); } @@ -462,7 +462,7 @@ bectl_cmd_rename(int argc, char *argv[]) case BE_ERR_SUCCESS: break; default: - fprintf(stderr, "failed to rename bootenv %s to %s\n", + fprintf(stderr, "Failed to rename bootenv %s to %s\n", src, dest); } @@ -507,7 +507,7 @@ bectl_cmd_unmount(int argc, char *argv[]) case BE_ERR_SUCCESS: break; default: - fprintf(stderr, "failed to unmount bootenv %s\n", bootenv); + fprintf(stderr, "Failed to unmount bootenv %s\n", bootenv); } return (err); @@ -563,7 +563,7 @@ main(int argc, char *argv[]) return (usage(true)); if ((cmd = get_cmd_info(command)) == NULL) { - fprintf(stderr, "unknown command: %s\n", command); + fprintf(stderr, "Unknown command: %s\n", command); return (usage(false)); } From owner-svn-src-head@freebsd.org Sat Nov 30 16:40:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04CCA1B03A3; Sat, 30 Nov 2019 16:40:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QHDJ6M2pz4D18; Sat, 30 Nov 2019 16:40:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD7C31160; Sat, 30 Nov 2019 16:40:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUGeGfd024993; Sat, 30 Nov 2019 16:40:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUGeG6C024992; Sat, 30 Nov 2019 16:40:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301640.xAUGeG6C024992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 16:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355226 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 16:40:17 -0000 Author: mjg Date: Sat Nov 30 16:40:16 2019 New Revision: 355226 URL: https://svnweb.freebsd.org/changeset/base/355226 Log: vfs: swap placement between v_type and v_tag The former is frequently accessed (e.g., in vfs_cache_lookup) and shares the cacheline with v_usecount, avoidably adding to cache misses during concurrent lookup. The latter is almost unused and probably can get garbage-collected. The struct does not change in size despite enum vs char * discrepancy. On 64-bit archs there used to be 4 bytes padding after v_type giving 480 bytes in total. Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Nov 30 14:17:45 2019 (r355225) +++ head/sys/sys/vnode.h Sat Nov 30 16:40:16 2019 (r355226) @@ -103,7 +103,7 @@ struct vnode { * Fields which define the identity of the vnode. These fields are * owned by the filesystem (XXX: and vgone() ?) */ - const char *v_tag; /* u type of underlying data */ + enum vtype v_type; /* u vnode type */ struct vop_vector *v_op; /* u vnode operations vector */ void *v_data; /* u private data for fs */ @@ -173,7 +173,7 @@ struct vnode { int v_writecount; /* I ref count of writers or (negative) text users */ u_int v_hash; - enum vtype v_type; /* u vnode type */ + const char *v_tag; /* u type of underlying data */ }; #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ From owner-svn-src-head@freebsd.org Sat Nov 30 16:41:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D2AC1B05C7; Sat, 30 Nov 2019 16:41:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QHG43j7nz4DJx; Sat, 30 Nov 2019 16:41:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62E9D12E7; Sat, 30 Nov 2019 16:41:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUGfmrt029300; Sat, 30 Nov 2019 16:41:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUGfmMt029299; Sat, 30 Nov 2019 16:41:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301641.xAUGfmMt029299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 16:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355227 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 355227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 16:41:48 -0000 Author: mjg Date: Sat Nov 30 16:41:47 2019 New Revision: 355227 URL: https://svnweb.freebsd.org/changeset/base/355227 Log: tmpfs: add fast path to tmpfs_access for common case lookup VEXEC consists of vast majority of all calls and almost all targets have at least 0111. Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:40:16 2019 (r355226) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:41:47 2019 (r355227) @@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v) node = VP_TO_TMPFS_NODE(vp); + /* + * Common case path lookup. + */ + if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111)) + return (0); + switch (vp->v_type) { case VDIR: /* FALLTHROUGH */ From owner-svn-src-head@freebsd.org Sat Nov 30 16:46:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15F3F1B06BF; Sat, 30 Nov 2019 16:46:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QHMJ6pGzz4DVL; Sat, 30 Nov 2019 16:46:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE5E9132D; Sat, 30 Nov 2019 16:46:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUGkKZg030907; Sat, 30 Nov 2019 16:46:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUGkJxw030903; Sat, 30 Nov 2019 16:46:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301646.xAUGkJxw030903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 16:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355228 - in head/sys: fs/devfs kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/devfs kern X-SVN-Commit-Revision: 355228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 16:46:21 -0000 Author: mjg Date: Sat Nov 30 16:46:19 2019 New Revision: 355228 URL: https://svnweb.freebsd.org/changeset/base/355228 Log: devfs: introduce a per-dev lock to protect ->si_devsw This allows bumping threadcount without taking the global devmtx lock. In particular this eliminates contention on said lock while using bhyve with multiple vms. Reviewed by: kib Tested by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22548 Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_int.h head/sys/kern/kern_conf.c head/sys/kern/subr_witness.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Sat Nov 30 16:41:47 2019 (r355227) +++ head/sys/fs/devfs/devfs_devs.c Sat Nov 30 16:46:19 2019 (r355228) @@ -138,6 +138,8 @@ devfs_alloc(int flags) if (cdp == NULL) return (NULL); + mtx_init(&cdp->cdp_threadlock, "devthrd", NULL, MTX_DEF); + cdp->cdp_dirents = &cdp->cdp_dirent0; cdev = &cdp->cdp_c; @@ -180,6 +182,7 @@ devfs_free(struct cdev *cdev) devfs_free_cdp_inode(cdp->cdp_inode); if (cdp->cdp_maxdirent > 0) free(cdp->cdp_dirents, M_DEVFS2); + mtx_destroy(&cdp->cdp_threadlock); free(cdp, M_CDEVP); } Modified: head/sys/fs/devfs/devfs_int.h ============================================================================== --- head/sys/fs/devfs/devfs_int.h Sat Nov 30 16:41:47 2019 (r355227) +++ head/sys/fs/devfs/devfs_int.h Sat Nov 30 16:46:19 2019 (r355228) @@ -70,6 +70,8 @@ struct cdev_priv { void *cdp_dtr_cb_arg; LIST_HEAD(, cdev_privdata) cdp_fdpriv; + + struct mtx cdp_threadlock; }; #define cdev2priv(c) __containerof(c, struct cdev_priv, cdp_c) Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Nov 30 16:41:47 2019 (r355227) +++ head/sys/kern/kern_conf.c Sat Nov 30 16:46:19 2019 (r355228) @@ -186,16 +186,16 @@ dev_refthread(struct cdev *dev, int *ref) *ref = 0; return (dev->si_devsw); } - dev_lock(); + cdp = cdev2priv(dev); + mtx_lock(&cdp->cdp_threadlock); csw = dev->si_devsw; if (csw != NULL) { - cdp = cdev2priv(dev); if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) atomic_add_long(&dev->si_threadcount, 1); else csw = NULL; } - dev_unlock(); + mtx_unlock(&cdp->cdp_threadlock); if (csw != NULL) *ref = 1; return (csw); @@ -223,19 +223,21 @@ devvn_refthread(struct vnode *vp, struct cdev **devp, } csw = NULL; - dev_lock(); + VI_LOCK(vp); dev = vp->v_rdev; if (dev == NULL) { - dev_unlock(); + VI_UNLOCK(vp); return (NULL); } cdp = cdev2priv(dev); + mtx_lock(&cdp->cdp_threadlock); if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) { csw = dev->si_devsw; if (csw != NULL) atomic_add_long(&dev->si_threadcount, 1); } - dev_unlock(); + mtx_unlock(&cdp->cdp_threadlock); + VI_UNLOCK(vp); if (csw != NULL) { *devp = dev; *ref = 1; @@ -1136,20 +1138,26 @@ destroy_devl(struct cdev *dev) dev->si_flags &= ~SI_CLONELIST; } + mtx_lock(&cdp->cdp_threadlock); csw = dev->si_devsw; dev->si_devsw = NULL; /* already NULL for SI_ALIAS */ while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) { csw->d_purge(dev); + mtx_unlock(&cdp->cdp_threadlock); msleep(csw, &devmtx, PRIBIO, "devprg", hz/10); + mtx_lock(&cdp->cdp_threadlock); if (dev->si_threadcount) printf("Still %lu threads in %s\n", dev->si_threadcount, devtoname(dev)); } while (dev->si_threadcount != 0) { /* Use unique dummy wait ident */ + mtx_unlock(&cdp->cdp_threadlock); msleep(&csw, &devmtx, PRIBIO, "devdrn", hz / 10); + mtx_lock(&cdp->cdp_threadlock); } + mtx_unlock(&cdp->cdp_threadlock); dev_unlock(); if ((cdp->cdp_flags & CDP_UNREF_DTR) == 0) { /* avoid out of order notify events */ Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sat Nov 30 16:41:47 2019 (r355227) +++ head/sys/kern/subr_witness.c Sat Nov 30 16:46:19 2019 (r355228) @@ -602,6 +602,7 @@ static struct witness_order_list_entry order_lists[] = { "vm map (system)", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { "cdev", &lock_class_mtx_sleep }, + { "devthrd", &lock_class_mtx_sleep }, { NULL, NULL }, /* * VM From owner-svn-src-head@freebsd.org Sat Nov 30 17:22:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C6EE1B15B0; Sat, 30 Nov 2019 17:22:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QJ8g3DCqz4Fv7; Sat, 30 Nov 2019 17:22:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 524421A29; Sat, 30 Nov 2019 17:22:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUHMB0A054172; Sat, 30 Nov 2019 17:22:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUHMAsx054170; Sat, 30 Nov 2019 17:22:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301722.xAUHMAsx054170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 17:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355230 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 17:22:11 -0000 Author: mjg Date: Sat Nov 30 17:22:10 2019 New Revision: 355230 URL: https://svnweb.freebsd.org/changeset/base/355230 Log: Add a way to inject fences using IPIs A variant of this facility was already used by rmlocks where IPIs would enforce ordering. This allows to elide fences where they are rarely needed and the cost of IPI (should it be necessary) is cheaper. Reviewed by: kib, jeff (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21740 Modified: head/sys/kern/subr_smp.c head/sys/sys/smp.h Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat Nov 30 16:59:29 2019 (r355229) +++ head/sys/kern/subr_smp.c Sat Nov 30 17:22:10 2019 (r355230) @@ -929,6 +929,66 @@ quiesce_all_cpus(const char *wmesg, int prio) return quiesce_cpus(all_cpus, wmesg, prio); } +/* + * Observe all CPUs not executing in critical section. + * We are not in one so the check for us is safe. If the found + * thread changes to something else we know the section was + * exited as well. + */ +void +quiesce_all_critical(void) +{ + struct thread *td, *newtd; + struct pcpu *pcpu; + int cpu; + + MPASS(curthread->td_critnest == 0); + + CPU_FOREACH(cpu) { + pcpu = cpuid_to_pcpu[cpu]; + td = pcpu->pc_curthread; + for (;;) { + if (td->td_critnest == 0) + break; + cpu_spinwait(); + newtd = (struct thread *) + atomic_load_acq_ptr((u_long *)pcpu->pc_curthread); + if (td != newtd) + break; + } + } +} + +static void +cpus_fence_seq_cst_issue(void *arg __unused) +{ + + atomic_thread_fence_seq_cst(); +} + +/* + * Send an IPI forcing a sequentially consistent fence. + * + * Allows replacement of an explicitly fence with a compiler barrier. + * Trades speed up during normal execution for a significant slowdown when + * the barrier is needed. + */ +void +cpus_fence_seq_cst(void) +{ + +#ifdef SMP + smp_rendezvous( + smp_no_rendezvous_barrier, + cpus_fence_seq_cst_issue, + smp_no_rendezvous_barrier, + NULL + ); +#else + cpus_fence_seq_cst_issue(NULL); +#endif +} + /* Extra care is taken with this sysctl because the data type is volatile */ static int sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS) Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Sat Nov 30 16:59:29 2019 (r355229) +++ head/sys/sys/smp.h Sat Nov 30 17:22:10 2019 (r355230) @@ -264,6 +264,8 @@ extern struct mtx smp_ipi_mtx; int quiesce_all_cpus(const char *, int); int quiesce_cpus(cpuset_t, const char *, int); +void quiesce_all_critical(void); +void cpus_fence_seq_cst(void); void smp_no_rendezvous_barrier(void *); void smp_rendezvous(void (*)(void *), void (*)(void *), From owner-svn-src-head@freebsd.org Sat Nov 30 17:24:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 224E01B1687; Sat, 30 Nov 2019 17:24:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QJCb03LMz4G9j; Sat, 30 Nov 2019 17:24:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6841A4E; Sat, 30 Nov 2019 17:24:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUHOgFO054318; Sat, 30 Nov 2019 17:24:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUHOg42054317; Sat, 30 Nov 2019 17:24:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301724.xAUHOg42054317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 17:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355231 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 17:24:43 -0000 Author: mjg Date: Sat Nov 30 17:24:42 2019 New Revision: 355231 URL: https://svnweb.freebsd.org/changeset/base/355231 Log: lockprof: use IPI-injecetd fences to fix hangs on stat dump and reset The previously used quiesce_all_cpus walks all CPUs and waits until curthread can run on them. Even on contemporary machines this becomes a significant problem under load when it can literally take minutes for the operation to complete. With the patch the stall is normally less than 1 second. Reviewed by: kib, jeff (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21740 Modified: head/sys/kern/subr_lock.c Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sat Nov 30 17:22:10 2019 (r355230) +++ head/sys/kern/subr_lock.c Sat Nov 30 17:24:42 2019 (r355231) @@ -324,8 +324,14 @@ lock_prof_reset(void) atomic_store_rel_int(&lock_prof_resetting, 1); enabled = lock_prof_enable; lock_prof_enable = 0; - quiesce_all_cpus("profreset", 0); /* + * This both publishes lock_prof_enable as disabled and makes sure + * everyone else reads it if they are not far enough. We wait for the + * rest down below. + */ + cpus_fence_seq_cst(); + quiesce_all_critical(); + /* * Some objects may have migrated between CPUs. Clear all links * before we zero the structures. Some items may still be linked * into per-thread lists as well. @@ -343,6 +349,9 @@ lock_prof_reset(void) lock_prof_init_type(&lpc->lpc_types[0]); lock_prof_init_type(&lpc->lpc_types[1]); } + /* + * Paired with the fence from cpus_fence_seq_cst() + */ atomic_store_rel_int(&lock_prof_resetting, 0); lock_prof_enable = enabled; } @@ -433,12 +442,17 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); enabled = lock_prof_enable; lock_prof_enable = 0; - quiesce_all_cpus("profstat", 0); + /* + * See the comment in lock_prof_reset + */ + cpus_fence_seq_cst(); + quiesce_all_critical(); t = ticks; CPU_FOREACH(cpu) { lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[0], sb, 0, t); lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[1], sb, 1, t); } + atomic_thread_fence_rel(); lock_prof_enable = enabled; error = sbuf_finish(sb); @@ -591,6 +605,10 @@ lock_profile_obtain_lock_success(struct lock_object *l else l->lpo_waittime = 0; out: + /* + * Paired with cpus_fence_seq_cst(). + */ + atomic_thread_fence_rel(); critical_exit(); } @@ -677,6 +695,10 @@ release: type = &LP_CPU_SELF->lpc_types[spin]; LIST_INSERT_HEAD(&type->lpt_lpoalloc, l, lpo_link); out: + /* + * Paired with cpus_fence_seq_cst(). + */ + atomic_thread_fence_rel(); critical_exit(); } From owner-svn-src-head@freebsd.org Sat Nov 30 17:30:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 528FB1B177A; Sat, 30 Nov 2019 17:30:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QJKk1XQCz4GJg; Sat, 30 Nov 2019 17:30:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 173151A54; Sat, 30 Nov 2019 17:30:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUHU14D054617; Sat, 30 Nov 2019 17:30:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUHU1jH054616; Sat, 30 Nov 2019 17:30:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301730.xAUHU1jH054616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 17:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355232 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 355232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 17:30:02 -0000 Author: mjg Date: Sat Nov 30 17:30:01 2019 New Revision: 355232 URL: https://svnweb.freebsd.org/changeset/base/355232 Log: ldconfig: fetch hw.machine_arch only once This happens to be of significance with poudriere which runs the script a lot when installing packages. Modified: head/libexec/rc/rc.d/ldconfig Modified: head/libexec/rc/rc.d/ldconfig ============================================================================== --- head/libexec/rc/rc.d/ldconfig Sat Nov 30 17:24:42 2019 (r355231) +++ head/libexec/rc/rc.d/ldconfig Sat Nov 30 17:30:01 2019 (r355232) @@ -40,7 +40,9 @@ ldconfig_start() check_startmsgs && echo 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} - case `sysctl -n hw.machine_arch` in + machine_arch=$(sysctl -n hw.machine_arch) + + case ${machine_arch} in amd64|mips64|powerpc64) for i in ${ldconfig_local32_dirs}; do if [ -d "${i}" ]; then @@ -62,7 +64,7 @@ ldconfig_start() ;; esac - case `sysctl -n hw.machine_arch` in + case ${machine_arch} in armv[67]) for i in ${ldconfig_localsoft_dirs}; do if [ -d "${i}" ]; then @@ -85,7 +87,7 @@ ldconfig_start() esac # Legacy aout support for i386 only - case `sysctl -n hw.machine_arch` in + case ${machine_arch} in i386) # Default the a.out ldconfig path. : ${ldconfig_paths_aout=${ldconfig_paths}} From owner-svn-src-head@freebsd.org Sat Nov 30 17:47:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4859C1B1D7B; Sat, 30 Nov 2019 17:47:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QJjR1b7xz4H3v; Sat, 30 Nov 2019 17:47:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pj1-x1033.google.com with SMTP id t21so1959311pjq.1; Sat, 30 Nov 2019 09:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n4AheOi4p6r1voOPPNPTe5DU/kSO9xxF+E2DK8kYd8I=; b=FdFrL6rvaOCcu4FgaduozKGr6tbGYEtPzLQ7aE8qbiWy0W7eZQZVLVJkZe6+3ycop8 B7AAFVvLsQ0ZxyS01CxgL7O4aaKE3F0rrxuiiQ/2LLq+nmv7p2fq9MRyAwpgol4HEZep aWpema+zk/lRKfld+ZFy2MBSRk2h7qklJse/XfPGwF7kHIS6hCRfwcgWRQCgzYMQjiJv kU/WPx5dPVO6FF0McmahV3UCWxegyELdOz34cIDnfphrfTejJ7IExeUeb3nMA/t7JdeN p3F9HBOoUwXQKoiUlTBQ9yfl3JyGTQEEbDw3sgAzY7yKrPp54f09jvlQPOqgNJuK75/r 4fmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n4AheOi4p6r1voOPPNPTe5DU/kSO9xxF+E2DK8kYd8I=; b=tbaTPdo4u7eZjmLBXs+zBuaJ7wkRsM0Rk6PwKbrdtARdrTrVBBsNgF3BO2YwZQJim7 4X7hWkLWzok8ISC2Nhj7SjZy+vgHvQCKQmFbKYDuWWm7Ya9GbbdLMil71eseoSLXXL10 zhe1e/gOSOkSSZ2C+5TBVbSMYNGD4e+65diFcV7Xk3vO4YE0p89qcGPtmv26x+VLH/lP zBh/khM+v+/tIbCfBbu4b+pCyO21gxVwOi5H06elcf2vAEf37TZjKOiqBi994LVmHN+D SQr4V8Sgd/YGEqm+T4mVZa5VPbxTHyuYs9xjJyxoEgDDPXF5I2GEggwFXsRmqmF+saem pBGQ== X-Gm-Message-State: APjAAAVguOWIPH0t5NbKaR1daWGF5xSLcdKTsGH3Rb/QCGDj42GMrgvo I8WM50KOqX5IngpSjiv0UIC8Plr7VTc= X-Google-Smtp-Source: APXvYqz+abkRaXX7ZLgbex7Z9n8pbRA4wZHCyarfRmbtGm0EK+ZhDSZehe8mFNeGBHwEyLWHMfoJuw== X-Received: by 2002:a17:902:7892:: with SMTP id q18mr20080475pll.171.1575136019941; Sat, 30 Nov 2019 09:46:59 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k19sm11299981pfg.132.2019.11.30.09.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Nov 2019 09:46:59 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm From: Enji Cooper In-Reply-To: <201911280232.xAS2WHtb029602@repo.freebsd.org> Date: Sat, 30 Nov 2019 09:46:58 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> References: <201911280232.xAS2WHtb029602@repo.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47QJjR1b7xz4H3v X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FdFrL6rv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::1033 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[228.52.19.73.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 17:47:08 -0000 > On Nov 27, 2019, at 6:32 PM, Scott Long wrote: >=20 > Author: scottl > Date: Thu Nov 28 02:32:17 2019 > New Revision: 355164 > URL: https://svnweb.freebsd.org/changeset/base/355164 >=20 > Log: > Remove the trm(4) driver >=20 > Differential Revision: https://reviews.freebsd.org/D22575 Hi Scott, I believe this driver was removed because it was impacts the CAM = GIANT lock removal effort =E2=80=94 is that true (I=E2=80=99m asking = because the =E2=80=9Cwhy=E2=80=9D behind the removal is unclear)? Thanks! -Enji= From owner-svn-src-head@freebsd.org Sat Nov 30 18:03:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6515D1B255B for ; Sat, 30 Nov 2019 18:03:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QK4J4H8wz4J82 for ; Sat, 30 Nov 2019 18:03:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id g15so546257qka.8 for ; Sat, 30 Nov 2019 10:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVg4ek9i88bEOU/PXBtOKg2+bFaP7WlUcoBgixDxgY4=; b=AdLzZHylCa+yo6UH4yw2itgmnKlNMXIal2bLUQf8XaZ6yXfnPt5wt7psWI/69eWcZK pXF2ewjuXvps6j800/nJAhFdH/d36qn773yl+R5ERyUFX7LlRyKKLyf7SzW8AhnBkrL8 3liMf//MiAI4858KsWc5bMmubVSMtlyWmCSMlHLk8HkmeOqhPekheMDArCI67kZbxBto jBCxXZ/yuNfb7tlh0n1LMPOSsz0g7oEJUs/3UnCykpMIchew0ksADVz7LRH9dN6LYxP5 PFm5gB5jE+i0S5bbhr5GOh9O8+iomvdK+wPZK+pQm6wgzoEsuCsC6/XkLbodEt/gVpiK b2uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DVg4ek9i88bEOU/PXBtOKg2+bFaP7WlUcoBgixDxgY4=; b=tRo6SDmoh7nXqSgR5Snxt5JIhE59BG/IvFj1J6H4kvQWqwIr/3Wc3hYef6u5UDNZb3 wOyQnMezpfETa2vsKWd5pGiP/f50prqXluDFbj401bxqVn7lf1Q1vFwf9i/TDEMCscBp 0HVCWjKhdkWDQhES9VUzLHaa4k/V2ZrRIAkKUC1zH72IABAF3DCAGfTAh8YSxiAacoZ8 j7UxbXVigoR5UAgoTyXLy5ksO7tiE7uP/CxrbJG4zJ4DsjNFl9VOpNsKUcg9eTM5n0of 3eO5KtgUmJNNfTHZAGlv4PDod5spuv4eVHPoiAiOV2NUtLJv9LLuKnXJB/3wVZ6B4KpC DdOQ== X-Gm-Message-State: APjAAAWcJ+klThLwI7TsQejhqzgnqwe3D3LidoLDNqa1V8GuetmJyrWa T+cT+Ax9zaTcy3OO0NhaGUvSj6HT3J80gpXOQPQRug== X-Google-Smtp-Source: APXvYqzf/mCKT5h4LJEQ/Ylg1H+GuyFkDeGHVcuzr69OSIRPjH/wRwwCWQLjVS9yvF30TGgMnhm/MgecGMrIK8LB92E= X-Received: by 2002:a05:620a:144:: with SMTP id e4mr22136742qkn.240.1575137007237; Sat, 30 Nov 2019 10:03:27 -0800 (PST) MIME-Version: 1.0 References: <201911280232.xAS2WHtb029602@repo.freebsd.org> <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> In-Reply-To: <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> From: Warner Losh Date: Sat, 30 Nov 2019 11:03:16 -0700 Message-ID: Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm To: Enji Cooper Cc: Scott Long , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47QK4J4H8wz4J82 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=AdLzZHyl; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72e) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[e.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.70)[ip: (-9.28), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 18:03:29 -0000 On Sat, Nov 30, 2019 at 10:47 AM Enji Cooper wrote: > > > On Nov 27, 2019, at 6:32 PM, Scott Long wrote: > > > > Author: scottl > > Date: Thu Nov 28 02:32:17 2019 > > New Revision: 355164 > > URL: https://svnweb.freebsd.org/changeset/base/355164 > > > > Log: > > Remove the trm(4) driver > > > > Differential Revision: https://reviews.freebsd.org/D22575 > > Hi Scott, > I believe this driver was removed because it was impacts the CAM > GIANT lock removal effort =E2=80=94 is that true (I=E2=80=99m asking beca= use the =E2=80=9Cwhy=E2=80=9D > behind the removal is unclear)? > Hi Enji, We're trying hard to get rid of all Giant-locked drivers in the tree, either by updating or removal. Since sym(4) provides a super-set of trm(4) and we have recent-ish reports of sym(4) working, it makes sense to trim this driver from the tree. The specific cards it supports aren't all that popular, the couple-extra features that trm(4) gave over sym(4) aren't really that relevant today, and it's been years since trm has had good testing and maintenance. Warner From owner-svn-src-head@freebsd.org Sat Nov 30 18:58:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7B9F1B39C2; Sat, 30 Nov 2019 18:58:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLHx47QTz4LQh; Sat, 30 Nov 2019 18:58:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x544.google.com with SMTP id x8so2319205pgk.8; Sat, 30 Nov 2019 10:58:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Mnh4c+q4dZya/GwefBmzKqoffPevgGp8ZGsnMmWiXWM=; b=cL05zBcSSSNhzXEpuDTNWE6mRNiUvTsoh0r1SGQw7QeZUWWWHrD6f0tbvCeVH+cVfH jK+9rWjeRkhdp5NdRovbqyGU4CDyprAUlMdEWfvI1fzf3pW5z2w9UdMYGT8q5b9KR6+R W5wQ80Fd0XZj3EzuxVAqOgxaPMc8TTDa0qsg8cK3jZG216RUfi8DO2QNgT0l2zuc1bx2 PJC/TncoqFIgxTT+CxeuTJWszDYOTpdDQIgAvVBhNghkpSjqvNOpblfGMQB/oY5bYCCy OBJeDyQDXXpHbWifR8Wm1oMiNrRr10qm99d2Y5L5AdzQLpQLN7dZqupNmTv+u0/N9hMu p//Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Mnh4c+q4dZya/GwefBmzKqoffPevgGp8ZGsnMmWiXWM=; b=jmkg20giJfnXiycIt+ExJA+LdYXd70OxTJCYKanIR+dx9d5p753Rdrg+7wBl3J/RSP HNMF9FSnqsAL3po8C3WxAmVVL++WvoSITkCb/K+Pnd4CKbBLRmQZjc9dsCVtLzPhrEvm g+O/IEJaHfYDILS/+23J5NB39M58VToHE6v02ABl3hL0Q8lcgx/HRJa2l///qy/C75Kc /Cwm9ivKipPc6U+ioc9jZv8BaDmLI70dDO8GU413MUj+lblJmYFgTnhmuW2oGHq+vmf5 lCy4ozt57CIcdXm97DvcLgCevLqpjdD54RClqIAsptnvaxTqfyIkqfryCJvE8GXNbrUL 9fRA== X-Gm-Message-State: APjAAAUFG85KfGUQSYFsJ2rbSgHzsxKS1DWE1q7oZnALcPTD8N55jKO+ I5qSUXX8aT4yAAW5JjFop6V73M7UujE= X-Google-Smtp-Source: APXvYqzGOgCucqr1Fdr9iU9y2Kl+9ySxaMVjUc3sfkkAP7S1hMXmUMSkEeXFWcmV+Tm81Wmi406g0w== X-Received: by 2002:a63:1624:: with SMTP id w36mr21553615pgl.404.1575140315803; Sat, 30 Nov 2019 10:58:35 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id g7sm29945606pfq.33.2019.11.30.10.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Nov 2019 10:58:35 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm Date: Sat, 30 Nov 2019 10:58:34 -0800 In-Reply-To: Cc: Scott Long , src-committers , svn-src-all , svn-src-head To: Warner Losh References: <201911280232.xAS2WHtb029602@repo.freebsd.org> <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47QLHx47QTz4LQh X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cL05zBcS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::544 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[228.52.19.73.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-0.52), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[4.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 18:58:38 -0000 > On Nov 30, 2019, at 10:03 AM, Warner Losh wrote: >=20 >=20 >=20 > On Sat, Nov 30, 2019 at 10:47 AM Enji Cooper > wrote: >=20 > > On Nov 27, 2019, at 6:32 PM, Scott Long wrote: > >=20 > > Author: scottl > > Date: Thu Nov 28 02:32:17 2019 > > New Revision: 355164 > > URL: https://svnweb.freebsd.org/changeset/base/355164 = > >=20 > > Log: > > Remove the trm(4) driver > >=20 > > Differential Revision: https://reviews.freebsd.org/D22575 = >=20 > Hi Scott, > I believe this driver was removed because it was impacts the = CAM GIANT lock removal effort =E2=80=94 is that true (I=E2=80=99m asking = because the =E2=80=9Cwhy=E2=80=9D behind the removal is unclear)? >=20 > Hi Enji, >=20 > We're trying hard to get rid of all Giant-locked drivers in the tree, = either by updating or removal. Since sym(4) provides a super-set of = trm(4) and we have recent-ish reports of sym(4) working, it makes sense = to trim this driver from the tree. The specific cards it supports aren't = all that popular, the couple-extra features that trm(4) gave over sym(4) = aren't really that relevant today, and it's been years since trm has had = good testing and maintenance. Warner, Thanks so very much for the info :). Glad to see this effort = taking place, since it=E2=80=99s very needed to modernize FreeBSD and = improve concurrency in the kernel, as well as reduce the overall = maintenance burden. Keep up the good work :)! Cheers! -Enji= From owner-svn-src-head@freebsd.org Sat Nov 30 19:02:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E971B3C56 for ; Sat, 30 Nov 2019 19:02:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLN14fvhz4Ln6 for ; Sat, 30 Nov 2019 19:02:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x743.google.com with SMTP id a10so5611006qko.9 for ; Sat, 30 Nov 2019 11:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xkN9OrfTI8XkZDp5ZQaAHNPgXehH4kbR12vejV7Dk1I=; b=N/I+YfJh9rWckgY8gub0RH6RyOxnbDjso/HYUVaEEAtf8nWRjiHjJWFmZGt8gAJUYF Gta9yWhF3PRMEc8zSw52+ZEL0WO447KJRVaToBBPRaCpOAIZOkiZmySQQrYNIyNtM1A8 BNGAkdqgfH7rttRTDJ6MREJbd+UI27cpCTxvF8RHcJ+JluKp9z7akyUJUSdt/p0FBGxH cWJ+bnr68xFi9ieKyv1UTF2FM5Rsnfsp22powsoIa8Jup6N4C6zIo9rqk2sBMevNPMtE uDeSXYrtMfUhMJsYTq9CfCLKogK5dNdFwLQNJuKUvlkwhdeUaDIVi4uuba4bdtzfew54 zQ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xkN9OrfTI8XkZDp5ZQaAHNPgXehH4kbR12vejV7Dk1I=; b=Kv3tLzrjf83kobnhF7NHqHIyHH7+HkU1xap6m1g36PTgV8+qKd5cANpUkd9J/mEToD 6S1cGYy43sx5kiPEhVUB5o5BtXuqvkfrfg5K/d2pQRV+crH6gB78bHet3VO0sqwz25wB xTEqP3Ql3Ws9hZI8oGWOnyj5HiG+HLQoWClbAAyOHi+4XMS6nFWUYbFMZML9we3lmAAT Xl3nS6vQEtw7loQFY4XsVUEyPVJcDQxki3wsSm2IzCIhgGNhBbziTp8kpsFER3pEC8AR gJjyVYWRbxGyAQtKoZuYgVomgKQf36MFupwFNdxA4gL1N9QfAe3YnFrQ1fsWn/Kqf7Zp FzTA== X-Gm-Message-State: APjAAAXHyEnrEaCdfxuR/gZT4QkvyaEUUUeVzso71YCfm/saZC6/7SqM sDrwVC26Xr5ih9/Ck834vXTLLSY4Spy0bQLMbIk8CA== X-Google-Smtp-Source: APXvYqwB+8q8mnJmcBsVlwt7kkvqCaODmNb8vDjhxGhrSGnHw86DUrI4GUvbXVrZs37u2hJ0vziJ1zri2jzTU4GTxAM= X-Received: by 2002:a37:b0c5:: with SMTP id z188mr24245793qke.215.1575140528073; Sat, 30 Nov 2019 11:02:08 -0800 (PST) MIME-Version: 1.0 References: <201911280232.xAS2WHtb029602@repo.freebsd.org> <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> In-Reply-To: From: Warner Losh Date: Sat, 30 Nov 2019 12:01:57 -0700 Message-ID: Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm To: Enji Cooper Cc: Scott Long , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47QLN14fvhz4Ln6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=N/I+YfJh; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::743) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.33)[ip: (2.60), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 19:02:10 -0000 On Sat, Nov 30, 2019 at 11:58 AM Enji Cooper wrote: > > On Nov 30, 2019, at 10:03 AM, Warner Losh wrote: > > > > On Sat, Nov 30, 2019 at 10:47 AM Enji Cooper > wrote: > >> >> > On Nov 27, 2019, at 6:32 PM, Scott Long wrote: >> > >> > Author: scottl >> > Date: Thu Nov 28 02:32:17 2019 >> > New Revision: 355164 >> > URL: https://svnweb.freebsd.org/changeset/base/355164 >> > >> > Log: >> > Remove the trm(4) driver >> > >> > Differential Revision: https://reviews.freebsd.org/D22575 >> >> Hi Scott, >> I believe this driver was removed because it was impacts the CAM >> GIANT lock removal effort =E2=80=94 is that true (I=E2=80=99m asking bec= ause the =E2=80=9Cwhy=E2=80=9D >> behind the removal is unclear)? >> > > Hi Enji, > > We're trying hard to get rid of all Giant-locked drivers in the tree, > either by updating or removal. Since sym(4) provides a super-set of trm(4= ) > and we have recent-ish reports of sym(4) working, it makes sense to trim > this driver from the tree. The specific cards it supports aren't all that > popular, the couple-extra features that trm(4) gave over sym(4) aren't > really that relevant today, and it's been years since trm has had good > testing and maintenance. > > > Warner, > Thanks so very much for the info :). Glad to see this effort taking place= , > since it=E2=80=99s very needed to modernize FreeBSD and improve concurren= cy in the > kernel, as well as reduce the overall maintenance burden. > Giant isn't contending, but it's getting in the way of a cleanup of the console / kbd system, as well as there being newbus issues in highly dynamic systems. With TB and USB4 support on the horizon, we need to finally clean that mess up.. I'll post a longer summary of what's left. I have a 'doodle' tree that I'm separating out the Giant usage to 'driver lock', kbd/console/ddb, newbus, sysctl, and WTF is that protecting... I'm tempted to create wtf_lock() and wtf_unlock(), but I'm not sure how well that would go over :) Warner From owner-svn-src-head@freebsd.org Sat Nov 30 19:16:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95FD81B40CD; Sat, 30 Nov 2019 19:16:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLhs3S5sz4MKH; Sat, 30 Nov 2019 19:16:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B2C72DE7; Sat, 30 Nov 2019 19:16:45 +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 xAUJGjGL018856; Sat, 30 Nov 2019 19:16:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJGjgJ018855; Sat, 30 Nov 2019 19:16:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201911301916.xAUJGjgJ018855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 30 Nov 2019 19:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355239 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 355239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 19:16:45 -0000 Author: ian Date: Sat Nov 30 19:16:44 2019 New Revision: 355239 URL: https://svnweb.freebsd.org/changeset/base/355239 Log: Add an OFWBUS_PNP_INFO() macro for devices that hang directly off the root ofwbus. Also, apply some style(9) whitespace fixing to the SIMPLEBUS_PNP_INFO() macro (no functional change). Modified: head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sat Nov 30 18:55:50 2019 (r355238) +++ head/sys/dev/ofw/ofw_bus_subr.h Sat Nov 30 19:16:44 2019 (r355239) @@ -69,7 +69,8 @@ struct intr_map_data_fdt { #define FDTCOMPAT_PNP_INFO(t, busname) \ MODULE_PNP_INFO(FDTCOMPAT_PNP_DESCR, busname, t, t, sizeof(t) / sizeof(t[0])); -#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus) +#define OFWBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, ofwbus) +#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus) /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); From owner-svn-src-head@freebsd.org Sat Nov 30 19:25:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 420B41B48E6; Sat, 30 Nov 2019 19:25:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLtZ3KvQz4N2k; Sat, 30 Nov 2019 19:25:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x642.google.com with SMTP id o8so9933019pls.5; Sat, 30 Nov 2019 11:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=VFJDaNy6j7tfv4LV2KrFXJbJEq5JTNFO+4Qd08wh7yw=; b=NZxGgx68FV6aIiL51kburuqdbH8iq9KkKw9fOptLXQZ4wkiqAfS2Y8/bJSzNCm53g0 kaAcWlbH5YIP4ZERVILinm4oNzHNjrvFSAsl6QX1E4wIxuqpsHAKpyGuFeF4fba+DAgo wD5o/amhDXT+5kPk6kydcSU7AnWwteT7bJ1mLLMCfQXM2NCNm2HMAHQdLPssqcOIwpyh WASXbm2KKxZ8LwTRuGlZLOlEEV6x6gmSpKDx19eHXjcz+5oMyZPiFRRdCP3c9cFPWqgW qX3qlhTNR/4CstddBFRAK4vO1n3SZegqLxyjZjD1avdbuxXps5PUsbJITkPf46AVuCFS vhhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=VFJDaNy6j7tfv4LV2KrFXJbJEq5JTNFO+4Qd08wh7yw=; b=GCAlQz1hBaziW3wGvnjjvGpZGIqyFMih9XJs3EnOLWUg5Zwhox8FUvrRGt7S7Jwk1T nbkrWsszeALfFeMuxAhWKA0PxghoC0KDfPf+4S5NhnvgQiUT8b5kC0PU7psG02qvTAsl efGGrGNXUKzVNn/5wune4VAw683nrXgf+ZGEXLQ53NvM09Vh3WxokvXWbbx9fHalBUk/ ZiZ/xWtKkL9shkLNClnfzzQrDOZ1bjCQX2zjQ3fqKcES3G8KaczCdNcintjOCTojVASM ktZgU+eZxFZOYS2dfY9mHXeg0/4YyTC81FeQZRvqGxoER0CVIRr4PSOPv8XdzleqURhT BtBw== X-Gm-Message-State: APjAAAVGqI1DW3Tzi6SL4ui1P60m7GTA4LRLEbFvMklrSSSqQLEX4ZG7 m8jvR4eHkI9YH1U6fb90kS0/7CelX40= X-Google-Smtp-Source: APXvYqw9TIqaaz/gsAZdvC1vOLMcKHRocAmpXkcXmHqTNQKRpxns8qZSSM/jR4EKsQtRPEvDvN5RBA== X-Received: by 2002:a17:902:6b4b:: with SMTP id g11mr20116546plt.196.1575141908990; Sat, 30 Nov 2019 11:25:08 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c9sm28785972pfn.65.2019.11.30.11.25.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Nov 2019 11:25:08 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm Date: Sat, 30 Nov 2019 11:25:07 -0800 In-Reply-To: Cc: Scott Long , src-committers , svn-src-all , svn-src-head To: Warner Losh References: <201911280232.xAS2WHtb029602@repo.freebsd.org> <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47QLtZ3KvQz4N2k X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NZxGgx68; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::642 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[228.52.19.73.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-0.53), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 19:25:11 -0000 > On Nov 30, 2019, at 11:01 AM, Warner Losh wrote: >=20 > On Sat, Nov 30, 2019 at 11:58 AM Enji Cooper > wrote: >=20 >> On Nov 30, 2019, at 10:03 AM, Warner Losh > wrote: >>=20 >>=20 >>=20 >> On Sat, Nov 30, 2019 at 10:47 AM Enji Cooper > wrote: >>=20 >> > On Nov 27, 2019, at 6:32 PM, Scott Long > wrote: >> >=20 >> > Author: scottl >> > Date: Thu Nov 28 02:32:17 2019 >> > New Revision: 355164 >> > URL: https://svnweb.freebsd.org/changeset/base/355164 = >> >=20 >> > Log: >> > Remove the trm(4) driver >> >=20 >> > Differential Revision: https://reviews.freebsd.org/D22575 = >>=20 >> Hi Scott, >> I believe this driver was removed because it was impacts the = CAM GIANT lock removal effort =E2=80=94 is that true (I=E2=80=99m asking = because the =E2=80=9Cwhy=E2=80=9D behind the removal is unclear)? >>=20 >> Hi Enji, >>=20 >> We're trying hard to get rid of all Giant-locked drivers in the tree, = either by updating or removal. Since sym(4) provides a super-set of = trm(4) and we have recent-ish reports of sym(4) working, it makes sense = to trim this driver from the tree. The specific cards it supports aren't = all that popular, the couple-extra features that trm(4) gave over sym(4) = aren't really that relevant today, and it's been years since trm has had = good testing and maintenance. >=20 > Warner, > Thanks so very much for the info :). Glad to see this effort = taking place, since it=E2=80=99s very needed to modernize FreeBSD and = improve concurrency in the kernel, as well as reduce the overall = maintenance burden. >=20 > Giant isn't contending, but it's getting in the way of a cleanup of = the console / kbd system, as well as there being newbus issues in highly = dynamic systems. With TB and USB4 support on the horizon, we need to = finally clean that mess up.. I'll post a longer summary of what's left. = I have a 'doodle' tree that I'm separating out the Giant usage to = 'driver lock', kbd/console/ddb, newbus, sysctl, and WTF is that = protecting... I'm tempted to create wtf_lock() and wtf_unlock(), but I'm = not sure how well that would go over :) Sounds great :D=E2=80=A6 -Enji PS wtf_lock() would be amusing, but probably less of a good idea these = days :D...= From owner-svn-src-head@freebsd.org Sat Nov 30 19:33:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C83DB1B4C4E; Sat, 30 Nov 2019 19:33:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QM3f4yFHz4NVQ; Sat, 30 Nov 2019 19:33:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EBA63174; Sat, 30 Nov 2019 19:33:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJX2dl030549; Sat, 30 Nov 2019 19:33:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJX2DB030548; Sat, 30 Nov 2019 19:33:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301933.xAUJX2DB030548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 19:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355241 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 19:33:02 -0000 Author: mjg Date: Sat Nov 30 19:33:02 2019 New Revision: 355241 URL: https://svnweb.freebsd.org/changeset/base/355241 Log: smp: cast the read in quiesce_all_critical through void * Fixes compilation on some 32-bit arm platforms. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat Nov 30 19:21:29 2019 (r355240) +++ head/sys/kern/subr_smp.c Sat Nov 30 19:33:02 2019 (r355241) @@ -952,7 +952,7 @@ quiesce_all_critical(void) break; cpu_spinwait(); newtd = (struct thread *) - atomic_load_acq_ptr((u_long *)pcpu->pc_curthread); + atomic_load_acq_ptr((void *)pcpu->pc_curthread); if (td != newtd) break; } From owner-svn-src-head@freebsd.org Sat Nov 30 19:46:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64A511B51F8 for ; Sat, 30 Nov 2019 19:46:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMLg00fQz4PBX for ; Sat, 30 Nov 2019 19:46:02 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1575143161; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=G7SJe/y/EGw5k+V5M3VfvXGb37OO8w2HyidwHCJ120oRy31GwjEGKMdh9E9j1rDpfH2Vk+T35G//Z xMiW0G2CZwIBO5qWEt1qZdjROiBgfoEQC32rYJ5mRIxnm8FR90KHw5AeG6Uqe3GL8mh6hS0eloZRlA vyD4g23ZLwUFJZj4YH4xZOGSWX12nAGbumbKZheLT0aaMOf79sVdhb2Fq8eVdDnCjiGA9QGgiyr8na nXqs9xTX0dsMKr7iMtTV+8xEf4/gUujzx7GYJGAXGILs0Ks/pjKHsn/ROU8fZv8CFuGEMbXrlOSBaS nC9lffdPdrBbbY7dj+ZEhlrqX29nJ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=IgCUSmrl9SqL9sp2mQhjUYDjP4W42ci1dt8+QuHuRHs=; b=psUfqBNUILwlxLKjbNS8ruAsXzSdclBHnxL2UvtKpF3qsBF2MIftC694To+k+0O4kMCkDPzQvFj1k 1HHSLj+LMRc8dNzTX553+ebkUCiQ8n6pIV6eM/YBHlHc7F+NYKz4ZD2uUrub8fs2nu6kGj8VFBED2Q JIPUl4UqlMUb7bulv6KvPvq92eFmlMDP6ZG6XRoo6iZouSgrpgX0P7NgDqhjxsTuYrD+raCw8U84gM Vs+/KPFXB6TijqumSmTf8z6UhsheRYIOtzOxcJUK2SKrnREU0jtMl8TCfZUlmsmDDgkKoZK7rK23LY Ae9RCuYFQ+LmezTBLJ1ahUN84lEr0SQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=IgCUSmrl9SqL9sp2mQhjUYDjP4W42ci1dt8+QuHuRHs=; b=JWFQMmUBujNL0wNot3DjKMpwv34OFbM9PY1Gl9699MWupw3DIRXbUp8QmvPSlNYGFTn8QEJH6A+SQ Tp0ZnIO+O9qk/8E/6/PSvMFOSk7QDwEZpa9G+0t4hCzOwRVh+cgRuDJVkSTR0mv0QV5R7A8fk7t60S BGNiDJ7Hms8t4/Nn8PSvpwyv2qAsvCdmgWes5cScIsOEc1tBUqmLFEiQpOdDnZRgT+qlYQiAzLyWbM wyEffnyn8I3OL9BC1x9aIjjnP8a1dtgvyKWanr1ueMg12ci8+O7CMEnEAvDAcp6MhRoTil3WAKzzWq ZJl8aUY7JEUPFvfIKl2PBtBbpt/Gqzw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 07eeb242-13aa-11ea-b80c-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 07eeb242-13aa-11ea-b80c-052b4a66b6b2; Sat, 30 Nov 2019 19:45:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xAUJjwYg089354; Sat, 30 Nov 2019 12:45:58 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <94864ce829f8eeb7352ace92b6efdac55e9f1979.camel@freebsd.org> Subject: Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm From: Ian Lepore To: Enji Cooper , Warner Losh Cc: Scott Long , src-committers , svn-src-all , svn-src-head Date: Sat, 30 Nov 2019 12:45:58 -0700 In-Reply-To: References: <201911280232.xAS2WHtb029602@repo.freebsd.org> <41D40355-A16E-48E1-9C11-0C9E42C83A42@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47QMLg00fQz4PBX X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.77 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.84)[-0.836,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-0.93)[-0.931,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 19:46:03 -0000 On Sat, 2019-11-30 at 11:25 -0800, Enji Cooper wrote: > > On Nov 30, 2019, at 11:01 AM, Warner Losh wrote: > > > > On Sat, Nov 30, 2019 at 11:58 AM Enji Cooper > > wrote: > > > > > On Nov 30, 2019, at 10:03 AM, Warner Losh > > > wrote: > > > > > > > > > > > > On Sat, Nov 30, 2019 at 10:47 AM Enji Cooper < > > > yaneurabeya@gmail.com > wrote: > > > > > > > On Nov 27, 2019, at 6:32 PM, Scott Long > > > > wrote: > > > > > > > > Author: scottl > > > > Date: Thu Nov 28 02:32:17 2019 > > > > New Revision: 355164 > > > > URL: https://svnweb.freebsd.org/changeset/base/355164 < > > > > https://svnweb.freebsd.org/changeset/base/355164> > > > > > > > > Log: > > > > Remove the trm(4) driver > > > > > > > > Differential Revision: > > > > https://reviews.freebsd.org/D22575 < > > > > https://reviews.freebsd.org/D22575> > > > > > > Hi Scott, > > > I believe this driver was removed because it was impacts > > > the CAM GIANT lock removal effort — is that true (I’m asking > > > because the “why” behind the removal is unclear)? > > > > > > Hi Enji, > > > > > > We're trying hard to get rid of all Giant-locked drivers in the > > > tree, either by updating or removal. Since sym(4) provides a > > > super-set of trm(4) and we have recent-ish reports of sym(4) > > > working, it makes sense to trim this driver from the tree. The > > > specific cards it supports aren't all that popular, the couple- > > > extra features that trm(4) gave over sym(4) aren't really that > > > relevant today, and it's been years since trm has had good > > > testing and maintenance. > > > > Warner, > > Thanks so very much for the info :). Glad to see this effort > > taking place, since it’s very needed to modernize FreeBSD and > > improve concurrency in the kernel, as well as reduce the overall > > maintenance burden. > > > > Giant isn't contending, but it's getting in the way of a cleanup of > > the console / kbd system, as well as there being newbus issues in > > highly dynamic systems. With TB and USB4 support on the horizon, we > > need to finally clean that mess up.. I'll post a longer summary of > > what's left. I have a 'doodle' tree that I'm separating out the > > Giant usage to 'driver lock', kbd/console/ddb, newbus, sysctl, and > > WTF is that protecting... I'm tempted to create wtf_lock() and > > wtf_unlock(), but I'm not sure how well that would go over :) > > Sounds great :D… > -Enji > > PS wtf_lock() would be amusing, but probably less of a good idea > these days :D... But naming is important... I was wondering the other day whether Giant would have been misused and overused less if it had been named splhigh_lock. -- Ian From owner-svn-src-head@freebsd.org Sat Nov 30 20:06:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EC471B6513; Sat, 30 Nov 2019 20:06:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMpj75Zwz4RCg; Sat, 30 Nov 2019 20:06:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D280A38A1; Sat, 30 Nov 2019 20:06:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUK6re7048508; Sat, 30 Nov 2019 20:06:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUK6rAt048507; Sat, 30 Nov 2019 20:06:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201911302006.xAUK6rAt048507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 30 Nov 2019 20:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355247 - head/libexec/save-entropy X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/libexec/save-entropy X-SVN-Commit-Revision: 355247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 20:06:54 -0000 Author: delphij Date: Sat Nov 30 20:06:53 2019 New Revision: 355247 URL: https://svnweb.freebsd.org/changeset/base/355247 Log: Reduce disk write load in /usr/libexec/save-entropy. Before this commit, the save-entropy script rotates entropy files like logs. This involves creating a new file that holds the entropy and renaming of all existing entropy files. However, the entropy data do not really need to be kept in a particular order, and replacing the oldest file is sufficient. This commit replaces the rotation with a scan in the [1..entropy_save_num] space that finds the first empty slot, or the slot of the oldest file, and writes entropy into that slot. This also fixes an issue that prevents save-entropy from saving any entropy when there is one non-regular file in any slot as a side effect. Based on an earlier patch from peterj@. PR: 134225 Reported by: peterj Reviewed by: csprng (cem, markm) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22612 Modified: head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Sat Nov 30 20:04:40 2019 (r355246) +++ head/libexec/save-entropy/save-entropy.sh Sat Nov 30 20:06:53 2019 (r355247) @@ -71,26 +71,63 @@ cd "${entropy_dir}" || { for f in saved-entropy.*; do case "${f}" in saved-entropy.\*) continue ;; esac # No files match - [ ${f#saved-entropy\.} -ge ${entropy_save_num} ] && unlink ${f} + [ ${f#saved-entropy\.} -gt ${entropy_save_num} ] && unlink ${f} done -umask 377 +umask 177 -n=$(( ${entropy_save_num} - 1 )) -while [ ${n} -ge 1 ]; do - if [ -f "saved-entropy.${n}" ]; then - mv "saved-entropy.${n}" "saved-entropy.$(( ${n} + 1 ))" - elif [ -e "saved-entropy.${n}" -o -L "saved-entropy.${n}" ]; then +# Scan slots [1..$entropy_save_num), picking an empty slot or the oldest +# existing file if no empty slot was available. +# +# 1. Find out the first regular file or empty slot (and its serial number) +# +n=1 +while [ ${n} -le ${entropy_save_num} ]; do + save_file="saved-entropy.${n}" + if [ ! -e "${save_file}" -o -f "${save_file}" ]; then + break + else logger -is -t "$0" \ - "${entropy_dir}/saved-entropy.${n}" is not a regular file, and so \ - it will not be rotated. Entropy file rotation is aborted. - exit 1 + "${save_file}" is not a regular file, skipped. fi - n=$(( ${n} - 1 )) + n=$(( ${n} + 1 )) done +# +# 2. Start from (serial number + 1), and check if the slot is empty +# or is an older regular file, update save_file pointer in either +# case, and break early if we found an empty slot. +# +if [ -f ${save_file} ]; then + n=$(( ${n} + 1 )) + while [ ${n} -le ${entropy_save_num} ]; do + next_file=saved-entropy.${n} + if [ -f "${next_file}" ]; then + [ "${next_file}" -ot "${save_file}" ] && \ + save_file="${next_file}" + elif [ ! -e "${next_file}" ]; then + save_file="${next_file}" + break + else + logger -is -t "$0" \ + "${next_file}" is not a regular file, skipped. + fi + n=$(( ${n} + 1 )) + done +fi +# +# 3. Check if the pointer we have in hand is really a regular file or +# an empty slot, and bail out as that means there is no available slot. +# +if [ -e "${save_file}" -a ! -f "${save_file}" ]; then + logger -is -t "$0" \ + No available slot in "${entropy_dir}", save entropy is aborted. + exit 1 +fi -dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null -chflags nodump saved-entropy.1 2>/dev/null || : -fsync saved-entropy.1 "." +# Save entropy to the selected slot. +chmod 600 "${save_file}" 2>/dev/null || : +dd if=/dev/random of="${save_file}" bs=${entropy_save_sz} count=1 2>/dev/null +chflags nodump "${save_file}" 2>/dev/null || : +fsync "${save_file}" "." exit 0 From owner-svn-src-head@freebsd.org Sat Nov 30 20:10:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E8091B66C5; Sat, 30 Nov 2019 20:10:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMvH3lMSz4RNr; Sat, 30 Nov 2019 20:10:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6403E38C2; Sat, 30 Nov 2019 20:10:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUKAptH048777; Sat, 30 Nov 2019 20:10:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUKAodH048773; Sat, 30 Nov 2019 20:10:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911302010.xAUKAodH048773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 30 Nov 2019 20:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355248 - in head: share/man/man4 sys/fs/devfs sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/man/man4 sys/fs/devfs sys/kern X-SVN-Commit-Revision: 355248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 20:10:51 -0000 Author: kevans Date: Sat Nov 30 20:10:50 2019 New Revision: 355248 URL: https://svnweb.freebsd.org/changeset/base/355248 Log: tty: implement TIOCNOTTY Generally, it's preferred that an application fork/setsid if it doesn't want to keep its controlling TTY, but it could be that a debugger is trying to steal it instead -- so it would hook in, drop the controlling TTY, then do some magic to set things up again. In this case, TIOCNOTTY is quite handy and still respected by at least OpenBSD, NetBSD, and Linux as far as I can tell. I've dropped the note about obsoletion, as I intend to support TIOCNOTTY as long as it doesn't impose a major burden. Reviewed by: bcr (manpages), kib Differential Revision: https://reviews.freebsd.org/D22572 Modified: head/share/man/man4/tty.4 head/sys/fs/devfs/devfs_vnops.c head/sys/kern/tty.c Modified: head/share/man/man4/tty.4 ============================================================================== --- head/share/man/man4/tty.4 Sat Nov 30 20:06:53 2019 (r355247) +++ head/share/man/man4/tty.4 Sat Nov 30 20:10:50 2019 (r355248) @@ -28,7 +28,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd January 11, 2017 +.Dd November 27, 2019 .Dt TTY 4 .Os .Sh NAME @@ -194,7 +194,6 @@ Simulate typed input. Pretend as if the terminal received the character pointed to by .Fa cp . .It Dv TIOCNOTTY Fa void -This call is obsolete but left for compatibility. In the past, when a process that did not have a controlling terminal (see .Em The Controlling Terminal in @@ -203,7 +202,7 @@ first opened a terminal device, it acquired that termi controlling terminal. For some programs this was a hazard as they did not want a controlling terminal in the first place, and this -provided a mechanism to disassociate the controlling terminal from +provides a mechanism to disassociate the controlling terminal from the calling process. It .Em must @@ -228,6 +227,14 @@ system call which will place the process into its own has the effect of disassociating it from the controlling terminal. This is the new and preferred method for programs to lose their controlling terminal. +.Pp +However, environmental restrictions may prohibit the process from being able to +.Fn fork +and call the +.Fn setsid +system call to disassociate it from the controlling terminal. +In this case, it must use +.Dv TIOCNOTTY . .It Dv TIOCSTOP Fa void Stop output on the terminal (like typing ^S at the keyboard). .It Dv TIOCSTART Fa void Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Nov 30 20:06:53 2019 (r355247) +++ head/sys/fs/devfs/devfs_vnops.c Sat Nov 30 20:10:50 2019 (r355248) @@ -829,9 +829,16 @@ devfs_ioctl(struct vop_ioctl_args *ap) error = ENOTTY; if (error == 0 && com == TIOCSCTTY) { - /* Do nothing if reassigning same control tty */ + /* + * Do nothing if reassigning same control tty, or if the + * control tty has already disappeared. If it disappeared, + * it's because we were racing with TIOCNOTTY. TIOCNOTTY + * already took care of releasing the old vnode and we have + * nothing left to do. + */ sx_slock(&proctree_lock); - if (td->td_proc->p_session->s_ttyvp == vp) { + if (td->td_proc->p_session->s_ttyvp == vp || + td->td_proc->p_session->s_ttyp == NULL) { sx_sunlock(&proctree_lock); return (0); } Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Nov 30 20:06:53 2019 (r355247) +++ head/sys/kern/tty.c Sat Nov 30 20:10:50 2019 (r355248) @@ -1195,6 +1195,71 @@ tty_rel_gone(struct tty *tp) tty_rel_free(tp); } +static int +tty_drop_ctty(struct tty *tp, struct proc *p) +{ + struct session *session; + struct vnode *vp; + + /* + * This looks terrible, but it's generally safe as long as the tty + * hasn't gone away while we had the lock dropped. All of our sanity + * checking that this operation is OK happens after we've picked it back + * up, so other state changes are generally not fatal and the potential + * for this particular operation to happen out-of-order in a + * multithreaded scenario is likely a non-issue. + */ + tty_unlock(tp); + sx_xlock(&proctree_lock); + tty_lock(tp); + if (tty_gone(tp)) { + sx_xunlock(&proctree_lock); + return (ENODEV); + } + + /* + * If the session doesn't have a controlling TTY, or if we weren't + * invoked on the controlling TTY, we'll return ENOIOCTL as we've + * historically done. + */ + session = p->p_session; + if (session->s_ttyp == NULL || session->s_ttyp != tp) { + sx_xunlock(&proctree_lock); + return (ENOTTY); + } + + if (!SESS_LEADER(p)) { + sx_xunlock(&proctree_lock); + return (EPERM); + } + + PROC_LOCK(p); + SESS_LOCK(session); + vp = session->s_ttyvp; + session->s_ttyp = NULL; + session->s_ttyvp = NULL; + session->s_ttydp = NULL; + SESS_UNLOCK(session); + + tp->t_sessioncnt--; + p->p_flag &= ~P_CONTROLT; + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + + /* + * If we did have a vnode, release our reference. Ordinarily we manage + * these at the devfs layer, but we can't necessarily know that we were + * invoked on the vnode referenced in the session (i.e. the vnode we + * hold a reference to). We explicitly don't check VBAD/VI_DOOMED here + * to avoid a vnode leak -- in circumstances elsewhere where we'd hit a + * VI_DOOMED vnode, release has been deferred until the controlling TTY + * is either changed or released. + */ + if (vp != NULL) + vrele(vp); + return (0); +} + /* * Exposing information about current TTY's through sysctl */ @@ -1709,6 +1774,8 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da MPASS(tp->t_session); *(int *)data = tp->t_session->s_sid; return (0); + case TIOCNOTTY: + return (tty_drop_ctty(tp, td->td_proc)); case TIOCSCTTY: { struct proc *p = td->td_proc; From owner-svn-src-head@freebsd.org Sat Nov 30 23:07:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA33B1BB96F; Sat, 30 Nov 2019 23:07:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47QRqJ2pBJz4dfF; Sat, 30 Nov 2019 23:07:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAUN7Pc2023334 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 1 Dec 2019 01:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAUN7Pc2023334 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAUN7PHF023333; Sun, 1 Dec 2019 01:07:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 1 Dec 2019 01:07:25 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355227 - head/sys/fs/tmpfs Message-ID: <20191130230725.GB10580@kib.kiev.ua> References: <201911301641.xAUGfmMt029299@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911301641.xAUGfmMt029299@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47QRqJ2pBJz4dfF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 23:07:40 -0000 On Sat, Nov 30, 2019 at 04:41:48PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Nov 30 16:41:47 2019 > New Revision: 355227 > URL: https://svnweb.freebsd.org/changeset/base/355227 > > Log: > tmpfs: add fast path to tmpfs_access for common case lookup > > VEXEC consists of vast majority of all calls and almost all targets have > at least 0111. On what load VEXEC is the dominant access check ? > > Modified: > head/sys/fs/tmpfs/tmpfs_vnops.c > > Modified: head/sys/fs/tmpfs/tmpfs_vnops.c > ============================================================================== > --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:40:16 2019 (r355226) > +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:41:47 2019 (r355227) > @@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v) > > node = VP_TO_TMPFS_NODE(vp); > > + /* > + * Common case path lookup. > + */ > + if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111)) The 0111 must be spelled as (S_IXUSR | S_IXGRP | S_IXOTH). > + return (0); > + > switch (vp->v_type) { > case VDIR: > /* FALLTHROUGH */ From owner-svn-src-head@freebsd.org Sat Nov 30 23:15:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22D581BBC95; Sat, 30 Nov 2019 23:15:11 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QRzy0M6Mz4f9F; Sat, 30 Nov 2019 23:15:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id n1so39412875wra.10; Sat, 30 Nov 2019 15:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VQx8fSY94nFeby1Uo87piy3U2ypS2RAaoECnzFLwlvk=; b=FjaYM6sB9Sdw4OWFsJv5dzHKmjpkzXEmBkJTqWGaED9O27NL2jByzOu+HXb4WbVtyJ 6EfL0LRIo8hrNbEkW1EEJt3kRR6QPKcJ+N87Rj5Udiu6PEtGJ/YUl6/TCYyxh7q7dR25 CM5sw5vzZcolm1e2tPmOpG9vk+g+giZH7hkMMEeTAD4xIx8aGIYlM7uAjJy3YlnA7dmY ca9x2PJvh9uePzJGMwDcoAVJzeBe75JuPgBlWMFQ9zcAr3p9O9QxcNDK1PwUAlAxNS8w t+aIIyvBF5Ha8YrbsTuMVNbT7ke456zAOVT7IAA89LCYrIN2Z34Rbu+iu2E+5Ff/ZYW4 mrzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VQx8fSY94nFeby1Uo87piy3U2ypS2RAaoECnzFLwlvk=; b=SAmrvzR576DAKEMS9dPp0U5wg43lWm+SKbE64mmIXZmZl52j/0xTqJTm1GTeZJ+YHv vfxBmPgOEVDKSnBT31ySqWQALBpBtLaWajQ61QXrGUZBYWzYjYhrZRmlPTWn0zua2mqU Pzw32iK3DrGJuti6oHgntZWIXVpzG9q9I1N2Q/sbHusg+5XJiqIc4blgI/0ITlNSXbg1 /wqcPTif6vPTVuBOHWan9e3WAeifh15C7nuvcZBuCO1LY6v99d3q5E+ojJgL0HM7u7XJ dNZ8BodllqPMX71rOv3sxJET3C1L169LaTkkVo0PBTna1RI65sq845ZVv3HR/MCz0zdc 9coA== X-Gm-Message-State: APjAAAWYKuOzzHOaNy3uPMzNKQQYNIM5jaPJWQ8b1sQnH0+lL0zFnw2o oMUF1LzumlevY/XolUOzMzKsxVn54b7LKxJZRuA4Mg== X-Google-Smtp-Source: APXvYqxZweFb9axNJS8bJZmhDaR6TP2A9Xgen/CEyrwAL6gzqtRIlTjm5hb4ugqtBL1sMYRmNVZiemQXGcW5A5qYKn0= X-Received: by 2002:adf:d0c1:: with SMTP id z1mr2932785wrh.371.1575155707574; Sat, 30 Nov 2019 15:15:07 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:9ed0:0:0:0:0:0 with HTTP; Sat, 30 Nov 2019 15:15:06 -0800 (PST) In-Reply-To: <20191130230725.GB10580@kib.kiev.ua> References: <201911301641.xAUGfmMt029299@repo.freebsd.org> <20191130230725.GB10580@kib.kiev.ua> From: Mateusz Guzik Date: Sun, 1 Dec 2019 00:15:06 +0100 Message-ID: Subject: Re: svn commit: r355227 - head/sys/fs/tmpfs 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-Rspamd-Queue-Id: 47QRzy0M6Mz4f9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FjaYM6sB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.48), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.94), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 23:15:11 -0000 On 12/1/19, Konstantin Belousov wrote: > On Sat, Nov 30, 2019 at 04:41:48PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Sat Nov 30 16:41:47 2019 >> New Revision: 355227 >> URL: https://svnweb.freebsd.org/changeset/base/355227 >> >> Log: >> tmpfs: add fast path to tmpfs_access for common case lookup >> >> VEXEC consists of vast majority of all calls and almost all targets >> have >> at least 0111. > On what load VEXEC is the dominant access check ? > Note this is called for every directory to be traversed dooring lookup, so for instance looking up "foo/bar/baz" performs 2 VEXEC checks. Sample result from buildkernel. 64 is VEXEC. dtrace -n 'fbt::tmpfs_access:entry { @[args[0]->a_accmode, ((struct tmpfs_node *)args[0]->a_vp->v_data)->tn_mode & 0111] = count(); }' dtrace: description 'fbt::tmpfs_access:entry ' matched 1 probe 384 73 1 16512 0 2 128 0 68 384 0 877 4096 0 1049 320 73 5965 4096 73 32471 128 73 145115 256 73 160569 256 0 999827 64 73 32320731 >> >> Modified: >> head/sys/fs/tmpfs/tmpfs_vnops.c >> >> Modified: head/sys/fs/tmpfs/tmpfs_vnops.c >> ============================================================================== >> --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:40:16 2019 (r355226) >> +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:41:47 2019 (r355227) >> @@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v) >> >> node = VP_TO_TMPFS_NODE(vp); >> >> + /* >> + * Common case path lookup. >> + */ >> + if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111)) > The 0111 must be spelled as (S_IXUSR | S_IXGRP | S_IXOTH). > Ok. >> + return (0); >> + >> switch (vp->v_type) { >> case VDIR: >> /* FALLTHROUGH */ > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Nov 30 23:25:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 997821BBF94; Sat, 30 Nov 2019 23:25:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47QSCJ397dz4fd0; Sat, 30 Nov 2019 23:25:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAUNOqG9041878 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 1 Dec 2019 01:24:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAUNOqG9041878 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAUNOqDS041877; Sun, 1 Dec 2019 01:24:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 1 Dec 2019 01:24:52 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355227 - head/sys/fs/tmpfs Message-ID: <20191130232452.GC10580@kib.kiev.ua> References: <201911301641.xAUGfmMt029299@repo.freebsd.org> <20191130230725.GB10580@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47QSCJ397dz4fd0 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE_FREEMAIL(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.70), ipnet: 2001:470::/32(-4.64), asn: 6939(-3.52), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 23:25:01 -0000 On Sun, Dec 01, 2019 at 12:15:06AM +0100, Mateusz Guzik wrote: > On 12/1/19, Konstantin Belousov wrote: > > On Sat, Nov 30, 2019 at 04:41:48PM +0000, Mateusz Guzik wrote: > >> Author: mjg > >> Date: Sat Nov 30 16:41:47 2019 > >> New Revision: 355227 > >> URL: https://svnweb.freebsd.org/changeset/base/355227 > >> > >> Log: > >> tmpfs: add fast path to tmpfs_access for common case lookup > >> > >> VEXEC consists of vast majority of all calls and almost all targets > >> have > >> at least 0111. > > On what load VEXEC is the dominant access check ? > > > > Note this is called for every directory to be traversed dooring lookup, > so for instance looking up "foo/bar/baz" performs 2 VEXEC checks. So it is for directory components traversal during lookup. Does it make sense to add something similar at the start of ufs_accessx() when neither kind of ACLs is enabled for mp ? > > Sample result from buildkernel. 64 is VEXEC. > > dtrace -n 'fbt::tmpfs_access:entry { @[args[0]->a_accmode, ((struct > tmpfs_node *)args[0]->a_vp->v_data)->tn_mode & 0111] = count(); }' > dtrace: description 'fbt::tmpfs_access:entry ' matched 1 probe > > > 384 73 1 > 16512 0 2 > 128 0 68 > 384 0 877 > 4096 0 1049 > 320 73 5965 > 4096 73 32471 > 128 73 145115 > 256 73 160569 > 256 0 999827 > 64 73 32320731 > > >> > >> Modified: > >> head/sys/fs/tmpfs/tmpfs_vnops.c > >> > >> Modified: head/sys/fs/tmpfs/tmpfs_vnops.c > >> ============================================================================== > >> --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:40:16 2019 (r355226) > >> +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Nov 30 16:41:47 2019 (r355227) > >> @@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v) > >> > >> node = VP_TO_TMPFS_NODE(vp); > >> > >> + /* > >> + * Common case path lookup. > >> + */ > >> + if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111)) > > The 0111 must be spelled as (S_IXUSR | S_IXGRP | S_IXOTH). > > > > Ok. > > >> + return (0); > >> + > >> switch (vp->v_type) { > >> case VDIR: > >> /* FALLTHROUGH */ > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Nov 30 23:43:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7641D1BC698; Sat, 30 Nov 2019 23:43:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QScx2GWPz3C2b; Sat, 30 Nov 2019 23:43:45 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id p17so12967527wma.1; Sat, 30 Nov 2019 15:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hN72WEHsmgVbryEnfvNkMftvKI2y8oLldJy7aWzPV+I=; b=Xb/BhPBUJPv+QsKD+95mGzM7xz5HNlCZZJdOXjn1ANxSgDVLEF8+j8T38TOBnT+PLH 0XA2W/CmKaEquh93LHQsKhAFpvusEKXIif5l3Gt6w1HkyU+sAXeqgQ9XWDZabLOvlx37 ZH5eIyTqpTHLO2ojmtAuI6GEBgHahXQUdtrIVQRKx0l1v2hjR1jV++5ctbXPQ60kClKS M/LT9ewsMn6sT6WlQiNBSyQx0nSeoNEpAaL2zpdZf8YSQsmCzKmnCbbu+hna+p+vM+FJ jZm+fj9vOxI7+Yq5sxF5PkH1DXiwENPsSlzzZgXJ9FNvkjIdJG3Gs/hDANf6WyOxh8r6 kWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hN72WEHsmgVbryEnfvNkMftvKI2y8oLldJy7aWzPV+I=; b=jrERmJIdgA+o1svJzkTzzdo5hB4XEXWtXHY+YbYLdtwmvI4My7lf3a45FZDwGv1jUv tT6+3KsgQMg0c5XLIdj6PZzcz2vIRU05x3c/pA3Y4zXt2EsWhjp3eX7AZP4hiaD33f7A sZbF5cZGm/bo4MWMSxfqZ97ywB+k3fhzmOK/hrTrMtjPSayKLEFcEhYo8tQOID+g4l8q I9k2pDik4//daYMjyx8ghOH2ggBloIIOnNX8hTw3g6RM2yupqr8cUvKWPfHB1t+MqsnI iaO5Zt7VENd4nYbDWjI0rRtyMxs6EEE5stv3by3axltaRcZ2Pc1eBeno+FpcsVMzcFSl d91A== X-Gm-Message-State: APjAAAVDk2Jn1Z+b2kRdYdHlTdio5rU+vrIQI4zGrobBXH7deKEZmoiN aXwVxY1qEd3E1lNnPw1y5pYJmEnRedLgqOKlKXs= X-Google-Smtp-Source: APXvYqwfCC+6gN12LaoSTQy2BExcahkFmGmDozm7h6ZWhBQ7s/rUcclaqQgXNDV8BmcirMu1r/d0pfYASNnc4+mpomo= X-Received: by 2002:a1c:f610:: with SMTP id w16mr3481758wmc.34.1575157423783; Sat, 30 Nov 2019 15:43:43 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:9ed0:0:0:0:0:0 with HTTP; Sat, 30 Nov 2019 15:43:43 -0800 (PST) In-Reply-To: <20191130232452.GC10580@kib.kiev.ua> References: <201911301641.xAUGfmMt029299@repo.freebsd.org> <20191130230725.GB10580@kib.kiev.ua> <20191130232452.GC10580@kib.kiev.ua> From: Mateusz Guzik Date: Sun, 1 Dec 2019 00:43:43 +0100 Message-ID: Subject: Re: svn commit: r355227 - head/sys/fs/tmpfs 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-Rspamd-Queue-Id: 47QScx2GWPz3C2b X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Xb/BhPBU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::343 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.10), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.94), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 30 Nov 2019 23:43:46 -0000 On 12/1/19, Konstantin Belousov wrote: > On Sun, Dec 01, 2019 at 12:15:06AM +0100, Mateusz Guzik wrote: >> On 12/1/19, Konstantin Belousov wrote: >> > On Sat, Nov 30, 2019 at 04:41:48PM +0000, Mateusz Guzik wrote: >> >> Author: mjg >> >> Date: Sat Nov 30 16:41:47 2019 >> >> New Revision: 355227 >> >> URL: https://svnweb.freebsd.org/changeset/base/355227 >> >> >> >> Log: >> >> tmpfs: add fast path to tmpfs_access for common case lookup >> >> >> >> VEXEC consists of vast majority of all calls and almost all targets >> >> have >> >> at least 0111. >> > On what load VEXEC is the dominant access check ? >> > >> >> Note this is called for every directory to be traversed dooring lookup, >> so for instance looking up "foo/bar/baz" performs 2 VEXEC checks. > So it is for directory components traversal during lookup. > Does it make sense to add something similar at the start of > ufs_accessx() when neither kind of ACLs is enabled for mp ? > All filesystems should short-circuit it if they can. I have a review of the sort for zfs which internally was using a step forward in this idea by checking if any exec perms are denied: https://reviews.freebsd.org/D22224 However, if talking about ufs performance, I think the bigger fish to fry is ufs_need_inactive. While I have not benchmarked, if tmpfs and zfs are of any help, concurrent path lookup will keep contending on vputx relocking the vnode in exclusive manner. This not only slows things down as it is, It is a hard blocker for using adaptive spinning in lockmgr for this fs. I may get around to providing both much later, but I suspect you are much more familiar with the fs than I am and could do it significantly faster. -- Mateusz Guzik