From owner-svn-src-all@freebsd.org Sun Jan 20 00:45:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CA401499352; Sun, 20 Jan 2019 00:45:46 +0000 (UTC) (envelope-from gonzo@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 C6B1375278; Sun, 20 Jan 2019 00:45:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A132122468; Sun, 20 Jan 2019 00:45:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0K0jjaP001333; Sun, 20 Jan 2019 00:45:45 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K0jjqB001329; Sun, 20 Jan 2019 00:45:45 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901200045.x0K0jjqB001329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 00:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343204 - in head: sbin/ifconfig sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net80211 X-SVN-Commit-Revision: 343204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6B1375278 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 00:45:46 -0000 Author: gonzo Date: Sun Jan 20 00:45:44 2019 New Revision: 343204 URL: https://svnweb.freebsd.org/changeset/base/343204 Log: [ifconfig] Print more WPS attributes in verbose "list scan" output - Move WPS related defines to dedicated file - Add handlers for more WPS attributes PR: 217317 Submitted by: J.R. Oldroyd MFC after: 3 weeks Added: head/sys/net80211/ieee80211_wps.h (contents, props changed) Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Jan 19 20:45:41 2019 (r343203) +++ head/sbin/ifconfig/ifieee80211.c Sun Jan 20 00:45:44 2019 (r343204) @@ -77,6 +77,7 @@ #include #include #include +#include #include #include @@ -3129,13 +3130,6 @@ printrsnie(const char *tag, const u_int8_t *ie, size_t } } -/* XXX move to a public include file */ -#define IEEE80211_WPS_DEV_PASS_ID 0x1012 -#define IEEE80211_WPS_SELECTED_REG 0x1041 -#define IEEE80211_WPS_SETUP_STATE 0x1044 -#define IEEE80211_WPS_UUID_E 0x1047 -#define IEEE80211_WPS_VERSION 0x104a - #define BE_READ_2(p) \ ((u_int16_t) \ ((((const u_int8_t *)(p))[1] ) | \ @@ -3157,6 +3151,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t "R" /* Registrar-specified */ }; int n; + int f; ie +=6, len -= 4; /* NB: len is payload only */ @@ -3165,6 +3160,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t while (len) { uint16_t tlv_type = BE_READ_2(ie); uint16_t tlv_len = BE_READ_2(ie + 2); + uint16_t cfg_mthd; /* some devices broadcast invalid WPS frames */ if (tlv_len > len) { @@ -3177,30 +3173,191 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ie += 4, len -= 4; switch (tlv_type) { - case IEEE80211_WPS_VERSION: + case IEEE80211_WPS_ATTR_VERSION: printf("v:%d.%d", *ie >> 4, *ie & 0xf); break; - case IEEE80211_WPS_SETUP_STATE: - /* Only 1 and 2 are valid */ - if (*ie == 0 || *ie >= 3) - printf(" state:B"); + case IEEE80211_WPS_ATTR_AP_SETUP_LOCKED: + printf(" ap_setup:%s", *ie ? "locked" : + "unlocked"); + break; + case IEEE80211_WPS_ATTR_CONFIG_METHODS: + case IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS: + if (tlv_type == IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS) + printf(" sel_reg_cfg_mthd:"); else - printf(" st:%s", *ie == 1 ? "N" : "C"); + printf(" cfg_mthd:" ); + cfg_mthd = BE_READ_2(ie); + f = 0; + for (n = 15; n >= 0; n--) { + if (f) { + printf(","); + f = 0; + } + switch (cfg_mthd & (1 << n)) { + case 0: + break; + case IEEE80211_WPS_CONFIG_USBA: + printf("usba"); + f++; + break; + case IEEE80211_WPS_CONFIG_ETHERNET: + printf("ethernet"); + f++; + break; + case IEEE80211_WPS_CONFIG_LABEL: + printf("label"); + f++; + break; + case IEEE80211_WPS_CONFIG_DISPLAY: + if (!(cfg_mthd & + (IEEE80211_WPS_CONFIG_VIRT_DISPLAY | + IEEE80211_WPS_CONFIG_PHY_DISPLAY))) + { + printf("display"); + f++; + } + break; + case IEEE80211_WPS_CONFIG_EXT_NFC_TOKEN: + printf("ext_nfc_tokenk"); + f++; + break; + case IEEE80211_WPS_CONFIG_INT_NFC_TOKEN: + printf("int_nfc_token"); + f++; + break; + case IEEE80211_WPS_CONFIG_NFC_INTERFACE: + printf("nfc_interface"); + f++; + break; + case IEEE80211_WPS_CONFIG_PUSHBUTTON: + if (!(cfg_mthd & + (IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON | + IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON))) { + printf("push_button"); + f++; + } + break; + case IEEE80211_WPS_CONFIG_KEYPAD: + printf("keypad"); + f++; + break; + case IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON: + printf("virtual_push_button"); + f++; + break; + case IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON: + printf("physical_push_button"); + f++; + break; + case IEEE80211_WPS_CONFIG_P2PS: + printf("p2ps"); + f++; + break; + case IEEE80211_WPS_CONFIG_VIRT_DISPLAY: + printf("virtual_display"); + f++; + break; + case IEEE80211_WPS_CONFIG_PHY_DISPLAY: + printf("physical_display"); + f++; + break; + default: + printf("unknown_wps_config<%04x>", + cfg_mthd & (1 << n)); + f++; + break; + } + } break; - case IEEE80211_WPS_SELECTED_REG: - printf(" sel:%s", *ie ? "T" : "F"); + case IEEE80211_WPS_ATTR_DEV_NAME: + printf(" device_name:<%.*s>", tlv_len, ie); break; - case IEEE80211_WPS_DEV_PASS_ID: + case IEEE80211_WPS_ATTR_DEV_PASSWORD_ID: n = LE_READ_2(ie); if (n < nitems(dev_pass_id)) printf(" dpi:%s", dev_pass_id[n]); break; - case IEEE80211_WPS_UUID_E: + case IEEE80211_WPS_ATTR_MANUFACTURER: + printf(" manufacturer:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_MODEL_NAME: + printf(" model_name:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_MODEL_NUMBER: + printf(" model_number:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_PRIMARY_DEV_TYPE: + printf(" prim_dev:"); + for (n = 0; n < tlv_len; n++) + printf("%02x", ie[n]); + break; + case IEEE80211_WPS_ATTR_RF_BANDS: + printf(" rf:"); + f = 0; + for (n = 7; n >= 0; n--) { + if (f) { + printf(","); + f = 0; + } + switch (*ie & (1 << n)) { + case 0: + break; + case IEEE80211_WPS_RF_BAND_24GHZ: + printf("2.4Ghz"); + f++; + break; + case IEEE80211_WPS_RF_BAND_50GHZ: + printf("5Ghz"); + f++; + break; + case IEEE80211_WPS_RF_BAND_600GHZ: + printf("60Ghz"); + f++; + break; + default: + printf("unknown<%02x>", + *ie & (1 << n)); + f++; + break; + } + } + break; + case IEEE80211_WPS_ATTR_RESPONSE_TYPE: + printf(" resp_type:0x%02x", *ie); + break; + case IEEE80211_WPS_ATTR_SELECTED_REGISTRAR: + printf(" sel:%s", *ie ? "T" : "F"); + break; + case IEEE80211_WPS_ATTR_SERIAL_NUMBER: + printf(" serial_number:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_UUID_E: printf(" uuid-e:"); for (n = 0; n < (tlv_len - 1); n++) printf("%02x-", ie[n]); printf("%02x", ie[n]); break; + case IEEE80211_WPS_ATTR_VENDOR_EXT: + printf(" vendor:"); + for (n = 0; n < tlv_len; n++) + printf("%02x", ie[n]); + break; + case IEEE80211_WPS_ATTR_WPS_STATE: + switch (*ie) { + case IEEE80211_WPS_STATE_NOT_CONFIGURED: + printf(" state:N"); + break; + case IEEE80211_WPS_STATE_CONFIGURED: + printf(" state:C"); + break; + default: + printf(" state:B<%02x>", *ie); + break; + } + break; + default: + printf(" unknown_wps_attr:0x%x", tlv_type); + break; } ie += tlv_len, len -= tlv_len; } @@ -3353,6 +3510,7 @@ iswpsoui(const uint8_t *frm) static const char * iename(int elemid) { + static char iename_buf[64]; switch (elemid) { case IEEE80211_ELEMID_FHPARMS: return " FHPARMS"; case IEEE80211_ELEMID_CFPARMS: return " CFPARMS"; @@ -3370,10 +3528,21 @@ iename(int elemid) case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; + case IEEE80211_ELEMID_RESERVED_47: + return " RESERVED_47"; + case IEEE80211_ELEMID_MOBILITY_DOMAIN: + return " MOBILITY_DOMAIN"; + case IEEE80211_ELEMID_RRM_ENACAPS: + return " RRM_ENCAPS"; + case IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM: + return " OVERLAP_BSS"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; + case IEEE80211_ELEMID_EXTCAP: return " EXTCAP"; } - return " ???"; + snprintf(iename_buf, sizeof(iename_buf), " UNKNOWN_ELEMID_%d", + elemid); + return (const char *) iename_buf; } static void Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sat Jan 19 20:45:41 2019 (r343203) +++ head/sys/net80211/ieee80211.h Sun Jan 20 00:45:44 2019 (r343204) @@ -951,9 +951,11 @@ enum { IEEE80211_ELEMID_ERP = 42, IEEE80211_ELEMID_HTCAP = 45, IEEE80211_ELEMID_QOS = 46, + IEEE80211_ELEMID_RESERVED_47 = 47, IEEE80211_ELEMID_RSN = 48, IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_APCHANREP = 51, + IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, IEEE80211_ELEMID_HTINFO = 61, IEEE80211_ELEMID_SECCHAN_OFFSET = 62, IEEE80211_ELEMID_RRM_ENACAPS = 70, Added: head/sys/net80211/ieee80211_wps.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net80211/ieee80211_wps.h Sun Jan 20 00:45:44 2019 (r343204) @@ -0,0 +1,149 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 J.R. Oldroyd, Open Advisors Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _NET80211_IEEE80211_WPS_H_ +#define _NET80211_IEEE80211_WPS_H_ + +/* + * 802.11 WPS implementation definitions. + */ + +#define IEEE80211_WPS_ATTR_AP_CHANNEL 0x1001 +#define IEEE80211_WPS_ATTR_ASSOC_STATE 0x1002 +#define IEEE80211_WPS_ATTR_AUTH_TYPE 0x1003 +#define IEEE80211_WPS_ATTR_AUTH_TYPE_FLAGS 0x1004 +#define IEEE80211_WPS_ATTR_AUTHENTICATOR 0x1005 +#define IEEE80211_WPS_ATTR_CONFIG_METHODS 0x1008 +#define IEEE80211_WPS_ATTR_CONFIG_ERROR 0x1009 +#define IEEE80211_WPS_ATTR_CONFIRM_URL4 0x100a +#define IEEE80211_WPS_ATTR_CONFIRM_URL6 0x100b +#define IEEE80211_WPS_ATTR_CONN_TYPE 0x100c +#define IEEE80211_WPS_ATTR_CONN_TYPE_FLAGS 0x100d +#define IEEE80211_WPS_ATTR_CRED 0x100e +#define IEEE80211_WPS_ATTR_ENCR_TYPE 0x100f +#define IEEE80211_WPS_ATTR_ENCR_TYPE_FLAGS 0x1010 +#define IEEE80211_WPS_ATTR_DEV_NAME 0x1011 +#define IEEE80211_WPS_ATTR_DEV_PASSWORD_ID 0x1012 +#define IEEE80211_WPS_ATTR_E_HASH1 0x1014 +#define IEEE80211_WPS_ATTR_E_HASH2 0x1015 +#define IEEE80211_WPS_ATTR_E_SNONCE1 0x1016 +#define IEEE80211_WPS_ATTR_E_SNONCE2 0x1017 +#define IEEE80211_WPS_ATTR_ENCR_SETTINGS 0x1018 +#define IEEE80211_WPS_ATTR_ENROLLEE_NONCE 0x101a +#define IEEE80211_WPS_ATTR_FEATURE_ID 0x101b +#define IEEE80211_WPS_ATTR_IDENTITY 0x101c +#define IEEE80211_WPS_ATTR_IDENTITY_PROOF 0x101d +#define IEEE80211_WPS_ATTR_KEY_WRAP_AUTH 0x101e +#define IEEE80211_WPS_ATTR_KEY_ID 0x101f +#define IEEE80211_WPS_ATTR_MAC_ADDR 0x1020 +#define IEEE80211_WPS_ATTR_MANUFACTURER 0x1021 +#define IEEE80211_WPS_ATTR_MSG_TYPE 0x1022 +#define IEEE80211_WPS_ATTR_MODEL_NAME 0x1023 +#define IEEE80211_WPS_ATTR_MODEL_NUMBER 0x1024 +#define IEEE80211_WPS_ATTR_NETWORK_INDEX 0x1026 +#define IEEE80211_WPS_ATTR_NETWORK_KEY 0x1027 +#define IEEE80211_WPS_ATTR_NETWORK_KEY_INDEX 0x1028 +#define IEEE80211_WPS_ATTR_NEW_DEVICE_NAME 0x1029 +#define IEEE80211_WPS_ATTR_NEW_PASSWORD 0x102a +#define IEEE80211_WPS_ATTR_OOB_DEVICE_PASSWORD 0x102c +#define IEEE80211_WPS_ATTR_OS_VERSION 0x102d +#define IEEE80211_WPS_ATTR_POWER_LEVEL 0x102f +#define IEEE80211_WPS_ATTR_PSK_CURRENT 0x1030 +#define IEEE80211_WPS_ATTR_PSK_MAX 0x1031 +#define IEEE80211_WPS_ATTR_PUBLIC_KEY 0x1032 +#define IEEE80211_WPS_ATTR_RADIO_ENABLE 0x1033 +#define IEEE80211_WPS_ATTR_REBOOT 0x1034 +#define IEEE80211_WPS_ATTR_REGISTRAR_CURRENT 0x1035 +#define IEEE80211_WPS_ATTR_REGISTRAR_ESTBLSHD 0x1036 +#define IEEE80211_WPS_ATTR_REGISTRAR_LIST 0x1037 +#define IEEE80211_WPS_ATTR_REGISTRAR_MAX 0x1038 +#define IEEE80211_WPS_ATTR_REGISTRAR_NONCE 0x1039 +#define IEEE80211_WPS_ATTR_REQUEST_TYPE 0x103a +#define IEEE80211_WPS_ATTR_RESPONSE_TYPE 0x103b +#define IEEE80211_WPS_ATTR_RF_BANDS 0x103c +#define IEEE80211_WPS_ATTR_R_HASH1 0x103d +#define IEEE80211_WPS_ATTR_R_HASH2 0x103e +#define IEEE80211_WPS_ATTR_R_SNONCE1 0x103f +#define IEEE80211_WPS_ATTR_R_SNONCE2 0x1040 +#define IEEE80211_WPS_ATTR_SELECTED_REGISTRAR 0x1041 +#define IEEE80211_WPS_ATTR_SERIAL_NUMBER 0x1042 +#define IEEE80211_WPS_ATTR_WPS_STATE 0x1044 +#define IEEE80211_WPS_ATTR_SSID 0x1045 +#define IEEE80211_WPS_ATTR_TOTAL_NETWORKS 0x1046 +#define IEEE80211_WPS_ATTR_UUID_E 0x1047 +#define IEEE80211_WPS_ATTR_UUID_R 0x1048 +#define IEEE80211_WPS_ATTR_VENDOR_EXT 0x1049 +#define IEEE80211_WPS_ATTR_VERSION 0x104a +#define IEEE80211_WPS_ATTR_X509_CERT_REQ 0x104b +#define IEEE80211_WPS_ATTR_X509_CERT 0x104c +#define IEEE80211_WPS_ATTR_EAP_IDENTITY 0x104d +#define IEEE80211_WPS_ATTR_MSG_COUNTER 0x104e +#define IEEE80211_WPS_ATTR_PUBKEY_HASH 0x104f +#define IEEE80211_WPS_ATTR_REKEY_KEY 0x1050 +#define IEEE80211_WPS_ATTR_KEY_LIFETIME 0x1051 +#define IEEE80211_WPS_ATTR_PERMITTED_CONFIG_METHODS 0x1052 +#define IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS 0x1053 +#define IEEE80211_WPS_ATTR_PRIMARY_DEV_TYPE 0x1054 +#define IEEE80211_WPS_ATTR_SECONDARY_DEV_TYPE_LIST 0x1055 +#define IEEE80211_WPS_ATTR_PORTABLE_DEV 0x1056 +#define IEEE80211_WPS_ATTR_AP_SETUP_LOCKED 0x1057 +#define IEEE80211_WPS_ATTR_APPLICATION_EXT 0x1058 +#define IEEE80211_WPS_ATTR_EAP_TYPE 0x1059 +#define IEEE80211_WPS_ATTR_IV 0x1060 +#define IEEE80211_WPS_ATTR_KEY_PROVIDED_AUTO 0x1061 +#define IEEE80211_WPS_ATTR_802_1X_ENABLED 0x1062 +#define IEEE80211_WPS_ATTR_AP_SESSION_KEY 0x1063 +#define IEEE80211_WPS_ATTR_WEP_TRANSMIT_KEY 0x1064 +#define IEEE80211_WPS_ATTR_REQUESTED_DEV_TYPE 0x106a +#define IEEE80211_WPS_ATTR_EXTENSIBILITY_TEST 0x10fa /* _NOT_ defined in the spec */ + +/* RF bands bitmask */ +#define IEEE80211_WPS_RF_BAND_24GHZ 0x01 +#define IEEE80211_WPS_RF_BAND_50GHZ 0x02 +#define IEEE80211_WPS_RF_BAND_600GHZ 0x04 + +/* Config methods bitmask */ +#define IEEE80211_WPS_CONFIG_USBA 0x0001 +#define IEEE80211_WPS_CONFIG_ETHERNET 0x0002 +#define IEEE80211_WPS_CONFIG_LABEL 0x0004 +#define IEEE80211_WPS_CONFIG_DISPLAY 0x0008 +#define IEEE80211_WPS_CONFIG_EXT_NFC_TOKEN 0x0010 +#define IEEE80211_WPS_CONFIG_INT_NFC_TOKEN 0x0020 +#define IEEE80211_WPS_CONFIG_NFC_INTERFACE 0x0040 +#define IEEE80211_WPS_CONFIG_PUSHBUTTON 0x0080 +#define IEEE80211_WPS_CONFIG_KEYPAD 0x0100 +#define IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON 0x0200 +#define IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON 0x0400 +#define IEEE80211_WPS_CONFIG_P2PS 0x1000 +#define IEEE80211_WPS_CONFIG_VIRT_DISPLAY 0x2000 +#define IEEE80211_WPS_CONFIG_PHY_DISPLAY 0x4000 + +/* Wi-Fi Protected Setup state */ +#define IEEE80211_WPS_STATE_NOT_CONFIGURED 0x01 +#define IEEE80211_WPS_STATE_CONFIGURED 0x02 +#endif /* _NET80211_IEEE80211_WPS_H_ */ From owner-svn-src-all@freebsd.org Sun Jan 20 00:58:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A441499B47; Sun, 20 Jan 2019 00:58:55 +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 37647759E1; Sun, 20 Jan 2019 00:58:55 +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 246C522614; Sun, 20 Jan 2019 00:58:55 +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 x0K0wtcc006421; Sun, 20 Jan 2019 00:58:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K0wtRw006420; Sun, 20 Jan 2019 00:58:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901200058.x0K0wtRw006420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 20 Jan 2019 00:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343205 - stable/12/usr.bin/cmp X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/cmp X-SVN-Commit-Revision: 343205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37647759E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 00:58:55 -0000 Author: markj Date: Sun Jan 20 00:58:54 2019 New Revision: 343205 URL: https://svnweb.freebsd.org/changeset/base/343205 Log: MFC r343117: Fix handling of rights on stdio streams. PR: 234885 Modified: stable/12/usr.bin/cmp/cmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/cmp/cmp.c ============================================================================== --- stable/12/usr.bin/cmp/cmp.c Sun Jan 20 00:45:44 2019 (r343204) +++ stable/12/usr.bin/cmp/cmp.c Sun Jan 20 00:58:54 2019 (r343205) @@ -116,14 +116,16 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); + if (caph_limit_stdio() == -1) + err(ERR_EXIT, "failed to limit stdio"); + /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = 0; + fd1 = STDIN_FILENO; file1 = "stdin"; - } - else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -134,10 +136,9 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = 0; + fd2 = STDIN_FILENO; file2 = "stdin"; - } - else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -174,17 +175,6 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit fcntls for %s", file1); if (cap_fcntls_limit(fd2, fcntls) < 0 && errno != ENOSYS) err(ERR_EXIT, "unable to limit fcntls for %s", file2); - - if (!special) { - cap_rights_init(&rights); - if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && - errno != ENOSYS) { - err(ERR_EXIT, "unable to limit stdio"); - } - } - - if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) - err(ERR_EXIT, "unable to limit stdio"); caph_cache_catpages(); From owner-svn-src-all@freebsd.org Sun Jan 20 03:30:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E5C714A2684; Sun, 20 Jan 2019 03:30:05 +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 AC8B383A15; Sun, 20 Jan 2019 03:30:04 +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 A04532452A; Sun, 20 Jan 2019 03:30:04 +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 x0K3U4pc085188; Sun, 20 Jan 2019 03:30:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K3U4Cm085187; Sun, 20 Jan 2019 03:30:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901200330.x0K3U4Cm085187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Jan 2019 03:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343206 - stable/12/sys/powerpc/booke X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/booke X-SVN-Commit-Revision: 343206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC8B383A15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.892,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 03:30:05 -0000 Author: jhibbits Date: Sun Jan 20 03:30:04 2019 New Revision: 343206 URL: https://svnweb.freebsd.org/changeset/base/343206 Log: MFC r342988: powerpcspe: Correct SPE high-component loading Don't clobber the low part of the register restoring the high component of. This could lead to very bad behavior if it's an ABI-affected register. While here, also mark the asm volatile in the SPE high save case, to match the load case. Modified: stable/12/sys/powerpc/booke/spe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/booke/spe.c ============================================================================== --- stable/12/sys/powerpc/booke/spe.c Sun Jan 20 00:58:54 2019 (r343205) +++ stable/12/sys/powerpc/booke/spe.c Sun Jan 20 03:30:04 2019 (r343206) @@ -425,7 +425,7 @@ static uint32_t spe_save_reg_high(int reg) { uint32_t vec[2]; -#define EVSTDW(n) case n: __asm ("evstdw %1,0(%0)" \ +#define EVSTDW(n) case n: __asm __volatile ("evstdw %1,0(%0)" \ :: "b"(vec), "n"(n)); break; switch (reg) { EVSTDW(0); EVSTDW(1); EVSTDW(2); EVSTDW(3); @@ -448,7 +448,7 @@ spe_save_reg_high(int reg) static void spe_load_reg_high(int reg, uint32_t val) { -#define EVLDW(n) case n: __asm __volatile("evmergelo "#n",%0,0," \ +#define EVLDW(n) case n: __asm __volatile("evmergelo "#n",%0,"#n \ :: "r"(val)); break; switch (reg) { EVLDW(1); EVLDW(2); EVLDW(3); EVLDW(4); From owner-svn-src-all@freebsd.org Sun Jan 20 03:53:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0659514A3250; Sun, 20 Jan 2019 03:53:43 +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 9E57B846E4; Sun, 20 Jan 2019 03:53:42 +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 8AADB24A50; Sun, 20 Jan 2019 03:53:42 +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 x0K3rglt000541; Sun, 20 Jan 2019 03:53:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K3rggs000540; Sun, 20 Jan 2019 03:53:42 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901200353.x0K3rggs000540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Jan 2019 03:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343207 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 343207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E57B846E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.89)[-0.892,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 03:53:43 -0000 Author: jhibbits Date: Sun Jan 20 03:53:42 2019 New Revision: 343207 URL: https://svnweb.freebsd.org/changeset/base/343207 Log: MFC r341387: Fix PowerPC64 ELFv1-specific problem in __elf_phdr_match_addr() leading to crash in threaded programs that unload libraries. Summary: The GNOME update to 3.28 exposed a bug in __elf_phdr_match_addr(), which leads to a crash when building devel/libsoup on powerpc64. Due to __elf_phdr_match_addr() limiting its search to PF_X sections, on the PPC64 ELFv1 ABI, it was never matching function pointers properly. This meant that libthr was never cleaning up its atfork list in __pthread_cxa_finalize(), so if a library with an atfork handler was unloaded, libthr would crash on the next fork. Normally, the null pointer check it does before calling the handler would avoid this crash, but, due to PPC64 ELFv1 using function descriptors instead of raw function pointers, a null check against the pointer itself is insufficient, as the pointer itself was not null, it was just pointing at a function descriptor that had been zeroed. (Which is an ABI violation.) Calling a zeroed function descriptor on PPC64 ELFv1 causes a jump to address 0 with a zeroed r2 and r11. Modified: stable/12/lib/libc/gen/elf_utils.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/elf_utils.c ============================================================================== --- stable/12/lib/libc/gen/elf_utils.c Sun Jan 20 03:30:04 2019 (r343206) +++ stable/12/lib/libc/gen/elf_utils.c Sun Jan 20 03:53:42 2019 (r343207) @@ -47,8 +47,21 @@ __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, for (i = 0; i < phdr_info->dlpi_phnum; i++) { ph = &phdr_info->dlpi_phdr[i]; - if (ph->p_type != PT_LOAD || (ph->p_flags & PF_X) == 0) + if (ph->p_type != PT_LOAD) continue; + + /* ELFv1 ABI for powerpc64 passes function descriptor + * pointers around, not function pointers. The function + * descriptors live in .opd, which is a non-executable segment. + * The PF_X check would therefore make all address checks fail, + * causing a crash in some instances. Don't skip over + * non-executable segments in the ELFv1 powerpc64 case. + */ +#if !defined(__powerpc64__) || (defined(_CALL_ELF) && _CALL_ELF == 2) + if ((ph->p_flags & PF_X) == 0) + continue; +#endif + if (phdr_info->dlpi_addr + ph->p_vaddr <= (uintptr_t)addr && (uintptr_t)addr + sizeof(addr) < phdr_info->dlpi_addr + ph->p_vaddr + ph->p_memsz) From owner-svn-src-all@freebsd.org Sun Jan 20 05:52:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC87814A695B; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@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 54B2987E1C; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C6525E78; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0K5qHdg062288; Sun, 20 Jan 2019 05:52:17 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K5qHC3062287; Sun, 20 Jan 2019 05:52:17 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901200552.x0K5qHC3062287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 05:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343209 - head/sys/fs/smbfs X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/fs/smbfs X-SVN-Commit-Revision: 343209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54B2987E1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 05:52:17 -0000 Author: gonzo Date: Sun Jan 20 05:52:16 2019 New Revision: 343209 URL: https://svnweb.freebsd.org/changeset/base/343209 Log: [smbfs] Allow semicolon in mounts that support long names Semicolon is a legal character in long names but not in 8.3 format. Move it to respective character set. PR: 140068 Submitted by: tom@uffner.com MFC after: 3 weeks Modified: head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sun Jan 20 03:58:21 2019 (r343208) +++ head/sys/fs/smbfs/smbfs_vnops.c Sun Jan 20 05:52:16 2019 (r343209) @@ -1120,8 +1120,8 @@ smbfs_advlock(ap) static int smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop) { - static const char *badchars = "*/:<>;?"; - static const char *badchars83 = " +|,[]="; + static const char *badchars = "*/:<>?"; + static const char *badchars83 = " +|,[]=;"; const char *cp; int i, error; From owner-svn-src-all@freebsd.org Sun Jan 20 03:58:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEEC814A3395; Sun, 20 Jan 2019 03:58:22 +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 83D6D84864; Sun, 20 Jan 2019 03:58:22 +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 7217824A5E; Sun, 20 Jan 2019 03:58:22 +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 x0K3wMDu000799; Sun, 20 Jan 2019 03:58:22 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K3wMe3000798; Sun, 20 Jan 2019 03:58:22 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901200358.x0K3wMe3000798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Jan 2019 03:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343208 - stable/12/libexec/rtld-elf/powerpc64 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/libexec/rtld-elf/powerpc64 X-SVN-Commit-Revision: 343208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83D6D84864 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.892,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 03:58:23 -0000 Author: jhibbits Date: Sun Jan 20 03:58:21 2019 New Revision: 343208 URL: https://svnweb.freebsd.org/changeset/base/343208 Log: MFC r342671: rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fix We need to subtract the TLS_TCB_SIZE to get to the real data pointer, since r13 points to the end of the TCB structure. Prior to this, devel/protobuf-c port broke with recent update to devel/protobuf, which exposed this issue. Submitted by: andreast Reported by: Piotr Kubaj Modified: stable/12/libexec/rtld-elf/powerpc64/reloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- stable/12/libexec/rtld-elf/powerpc64/reloc.c Sun Jan 20 03:53:42 2019 (r343207) +++ stable/12/libexec/rtld-elf/powerpc64/reloc.c Sun Jan 20 03:58:21 2019 (r343208) @@ -255,7 +255,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *ob *(Elf_Addr **)where = *where * sizeof(Elf_Addr) + (Elf_Addr *)(def->st_value + rela->r_addend - + defobj->tlsoffset - TLS_TP_OFFSET); + + defobj->tlsoffset - TLS_TP_OFFSET - TLS_TCB_SIZE); break; From owner-svn-src-all@freebsd.org Sun Jan 20 12:14:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470C0148D2E5; Sun, 20 Jan 2019 12:14:34 +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 E2AE9937B6; Sun, 20 Jan 2019 12:14: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 B7EDC20B1; Sun, 20 Jan 2019 12:14: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 x0KCEXwC060657; Sun, 20 Jan 2019 12:14:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KCEXoX060656; Sun, 20 Jan 2019 12:14:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901201214.x0KCEXoX060656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Jan 2019 12:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343211 - stable/12/sys/amd64/vmm/intel X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 343211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2AE9937B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 12:14:34 -0000 Author: kib Date: Sun Jan 20 12:14:33 2019 New Revision: 343211 URL: https://svnweb.freebsd.org/changeset/base/343211 Log: MFC r343108: Trim whitespace at EoL, use tabs instead of spaces for indent. PR: 235004 Modified: stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Sun Jan 20 11:41:25 2019 (r343210) +++ stable/12/sys/amd64/vmm/intel/vmx.c Sun Jan 20 12:14:33 2019 (r343211) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); (PROCBASED_INT_WINDOW_EXITING | \ PROCBASED_NMI_WINDOW_EXITING) -#define PROCBASED_CTLS_ONE_SETTING \ +#define PROCBASED_CTLS_ONE_SETTING \ (PROCBASED_SECONDARY_CONTROLS | \ PROCBASED_MWAIT_EXITING | \ PROCBASED_MONITOR_EXITING | \ @@ -428,7 +428,7 @@ vmx_allow_x2apic_msrs(struct vmx *vmx) for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_TMR0 + i); - + for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_IRR0 + i); @@ -576,7 +576,7 @@ vmx_disable(void *arg __unused) static int vmx_cleanup(void) { - + if (pirvec >= 0) lapic_ipi_free(pirvec); @@ -1097,7 +1097,7 @@ static int vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx) { int handled, func; - + func = vmxctx->guest_rax; handled = x86_emulate_cpuid(vm, vcpu, @@ -3096,7 +3096,7 @@ vmx_get_intr_shadow(struct vmx *vmx, int vcpu, int run uint64_t gi; int error; - error = vmcs_getreg(&vmx->vmcs[vcpu], running, + error = vmcs_getreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY), &gi); *retval = (gi & HWINTR_BLOCKING) ? 1 : 0; return (error); @@ -3140,8 +3140,8 @@ vmx_shadow_reg(int reg) switch (reg) { case VM_REG_GUEST_CR0: shreg = VMCS_CR0_SHADOW; - break; - case VM_REG_GUEST_CR4: + break; + case VM_REG_GUEST_CR4: shreg = VMCS_CR4_SHADOW; break; default: @@ -3212,7 +3212,7 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (shadow > 0) { /* * Store the unmodified value in the shadow - */ + */ error = vmcs_setreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(shadow), val); } @@ -3395,7 +3395,7 @@ vmx_setcap(void *arg, int vcpu, int type, int val) } } - return (retval); + return (retval); } struct vlapic_vtx { @@ -3698,7 +3698,7 @@ vmx_vlapic_init(void *arg, int vcpuid) struct vmx *vmx; struct vlapic *vlapic; struct vlapic_vtx *vlapic_vtx; - + vmx = arg; vlapic = malloc(sizeof(struct vlapic_vtx), M_VLAPIC, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Sun Jan 20 14:33:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A81B01491DE8; Sun, 20 Jan 2019 14:33:30 +0000 (UTC) (envelope-from avos@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 45CE76A0BE; Sun, 20 Jan 2019 14:33:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 047A33A11; Sun, 20 Jan 2019 14:33:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KEXThq034788; Sun, 20 Jan 2019 14:33:29 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KEXTtb034787; Sun, 20 Jan 2019 14:33:29 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901201433.x0KEXTtb034787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 20 Jan 2019 14:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343216 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 343216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45CE76A0BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:33:30 -0000 Author: avos Date: Sun Jan 20 14:33:29 2019 New Revision: 343216 URL: https://svnweb.freebsd.org/changeset/base/343216 Log: MFC r342991: net80211: provide rate validation for injected frames. There may be various side effects (device timeout, firmware and / or kernel panic) when an invalid (or inapplicable - e.g., an MCS rate for 11g-only device) is set; check rates before sending the frame to the driver. Modified: stable/12/sys/net80211/ieee80211_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_output.c ============================================================================== --- stable/12/sys/net80211/ieee80211_output.c Sun Jan 20 14:25:25 2019 (r343215) +++ stable/12/sys/net80211/ieee80211_output.c Sun Jan 20 14:33:29 2019 (r343216) @@ -604,6 +604,97 @@ ieee80211_validate_frame(struct mbuf *m, return (0); } +static int +ieee80211_validate_rate(struct ieee80211_node *ni, uint8_t rate) +{ + struct ieee80211com *ic = ni->ni_ic; + + if (IEEE80211_IS_HT_RATE(rate)) { + if ((ic->ic_htcaps & IEEE80211_HTC_HT) == 0) + return (EINVAL); + + rate = IEEE80211_RV(rate); + if (rate <= 31) { + if (rate > ic->ic_txstream * 8 - 1) + return (EINVAL); + + return (0); + } + + if (rate == 32) { + if ((ic->ic_htcaps & IEEE80211_HTC_TXMCS32) == 0) + return (EINVAL); + + return (0); + } + + if ((ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) == 0) + return (EINVAL); + + switch (ic->ic_txstream) { + case 0: + case 1: + return (EINVAL); + case 2: + if (rate > 38) + return (EINVAL); + + return (0); + case 3: + if (rate > 52) + return (EINVAL); + + return (0); + case 4: + default: + if (rate > 76) + return (EINVAL); + + return (0); + } + } + + if (!ieee80211_isratevalid(ic->ic_rt, rate)) + return (EINVAL); + + return (0); +} + +static int +ieee80211_sanitize_rates(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + int error; + + if (!params) + return (0); /* nothing to do */ + + /* NB: most drivers assume that ibp_rate0 is set (!= 0). */ + if (params->ibp_rate0 != 0) { + error = ieee80211_validate_rate(ni, params->ibp_rate0); + if (error != 0) + return (error); + } else { + /* XXX pre-setup some default (e.g., mgmt / mcast) rate */ + /* XXX __DECONST? */ + (void) m; + } + + if (params->ibp_rate1 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate1)) != 0) + return (error); + + if (params->ibp_rate2 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate2)) != 0) + return (error); + + if (params->ibp_rate3 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate3)) != 0) + return (error); + + return (0); +} + /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting @@ -717,6 +808,10 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, m->m_pkthdr.len - ieee80211_hdrsize(wh)); } else M_WME_SETAC(m, WME_AC_BE); + + error = ieee80211_sanitize_rates(ni, m, params); + if (error != 0) + senderr(error); IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { From owner-svn-src-all@freebsd.org Sun Jan 20 14:02:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FF0A1490E4C; Sun, 20 Jan 2019 14:02:15 +0000 (UTC) (envelope-from bz@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 DC75097809; Sun, 20 Jan 2019 14:02:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A3847165FB; Sun, 20 Jan 2019 14:02:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 52D878D4A142; Sun, 20 Jan 2019 14:02:12 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 61A05D211B6; Sun, 20 Jan 2019 14:02:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 4fJ27fBLmUuv; Sun, 20 Jan 2019 14:02:09 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6D10CD1F85E; Sun, 20 Jan 2019 14:02:09 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Andriy Voskoboinyk" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343213 - in head/sys: net80211 sys Date: Sun, 20 Jan 2019 14:02:08 +0000 X-Mailer: MailMate (2.0BETAr6134) Message-ID: <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> In-Reply-To: <201901201339.x0KDdICk003155@repo.freebsd.org> References: <201901201339.x0KDdICk003155@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC75097809 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:02:15 -0000 On 20 Jan 2019, at 13:39, Andriy Voskoboinyk wrote: > Author: avos > Date: Sun Jan 20 13:39:18 2019 > New Revision: 343213 > URL: https://svnweb.freebsd.org/changeset/base/343213 > > Log: > net80211: resolve ioctl <-> detach race for ieee80211com structure > > Since r287197 ieee80211com is a part of drivers softc; as a result, > after detach all pointers to it (iv_ic, ni_ic) are invalid. Most > possible users (tasks, interrupt handlers) are blocked / removed > when device is stopped; however, ioctl handlers were not tracked > and may crash if ieee80211com structure is accessed. > > Since ieee80211com pointer access from ieee80211vap structure is not > protected by lock (constant after interface creation) and used in > many other places just use reference counting for ioctl handlers; > on detach set 'detached' flag and wait until reference counter goes > to 0. So how do any cloned interfaces do this (wifi or non-wifi)? Is this a more general problem or are some wifi drivers just not exactly careful with the order they take things down? On another note, why would refcount(9) not be sufficient? I didn’t really like the MC() macros and the hand crafted state machine for a refcount when scrolling through. /bz From owner-svn-src-all@freebsd.org Sun Jan 20 14:25:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B13C7149187A; Sun, 20 Jan 2019 14:25:26 +0000 (UTC) (envelope-from jilles@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 51F9C6852F; Sun, 20 Jan 2019 14:25:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE25A3836; Sun, 20 Jan 2019 14:25:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KEPPSa029394; Sun, 20 Jan 2019 14:25:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KEPPEU029393; Sun, 20 Jan 2019 14:25:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901201425.x0KEPPEU029393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Jan 2019 14:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343215 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51F9C6852F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:25:26 -0000 Author: jilles Date: Sun Jan 20 14:25:25 2019 New Revision: 343215 URL: https://svnweb.freebsd.org/changeset/base/343215 Log: sh: Send libedit "ferr" output to fd 2 The libedit "fout" output must be sent to fd 2 since it contains prompts that POSIX says must be sent to fd 2. However, the libedit "ferr" output receives error messages such as from "bind" that make no sense to send to fd 1. Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun Jan 20 14:02:54 2019 (r343214) +++ head/bin/sh/histedit.c Sun Jan 20 14:25:25 2019 (r343215) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); History *hist; /* history cookie */ EditLine *el; /* editline cookie */ int displayhist; -static FILE *el_in, *el_out, *el_err; +static FILE *el_in, *el_out; static char *fc_replace(const char *, char *, char *); static int not_fcnumber(const char *); @@ -106,18 +106,16 @@ histedit(void) INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); - if (el_err == NULL) - el_err = fdopen(1, "w"); if (el_out == NULL) el_out = fdopen(2, "w"); - if (el_in == NULL || el_err == NULL || el_out == NULL) + if (el_in == NULL || el_out == NULL) goto bad; term = lookupvar("TERM"); if (term) setenv("TERM", term, 1); else unsetenv("TERM"); - el = el_init(arg0, el_in, el_out, el_err); + el = el_init(arg0, el_in, el_out, el_out); if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); From owner-svn-src-all@freebsd.org Sun Jan 20 13:39:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920E51490230; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@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 348CB96A02; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23B402E0C; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KDdJPf003164; Sun, 20 Jan 2019 13:39:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KDdICk003155; Sun, 20 Jan 2019 13:39:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901201339.x0KDdICk003155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 20 Jan 2019 13:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343213 - in head/sys: net80211 sys X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: net80211 sys X-SVN-Commit-Revision: 343213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 348CB96A02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 13:39:20 -0000 Author: avos Date: Sun Jan 20 13:39:18 2019 New Revision: 343213 URL: https://svnweb.freebsd.org/changeset/base/343213 Log: net80211: resolve ioctl <-> detach race for ieee80211com structure Since r287197 ieee80211com is a part of drivers softc; as a result, after detach all pointers to it (iv_ic, ni_ic) are invalid. Most possible users (tasks, interrupt handlers) are blocked / removed when device is stopped; however, ioctl handlers were not tracked and may crash if ieee80211com structure is accessed. Since ieee80211com pointer access from ieee80211vap structure is not protected by lock (constant after interface creation) and used in many other places just use reference counting for ioctl handlers; on detach set 'detached' flag and wait until reference counter goes to 0. For HEAD ieee80211vap size was changed (__FreeBSD_version bumped); however, in stable branches I'm going to split / reuse the last iv_spare field for KBI stability. Tested with: - rsu(4), SIOCSIFCAP (-rxcsum) ioctl; - rtwn_pci(4), SIOCG80211 / IEEE80211_IOC_HTPROTMODE ioctl. MFC after: 1 week Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_var.h head/sys/sys/param.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211.c Sun Jan 20 13:39:18 2019 (r343213) @@ -405,8 +405,10 @@ ieee80211_ifdetach(struct ieee80211com *ic) * The VAP is responsible for setting and clearing * the VIMAGE context. */ - while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) + while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) { + ieee80211_com_vdetach(vap); ieee80211_vap_destroy(vap); + } ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_freebsd.c Sun Jan 20 13:39:18 2019 (r343213) @@ -307,6 +307,55 @@ ieee80211_sysctl_vdetach(struct ieee80211vap *vap) } } +#define MS(_v, _f) (((_v) & _f##_M) >> _f##_S) +int +ieee80211_com_vincref(struct ieee80211vap *vap) +{ + uint32_t ostate; + + ostate = atomic_fetchadd_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + + if (ostate & IEEE80211_COM_DETACHED) { + atomic_subtract_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + return (ENETDOWN); + } + + if (MS(ostate, IEEE80211_COM_REF) == IEEE80211_COM_REF_MAX) { + atomic_subtract_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + return (EOVERFLOW); + } + + return (0); +} + +void +ieee80211_com_vdecref(struct ieee80211vap *vap) +{ + uint32_t ostate; + + ostate = atomic_fetchadd_32(&vap->iv_com_state, -IEEE80211_COM_REF_ADD); + + KASSERT(MS(ostate, IEEE80211_COM_REF) != 0, + ("com reference counter underflow")); + + (void) ostate; +} + +void +ieee80211_com_vdetach(struct ieee80211vap *vap) +{ + int sleep_time; + + sleep_time = msecs_to_ticks(250); + if (sleep_time == 0) + sleep_time = 1; + + atomic_set_32(&vap->iv_com_state, IEEE80211_COM_DETACHED); + while (MS(atomic_load_32(&vap->iv_com_state), IEEE80211_COM_REF) != 0) + pause("comref", sleep_time); +} +#undef MS + int ieee80211_node_dectestref(struct ieee80211_node *ni) { Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_freebsd.h Sun Jan 20 13:39:18 2019 (r343213) @@ -224,6 +224,11 @@ typedef struct mtx ieee80211_rt_lock_t; */ #include +struct ieee80211vap; +int ieee80211_com_vincref(struct ieee80211vap *); +void ieee80211_com_vdecref(struct ieee80211vap *); +void ieee80211_com_vdetach(struct ieee80211vap *); + #define ieee80211_node_initref(_ni) \ do { ((_ni)->ni_refcnt = 1); } while (0) #define ieee80211_node_incref(_ni) \ @@ -235,7 +240,6 @@ int ieee80211_node_dectestref(struct ieee80211_node *n #define ieee80211_node_refcnt(_ni) (_ni)->ni_refcnt struct ifqueue; -struct ieee80211vap; void ieee80211_drain_ifq(struct ifqueue *); void ieee80211_flush_ifq(struct ifqueue *, struct ieee80211vap *); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 20 13:39:18 2019 (r343213) @@ -3480,10 +3480,14 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - int error = 0, wait = 0; + int error = 0, wait = 0, ic_used; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ + ic_used = (cmd != SIOCSIFMTU && cmd != SIOCG80211STATS); + if (ic_used && (error = ieee80211_com_vincref(vap)) != 0) + return (error); + switch (cmd) { case SIOCSIFFLAGS: IEEE80211_LOCK(ic); @@ -3620,5 +3624,9 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t error = ether_ioctl(ifp, cmd, data); break; } + + if (ic_used) + ieee80211_com_vdecref(vap); + return (error); } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_var.h Sun Jan 20 13:39:18 2019 (r343213) @@ -400,6 +400,7 @@ struct ieee80211vap { uint32_t iv_caps; /* capabilities */ uint32_t iv_htcaps; /* HT capabilities */ uint32_t iv_htextcaps; /* HT extended capabilities */ + uint32_t iv_com_state; /* com usage / detached flag */ enum ieee80211_opmode iv_opmode; /* operation mode */ enum ieee80211_state iv_state; /* state machine state */ enum ieee80211_state iv_nstate; /* pending state */ @@ -684,6 +685,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_VFHT_BITS \ "\20\1VHT\2VHT40\3VHT80\4VHT80P80\5VHT160" + +#define IEEE80211_COM_DETACHED 0x00000001 /* ieee80211_ifdetach called */ +#define IEEE80211_COM_REF_ADD 0x00000002 /* add / remove reference */ +#define IEEE80211_COM_REF_M 0xfffffffe /* reference counter bits */ +#define IEEE80211_COM_REF_S 1 +#define IEEE80211_COM_REF_MAX (IEEE80211_COM_REF_M >> IEEE80211_COM_REF_S) int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); void ieee80211_ifattach(struct ieee80211com *); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/sys/param.h Sun Jan 20 13:39:18 2019 (r343213) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300008 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300009 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Jan 20 13:16:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB91148F906; Sun, 20 Jan 2019 13:16:37 +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 A836195FD9; Sun, 20 Jan 2019 13:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D5032AAB; Sun, 20 Jan 2019 13:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KDGaC5092377; Sun, 20 Jan 2019 13:16:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KDGa8L092376; Sun, 20 Jan 2019 13:16:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901201316.x0KDGa8L092376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Jan 2019 13:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343212 - stable/11/sys/amd64/vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/intel X-SVN-Commit-Revision: 343212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A836195FD9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 13:16:37 -0000 Author: kib Date: Sun Jan 20 13:16:36 2019 New Revision: 343212 URL: https://svnweb.freebsd.org/changeset/base/343212 Log: MFC r343108: Trim whitespace at EoL, use tabs instead of spaces for indent. PR: 235004 Modified: stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Sun Jan 20 12:14:33 2019 (r343211) +++ stable/11/sys/amd64/vmm/intel/vmx.c Sun Jan 20 13:16:36 2019 (r343212) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); (PROCBASED_INT_WINDOW_EXITING | \ PROCBASED_NMI_WINDOW_EXITING) -#define PROCBASED_CTLS_ONE_SETTING \ +#define PROCBASED_CTLS_ONE_SETTING \ (PROCBASED_SECONDARY_CONTROLS | \ PROCBASED_MWAIT_EXITING | \ PROCBASED_MONITOR_EXITING | \ @@ -347,7 +347,7 @@ vmx_allow_x2apic_msrs(struct vmx *vmx) for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_TMR0 + i); - + for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_IRR0 + i); @@ -495,7 +495,7 @@ vmx_disable(void *arg __unused) static int vmx_cleanup(void) { - + if (pirvec >= 0) lapic_ipi_free(pirvec); @@ -1016,7 +1016,7 @@ static int vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx) { int handled, func; - + func = vmxctx->guest_rax; handled = x86_emulate_cpuid(vm, vcpu, @@ -2958,7 +2958,7 @@ vmx_get_intr_shadow(struct vmx *vmx, int vcpu, int run uint64_t gi; int error; - error = vmcs_getreg(&vmx->vmcs[vcpu], running, + error = vmcs_getreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY), &gi); *retval = (gi & HWINTR_BLOCKING) ? 1 : 0; return (error); @@ -3002,8 +3002,8 @@ vmx_shadow_reg(int reg) switch (reg) { case VM_REG_GUEST_CR0: shreg = VMCS_CR0_SHADOW; - break; - case VM_REG_GUEST_CR4: + break; + case VM_REG_GUEST_CR4: shreg = VMCS_CR4_SHADOW; break; default: @@ -3074,7 +3074,7 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (shadow > 0) { /* * Store the unmodified value in the shadow - */ + */ error = vmcs_setreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(shadow), val); } @@ -3257,7 +3257,7 @@ vmx_setcap(void *arg, int vcpu, int type, int val) } } - return (retval); + return (retval); } struct vlapic_vtx { @@ -3539,7 +3539,7 @@ vmx_vlapic_init(void *arg, int vcpuid) struct vmx *vmx; struct vlapic *vlapic; struct vlapic_vtx *vlapic_vtx; - + vmx = arg; vlapic = malloc(sizeof(struct vlapic_vtx), M_VLAPIC, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Sun Jan 20 14:31:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4591491BCA; Sun, 20 Jan 2019 14:31:17 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F5369DA2; Sun, 20 Jan 2019 14:31:16 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id t18-v6so15377540ljd.4; Sun, 20 Jan 2019 06:31:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=V7NcKOyLf/SMcZ/6q4WBZC1D9+B+t4TnJ/fF4/heQmQ=; b=HujSzQ7zZXHivKXlXutuHOcUUZQnHYvEtu22SkQnLq5fnseLOSxh6RWIwNySAotmnO 9VUGMI8rdJ0b+kzFBmhqwpiz3+SurFFfZe9dQ/+iZYnfwCUeS4hjtBunAJgdRRGqNdhR ST4vCNdf0bKc+gYs53ilEr4mzOYi5wx/eLxpHwtx2G/sYzyckEz6pW9SA4aRXZV1o0u3 OTgotC0/2fKjWwm2kMjUAQ/mfnQ5byb96KRwXZnpb1B3lm2EcullLj5eVLZylpPwXkgO NQyaYi/AYTvpl+aLKawft9www5FwlZZUfS51+UBxUXwzIaOH6U8kqIklj+drYF96RmNT 2PPw== X-Gm-Message-State: AJcUukcfbdxXAH25x4/BcSjIZ5qr06rit5SBLaPuZNv7va7TTGn+V2l0 NnrT9g2fKCM+ydODBaEyNADBzdfP X-Google-Smtp-Source: ALg8bN6tw94tz9qCUmc1nmVC8lGdK2Dj1Zya4aMAnz2tNWu6SMnh7cjASZoTcQR+Oe21XfRb/+cflA== X-Received: by 2002:a2e:99d7:: with SMTP id l23-v6mr15359674ljj.165.1547994234377; Sun, 20 Jan 2019 06:23:54 -0800 (PST) Received: from localhost (46-133-20-39.dialup.umc.net.ua. [46.133.20.39]) by smtp.gmail.com with ESMTPSA id j25-v6sm1766388lji.77.2019.01.20.06.23.51 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 20 Jan 2019 06:23:53 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343213 - in head/sys: net80211 sys References: <201901201339.x0KDdICk003155@repo.freebsd.org> <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> Date: Sun, 20 Jan 2019 15:55:08 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 82F5369DA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of andriyvos@gmail.com designates 209.85.208.170 as permitted sender) smtp.mailfrom=andriyvos@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.13)[ipnet: 209.85.128.0/17(-3.75), asn: 15169(-1.84), country: US(-0.08)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.34)[-0.344,0]; RCVD_IN_DNSWL_NONE(0.00)[170.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[avos@freebsd.org,andriyvos@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_NOT_FQDN(0.50)[]; FROM_NEQ_ENVFROM(0.00)[avos@freebsd.org,andriyvos@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:31:17 -0000 Sun, 20 Jan 2019 16:02:08 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Bjoern A. Zeeb = : > On 20 Jan 2019, at 13:39, Andriy Voskoboinyk wrote: > >> Author: avos >> Date: Sun Jan 20 13:39:18 2019 >> New Revision: 343213 >> URL: https://svnweb.freebsd.org/changeset/base/343213 >> >> Log: >> net80211: resolve ioctl <-> detach race for ieee80211com structure >> >> Since r287197 ieee80211com is a part of drivers softc; as a result,= >> after detach all pointers to it (iv_ic, ni_ic) are invalid. Most >> possible users (tasks, interrupt handlers) are blocked / removed >> when device is stopped; however, ioctl handlers were not tracked >> and may crash if ieee80211com structure is accessed. >> >> Since ieee80211com pointer access from ieee80211vap structure is no= t >> protected by lock (constant after interface creation) and used in >> many other places just use reference counting for ioctl handlers; >> on detach set 'detached' flag and wait until reference counter goes= = >> to 0. > > So how do any cloned interfaces do this (wifi or non-wifi)? Is this a= = > more general problem or are some wifi drivers just not exactly careful= = > with the order they take things down? > That's for wifi only; ifp (and vap as subpart) is alive until reference counter for ifp is not 0; however, 'com' gets invalid as soon as device detach procedure is finished - and net80211 uses it in various places inside ieee80211_ioctl(). > On another note, why would refcount(9) not be sufficient? I didn=E2=80= =99t = > really like the MC() macros and the hand crafted state machine for a = > refcount when scrolling through. > Just to keep 'detached' flag and reference counter inside one variable (they both need to be atomically accessible). > /bz From owner-svn-src-all@freebsd.org Sun Jan 20 15:18:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D95171495181; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@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 817956C2AE; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 745AF41C7; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KFHxoo056383; Sun, 20 Jan 2019 15:17:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KFHvYE056373; Sun, 20 Jan 2019 15:17:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901201517.x0KFHvYE056373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 20 Jan 2019 15:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343219 - in head: sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/mips/conf sys/sparc64/conf tools/tools/nanobsd/pcengines X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/mips/conf sys/sparc64/conf tools/tools/nanobsd/pcengines X-SVN-Commit-Revision: 343219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 817956C2AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 15:18:00 -0000 Author: avos Date: Sun Jan 20 15:17:56 2019 New Revision: 343219 URL: https://svnweb.freebsd.org/changeset/base/343219 Log: Remove IEEE80211_AMPDU_AGE config option. It is noop since r297774. Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/RK3188 head/sys/conf/NOTES head/sys/conf/config.mk head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ERL head/sys/mips/conf/OCTEON1 head/sys/sparc64/conf/GENERIC head/tools/tools/nanobsd/pcengines/ALIX_DSK Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/amd64/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -284,7 +284,6 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/arm/conf/RK3188 Sun Jan 20 15:17:56 2019 (r343219) @@ -79,7 +79,6 @@ device bpf # Wireless NIC cards options IEEE80211_DEBUG -options IEEE80211_AMPDU_AGE options IEEE80211_SUPPORT_MESH options IEEE80211_SUPPORT_TDMA device wlan # 802.11 support Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/NOTES Sun Jan 20 15:17:56 2019 (r343219) @@ -843,7 +843,6 @@ device vxlan # and ath drivers and will eventually be required by all 802.11 drivers. device wlan options IEEE80211_DEBUG #enable debugging msgs -options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH #enable 802.11s D3.0 support options IEEE80211_SUPPORT_TDMA #enable TDMA support Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/config.mk Sun Jan 20 15:17:56 2019 (r343219) @@ -31,13 +31,12 @@ opt_scsi.h: echo "#define SCSI_DELAY 15000" > ${.TARGET} opt_wlan.h: echo "#define IEEE80211_DEBUG 1" > ${.TARGET} - echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} KERN_OPTS.i386=NEW_PCIB DEV_PCI KERN_OPTS.amd64=NEW_PCIB DEV_PCI KERN_OPTS.powerpc=NEW_PCIB DEV_PCI KERN_OPTS=MROUTING IEEE80211_DEBUG \ - IEEE80211_AMPDU_AGE IEEE80211_SUPPORT_MESH DEV_BPF \ + IEEE80211_SUPPORT_MESH DEV_BPF \ ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA} .if ${MK_INET_SUPPORT} != "no" KERN_OPTS+= INET TCP_OFFLOAD Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/options Sun Jan 20 15:17:56 2019 (r343219) @@ -908,7 +908,6 @@ HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h # 802.11 support layer IEEE80211_DEBUG opt_wlan.h IEEE80211_DEBUG_REFCNT opt_wlan.h -IEEE80211_AMPDU_AGE opt_wlan.h IEEE80211_SUPPORT_MESH opt_wlan.h IEEE80211_SUPPORT_SUPERG opt_wlan.h IEEE80211_SUPPORT_TDMA opt_wlan.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/i386/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -280,7 +280,6 @@ device xe # Xircom pccard Ethernet # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/mips/conf/ERL Sun Jan 20 15:17:56 2019 (r343219) @@ -136,7 +136,6 @@ device octm # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/mips/conf/OCTEON1 Sun Jan 20 15:17:56 2019 (r343219) @@ -169,7 +169,6 @@ device bge # Broadcom BCM570xx Gigabit Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/sparc64/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -217,7 +217,6 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Sun Jan 20 15:00:15 2019 (r343218) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Sun Jan 20 15:17:56 2019 (r343219) @@ -54,7 +54,6 @@ device miibus device vr device wlan options IEEE80211_DEBUG -options IEEE80211_AMPDU_AGE options IEEE80211_SUPPORT_MESH device wlan_wep device wlan_ccmp From owner-svn-src-all@freebsd.org Sun Jan 20 21:09:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7866014A68FD; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@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 1D7B782AA8; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028F77CEF; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KL9iZr038441; Sun, 20 Jan 2019 21:09:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KL9ioc038440; Sun, 20 Jan 2019 21:09:44 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202109.x0KL9ioc038440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 21:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343225 - head/stand/mips/beri/boot2 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/stand/mips/beri/boot2 X-SVN-Commit-Revision: 343225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D7B782AA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 21:09:45 -0000 Author: gonzo Date: Sun Jan 20 21:09:44 2019 New Revision: 343225 URL: https://svnweb.freebsd.org/changeset/base/343225 Log: Unbreak mip64 build after r328437 Add exit and getchar functions to beri/boot2 code. They are required by panic_action functin introduced in r328437 Modified: head/stand/mips/beri/boot2/boot2.c Modified: head/stand/mips/beri/boot2/boot2.c ============================================================================== --- head/stand/mips/beri/boot2/boot2.c Sun Jan 20 20:29:26 2019 (r343224) +++ head/stand/mips/beri/boot2/boot2.c Sun Jan 20 21:09:44 2019 (r343225) @@ -651,3 +651,19 @@ xgetc(int fn) return 0; } } + +int +getchar(void) +{ + + return xgetc(0); +} + +void +exit(int code) +{ + + printf("error: loader exit\n"); + while (1); + __unreachable(); +} From owner-svn-src-all@freebsd.org Sun Jan 20 19:55:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8332214A3424; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@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 2523476E9E; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1840D70C6; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KJts7U001298; Sun, 20 Jan 2019 19:55:54 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KJtsO8001297; Sun, 20 Jan 2019 19:55:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901201955.x0KJtsO8001297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 19:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343223 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2523476E9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 19:55:55 -0000 Author: gonzo Date: Sun Jan 20 19:55:54 2019 New Revision: 343223 URL: https://svnweb.freebsd.org/changeset/base/343223 Log: Fix inconsistency in return values introduced by r343222 Consistently return 1 or the case of missing arguments in both functions PR: 219689 MFC after: 1 week X-MFC-With: 343222 Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Sun Jan 20 19:47:33 2019 (r343222) +++ head/usr.bin/systat/devs.c Sun Jan 20 19:55:54 2019 (r343223) @@ -195,7 +195,7 @@ dsmatchselect(const char *args, devstat_select_mode se if (!args) { warnx("dsmatchselect: no arguments"); - return(0); + return(1); } /* From owner-svn-src-all@freebsd.org Sun Jan 20 21:49:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED6C14A8554; Sun, 20 Jan 2019 21:49:14 +0000 (UTC) (envelope-from joerg@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 CABAF8470F; Sun, 20 Jan 2019 21:49:13 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7807983B2; Sun, 20 Jan 2019 21:49:13 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KLnDhi059438; Sun, 20 Jan 2019 21:49:13 GMT (envelope-from joerg@FreeBSD.org) Received: (from joerg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KLnDFo059437; Sun, 20 Jan 2019 21:49:13 GMT (envelope-from joerg@FreeBSD.org) Message-Id: <201901202149.x0KLnDFo059437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joerg set sender to joerg@FreeBSD.org using -f From: Joerg Wunsch Date: Sun, 20 Jan 2019 21:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343227 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: joerg X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 343227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CABAF8470F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 21:49:14 -0000 Author: joerg Date: Sun Jan 20 21:49:13 2019 New Revision: 343227 URL: https://svnweb.freebsd.org/changeset/base/343227 Log: MFC r342791: fix a typo in chio(4) (which propagates into chio(1)) Modified: stable/10/sys/sys/chio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/chio.h ============================================================================== --- stable/10/sys/sys/chio.h Sun Jan 20 21:38:24 2019 (r343226) +++ stable/10/sys/sys/chio.h Sun Jan 20 21:49:13 2019 (r343227) @@ -262,7 +262,7 @@ struct changer_set_voltag_request { #define CESTATUS_BITS \ - "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" + "\20\6INENAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" #define CHIOMOVE _IOW('c', 0x01, struct changer_move) #define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) From owner-svn-src-all@freebsd.org Sun Jan 20 22:03:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA41914A8F68; Sun, 20 Jan 2019 22:03:44 +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 8F8B48520A; Sun, 20 Jan 2019 22:03:44 +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 805F686FC; Sun, 20 Jan 2019 22:03:44 +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 x0KM3iMm069591; Sun, 20 Jan 2019 22:03:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KM3iWl069590; Sun, 20 Jan 2019 22:03:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901202203.x0KM3iWl069590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 20 Jan 2019 22:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343230 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 343230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F8B48520A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:03:45 -0000 Author: kp Date: Sun Jan 20 22:03:43 2019 New Revision: 343230 URL: https://svnweb.freebsd.org/changeset/base/343230 Log: MFC r342990 pf tests: Test PR 229241 pfctl has an issue with 'set skip on ', which causes inconsistent behaviour: the set skip directive works initially, but does not take effect when the same rules are re-applied. PR: 229241 Modified: stable/12/tests/sys/netpfil/pf/set_skip.sh stable/12/tests/sys/netpfil/pf/utils.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- stable/12/tests/sys/netpfil/pf/set_skip.sh Sun Jan 20 22:01:41 2019 (r343229) +++ stable/12/tests/sys/netpfil/pf/set_skip.sh Sun Jan 20 22:03:43 2019 (r343230) @@ -30,7 +30,38 @@ set_skip_group_cleanup() pft_cleanup } +atf_test_case "set_skip_group_lo" "cleanup" +set_skip_group_lo_head() +{ + atf_set descr 'Basic set skip test, lo' + atf_set require.user root +} + +set_skip_group_lo_body() +{ + # See PR 229241 + pft_init + + pft_mkjail alcatraz + jexec alcatraz ifconfig lo0 127.0.0.1/8 up + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on lo" \ + "block on lo0" + + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + pft_set_rules noflush alcatraz "set skip on lo" \ + "block on lo0" + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + jexec alcatraz pfctl -s rules +} + +set_skip_group_lo_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "set_skip_group" + atf_add_test_case "set_skip_group_lo" } Modified: stable/12/tests/sys/netpfil/pf/utils.subr ============================================================================== --- stable/12/tests/sys/netpfil/pf/utils.subr Sun Jan 20 22:01:41 2019 (r343229) +++ stable/12/tests/sys/netpfil/pf/utils.subr Sun Jan 20 22:03:43 2019 (r343230) @@ -49,8 +49,14 @@ pft_set_rules() jname=$1 shift - # Flush all states, rules, fragments, ... - jexec ${jname} pfctl -F all + if [ $jname == "noflush" ]; + then + jname=$1 + shift + else + # Flush all states, rules, fragments, ... + jexec ${jname} pfctl -F all + fi while [ $# -gt 0 ]; do printf "$1\n" From owner-svn-src-all@freebsd.org Sun Jan 20 22:01:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F88814A8F13; Sun, 20 Jan 2019 22:01:42 +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 BAEC384E65; Sun, 20 Jan 2019 22:01:41 +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 AFE5C85B1; Sun, 20 Jan 2019 22:01:41 +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 x0KM1fQD065568; Sun, 20 Jan 2019 22:01:41 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KM1fFF065567; Sun, 20 Jan 2019 22:01:41 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901202201.x0KM1fFF065567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 20 Jan 2019 22:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343229 - stable/11/sbin/pfctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sbin/pfctl X-SVN-Commit-Revision: 343229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAEC384E65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:01:42 -0000 Author: kp Date: Sun Jan 20 22:01:41 2019 New Revision: 343229 URL: https://svnweb.freebsd.org/changeset/base/343229 Log: MFC r342989 pfctl: Fix 'set skip' handling for groups When we skip on a group the kernel will automatically skip on the member interfaces. We still need to update our own cache though, or we risk overruling the kernel afterwards. This manifested as 'set skip' working initially, then not working when the rules were reloaded. PR: 229241 Modified: stable/11/sbin/pfctl/pfctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/pfctl.c ============================================================================== --- stable/11/sbin/pfctl/pfctl.c Sun Jan 20 22:01:39 2019 (r343228) +++ stable/11/sbin/pfctl/pfctl.c Sun Jan 20 22:01:41 2019 (r343229) @@ -1972,6 +1972,7 @@ int pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) { struct pfioc_iface pi; + struct node_host *h = NULL, *n = NULL; if ((loadopt & PFCTL_FLAG_OPTION) == 0) return (0); @@ -1979,6 +1980,12 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifna bzero(&pi, sizeof(pi)); pi.pfiio_flags = flags; + + /* Make sure our cache matches the kernel. If we set or clear the flag + * for a group this applies to all members. */ + h = ifa_grouplookup(ifname, 0); + for (n = h; n != NULL; n = n->next) + pfctl_set_interface_flags(pf, n->ifname, flags, how); if (strlcpy(pi.pfiio_name, ifname, sizeof(pi.pfiio_name)) >= sizeof(pi.pfiio_name)) From owner-svn-src-all@freebsd.org Sun Jan 20 22:08:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D22314A918D; Sun, 20 Jan 2019 22:08:51 +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 F3AF8854DA; Sun, 20 Jan 2019 22:08:50 +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 E528086FF; Sun, 20 Jan 2019 22:08:50 +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 x0KM8oc2069864; Sun, 20 Jan 2019 22:08:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KM8n10069859; Sun, 20 Jan 2019 22:08:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901202208.x0KM8n10069859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 20 Jan 2019 22:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343231 - in head: bin/csh bin/sh share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: bin/csh bin/sh share/skel X-SVN-Commit-Revision: 343231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3AF8854DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:08:51 -0000 Author: trasz Date: Sun Jan 20 22:08:49 2019 New Revision: 343231 URL: https://svnweb.freebsd.org/changeset/base/343231 Log: Don't mess with BLOCKSIZE in shell startup files - it's set by login.conf(5); there's no need to even mention it in shell rc files. Not that it's wrong; just pointless and somewhat misleading. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18809 Modified: head/bin/csh/csh.login head/bin/csh/dot.cshrc head/bin/sh/profile head/share/skel/dot.cshrc head/share/skel/dot.profile Modified: head/bin/csh/csh.login ============================================================================== --- head/bin/csh/csh.login Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/csh/csh.login Sun Jan 20 22:08:49 2019 (r343231) @@ -1,9 +1,6 @@ # $FreeBSD$ # # System-wide .login file for csh(1). -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# setenv BLOCKSIZE K # # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. Modified: head/bin/csh/dot.cshrc ============================================================================== --- head/bin/csh/dot.cshrc Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/csh/dot.cshrc Sun Jan 20 22:08:49 2019 (r343231) @@ -19,7 +19,6 @@ set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/s setenv EDITOR vi setenv PAGER less -setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up Modified: head/bin/sh/profile ============================================================================== --- head/bin/sh/profile Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/sh/profile Sun Jan 20 22:08:49 2019 (r343231) @@ -2,10 +2,6 @@ # # System-wide .profile file for sh(1). # -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# BLOCKSIZE=K; export BLOCKSIZE -# # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. # For full locales list check /usr/share/locale/* Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Sun Jan 20 22:03:43 2019 (r343230) +++ head/share/skel/dot.cshrc Sun Jan 20 22:08:49 2019 (r343231) @@ -15,7 +15,6 @@ alias ll ls -lAF # These are normally set through /etc/login.conf. You may override them here # if wanted. # set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) -# setenv BLOCKSIZE K # A righteous umask # umask 22 Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Sun Jan 20 22:03:43 2019 (r343230) +++ head/share/skel/dot.profile Sun Jan 20 22:08:49 2019 (r343231) @@ -8,7 +8,6 @@ # These are normally set through /etc/login.conf. You may override them here # if wanted. # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH -# BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a From owner-svn-src-all@freebsd.org Sun Jan 20 19:47:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD45B14A2EFE; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@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 5D72A7698B; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513896F1E; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KJlY4E096276; Sun, 20 Jan 2019 19:47:34 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KJlYDa096275; Sun, 20 Jan 2019 19:47:34 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901201947.x0KJlYDa096275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 19:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343222 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D72A7698B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 19:47:34 -0000 Author: gonzo Date: Sun Jan 20 19:47:33 2019 New Revision: 343222 URL: https://svnweb.freebsd.org/changeset/base/343222 Log: Fix crash in systat(4) when certain commands are called without arguments Add check for missing arguments to dsmatchselect and dsselect PR: 219689 Submitted by: Marko Turk MFC after: 1 week Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Sun Jan 20 18:53:32 2019 (r343221) +++ head/usr.bin/systat/devs.c Sun Jan 20 19:47:33 2019 (r343222) @@ -193,6 +193,11 @@ dsmatchselect(const char *args, devstat_select_mode se int i; int retval = 0; + if (!args) { + warnx("dsmatchselect: no arguments"); + return(0); + } + /* * Break the (pipe delimited) input string out into separate * strings. @@ -250,6 +255,11 @@ dsselect(const char *args, devstat_select_mode select_ char *cp, *tmpstr, *tmpstr1, *buffer; int i; int retval = 0; + + if (!args) { + warnx("dsselect: no argument"); + return(1); + } /* * If we've gone through this code before, free previously From owner-svn-src-all@freebsd.org Sun Jan 20 20:29:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B1D14A4C8A; Sun, 20 Jan 2019 20:29:28 +0000 (UTC) (envelope-from gonzo@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 D122C805B6; Sun, 20 Jan 2019 20:29:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0E1175FF; Sun, 20 Jan 2019 20:29:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KKTRTD017009; Sun, 20 Jan 2019 20:29:27 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KKTRBN017008; Sun, 20 Jan 2019 20:29:27 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202029.x0KKTRBN017008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 20:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343224 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D122C805B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 20:29:28 -0000 Author: gonzo Date: Sun Jan 20 20:29:26 2019 New Revision: 343224 URL: https://svnweb.freebsd.org/changeset/base/343224 Log: Add KBD_BOOTPROTO quirk for Logitech G510s USB keyboard PR: 232136 Submitted by: dgilbert@eicat.ca MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Jan 20 19:55:54 2019 (r343223) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Jan 20 20:29:26 2019 (r343224) @@ -96,6 +96,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC), USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), + USB_QUIRK(LOGITECH, G510S, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jan 20 19:55:54 2019 (r343223) +++ head/sys/dev/usb/usbdevs Sun Jan 20 20:29:26 2019 (r343224) @@ -2842,6 +2842,7 @@ product LOGITECH UN58A 0xc030 iFeel Mouse product LOGITECH UN53B 0xc032 iFeel MouseMan product LOGITECH WMPAD 0xc208 WingMan GamePad Extreme product LOGITECH WMRPAD 0xc20a WingMan RumblePad +product LOGITECH G510S 0xc22d G510s Keyboard product LOGITECH WMJOY 0xc281 WingMan Force joystick product LOGITECH BB13 0xc401 USB-PS/2 Trackball product LOGITECH RK53 0xc501 Cordless mouse From owner-svn-src-all@freebsd.org Sun Jan 20 22:01:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F8A814A8F0B; Sun, 20 Jan 2019 22:01:40 +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 A9A3984E5A; Sun, 20 Jan 2019 22:01:39 +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 9ED2A85AC; Sun, 20 Jan 2019 22:01:39 +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 x0KM1dWx065510; Sun, 20 Jan 2019 22:01:39 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KM1dvg065509; Sun, 20 Jan 2019 22:01:39 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901202201.x0KM1dvg065509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 20 Jan 2019 22:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343228 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 343228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9A3984E5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:01:40 -0000 Author: kp Date: Sun Jan 20 22:01:39 2019 New Revision: 343228 URL: https://svnweb.freebsd.org/changeset/base/343228 Log: MFC r342989 pfctl: Fix 'set skip' handling for groups When we skip on a group the kernel will automatically skip on the member interfaces. We still need to update our own cache though, or we risk overruling the kernel afterwards. This manifested as 'set skip' working initially, then not working when the rules were reloaded. PR: 229241 Modified: stable/12/sbin/pfctl/pfctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/pfctl.c ============================================================================== --- stable/12/sbin/pfctl/pfctl.c Sun Jan 20 21:49:13 2019 (r343227) +++ stable/12/sbin/pfctl/pfctl.c Sun Jan 20 22:01:39 2019 (r343228) @@ -1977,6 +1977,7 @@ int pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) { struct pfioc_iface pi; + struct node_host *h = NULL, *n = NULL; if ((loadopt & PFCTL_FLAG_OPTION) == 0) return (0); @@ -1984,6 +1985,12 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifna bzero(&pi, sizeof(pi)); pi.pfiio_flags = flags; + + /* Make sure our cache matches the kernel. If we set or clear the flag + * for a group this applies to all members. */ + h = ifa_grouplookup(ifname, 0); + for (n = h; n != NULL; n = n->next) + pfctl_set_interface_flags(pf, n->ifname, flags, how); if (strlcpy(pi.pfiio_name, ifname, sizeof(pi.pfiio_name)) >= sizeof(pi.pfiio_name)) From owner-svn-src-all@freebsd.org Sun Jan 20 22:34:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA2214AA240; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@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 8189986711; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72DC18C03; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KMY4P7085203; Sun, 20 Jan 2019 22:34:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KMY4T5085202; Sun, 20 Jan 2019 22:34:04 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202234.x0KMY4T5085202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 22:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343232 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8189986711 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:34:05 -0000 Author: gonzo Date: Sun Jan 20 22:34:04 2019 New Revision: 343232 URL: https://svnweb.freebsd.org/changeset/base/343232 Log: Add more profile-enabled libraries to remove when WITHOUT_PROFILE is defined PR: 230898 Submitted by: Herbert J. Skuhra MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 20 22:08:49 2019 (r343231) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 20 22:34:04 2019 (r343232) @@ -7464,6 +7464,8 @@ OLD_FILES+=usr/share/man/man8/pppctl.8.gz .endif .if ${MK_PROFILE} == no +OLD_FILES+=usr/lib/lib80211_p.a +OLD_FILES+=usr/lib/libBlocksRuntime_p.a OLD_FILES+=usr/lib/libalias_cuseeme_p.a OLD_FILES+=usr/lib/libalias_dummy_p.a OLD_FILES+=usr/lib/libalias_ftp_p.a @@ -7475,40 +7477,64 @@ OLD_FILES+=usr/lib/libalias_skinny_p.a OLD_FILES+=usr/lib/libalias_smedia_p.a OLD_FILES+=usr/lib/libarchive_p.a OLD_FILES+=usr/lib/libasn1_p.a +OLD_FILES+=usr/lib/libauditd_p.a +OLD_FILES+=usr/lib/libavl_p.a +OLD_FILES+=usr/lib/libbe_p.a OLD_FILES+=usr/lib/libbegemot_p.a +OLD_FILES+=usr/lib/libblacklist_p.a OLD_FILES+=usr/lib/libbluetooth_p.a OLD_FILES+=usr/lib/libbsdxml_p.a OLD_FILES+=usr/lib/libbsm_p.a OLD_FILES+=usr/lib/libbsnmp_p.a OLD_FILES+=usr/lib/libbz2_p.a +OLD_FILES+=usr/lib/libc++_p.a OLD_FILES+=usr/lib/libc_p.a OLD_FILES+=usr/lib/libcalendar_p.a OLD_FILES+=usr/lib/libcam_p.a OLD_FILES+=usr/lib/libcom_err_p.a OLD_FILES+=usr/lib/libcompat_p.a +OLD_FILES+=usr/lib/libcompiler_rt_p.a OLD_FILES+=usr/lib/libcrypt_p.a OLD_FILES+=usr/lib/libcrypto_p.a +OLD_FILES+=usr/lib/libctf_p.a OLD_FILES+=usr/lib/libcurses_p.a OLD_FILES+=usr/lib/libcursesw_p.a +OLD_FILES+=usr/lib/libcuse_p.a +OLD_FILES+=usr/lib/libcxxrt_p.a +OLD_FILES+=usr/lib/libdevctl_p.a OLD_FILES+=usr/lib/libdevinfo_p.a OLD_FILES+=usr/lib/libdevstat_p.a OLD_FILES+=usr/lib/libdialog_p.a +OLD_FILES+=usr/lib/libdl_p.a +OLD_FILES+=usr/lib/libdpv_p.a +OLD_FILES+=usr/lib/libdtrace_p.a +OLD_FILES+=usr/lib/libdwarf_p.a OLD_FILES+=usr/lib/libedit_p.a +OLD_FILES+=usr/lib/libefivar_p.a OLD_FILES+=usr/lib/libelf_p.a +OLD_FILES+=usr/lib/libexecinfo_p.a OLD_FILES+=usr/lib/libfetch_p.a +OLD_FILES+=usr/lib/libfigpar_p.a OLD_FILES+=usr/lib/libfl_p.a OLD_FILES+=usr/lib/libform_p.a OLD_FILES+=usr/lib/libformw_p.a +OLD_FILES+=usr/lib/libgcc_eh_p.a OLD_FILES+=usr/lib/libgcc_p.a OLD_FILES+=usr/lib/libgeom_p.a OLD_FILES+=usr/lib/libgnuregex_p.a +OLD_FILES+=usr/lib/libgpio_p.a OLD_FILES+=usr/lib/libgssapi_krb5_p.a +OLD_FILES+=usr/lib/libgssapi_ntlm_p.a OLD_FILES+=usr/lib/libgssapi_p.a +OLD_FILES+=usr/lib/libgssapi_spnego_p.a OLD_FILES+=usr/lib/libhdb_p.a OLD_FILES+=usr/lib/libheimbase_p.a +OLD_FILES+=usr/lib/libheimntlm_p.a OLD_FILES+=usr/lib/libheimsqlite_p.a OLD_FILES+=usr/lib/libhistory_p.a +OLD_FILES+=usr/lib/libhx509_p.a OLD_FILES+=usr/lib/libipsec_p.a +OLD_FILES+=usr/lib/libipt_p.a OLD_FILES+=usr/lib/libjail_p.a OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv_p.a @@ -7519,6 +7545,7 @@ OLD_FILES+=usr/lib/libkrb5_p.a OLD_FILES+=usr/lib/libkvm_p.a OLD_FILES+=usr/lib/libl_p.a OLD_FILES+=usr/lib/libln_p.a +OLD_FILES+=usr/lib/liblzma_p.a OLD_FILES+=usr/lib/libm_p.a OLD_FILES+=usr/lib/libmagic_p.a OLD_FILES+=usr/lib/libmd_p.a @@ -7527,26 +7554,52 @@ OLD_FILES+=usr/lib/libmenu_p.a OLD_FILES+=usr/lib/libmenuw_p.a OLD_FILES+=usr/lib/libmilter_p.a OLD_FILES+=usr/lib/libmp_p.a +OLD_FILES+=usr/lib/libmt_p.a OLD_FILES+=usr/lib/libncurses_p.a OLD_FILES+=usr/lib/libncursesw_p.a OLD_FILES+=usr/lib/libnetgraph_p.a OLD_FILES+=usr/lib/libngatm_p.a +OLD_FILES+=usr/lib/libnv_p.a +OLD_FILES+=usr/lib/libnvpair_p.a +OLD_FILES+=usr/lib/libopencsd_p.a OLD_FILES+=usr/lib/libopie_p.a OLD_FILES+=usr/lib/libpanel_p.a OLD_FILES+=usr/lib/libpanelw_p.a +OLD_FILES+=usr/lib/libpathconv_p.a OLD_FILES+=usr/lib/libpcap_p.a +OLD_FILES+=usr/lib/libpjdlog_p.a OLD_FILES+=usr/lib/libpmc_p.a +OLD_FILES+=usr/lib/libprivatebsdstat_p.a +OLD_FILES+=usr/lib/libprivatedevdctl_p.a +OLD_FILES+=usr/lib/libprivateevent_p.a +OLD_FILES+=usr/lib/libprivateheimipcc_p.a +OLD_FILES+=usr/lib/libprivateheimipcs_p.a +OLD_FILES+=usr/lib/libprivateifconfig_p.a +OLD_FILES+=usr/lib/libprivateldns_p.a +OLD_FILES+=usr/lib/libprivatesqlite3_p.a +OLD_FILES+=usr/lib/libprivatessh_p.a +OLD_FILES+=usr/lib/libprivateucl_p.a +OLD_FILES+=usr/lib/libprivateunbound_p.a +OLD_FILES+=usr/lib/libprivatezstd_p.a +OLD_FILES+=usr/lib/libproc_p.a +OLD_FILES+=usr/lib/libprocstat_p.a OLD_FILES+=usr/lib/libpthread_p.a OLD_FILES+=usr/lib/libradius_p.a +OLD_FILES+=usr/lib/libregex_p.a OLD_FILES+=usr/lib/libroken_p.a OLD_FILES+=usr/lib/librpcsvc_p.a +OLD_FILES+=usr/lib/librss_p.a OLD_FILES+=usr/lib/librt_p.a +OLD_FILES+=usr/lib/librtld_db_p.a OLD_FILES+=usr/lib/libsbuf_p.a OLD_FILES+=usr/lib/libsdp_p.a OLD_FILES+=usr/lib/libsmb_p.a OLD_FILES+=usr/lib/libssl_p.a +OLD_FILES+=usr/lib/libstdbuf_p.a OLD_FILES+=usr/lib/libstdc++_p.a +OLD_FILES+=usr/lib/libstdthreads_p.a OLD_FILES+=usr/lib/libsupc++_p.a +OLD_FILES+=usr/lib/libsysdecode_p.a OLD_FILES+=usr/lib/libtacplus_p.a OLD_FILES+=usr/lib/libtermcap_p.a OLD_FILES+=usr/lib/libtermcapw_p.a @@ -7558,14 +7611,23 @@ OLD_FILES+=usr/lib/libtinfo_p.a OLD_FILES+=usr/lib/libtinfow_p.a OLD_FILES+=usr/lib/libufs_p.a OLD_FILES+=usr/lib/libugidfw_p.a +OLD_FILES+=usr/lib/libulog_p.a +OLD_FILES+=usr/lib/libumem_p.a +OLD_FILES+=usr/lib/libusb_p.a OLD_FILES+=usr/lib/libusbhid_p.a +OLD_FILES+=usr/lib/libutempter_p.a OLD_FILES+=usr/lib/libutil_p.a +OLD_FILES+=usr/lib/libuutil_p.a OLD_FILES+=usr/lib/libvgl_p.a +OLD_FILES+=usr/lib/libvmmapi_p.a OLD_FILES+=usr/lib/libwind_p.a OLD_FILES+=usr/lib/libwrap_p.a +OLD_FILES+=usr/lib/libxo_p.a OLD_FILES+=usr/lib/liby_p.a OLD_FILES+=usr/lib/libypclnt_p.a OLD_FILES+=usr/lib/libz_p.a +OLD_FILES+=usr/lib/libzfs_core_p.a +OLD_FILES+=usr/lib/libzfs_p.a OLD_FILES+=usr/lib/private/libldns_p.a OLD_FILES+=usr/lib/private/libssh_p.a .endif From owner-svn-src-all@freebsd.org Mon Jan 21 00:03:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED9F14AE6B3; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@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 1210F8B206; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F829AED; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L03Z3K031879; Mon, 21 Jan 2019 00:03:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L03Zw6031878; Mon, 21 Jan 2019 00:03:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210003.x0L03Zw6031878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343234 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1210F8B206 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:03:36 -0000 Author: avos Date: Mon Jan 21 00:03:35 2019 New Revision: 343234 URL: https://svnweb.freebsd.org/changeset/base/343234 Log: run(4): add more length checks in Rx path. - Discard frames that are bigger than MCLBYTES (to prevent buffer overrun). - Check buffer length before accessing its contents. - Fix len <-> dmalen check - the last includes Rx Wireless information structure size. - Fix out-of-bounds read during Rx node search for ACK / CTS frames (monitor mode only). While here: - Mark few suspicious places with comments. - Move common cleanup to the function end. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Jan 20 23:30:16 2019 (r343233) +++ head/sys/dev/usb/wlan/if_run.c Mon Jan 21 00:03:35 2019 (r343234) @@ -2824,69 +2824,80 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin uint8_t ant, rssi; int8_t nf; - rxwi = mtod(m, struct rt2860_rxwi *); - len = le16toh(rxwi->len) & 0xfff; rxwisize = sizeof(struct rt2860_rxwi); if (sc->mac_ver == 0x5592) rxwisize += sizeof(uint64_t); else if (sc->mac_ver == 0x3593) rxwisize += sizeof(uint32_t); - if (__predict_false(len > dmalen)) { - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); + + if (__predict_false(dmalen < + rxwisize + sizeof(struct ieee80211_frame_ack))) { RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "payload is too short: dma length %u < %zu\n", + dmalen, rxwisize + sizeof(struct ieee80211_frame_ack)); + goto fail; + } + + rxwi = mtod(m, struct rt2860_rxwi *); + len = le16toh(rxwi->len) & 0xfff; + + if (__predict_false(len > dmalen - rxwisize)) { + RUN_DPRINTF(sc, RUN_DEBUG_RECV, "bad RXWI length %u > %u\n", len, dmalen); - return; + goto fail; } + /* Rx descriptor is located at the end */ rxd = (struct rt2870_rxd *)(mtod(m, caddr_t) + dmalen); flags = le32toh(rxd->flags); if (__predict_false(flags & (RT2860_RX_CRCERR | RT2860_RX_ICVERR))) { - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); RUN_DPRINTF(sc, RUN_DEBUG_RECV, "%s error.\n", (flags & RT2860_RX_CRCERR)?"CRC":"ICV"); - return; + goto fail; } + if (flags & RT2860_RX_L2PAD) { + /* + * XXX OpenBSD removes padding between header + * and payload here... + */ + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "received RT2860_RX_L2PAD frame\n"); + len += 2; + } + m->m_data += rxwisize; - m->m_pkthdr.len = m->m_len -= rxwisize; + m->m_pkthdr.len = m->m_len = len; wh = mtod(m, struct ieee80211_frame *); + /* XXX wrong for monitor mode */ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; m->m_flags |= M_WEP; } - if (flags & RT2860_RX_L2PAD) { - RUN_DPRINTF(sc, RUN_DEBUG_RECV, - "received RT2860_RX_L2PAD frame\n"); - len += 2; - } + if (len >= sizeof(struct ieee80211_frame_min)) { + ni = ieee80211_find_rxnode(ic, + mtod(m, struct ieee80211_frame_min *)); + } else + ni = NULL; - ni = ieee80211_find_rxnode(ic, - mtod(m, struct ieee80211_frame_min *)); - if (__predict_false(flags & RT2860_RX_MICERR)) { /* report MIC failures to net80211 for TKIP */ if (ni != NULL) ieee80211_notify_michael_failure(ni->ni_vap, wh, rxwi->keyidx); - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); RUN_DPRINTF(sc, RUN_DEBUG_RECV, "MIC error. Someone is lying.\n"); - return; + goto fail; } ant = run_maxrssi_chain(sc, rxwi); rssi = rxwi->rssi[ant]; nf = run_rssi2dbm(sc, rssi, ant); - m->m_pkthdr.len = m->m_len = len; - if (__predict_false(ieee80211_radiotap_active(ic))) { struct run_rx_radiotap_header *tap = &sc->sc_rxtap; uint16_t phy; @@ -2934,6 +2945,12 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin } else { (void)ieee80211_input_all(ic, m, rssi, nf); } + + return; + +fail: + m_freem(m); + counter_u64_add(ic->ic_ierrors, 1); } static void @@ -2943,7 +2960,7 @@ run_bulk_rx_callback(struct usb_xfer *xfer, usb_error_ struct ieee80211com *ic = &sc->sc_ic; struct mbuf *m = NULL; struct mbuf *m0; - uint32_t dmalen; + uint32_t dmalen, mbuf_len; uint16_t rxwisize; int xferlen; @@ -3049,6 +3066,14 @@ tr_setup: break; } + mbuf_len = dmalen + sizeof(struct rt2870_rxd); + if (__predict_false(mbuf_len > MCLBYTES)) { + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, + "payload is too big: mbuf_len %u\n", mbuf_len); + counter_u64_add(ic->ic_ierrors, 1); + break; + } + /* copy aggregated frames to another mbuf */ m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { @@ -3058,14 +3083,13 @@ tr_setup: break; } m_copydata(m, 4 /* skip 32-bit DMA-len header */, - dmalen + sizeof(struct rt2870_rxd), mtod(m0, caddr_t)); - m0->m_pkthdr.len = m0->m_len = - dmalen + sizeof(struct rt2870_rxd); + mbuf_len, mtod(m0, caddr_t)); + m0->m_pkthdr.len = m0->m_len = mbuf_len; run_rx_frame(sc, m0, dmalen); /* update data ptr */ - m->m_data += dmalen + 8; - m->m_pkthdr.len = m->m_len -= dmalen + 8; + m->m_data += mbuf_len + 4; + m->m_pkthdr.len = m->m_len -= mbuf_len + 4; } /* make sure we free the source buffer, if any */ From owner-svn-src-all@freebsd.org Mon Jan 21 00:09:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA0014AEB84; Mon, 21 Jan 2019 00:09:55 +0000 (UTC) (envelope-from avos@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 C49188B4E3; Mon, 21 Jan 2019 00:09:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7D119AF1; Mon, 21 Jan 2019 00:09:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L09smo032190; Mon, 21 Jan 2019 00:09:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L09sLM032189; Mon, 21 Jan 2019 00:09:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210009.x0L09sLM032189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343235 - head/sys/dev/iwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwn X-SVN-Commit-Revision: 343235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C49188B4E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:09:55 -0000 Author: avos Date: Mon Jan 21 00:09:54 2019 New Revision: 343235 URL: https://svnweb.freebsd.org/changeset/base/343235 Log: iwn(4): drop return code from iwn_*attach functions (they cannot fail) While here, add missing trace 'end' marker in iwn5000_attach(). MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jan 21 00:03:35 2019 (r343234) +++ head/sys/dev/iwn/if_iwn.c Mon Jan 21 00:09:54 2019 (r343235) @@ -131,8 +131,8 @@ static const struct iwn_ident iwn_ident_table[] = { static int iwn_probe(device_t); static int iwn_attach(device_t); -static int iwn4965_attach(struct iwn_softc *, uint16_t); -static int iwn5000_attach(struct iwn_softc *, uint16_t); +static void iwn4965_attach(struct iwn_softc *, uint16_t); +static void iwn5000_attach(struct iwn_softc *, uint16_t); static int iwn_config_specific(struct iwn_softc *, uint16_t); static void iwn_radiotap_attach(struct iwn_softc *); static void iwn_sysctlattach(struct iwn_softc *); @@ -495,14 +495,9 @@ iwn_attach(device_t dev) * Let's set those up first. */ if (sc->hw_type == IWN_HW_REV_TYPE_4965) - error = iwn4965_attach(sc, pci_get_device(dev)); + iwn4965_attach(sc, pci_get_device(dev)); else - error = iwn5000_attach(sc, pci_get_device(dev)); - if (error != 0) { - device_printf(dev, "could not attach device, error %d\n", - error); - goto fail; - } + iwn5000_attach(sc, pci_get_device(dev)); /* * Next, let's setup the various parameters of each NIC. @@ -1224,12 +1219,13 @@ iwn_config_specific(struct iwn_softc *sc, uint16_t pid return 0; } -static int +static void iwn4965_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + ops->load_firmware = iwn4965_load_firmware; ops->read_eeprom = iwn4965_read_eeprom; ops->post_alive = iwn4965_post_alive; @@ -1264,11 +1260,9 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) sc->sc_flags |= IWN_FLAG_BTCOEX; DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); - - return 0; } -static int +static void iwn5000_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; @@ -1303,7 +1297,7 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) sc->reset_noise_gain = IWN5000_PHY_CALIB_RESET_NOISE_GAIN; sc->noise_gain = IWN5000_PHY_CALIB_NOISE_GAIN; - return 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); } /* From owner-svn-src-all@freebsd.org Sun Jan 20 21:38:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E30CC14A7CEB; Sun, 20 Jan 2019 21:38:24 +0000 (UTC) (envelope-from joerg@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 8776183E9D; Sun, 20 Jan 2019 21:38:24 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 796C381F0; Sun, 20 Jan 2019 21:38:24 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KLcOs8053955; Sun, 20 Jan 2019 21:38:24 GMT (envelope-from joerg@FreeBSD.org) Received: (from joerg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KLcOEj053954; Sun, 20 Jan 2019 21:38:24 GMT (envelope-from joerg@FreeBSD.org) Message-Id: <201901202138.x0KLcOEj053954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joerg set sender to joerg@FreeBSD.org using -f From: Joerg Wunsch Date: Sun, 20 Jan 2019 21:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343226 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: joerg X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 343226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8776183E9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 21:38:25 -0000 Author: joerg Date: Sun Jan 20 21:38:24 2019 New Revision: 343226 URL: https://svnweb.freebsd.org/changeset/base/343226 Log: MFC r342791: fix a typo in chio(4) (which propagates into chio(1)) Modified: stable/11/sys/sys/chio.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/chio.h ============================================================================== --- stable/11/sys/sys/chio.h Sun Jan 20 21:09:44 2019 (r343225) +++ stable/11/sys/sys/chio.h Sun Jan 20 21:38:24 2019 (r343226) @@ -262,7 +262,7 @@ struct changer_set_voltag_request { #define CESTATUS_BITS \ - "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" + "\20\6INENAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" #define CHIOMOVE _IOW('c', 0x01, struct changer_move) #define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) From owner-svn-src-all@freebsd.org Sun Jan 20 23:30:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C396D14AD59B; Sun, 20 Jan 2019 23:30:17 +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 6954E89F99; Sun, 20 Jan 2019 23:30:17 +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 4D903944A; Sun, 20 Jan 2019 23:30:17 +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 x0KNUHb4011468; Sun, 20 Jan 2019 23:30:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KNUH0c011467; Sun, 20 Jan 2019 23:30:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901202330.x0KNUH0c011467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 20 Jan 2019 23:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343233 - 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: 343233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6954E89F99 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 23:30:17 -0000 Author: np Date: Sun Jan 20 23:30:16 2019 New Revision: 343233 URL: https://svnweb.freebsd.org/changeset/base/343233 Log: cxgbe(4): Clear the reply-pending status of a hashfilter when the reply indicates an error. Also, do not remove it twice from the hf list in this case. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 week Sponsored by: Chelsio Communicatons Modified: head/sys/dev/cxgbe/t4_filter.c Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Sun Jan 20 22:34:04 2019 (r343232) +++ head/sys/dev/cxgbe/t4_filter.c Sun Jan 20 23:30:16 2019 (r343233) @@ -1229,6 +1229,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r /* provide errno instead of tid to ioctl */ f->tid = act_open_rpl_status_to_errno(status); f->valid = 0; + f->pending = 0; if (act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); @@ -1587,7 +1588,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 0; t->idx = f->tid; } else { - remove_hf(sc, f); rc = f->tid; free(f, M_CXGBE); } From owner-svn-src-all@freebsd.org Mon Jan 21 00:32:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08FAB14AF9D1; Mon, 21 Jan 2019 00:32:05 +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 A4EDB8C2FE; Mon, 21 Jan 2019 00:32:04 +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 9221D9EBA; Mon, 21 Jan 2019 00:32:04 +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 x0L0W4h1046625; Mon, 21 Jan 2019 00:32:04 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L0W4wh046624; Mon, 21 Jan 2019 00:32:04 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901210032.x0L0W4wh046624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 21 Jan 2019 00:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343237 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 343237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4EDB8C2FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:32:05 -0000 Author: kp Date: Mon Jan 21 00:32:04 2019 New Revision: 343237 URL: https://svnweb.freebsd.org/changeset/base/343237 Log: MFC r343130 pf: fix pfsync breaking carp Fix missing initialisation of sc_flags into a valid sync state on clone which breaks carp in pfsync. This regression was introduce by r342051. PR: 235005 Submitted by: smh@FreeBSD.org Pointy hat to: kp Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Mon Jan 21 00:32:03 2019 (r343236) +++ stable/12/sys/netpfil/pf/if_pfsync.c Mon Jan 21 00:32:04 2019 (r343237) @@ -335,6 +335,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit, ca pfsync_buckets = mp_ncpus * 2; sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | M_ZERO); + sc->sc_flags |= PFSYNCF_OK; sc->sc_maxupdates = 128; ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); From owner-svn-src-all@freebsd.org Mon Jan 21 00:32:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B30814AF9CB; Mon, 21 Jan 2019 00:32:04 +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 239998C2FA; Mon, 21 Jan 2019 00:32:04 +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 19BC69EB8; Mon, 21 Jan 2019 00:32:04 +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 x0L0W3KL046581; Mon, 21 Jan 2019 00:32:03 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L0W3Px046579; Mon, 21 Jan 2019 00:32:03 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901210032.x0L0W3Px046579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 21 Jan 2019 00:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343236 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 343236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 239998C2FA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:32:04 -0000 Author: kp Date: Mon Jan 21 00:32:03 2019 New Revision: 343236 URL: https://svnweb.freebsd.org/changeset/base/343236 Log: MFC r343130 pf: fix pfsync breaking carp Fix missing initialisation of sc_flags into a valid sync state on clone which breaks carp in pfsync. This regression was introduce by r342051. PR: 235005 Submitted by: smh@FreeBSD.org Pointy hat to: kp Modified: stable/11/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Mon Jan 21 00:09:54 2019 (r343235) +++ stable/11/sys/netpfil/pf/if_pfsync.c Mon Jan 21 00:32:03 2019 (r343236) @@ -333,6 +333,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit, ca pfsync_buckets = mp_ncpus * 2; sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | M_ZERO); + sc->sc_flags |= PFSYNCF_OK; sc->sc_maxupdates = 128; ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); From owner-svn-src-all@freebsd.org Mon Jan 21 00:53:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C323D14B048D; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@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 601B78D12A; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52BBDA351; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L0rduB057906; Mon, 21 Jan 2019 00:53:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L0rcNf057904; Mon, 21 Jan 2019 00:53:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210053.x0L0rcNf057904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343238 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 601B78D12A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:53:40 -0000 Author: avos Date: Mon Jan 21 00:53:38 2019 New Revision: 343238 URL: https://svnweb.freebsd.org/changeset/base/343238 Log: urtw(4): add length checks in Rx path. - Check if buffer can contain Rx descriptor before accessing it. - Verify upper / lower bounds for frame length. - Do not pass too short frames into ieee80211_find_rxnode(). While here: - Move cleanup to the function end. - Reuse IEEE80211_IS_DATA() macro. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwvar.h Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Mon Jan 21 00:32:04 2019 (r343237) +++ head/sys/dev/usb/wlan/if_urtw.c Mon Jan 21 00:53:38 2019 (r343238) @@ -3933,21 +3933,18 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); - if (actlen < (int)URTW_MIN_RXBUFSZ) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } - if (sc->sc_flags & URTW_RTL8187B) { struct urtw_8187b_rxhdr *rx; + if (actlen < sizeof(*rx) + IEEE80211_ACK_LEN) + goto fail; + rx = (struct urtw_8187b_rxhdr *)(data->buf + (actlen - (sizeof(struct urtw_8187b_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; - if (flen > actlen) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (flen > actlen - sizeof(*rx)) + goto fail; + rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf; /* XXX correct? */ rssi = rx->rssi & URTW_RX_RSSI_MASK; @@ -3955,13 +3952,14 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da } else { struct urtw_8187l_rxhdr *rx; + if (actlen < sizeof(*rx) + IEEE80211_ACK_LEN) + goto fail; + rx = (struct urtw_8187l_rxhdr *)(data->buf + (actlen - (sizeof(struct urtw_8187l_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; - if (flen > actlen) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (flen > actlen - sizeof(*rx)) + goto fail; rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf; /* XXX correct? */ @@ -3969,11 +3967,12 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da noise = rx->noise; } + if (flen < IEEE80211_ACK_LEN) + goto fail; + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (mnew == NULL) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (mnew == NULL) + goto fail; m = data->m; data->m = mnew; @@ -3992,13 +3991,17 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da } wh = mtod(m, struct ieee80211_frame *); - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) + if (IEEE80211_IS_DATA(wh)) sc->sc_currate = (rate > 0) ? rate : sc->sc_currate; *rssi_p = rssi; *nf_p = noise; /* XXX correct? */ return (m); + +fail: + counter_u64_add(ic->ic_ierrors, 1); + return (NULL); } static void @@ -4006,7 +4009,6 @@ urtw_bulk_rx_callback(struct usb_xfer *xfer, usb_error { struct urtw_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; struct ieee80211_node *ni; struct mbuf *m = NULL; struct urtw_data *data; @@ -4044,9 +4046,13 @@ setup: */ URTW_UNLOCK(sc); if (m != NULL) { - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, - (struct ieee80211_frame_min *)wh); + if (m->m_pkthdr.len >= + sizeof(struct ieee80211_frame_min)) { + ni = ieee80211_find_rxnode(ic, + mtod(m, struct ieee80211_frame_min *)); + } else + ni = NULL; + if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); /* node is no longer needed */ Modified: head/sys/dev/usb/wlan/if_urtwvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwvar.h Mon Jan 21 00:32:04 2019 (r343237) +++ head/sys/dev/usb/wlan/if_urtwvar.h Mon Jan 21 00:53:38 2019 (r343238) @@ -47,10 +47,6 @@ struct urtw_data { }; typedef STAILQ_HEAD(, urtw_data) urtw_datahead; -/* XXX not correct.. */ -#define URTW_MIN_RXBUFSZ \ - (sizeof(struct ieee80211_frame_min)) - #define URTW_RX_DATA_LIST_COUNT 4 #define URTW_TX_DATA_LIST_COUNT 16 #define URTW_RX_MAXSIZE 0x9c4 From owner-svn-src-all@freebsd.org Mon Jan 21 01:03:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C978014B06A5; Mon, 21 Jan 2019 01:03:04 +0000 (UTC) (envelope-from avos@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 63E288D570; Mon, 21 Jan 2019 01:03:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5714CA4F6; Mon, 21 Jan 2019 01:03:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L134gL063114; Mon, 21 Jan 2019 01:03:04 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L1344k063113; Mon, 21 Jan 2019 01:03:04 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210103.x0L1344k063113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 01:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343239 - in stable/12/sys/dev/rtwn: rtl8192c rtl8812a X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/12/sys/dev/rtwn: rtl8192c rtl8812a X-SVN-Commit-Revision: 343239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63E288D570 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 01:03:05 -0000 Author: avos Date: Mon Jan 21 01:03:03 2019 New Revision: 343239 URL: https://svnweb.freebsd.org/changeset/base/343239 Log: MFC r343092: rtwn(4): clear 'basic' rate bit before calculating RTS/CTS rate. Rate tables have this bit set to indicate minimal set of basic rates; however, it overlappes with MCS bit, so rate2ridx() will treat them as an 11n rate. Due to the current rates setup the issue can be reproduced only in 5GHz band with 11n / protection enabled. Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c ============================================================================== --- stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c Mon Jan 21 00:53:38 2019 (r343238) +++ stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c Mon Jan 21 01:03:03 2019 (r343239) @@ -103,7 +103,7 @@ r92c_tx_protection(struct rtwn_softc *sc, struct r92c_ rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); - ridx = rate2ridx(rate); + ridx = rate2ridx(IEEE80211_RV(rate)); txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, ridx)); /* RTS rate fallback limit (max). */ Modified: stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c ============================================================================== --- stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c Mon Jan 21 00:53:38 2019 (r343238) +++ stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c Mon Jan 21 01:03:03 2019 (r343239) @@ -111,7 +111,7 @@ r12a_tx_protection(struct rtwn_softc *sc, struct r12a_ rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); - ridx = rate2ridx(rate); + ridx = rate2ridx(IEEE80211_RV(rate)); txd->txdw4 |= htole32(SM(R12A_TXDW4_RTSRATE, ridx)); /* RTS rate fallback limit (max). */ From owner-svn-src-all@freebsd.org Mon Jan 21 01:45:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E92A714B147A; Mon, 21 Jan 2019 01:45:35 +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 8ED2E8E90E; Mon, 21 Jan 2019 01:45:35 +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 7AECAABA4; Mon, 21 Jan 2019 01:45:35 +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 x0L1jZXV084110; Mon, 21 Jan 2019 01:45:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L1jZww084109; Mon, 21 Jan 2019 01:45:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901210145.x0L1jZww084109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 01:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343240 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ED2E8E90E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 01:45:36 -0000 Author: kevans Date: Mon Jan 21 01:45:35 2019 New Revision: 343240 URL: https://svnweb.freebsd.org/changeset/base/343240 Log: iwm(4): Fix possible null pointer indirection Obtained from: DragonFlyBSD (obtained from Haiku) MFC after: 1 week Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 21 01:03:03 2019 (r343239) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 21 01:45:35 2019 (r343240) @@ -1033,7 +1033,8 @@ iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ * The hw rx ring index in shared memory must also be cleared, * otherwise the discrepancy can cause reprocessing chaos. */ - memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); + if (sc->rxq.stat) + memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); } static void From owner-svn-src-all@freebsd.org Mon Jan 21 02:57:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995371481C99; Mon, 21 Jan 2019 02:57:59 +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 4C0EE699E5; Mon, 21 Jan 2019 02:57:59 +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 25A01B769; Mon, 21 Jan 2019 02:57:59 +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 x0L2vxRe019898; Mon, 21 Jan 2019 02:57:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L2vwv0019892; Mon, 21 Jan 2019 02:57:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901210257.x0L2vwv0019892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 02:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343241 - in stable/12: lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 343241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C0EE699E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 02:57:59 -0000 Author: kevans Date: Mon Jan 21 02:57:57 2019 New Revision: 343241 URL: https://svnweb.freebsd.org/changeset/base/343241 Log: MFC r342903, r342911: libbe(3)/bectl(8) refactor and fix mount for deep BEs r342903: libbe(3): move altroot augmentation bits around a little bit We could perhaps have a method that does this given a dataset, but it's yet clear that we'll always want to bypass the altroot when we grab the mountpoint. For now, we'll refactor things a bit so we grab the altroot length when libbe is initialized and have a common method that does the necessary augmentation (replace with / if it's the root, return a pointer to later in the string if not). This will be used in some upcoming work to make be_mount work properly for deep BEs. r342911: libbe(3): Change be_mount to mount/unmount child datasets This set of changes is geared towards making bectl respect deep boot environments when they exist and are mounted. The deep BE composition functionality (`bectl add`) remains disabled for the time being. This set of changes has no effect for the average user. but allows deep BE users to upgrade properly with their current setup. libbe(3): Open the target boot environment and get a zfs handle, then pass that with the target mountpoint to be_mount_iter; If the BE_MNT_DEEP flag is set call zfs_iter_filesystems and mount the child datasets. Similar logic is employed when unmounting the datasets, save for children are unmounted first. bectl(8): Change bectl_cmd_jail to pass the BE_MNT_DEEP flag when calling be_mount as well as call be_unmount when cleaning up after the jail has exited instead of umount(2) directly. PR: 234795 Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_impl.h stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/bectl_jail.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/lib/libbe/be.c Mon Jan 21 02:57:57 2019 (r343241) @@ -90,6 +90,7 @@ be_locate_rootfs(libbe_handle_t *lbh) libbe_handle_t * libbe_init(const char *root) { + char altroot[MAXPATHLEN]; libbe_handle_t *lbh; char *poolname, *pos; int pnamelen; @@ -140,6 +141,11 @@ libbe_init(const char *root) sizeof(lbh->bootfs), NULL, true) != 0) goto err; + if (zpool_get_prop(lbh->active_phandle, ZPOOL_PROP_ALTROOT, + altroot, sizeof(altroot), NULL, true) == 0 && + strcmp(altroot, "-") != 0) + lbh->altroot_len = strlen(altroot); + return (lbh); err: if (lbh != NULL) { @@ -314,7 +320,6 @@ be_create(libbe_handle_t *lbh, const char *name) return (set_error(lbh, err)); } - static int be_deep_clone_prop(int prop, void *cb) { @@ -345,12 +350,9 @@ be_deep_clone_prop(int prop, void *cb) /* Augment mountpoint with altroot, if needed */ val = pval; - if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { - if (pval[strlen(dccb->altroot)] == '\0') - strlcpy(pval, "/", sizeof(pval)); - else - val = pval + strlen(dccb->altroot); - } + if (prop == ZFS_PROP_MOUNTPOINT) + val = be_mountpoint_augmented(dccb->lbh, val); + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); @@ -392,12 +394,9 @@ be_deep_clone(zfs_handle_t *ds, void *data) nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); + dccb.lbh = isdc->lbh; dccb.zhp = ds; dccb.props = props; - if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, - dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || - strcmp(dccb.altroot, "-") == 0) - *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/lib/libbe/be_access.c Mon Jan 21 02:57:57 2019 (r343241) @@ -3,6 +3,7 @@ * * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans + * Copyright (c) 2019 Wes Maag * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,6 +39,14 @@ struct be_mountcheck_info { char *name; }; +struct be_mount_info { + libbe_handle_t *lbh; + const char *be; + const char *mountpoint; + int mntflags; + int deepmount; +}; + static int be_mountcheck_cb(zfs_handle_t *zfs_hdl, void *data) { @@ -59,6 +68,105 @@ be_mountcheck_cb(zfs_handle_t *zfs_hdl, void *data) } /* + * Called from be_mount, uses the given zfs_handle and attempts to + * mount it at the passed mountpoint. If the deepmount flag is set, continue + * calling the function for each child dataset. + */ +static int +be_mount_iter(zfs_handle_t *zfs_hdl, void *data) +{ + int err; + char *mountpoint; + char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; + struct be_mount_info *info; + + info = (struct be_mount_info *)data; + + if (zfs_is_mounted(zfs_hdl, &mountpoint)) { + free(mountpoint); + return (0); + } + + if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) + return (0); + + if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, BE_MAXPATHLEN, + NULL, NULL, 0, 1)) + return (1); + + if (strcmp("none", zfs_mnt) != 0) { + char opt = '\0'; + + mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); + + snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, + mountpoint); + + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); + } + } + } + + if (!info->deepmount) + return (0); + + return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); +} + + +static int +be_umount_iter(zfs_handle_t *zfs_hdl, void *data) +{ + + int err; + char *mountpoint; + struct be_mount_info *info; + + info = (struct be_mount_info *)data; + + if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { + return (err); + } + + if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { + return (0); + } + free(mountpoint); + + if (zfs_unmount(zfs_hdl, NULL, info->mntflags) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); + } + } + return (0); +} + +/* * usage */ int @@ -108,8 +216,10 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou { char be[BE_MAXPATHLEN]; char mnt_temp[BE_MAXPATHLEN]; - int mntflags; + int mntflags, mntdeep; int err; + struct be_mount_info info; + zfs_handle_t *zhdl; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); @@ -120,6 +230,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou if (is_mounted(lbh->lzh, be, NULL)) return (set_error(lbh, BE_ERR_MOUNTED)); + mntdeep = (flags & BE_MNT_DEEP) ? 1 : 0; mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; /* Create mountpoint if it is not specified */ @@ -129,24 +240,20 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou return (set_error(lbh, BE_ERR_IO)); } - char opt = '\0'; - if ((err = zmount(be, (mountpoint == NULL) ? mnt_temp : mountpoint, - mntflags, __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(lbh, BE_ERR_UNKNOWN)); - } + if ((zhdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); + + info.lbh = lbh; + info.be = be; + info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; + info.mntflags = mntflags; + info.deepmount = mntdeep; + + if((err = be_mount_iter(zhdl, &info) != 0)) { + zfs_close(zhdl); + return (err); } + zfs_close(zhdl); if (result_loc != NULL) strlcpy(result_loc, mountpoint == NULL ? mnt_temp : mountpoint, @@ -155,16 +262,16 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou return (BE_ERR_SUCCESS); } - /* * usage */ int be_unmount(libbe_handle_t *lbh, char *bootenv, int flags) { - int err, mntflags; + int err; char be[BE_MAXPATHLEN]; zfs_handle_t *root_hdl; + struct be_mount_info info; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); @@ -172,26 +279,38 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla if ((root_hdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); - mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.lbh = lbh; + info.be = be; + info.mountpoint = NULL; + info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; - if (zfs_unmount(root_hdl, NULL, mntflags) != 0) { + if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); - switch (errno) { - case ENAMETOOLONG: - return (set_error(lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(lbh, BE_ERR_UNKNOWN)); - } + return (err); } - zfs_close(root_hdl); + zfs_close(root_hdl); return (BE_ERR_SUCCESS); +} + +/* + * This function will blow away the input buffer as needed if we're discovered + * to be looking at a root-mount. If the mountpoint is naturally beyond the + * root, however, the buffer may be left intact and a pointer to the section + * past altroot will be returned instead for the caller's perusal. + */ +char * +be_mountpoint_augmented(libbe_handle_t *lbh, char *mountpoint) +{ + + if (lbh->altroot_len == 0) + return (mountpoint); + if (mountpoint == NULL || *mountpoint == '\0') + return (mountpoint); + + if (mountpoint[lbh->altroot_len] == '\0') { + *(mountpoint + 1) = '\0'; + return (mountpoint); + } else + return (mountpoint + lbh->altroot_len); } Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/lib/libbe/be_impl.h Mon Jan 21 02:57:57 2019 (r343241) @@ -36,11 +36,12 @@ #include "be.h" struct libbe_handle { - libzfs_handle_t *lzh; - zpool_handle_t *active_phandle; char root[BE_MAXPATHLEN]; char rootfs[BE_MAXPATHLEN]; char bootfs[BE_MAXPATHLEN]; + size_t altroot_len; + zpool_handle_t *active_phandle; + libzfs_handle_t *lzh; be_error_t error; bool print_on_err; }; @@ -53,9 +54,9 @@ struct libbe_deep_clone { }; struct libbe_dccb { + libbe_handle_t *lbh; zfs_handle_t *zhp; nvlist_t *props; - char altroot[MAXPATHLEN]; }; typedef struct prop_data { @@ -66,6 +67,8 @@ typedef struct prop_data { int prop_list_builder_cb(zfs_handle_t *, void *); int be_proplist_update(prop_data_t *); + +char *be_mountpoint_augmented(libbe_handle_t *lbh, char *mountpoint); /* Clobbers any previous errors */ int set_error(libbe_handle_t *, be_error_t); Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/sbin/bectl/bectl.c Mon Jan 21 02:57:57 2019 (r343241) @@ -378,8 +378,10 @@ bectl_cmd_mount(int argc, char *argv[]) { char result_loc[BE_MAXPATHLEN]; char *bootenv, *mountpoint; - int err; + int err, mntflags; + /* XXX TODO: Allow shallow */ + mntflags = BE_MNT_DEEP; if (argc < 2) { fprintf(stderr, "bectl mount: missing argument(s)\n"); return (usage(false)); @@ -393,7 +395,7 @@ bectl_cmd_mount(int argc, char *argv[]) bootenv = argv[1]; mountpoint = ((argc == 3) ? argv[2] : NULL); - err = be_mount(be, bootenv, mountpoint, 0, result_loc); + err = be_mount(be, bootenv, mountpoint, mntflags, result_loc); switch (err) { case BE_ERR_SUCCESS: Modified: stable/12/sbin/bectl/bectl_jail.c ============================================================================== --- stable/12/sbin/bectl/bectl_jail.c Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/sbin/bectl/bectl_jail.c Mon Jan 21 02:57:57 2019 (r343241) @@ -180,10 +180,12 @@ int bectl_cmd_jail(int argc, char *argv[]) { char *bootenv, *mountpoint; - int jid, opt, ret; + int jid, mntflags, opt, ret; bool default_hostname, interactive, unjail; pid_t pid; + /* XXX TODO: Allow shallow */ + mntflags = BE_MNT_DEEP; default_hostname = interactive = unjail = true; jpcnt = INIT_PARAMCOUNT; jp = malloc(jpcnt * sizeof(*jp)); @@ -250,7 +252,7 @@ bectl_cmd_jail(int argc, char *argv[]) mountpoint = NULL; else mountpoint = mnt_loc; - if (be_mount(be, bootenv, mountpoint, 0, mnt_loc) != BE_ERR_SUCCESS) { + if (be_mount(be, bootenv, mountpoint, mntflags, mnt_loc) != BE_ERR_SUCCESS) { fprintf(stderr, "could not mount bootenv\n"); return (1); } @@ -301,7 +303,7 @@ bectl_cmd_jail(int argc, char *argv[]) if (unjail) { jail_remove(jid); - unmount(mnt_loc, 0); + be_unmount(be, bootenv, 0); } return (0); @@ -415,7 +417,7 @@ bectl_cmd_unjail(int argc, char *argv[]) } jail_remove(jid); - unmount(path, 0); + be_unmount(be, target, 0); return (0); } Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- stable/12/sbin/bectl/tests/bectl_test.sh Mon Jan 21 01:45:35 2019 (r343240) +++ stable/12/sbin/bectl/tests/bectl_test.sh Mon Jan 21 02:57:57 2019 (r343241) @@ -42,7 +42,21 @@ bectl_create_setup() atf_check zfs create -o mountpoint=/ -o canmount=noauto \ ${zpool}/ROOT/default } +bectl_create_deep_setup() +{ + zpool=$1 + disk=$2 + mnt=$3 + bectl_create_setup ${zpool} ${disk} ${mnt} + atf_check mkdir -p ${root} + atf_check -o ignore bectl -r ${zpool}/ROOT mount default ${root} + atf_check mkdir -p ${root}/usr + atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ + ${zpool}/ROOT/default/usr + atf_check -o ignore bectl -r ${zpool}/ROOT umount default +} + bectl_cleanup() { zpool=$1 @@ -183,7 +197,7 @@ bectl_mount_body() mount=${cwd}/mnt root=${mount}/root - bectl_create_setup ${zpool} ${disk} ${mount} + bectl_create_deep_setup ${zpool} ${disk} ${mount} atf_check mkdir -p ${root} # Test unmount first... atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} @@ -246,7 +260,7 @@ bectl_jail_body() if [ ! -f /rescue/rescue ]; then atf_skip "This test requires a rescue binary" fi - bectl_create_setup ${zpool} ${disk} ${mount} + bectl_create_deep_setup ${zpool} ${disk} ${mount} # Prepare our minimal BE... plop a rescue binary into it atf_check mkdir -p ${root} atf_check -o ignore bectl -r ${zpool}/ROOT mount default ${root} @@ -263,9 +277,9 @@ bectl_jail_body() atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail default # Basic command-mode tests, with and without jail cleanup - atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + atf_check -o inline:"rescue\nusr\n" bectl -r ${zpool}/ROOT \ jail default /rescue/rescue ls -1 - atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + atf_check -o inline:"rescue\nusr\n" bectl -r ${zpool}/ROOT \ jail -Uo path=${root} default /rescue/rescue ls -1 atf_check [ -f ${root}/rescue/rescue ] atf_check bectl -r ${zpool}/ROOT ujail default From owner-svn-src-all@freebsd.org Mon Jan 21 02:59:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6354E1481DB7; Mon, 21 Jan 2019 02:59:38 +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 0682369BAF; Mon, 21 Jan 2019 02:59:38 +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 C10ADB76C; Mon, 21 Jan 2019 02:59:37 +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 x0L2xblb020037; Mon, 21 Jan 2019 02:59:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L2xbm0020036; Mon, 21 Jan 2019 02:59:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901210259.x0L2xbm0020036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 02:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343242 - stable/12/lib/libc/stdlib X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libc/stdlib X-SVN-Commit-Revision: 343242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0682369BAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 02:59:38 -0000 Author: kevans Date: Mon Jan 21 02:59:37 2019 New Revision: 343242 URL: https://svnweb.freebsd.org/changeset/base/343242 Log: MFC r342757: getopt_long(3): fix case of malformed long opt When presented with an arg string like '-l-', getopt_long will successfully parse out the 'l' short option, then proceed to match '--' against the first longopts entry as it later does a strncmp with len=0. This latter bit is arguably another bug in itself, but presumably not a practical issue as all callers of parse_long_options are already doing the right thing (except this one pointed out). An opt string like '-l-' should be considered malformed and throw a bad argument rather than behaving as if '--' were passed. It cannot possibly do what the invoker expects, and it's probably the result of a typo (ls -l- a) rather than any intent. Modified: stable/12/lib/libc/stdlib/getopt_long.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/stdlib/getopt_long.c ============================================================================== --- stable/12/lib/libc/stdlib/getopt_long.c Mon Jan 21 02:57:57 2019 (r343241) +++ stable/12/lib/libc/stdlib/getopt_long.c Mon Jan 21 02:59:37 2019 (r343242) @@ -481,6 +481,8 @@ start: #endif if (*place == '-') { place++; /* --foo long option */ + if (*place == '\0') + return (BADARG); /* malformed option */ #ifdef GNU_COMPATIBLE dash_prefix = DD_PREFIX; #endif From owner-svn-src-all@freebsd.org Mon Jan 21 03:01:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA89F14880AF; Mon, 21 Jan 2019 03:01:42 +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 5E5AD6A0D2; Mon, 21 Jan 2019 03:01:42 +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 1EF61B842; Mon, 21 Jan 2019 03:01:42 +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 x0L31gDr022757; Mon, 21 Jan 2019 03:01:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L31gkX022756; Mon, 21 Jan 2019 03:01:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901210301.x0L31gkX022756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 03:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343243 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 343243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E5AD6A0D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:01:42 -0000 Author: kevans Date: Mon Jan 21 03:01:41 2019 New Revision: 343243 URL: https://svnweb.freebsd.org/changeset/base/343243 Log: MFC r343095, r343119: awg no-op (record-only) r343095: awg: Move MAC soft reset to awg_init_locked to avoid soft reset timeout From NetBSD: Since the MAC can get stuck in reset state with no link, ignore reset timeouts and continue with initializing the device. Fixes "soft reset timeout" issue at boot with no network cable plugged in. awg_init may be called multiple times throughout normal interface usage, so the tx/rx descriptor base address registers must be written after each MAC reset and are moved as such. This problem has been observed on FreeBSD, H3/H2+ devices with an internal PHY (includes OrangePi R1, OrangePi One at least). r343119: Revert r343095 This was intended to fix the soft reset timeout on boot for OrangePi One/R1 with internal PHY, but seems to cause other problems later on due to soft resetting around some state changes that may or may not make the NIC non-functional. Reverting this for now while a better solution is sought out. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Mon Jan 21 03:38:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6D9148D24C; Mon, 21 Jan 2019 03:38:38 +0000 (UTC) (envelope-from avos@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 B1D2C6B513; Mon, 21 Jan 2019 03:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A30E8C0B9; Mon, 21 Jan 2019 03:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L3cbK6041661; Mon, 21 Jan 2019 03:38:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3cbxm041660; Mon, 21 Jan 2019 03:38:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210338.x0L3cbxm041660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 03:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343244 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 343244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D2C6B513 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:38:38 -0000 Author: avos Date: Mon Jan 21 03:38:37 2019 New Revision: 343244 URL: https://svnweb.freebsd.org/changeset/base/343244 Log: devd.conf(5): add otus(4) into wifi-driver-regex MFC after: 5 days Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Mon Jan 21 03:01:41 2019 (r343243) +++ head/sbin/devd/devd.conf Mon Jan 21 03:38:37 2019 (r343244) @@ -23,8 +23,8 @@ options { esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|sym|trm)\ [0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ - uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rtwn|rum|\ + run|uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-all@freebsd.org Mon Jan 21 03:47:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF0C9148D567; Mon, 21 Jan 2019 03:47:21 +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 72FF36B9F2; Mon, 21 Jan 2019 03:47:21 +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 509C0C25F; Mon, 21 Jan 2019 03:47:21 +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 x0L3lLRu047116; Mon, 21 Jan 2019 03:47:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3lLQt047115; Mon, 21 Jan 2019 03:47:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210347.x0L3lLQt047115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 03:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343245 - head/usr.bin/cmp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cmp X-SVN-Commit-Revision: 343245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72FF36B9F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:47:22 -0000 Author: markj Date: Mon Jan 21 03:47:20 2019 New Revision: 343245 URL: https://svnweb.freebsd.org/changeset/base/343245 Log: Revert r343117. It breaks the special mode specified by passing "-" as one of the input files. Revert for now while we discuss a fix. PR: 234885 Reported by: delphij MFC after: now Modified: head/usr.bin/cmp/cmp.c Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Mon Jan 21 03:38:37 2019 (r343244) +++ head/usr.bin/cmp/cmp.c Mon Jan 21 03:47:20 2019 (r343245) @@ -116,16 +116,14 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); - if (caph_limit_stdio() == -1) - err(ERR_EXIT, "failed to limit stdio"); - /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = STDIN_FILENO; + fd1 = 0; file1 = "stdin"; - } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -136,9 +134,10 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = STDIN_FILENO; + fd2 = 0; file2 = "stdin"; - } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -175,6 +174,16 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit fcntls for %s", file1); if (caph_fcntls_limit(fd2, fcntls) < 0) err(ERR_EXIT, "unable to limit fcntls for %s", file2); + + if (!special) { + cap_rights_init(&rights); + if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { + err(ERR_EXIT, "unable to limit stdio"); + } + } + + if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) + err(ERR_EXIT, "unable to limit stdio"); caph_cache_catpages(); From owner-svn-src-all@freebsd.org Mon Jan 21 03:48:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13306148D621; Mon, 21 Jan 2019 03:48: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 A9C616BB82; Mon, 21 Jan 2019 03:48:30 +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 9B49EC262; Mon, 21 Jan 2019 03:48:30 +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 x0L3mUvv047221; Mon, 21 Jan 2019 03:48:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3mULZ047220; Mon, 21 Jan 2019 03:48:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210348.x0L3mULZ047220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 03:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343246 - stable/12/usr.bin/cmp X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/cmp X-SVN-Commit-Revision: 343246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9C616BB82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:48:31 -0000 Author: markj Date: Mon Jan 21 03:48:30 2019 New Revision: 343246 URL: https://svnweb.freebsd.org/changeset/base/343246 Log: MFC r343245: Revert r343117. Modified: stable/12/usr.bin/cmp/cmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/cmp/cmp.c ============================================================================== --- stable/12/usr.bin/cmp/cmp.c Mon Jan 21 03:47:20 2019 (r343245) +++ stable/12/usr.bin/cmp/cmp.c Mon Jan 21 03:48:30 2019 (r343246) @@ -116,16 +116,14 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); - if (caph_limit_stdio() == -1) - err(ERR_EXIT, "failed to limit stdio"); - /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = STDIN_FILENO; + fd1 = 0; file1 = "stdin"; - } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -136,9 +134,10 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = STDIN_FILENO; + fd2 = 0; file2 = "stdin"; - } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -175,6 +174,16 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit fcntls for %s", file1); if (cap_fcntls_limit(fd2, fcntls) < 0 && errno != ENOSYS) err(ERR_EXIT, "unable to limit fcntls for %s", file2); + + if (!special) { + cap_rights_init(&rights); + if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { + err(ERR_EXIT, "unable to limit stdio"); + } + } + + if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) + err(ERR_EXIT, "unable to limit stdio"); caph_cache_catpages(); From owner-svn-src-all@freebsd.org Mon Jan 21 03:57:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273D3148DA50; Mon, 21 Jan 2019 03:57:50 +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 A766B6C0D0; Mon, 21 Jan 2019 03:57:49 +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 92477C40C; Mon, 21 Jan 2019 03:57:49 +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 x0L3vnl5052454; Mon, 21 Jan 2019 03:57:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3vnIx052453; Mon, 21 Jan 2019 03:57:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210357.x0L3vnIx052453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 03:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343247 - head/usr.bin/cmp/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cmp/tests X-SVN-Commit-Revision: 343247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A766B6C0D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:57:50 -0000 Author: markj Date: Mon Jan 21 03:57:49 2019 New Revision: 343247 URL: https://svnweb.freebsd.org/changeset/base/343247 Log: Fix cmp(1) tests for "special" mode. Test failures don't seem to propagate up if atf_check is run in a pipeline. Thus, the tests continued to pass despite the bug reverted in r343245. MFC after: 1 week Modified: head/usr.bin/cmp/tests/cmp_test2.sh Modified: head/usr.bin/cmp/tests/cmp_test2.sh ============================================================================== --- head/usr.bin/cmp/tests/cmp_test2.sh Mon Jan 21 03:48:30 2019 (r343246) +++ head/usr.bin/cmp/tests/cmp_test2.sh Mon Jan 21 03:57:49 2019 (r343247) @@ -31,11 +31,10 @@ special_head() { special_body() { echo 0123456789abcdef > a echo 0123456789abcdeg > b - cat a | atf_check -s exit:0 cmp a - - cat a | atf_check -s exit:0 cmp - a - cat b | atf_check -s not-exit:0 cmp a - - cat b | atf_check -s not-exit:0 cmp - a - true + atf_check -s exit:0 -o empty -e empty -x "cat a | cmp a -" + atf_check -s exit:0 -o empty -e empty -x "cat a | cmp - a" + atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp a -" + atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp - a" } atf_test_case symlink From owner-svn-src-all@freebsd.org Mon Jan 21 04:10:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5C47148E03E; Mon, 21 Jan 2019 04:10:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4916C75C; Mon, 21 Jan 2019 04:10:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x431.google.com with SMTP id g62so9462584pfd.12; Sun, 20 Jan 2019 20:10:23 -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=Jm17GzQvlaZgn8lkvHwQmwyKXFlpNNyLcKMF0WRPuio=; b=kYi4Iz8MMAkKPd9itkpzKGrn/Z57/x0EGeGuLvahCHK8DtwmEkI8lXUGSJIZ21Qhge 5MsKB+vTs4zmAkvMD9Hz8EioQzz+7q8ne3Xvto/OS9HsNMsUV50fiZIoq/LL7dMORPLl wLJMk/hdkFtgC/HzHupOYIPldQr3BgHNjY2dNY/KX8vfHHq/wBZhtk5z6n6A6WVs1SUb fVJuL7Qmulbz64uHo0AKnsSK70Rf2MUWLW5UR9MWEZpoihc9P9G/3J15FrFi24EfiHwq q0Du4mVeLgG9OD5YrJ+4R6aSa/HNX0gofFwczvPgvMy8ckAGkptDEC9YDKxEFKq5hD8c 407g== 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=Jm17GzQvlaZgn8lkvHwQmwyKXFlpNNyLcKMF0WRPuio=; b=aS7qRmNUGLR5XaEVkzN0VAJScRdP8hBlHga3yasGs3842LwMXQas5neOJUnnQ0FUD+ zGXJ9hQaCgtPRcMUXIC36jY3SrnQOj2zZQaJyw3dOWIons5qfff97kIYG33y4ZHtcqaP LBObvqYQA4Lac8j06AyokpKgdxStG3S3GlrrYYcBgDa6BXt4vXt1ADD89BgRtFte+54G +hytJYOZI64ALt7RIeXfrWmzEJSyq7iRxXKUB0qH36oHaKXNz+UyRwD4cn6J0xBhb68N qogGHeDn7Da70GPsJBcmRPeyX3KNOMfNqsZEXINMuHDlrI+sOXI4o9+uk3lACsarRrLY HP4Q== X-Gm-Message-State: AJcUukcbkDWyeazW/nTy7rMOcwPaqTjxEwTG3VPZtXpikC4TDRTuTB7c vzA1/Z4XRLC0tHJXmGo4KAD0Msiz X-Google-Smtp-Source: ALg8bN5H0FEMnpXAG0p4d1+d4xPqrVUP6LQb5tBar39Memmdrk/VQ2QKodOzw0DmIr07mPYfhUoWSQ== X-Received: by 2002:a63:f65:: with SMTP id 37mr26542780pgp.238.1548043821783; Sun, 20 Jan 2019 20:10:21 -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 a90sm19844561pfj.109.2019.01.20.20.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 20:10:21 -0800 (PST) From: Enji Cooper Message-Id: <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Date: Sun, 20 Jan 2019 20:10:19 -0800 In-Reply-To: <201901210357.x0L3vnIx052453@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Mark Johnston References: <201901210357.x0L3vnIx052453@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 0E4916C75C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:10:24 -0000 --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: >=20 > Author: markj > Date: Mon Jan 21 03:57:49 2019 > New Revision: 343247 > URL: https://svnweb.freebsd.org/changeset/base/343247 >=20 > Log: > Fix cmp(1) tests for "special" mode. >=20 > Test failures don't seem to propagate up if atf_check is run in > a pipeline. Thus, the tests continued to pass despite the bug = reverted > in r343245. Hmmm=E2=80=A6 that=E2=80=99s strange=E2=80=A6 -Enji --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlxFRisACgkQ5JFNMZeD GN74BA/+JPh4rgtJbus4A4WcOHJshBVB3VyrjZDjAKUrvk7aTxqqibVWjr0SDxcv JhtALnhaIc4Hu5EvHJzYC+AaWfFcLafsOmDdsxOlMByZ1QDZVfRRgYr3XwjX74aq iLmTqA1WqxEDoIcHkH/fxBlzTpZ1uujMwSM5NIJqemPynzOcsztwt5NTfTSYQxZA NWug6UBxSjL7bzOxIR4f9hntdB1B3DMsv3+ngUnBqClDtAll3X3g4g52WJH4jhUH ahLpHL+G4vaAD4eo4S4uW0X9a2zbtYIZ3nPXGqzAuoIfh8k+RzbA05l8F8+W5S5n 1YqJHqzBltvsQCUxr0U42NXcSxw18CBzP9iAgo1yq112bcF3cPpn0dJ1aw3UDsuH xyIlMgt4E7f9tJfxRGu08CikVEU7qk6Fn0x9f9EXOm8T8TFZdv/tM8fSDl+IgpJP Fko70sA/sNiy/qWHasfx9u+1OFh9gKGSeRBieio0QS/y+5JHKVEzTaJbNoxRA9/a HHx6xg91bSb9yHHkRwOsn4LE169tQvXITbkf+mYXOscxqKDOSnNf0rwPTs1SMXs+ QfPuhchzj8NvnyXGWaqJ2rcDUX18G0Wq3zZWu5TnQ9D4tUYmOCFXyxFcbpwexgC7 0KYmPcLOLeKwKf6eLpTB2QO+0K+keIxzkA9RLayyePjtnjNLSSk= =WYHg -----END PGP SIGNATURE----- --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8-- From owner-svn-src-all@freebsd.org Mon Jan 21 04:10:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2595D148E1C9; Mon, 21 Jan 2019 04:10:47 +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 BBAB06C918; Mon, 21 Jan 2019 04:10:46 +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 38C4BC6E6; Mon, 21 Jan 2019 04:10:46 +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 x0L4AkiD058549; Mon, 21 Jan 2019 04:10:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L4Aji2058548; Mon, 21 Jan 2019 04:10:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210410.x0L4Aji2058548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 04:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343248 - stable/12/usr.bin/cmp X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/cmp X-SVN-Commit-Revision: 343248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBAB06C918 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:10:47 -0000 Author: markj Date: Mon Jan 21 04:10:45 2019 New Revision: 343248 URL: https://svnweb.freebsd.org/changeset/base/343248 Log: Properly commit the revert of r343205. MFCing the head revert isn't the same as reverting the MFC. This is a direct commit to stable/12. Modified: stable/12/usr.bin/cmp/cmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/cmp/cmp.c ============================================================================== --- stable/12/usr.bin/cmp/cmp.c Mon Jan 21 03:57:49 2019 (r343247) +++ stable/12/usr.bin/cmp/cmp.c Mon Jan 21 04:10:45 2019 (r343248) @@ -177,7 +177,8 @@ main(int argc, char *argv[]) if (!special) { cap_rights_init(&rights); - if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { + if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && + errno != ENOSYS) { err(ERR_EXIT, "unable to limit stdio"); } } From owner-svn-src-all@freebsd.org Mon Jan 21 04:11:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 904C2148E4B1; Mon, 21 Jan 2019 04:11:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD0D6CC54; Mon, 21 Jan 2019 04:11:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x635.google.com with SMTP id 101so9123559pld.6; Sun, 20 Jan 2019 20:11:23 -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=pdFQ9YzfuzWOPdDPzspymel/HvCgaigoHVzC1AF1NsE=; b=fXZznRS2zXF6ZzZJpeiP0u30En3nKaTV/KhESbu8oZW8uw5ixV6eOLOnzR8Oi/Pr0Z YSfsRaLaAghqhiTHXE0JdbwEUO4JO5ak3i27NEvk0nVK/h6ucbgJ5yvYgI6oEjeaTmxR SIykvMMjuTEnKx4hTL3SIw0G5ANbaswzrDaRZEfJEyEudLbBAG1iPs1lgMadgbHBqRBL mKQRCMlWXM/co7NmmVpsv5111Rhv6wDxSbCGL4xgoNXyR98kI992nWuwKYhZ9yZFZj71 4JdnUoUEHknNvb8GVYYfWKJL8RV+xnodzP9nRijktXDkLwbW1HwjjWUnabGqxEOVlbjz jsQw== 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=pdFQ9YzfuzWOPdDPzspymel/HvCgaigoHVzC1AF1NsE=; b=blm8VsUMtM/N82uauS/O5Bx7+35joM79ueYhkvKpM5jYH70iniza3cchUxF5QmnGpC S+VsF7d3D23LWIX4j/lZzqOUIGTfoKIywMIYs4Sg+YOt1zb47GIRJYLUbwWD5AT37Kho gmFnuBgKPbpSQ5fLrgrPn0ii0mx164BqrByHPR+PnlK9POo9WaAG+mH2yD3QfqezMAtT 3G14d0bo13iKIL4BjBBVKfuwijSIOFQJ3bs3uQeTr2dsrFe6lE6JoJ+Rck3rIRRNU/Jw CjKMxBZGpDSy448rO2tVW4dWuS0dffIbHtfocYstWIxTa+pGjZ8WIf/YEXGylHMfEAmE APIQ== X-Gm-Message-State: AJcUukd2XB33Hr2uKkrp6oD+qoJVNa2+QbYq8oLKLqgGXCI6UutmTmgT aYCGwfzx+JqsPu72+XSbaG3GDxXh X-Google-Smtp-Source: ALg8bN6JyWbuC2O9Gc+VhQ3ueI+I3z+u8nBiNTGDutG3XgjMTDoaxaLFyEw1vVU7YF36f5Zb9/FTFA== X-Received: by 2002:a17:902:968d:: with SMTP id n13mr29031994plp.109.1548043881581; Sun, 20 Jan 2019 20:11:21 -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 a90sm19844561pfj.109.2019.01.20.20.11.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 20:11:20 -0800 (PST) From: Enji Cooper Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Date: Sun, 20 Jan 2019 20:11:20 -0800 In-Reply-To: <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Mark Johnston References: <201901210357.x0L3vnIx052453@repo.freebsd.org> <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 0AD0D6CC54 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:11:23 -0000 --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 20, 2019, at 8:10 PM, Enji Cooper = wrote: >=20 >=20 >> On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: >>=20 >> Author: markj >> Date: Mon Jan 21 03:57:49 2019 >> New Revision: 343247 >> URL: https://svnweb.freebsd.org/changeset/base/343247 >>=20 >> Log: >> Fix cmp(1) tests for "special" mode. >>=20 >> Test failures don't seem to propagate up if atf_check is run in >> a pipeline. Thus, the tests continued to pass despite the bug = reverted >> in r343245. >=20 > Hmmm=E2=80=A6 that=E2=80=99s strange=E2=80=A6 > -Enji There=E2=80=99s a good chance that this issue is also masked by the fact = that the CI runs have been panicking with bug 235097 as well. Cheers, -Enji --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlxFRmgACgkQ5JFNMZeD GN4GSw//Zq1tEqhXUqlntSxuZ2IRa5Rt2qFCuQwBvpZwhX+9KYQINXYzMT44ih40 x2L9ed0n24Vb/jdwEuMCeOdJIs6l/MiSfg26Fj7zTW0UYqL6k/7NhIEiFM0RTYA1 j5Qucs46h8nXZk79I7GeDNouWdvCaAzWbUoU9BoqJN2cp1tc0n4DpK68icToSNtG JtPKAE+ZCF1nd188dH/znf2EItczXunOkQQyT48H3umoVO2X8mp2kprLw6Gwylkq F3LtmA2VTK8lHxfCRhCmHSZbytudBEiaz9wdd7hAf5MoWAf7NpH6dyQRMejLEq3I VCmsVDiJawkM4karMKgbTH7tfSeOIcPcEkoUtu9rspA41n/X4SglfcTgnhrXKSC5 yjXmaw9M5pzfXZQnU8n9x9Yb0pljwt71y4O85nhJ2suqb6GMkqHWKKhdbxOaSZxU d1rRl4QJCs/1RJXW5YPnv6TE7BSUZnY8QIate+5NxnoRZ0du/M2fidxTmxRnmPUf DBYU3yXIuWoqFEa2sleKYhpIr1OPmO5gL33ghH1bWzAwpPYz9K8ncIc1Rhy/Fs7H IzKLwdPqWe9pRtf764VVCpRa07oYETrWEc6gW1YHyTUC1mt8WTdGnqb7U68kFEum L/dB7UyMYCIzA10L8N+ux0eqG3Y8GlLXa5u/oSQV53iod3cANLM= =ycaO -----END PGP SIGNATURE----- --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103-- From owner-svn-src-all@freebsd.org Mon Jan 21 04:13:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05A4148E66A; Mon, 21 Jan 2019 04:13:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64E326CEF2; Mon, 21 Jan 2019 04:13:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12c.google.com with SMTP id p197so13486429itp.0; Sun, 20 Jan 2019 20:13:02 -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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Dj7BYeyNUbLn+KU27VKJYtSNyFPXbQummQIJ5bA5pgs=; b=czdCTcChMbzfH0hQdoeRUfTKifkfSccBfUYkkOLQ5w0uecg2/xkwQJsn5sMtQuGolZ hs2mE1Vt9Z2ToqxfxgIcFMZqvI4RMfTNn3/ATKoq4yToABj87BtGaV1XKYPwLsQvkH17 Wti0KWphyJ/ZqkuTuh4pCCfRNfYo2E0i0JscZLZZ5Wt+cyNDCiz765SYeeSBPx6sI838 x2h0Xa2VGJPVcfZcU43RKw8aTlmaDSqw3/mk0R1ELkCKGCSmbZcD4pZKlSvarcYwSFXm Q25R5Z7nJINJqhg+1oWYi1H/1w4ORA2VthjHK4Wv9ko10VEu917hFA4WE/DrPpMrwr9+ 34ng== 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 :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Dj7BYeyNUbLn+KU27VKJYtSNyFPXbQummQIJ5bA5pgs=; b=qVCUMxKslT/nyrGa5puYaJUTyfrcoeOfEWsyVkS9QnCrVByVDU3Et8X23P2wiKl+6M 5B8AWDOshy/iPp7XC9YKqi9IG1MMyPMJ48iKZpYN2grigPqCfKqzqLH+BaM2iGqossuD OylEEKIlWatqVABC6JagKNyt6bliXK1poAFCbofYIdvqBbKXYca79sLCG7evivo0lXmj Qo41BoYypdbxlhvaq09N+xOEq6I+qihYAoI8NECpCYEfctvx+rg0WUtZxa1R7hGAqWYw FfDEggFAuU6kxS1SGRi6p1YP7cVG2HkOk41OmxCIdWe7Ey2+RfVWVKiLe135pYKpIj30 QAHg== X-Gm-Message-State: AJcUukdK+2vwvZXNVkAelB7s6a0T39sdLUkqOWhFMRvAxKWjTEOf+Pj8 PKaKwNuXb8oRWgidjMMsj3sYQISO X-Google-Smtp-Source: ALg8bN77N/WNdIpUBKeuoXgzM8EI/Cx6N0G412ql6zZdLKzXwoYpc4AcbAJhKUbU+8hJ/ceqiMoixw== X-Received: by 2002:a24:7e8c:: with SMTP id h134mr15097785itc.130.1548043981683; Sun, 20 Jan 2019 20:13:01 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id p198sm5542577itb.30.2019.01.20.20.13.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 20:13:01 -0800 (PST) Sender: Mark Johnston Date: Sun, 20 Jan 2019 23:12:59 -0500 From: Mark Johnston To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Message-ID: <20190121041259.GB96979@raichu> References: <201901210357.x0L3vnIx052453@repo.freebsd.org> <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 64E326CEF2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:13:03 -0000 On Sun, Jan 20, 2019 at 08:11:20PM -0800, Enji Cooper wrote: > > > On Jan 20, 2019, at 8:10 PM, Enji Cooper wrote: > > > > > >> On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: > >> > >> Author: markj > >> Date: Mon Jan 21 03:57:49 2019 > >> New Revision: 343247 > >> URL: https://svnweb.freebsd.org/changeset/base/343247 > >> > >> Log: > >> Fix cmp(1) tests for "special" mode. > >> > >> Test failures don't seem to propagate up if atf_check is run in > >> a pipeline. Thus, the tests continued to pass despite the bug reverted > >> in r343245. > > > > Hmmm… that’s strange… > > -Enji > > There’s a good chance that this issue is also masked by the fact that the CI runs have been panicking with bug 235097 as well. > Cheers, > -Enji No, I ran the tests locally before committing the now-reverted diff. From owner-svn-src-all@freebsd.org Mon Jan 21 04:50:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9348148EFDA; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@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 80A1F6DB45; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D6E6CC92; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L4ougf079337; Mon, 21 Jan 2019 04:50:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L4ouKV079336; Mon, 21 Jan 2019 04:50:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210450.x0L4ouKV079336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 04:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343249 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 343249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80A1F6DB45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:50:57 -0000 Author: avos Date: Mon Jan 21 04:50:56 2019 New Revision: 343249 URL: https://svnweb.freebsd.org/changeset/base/343249 Log: Fix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8) Do not invoke 'wlan_up' function from devd(8) on interface creation event (an example to create such event: 'ifconfig wlan0 create wlandev rtwn0'); they're typically produced during 'service netif (re)start' and result in duplicate interface initialization. From the user side if WPA option is used, this result in messages like: - /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant or - wpa_supplicant already running? (pid=xxxx). (for HOSTAP interfaces this race may result in startup failure). As a side effect, wpa_supplicant(8) / hostapd(8) will not be invoked when new wlan(4) interface is created manually and corresponding configuration for it is present in rc.conf(5). This change does not affect device attach / removal events. MFC after: 5 days Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Mon Jan 21 04:10:45 2019 (r343248) +++ head/sbin/devd/devd.conf Mon Jan 21 04:50:56 2019 (r343249) @@ -43,7 +43,7 @@ options { # notify 0 { match "system" "IFNET"; - match "subsystem" "!usbus[0-9]+"; + match "subsystem" "(?!usbus[0-9]+|?!wlan[0-9]+)"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; From owner-svn-src-all@freebsd.org Mon Jan 21 06:14:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71BB149187C; Mon, 21 Jan 2019 06:14:27 +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 6E49A6FB2C; Mon, 21 Jan 2019 06:14:27 +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 57D48DB5B; Mon, 21 Jan 2019 06:14:27 +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 x0L6ERsf025218; Mon, 21 Jan 2019 06:14:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L6EQnD025214; Mon, 21 Jan 2019 06:14:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901210614.x0L6EQnD025214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 21 Jan 2019 06:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343250 - stable/12/usr.bin/gzip X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/usr.bin/gzip X-SVN-Commit-Revision: 343250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E49A6FB2C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 06:14:28 -0000 Author: delphij Date: Mon Jan 21 06:14:26 2019 New Revision: 343250 URL: https://svnweb.freebsd.org/changeset/base/343250 Log: MFC r342845,342846: Port NetBSD improvements: - Add -l support for xz files - Add lzip support to gzip based on the example lzip decoder. Obtained from: NetBSD Relnotes: yes Added: stable/12/usr.bin/gzip/unlz.c - copied unchanged from r342845, head/usr.bin/gzip/unlz.c Modified: stable/12/usr.bin/gzip/gzip.1 stable/12/usr.bin/gzip/gzip.c stable/12/usr.bin/gzip/unxz.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/gzip/gzip.1 ============================================================================== --- stable/12/usr.bin/gzip/gzip.1 Mon Jan 21 04:50:56 2019 (r343249) +++ stable/12/usr.bin/gzip/gzip.1 Mon Jan 21 06:14:26 2019 (r343250) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.30 2017/10/22 17:36:49 abhinav Exp $ +.\" $NetBSD: gzip.1,v 1.31 2018/10/26 22:10:15 christos Exp $ .\" .\" Copyright (c) 1997, 2003, 2004, 2008, 2009, 2015, 2017 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd November 21, 2017 +.Dd January 7, 2019 .Dt GZIP 1 .Os .Sh NAME @@ -109,6 +109,7 @@ This version of is also capable of decompressing files compressed using .Xr compress 1 , .Xr bzip2 1 , +.Ar lzip , or .Xr xz 1 . .Sh OPTIONS @@ -224,7 +225,7 @@ This implementation of was ported based on the .Nx .Nm -version 20170803, +version 20181111, and first appeared in .Fx 7.0 . .Sh AUTHORS Modified: stable/12/usr.bin/gzip/gzip.c ============================================================================== --- stable/12/usr.bin/gzip/gzip.c Mon Jan 21 04:50:56 2019 (r343249) +++ stable/12/usr.bin/gzip/gzip.c Mon Jan 21 06:14:26 2019 (r343250) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.113 2018/06/12 00:42:17 kamil Exp $ */ +/* $NetBSD: gzip.c,v 1.116 2018/10/27 11:39:12 skrll Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -84,6 +84,9 @@ enum filetype { #ifndef NO_XZ_SUPPORT FT_XZ, #endif +#ifndef NO_LZ_SUPPORT + FT_LZ, +#endif FT_LAST, FT_UNKNOWN }; @@ -110,6 +113,11 @@ enum filetype { #define XZ_MAGIC "\3757zXZ" #endif +#ifndef NO_LZ_SUPPORT +#define LZ_SUFFIX ".lz" +#define LZ_MAGIC "LZIP" +#endif + #define GZ_SUFFIX ".gz" #define BUFLEN (64 * 1024) @@ -155,6 +163,9 @@ static suffixes_t suffixes[] = { #ifndef NO_XZ_SUPPORT SUFFIX(XZ_SUFFIX, ""), #endif +#ifndef NO_LZ_SUPPORT + SUFFIX(LZ_SUFFIX, ""), +#endif SUFFIX(GZ_SUFFIX, ""), /* Overwritten by -S "" */ #endif /* SMALL */ #undef SUFFIX @@ -162,7 +173,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (nitems(suffixes)) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20171121"; +static const char gzip_version[] = "FreeBSD gzip 20190107"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -246,6 +257,7 @@ static void display_license(void); static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); static ssize_t write_retry(int, const void *, size_t); +static void print_list_out(off_t, off_t, const char*); #ifdef SMALL #define infile_set(f,t) infile_set(f) @@ -289,8 +301,13 @@ static off_t unpack(int, int, char *, size_t, off_t *) #ifndef NO_XZ_SUPPORT static off_t unxz(int, int, char *, size_t, off_t *); +static off_t unxz_len(int); #endif +#ifndef NO_LZ_SUPPORT +static off_t unlz(int, int, char *, size_t, off_t *); +#endif + #ifdef SMALL #define getopt_long(a,b,c,d,e) getopt(a,b,c) #else @@ -1159,6 +1176,11 @@ file_gettype(u_char *buf) return FT_XZ; else #endif +#ifndef NO_LZ_SUPPORT + if (memcmp(buf, LZ_MAGIC, 4) == 0) + return FT_LZ; + else +#endif return FT_UNKNOWN; } @@ -1632,14 +1654,23 @@ file_uncompress(char *file, char *outfile, size_t outs #ifndef NO_XZ_SUPPORT case FT_XZ: if (lflag) { - maybe_warnx("no -l with xz files"); - goto lose; + size = unxz_len(fd); + print_list_out(in_size, size, file); + return -1; } - size = unxz(fd, zfd, NULL, 0, NULL); break; #endif +#ifndef NO_LZ_SUPPORT + case FT_LZ: + if (lflag) { + maybe_warnx("no -l with lzip files"); + goto lose; + } + size = unlz(fd, zfd, NULL, 0, NULL); + break; +#endif #ifndef SMALL case FT_UNKNOWN: if (lflag) { @@ -1872,6 +1903,12 @@ handle_stdin(void) (char *)header1, sizeof header1, &gsize); break; #endif +#ifndef NO_LZ_SUPPORT + case FT_LZ: + usize = unlz(STDIN_FILENO, STDOUT_FILENO, + (char *)header1, sizeof header1, &gsize); + break; +#endif } #ifndef SMALL @@ -2197,6 +2234,12 @@ print_list(int fd, off_t out, const char *outfile, tim #else (void)&ts; /* XXX */ #endif + print_list_out(out, in, outfile); +} + +static void +print_list_out(off_t out, off_t in, const char *outfile) +{ printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in); print_ratio(in, out, stdout); printf(" %s\n", outfile); @@ -2270,6 +2313,9 @@ display_version(void) #endif #ifndef NO_XZ_SUPPORT #include "unxz.c" +#endif +#ifndef NO_LZ_SUPPORT +#include "unlz.c" #endif static ssize_t Copied: stable/12/usr.bin/gzip/unlz.c (from r342845, head/usr.bin/gzip/unlz.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.bin/gzip/unlz.c Mon Jan 21 06:14:26 2019 (r343250, copy of r342845, head/usr.bin/gzip/unlz.c) @@ -0,0 +1,646 @@ +/* $NetBSD: unlz.c,v 1.6 2018/11/11 01:42:36 christos Exp $ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + */ + +/* Lzd - Educational decompressor for the lzip format + Copyright (C) 2013-2018 Antonio Diaz Diaz. + + This program is free software. 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 program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LZ_STATES 12 + +#define LITERAL_CONTEXT_BITS 3 +#define POS_STATE_BITS 2 +#define POS_STATES (1 << POS_STATE_BITS) +#define POS_STATE_MASK (POS_STATES - 1) + +#define STATES 4 +#define DIS_SLOT_BITS 6 + +#define DIS_MODEL_START 4 +#define DIS_MODEL_END 14 + +#define MODELED_DISTANCES (1 << (DIS_MODEL_END / 2)) +#define DIS_ALIGN_BITS 4 +#define DIS_ALIGN_SIZE (1 << DIS_ALIGN_BITS) + +#define LOW_BITS 3 +#define MID_BITS 3 +#define HIGH_BITS 8 + +#define LOW_SYMBOLS (1 << LOW_BITS) +#define MID_SYMBOLS (1 << MID_BITS) +#define HIGH_SYMBOLS (1 << HIGH_BITS) + +#define MAX_SYMBOLS (LOW_SYMBOLS + MID_SYMBOLS + HIGH_SYMBOLS) + +#define MIN_MATCH_LEN 2 + +#define BIT_MODEL_MOVE_BITS 5 +#define BIT_MODEL_TOTAL_BITS 11 +#define BIT_MODEL_TOTAL (1 << BIT_MODEL_TOTAL_BITS) +#define BIT_MODEL_INIT (BIT_MODEL_TOTAL / 2) + +static const int lz_st_next[] = { + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, +}; + +static bool +lz_st_is_char(int st) { + return st < 7; +} + +static int +lz_st_get_char(int st) { + return lz_st_next[st]; +} + +static int +lz_st_get_match(int st) { + return st < 7 ? 7 : 10; +} + +static int +lz_st_get_rep(int st) { + return st < 7 ? 8 : 11; +} + +static int +lz_st_get_short_rep(int st) { + return st < 7 ? 9 : 11; +} + +struct lz_len_model { + int choice1; + int choice2; + int bm_low[POS_STATES][LOW_SYMBOLS]; + int bm_mid[POS_STATES][MID_SYMBOLS]; + int bm_high[HIGH_SYMBOLS]; +}; + +static uint32_t lz_crc[256]; + +static void +lz_crc_init(void) +{ + for (unsigned i = 0; i < nitems(lz_crc); i++) { + unsigned c = i; + for (unsigned j = 0; j < 8; j++) { + if (c & 1) + c = 0xEDB88320U ^ (c >> 1); + else + c >>= 1; + } + lz_crc[i] = c; + } +} + +static void +lz_crc_update(uint32_t *crc, const uint8_t *buf, size_t len) +{ + for (size_t i = 0; i < len; i++) + *crc = lz_crc[(*crc ^ buf[i]) & 0xFF] ^ (*crc >> 8); +} + +struct lz_range_decoder { + FILE *fp; + uint32_t code; + uint32_t range; +}; + +static int +lz_rd_create(struct lz_range_decoder *rd, FILE *fp) +{ + rd->fp = fp; + rd->code = 0; + rd->range = ~0; + for (int i = 0; i < 5; i++) + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + return ferror(rd->fp) ? -1 : 0; +} + +static unsigned +lz_rd_decode(struct lz_range_decoder *rd, int num_bits) +{ + unsigned symbol = 0; + + for (int i = num_bits; i > 0; i--) { + rd->range >>= 1; + symbol <<= 1; + if (rd->code >= rd->range) { + rd->code -= rd->range; + symbol |= 1; + } + if (rd->range <= 0x00FFFFFFU) { + rd->range <<= 8; + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + } + } + + return symbol; +} + +static unsigned +lz_rd_decode_bit(struct lz_range_decoder *rd, int *bm) +{ + unsigned symbol; + const uint32_t bound = (rd->range >> BIT_MODEL_TOTAL_BITS) * *bm; + + if(rd->code < bound) { + rd->range = bound; + *bm += (BIT_MODEL_TOTAL - *bm) >> BIT_MODEL_MOVE_BITS; + symbol = 0; + } + else { + rd->range -= bound; + rd->code -= bound; + *bm -= *bm >> BIT_MODEL_MOVE_BITS; + symbol = 1; + } + + if (rd->range <= 0x00FFFFFFU) { + rd->range <<= 8; + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + } + return symbol; +} + +static unsigned +lz_rd_decode_tree(struct lz_range_decoder *rd, int *bm, int num_bits) +{ + unsigned symbol = 1; + + for (int i = 0; i < num_bits; i++) + symbol = (symbol << 1) | lz_rd_decode_bit(rd, &bm[symbol]); + + return symbol - (1 << num_bits); +} + +static unsigned +lz_rd_decode_tree_reversed(struct lz_range_decoder *rd, int *bm, int num_bits) +{ + unsigned symbol = lz_rd_decode_tree(rd, bm, num_bits); + unsigned reversed_symbol = 0; + + for (int i = 0; i < num_bits; i++) { + reversed_symbol = (reversed_symbol << 1) | (symbol & 1); + symbol >>= 1; + } + + return reversed_symbol; +} + +static unsigned +lz_rd_decode_matched(struct lz_range_decoder *rd, int *bm, int match_byte) +{ + unsigned symbol = 1; + + for (int i = 7; i >= 0; i--) { + const unsigned match_bit = (match_byte >> i) & 1; + const unsigned bit = lz_rd_decode_bit(rd, + &bm[symbol + (match_bit << 8) + 0x100]); + symbol = (symbol << 1) | bit; + if (match_bit != bit) { + while (symbol < 0x100) { + symbol = (symbol << 1) | + lz_rd_decode_bit(rd, &bm[symbol]); + } + break; + } + } + return symbol & 0xFF; +} + +static unsigned +lz_rd_decode_len(struct lz_range_decoder *rd, struct lz_len_model *lm, + int pos_state) +{ + if (lz_rd_decode_bit(rd, &lm->choice1) == 0) + return lz_rd_decode_tree(rd, lm->bm_low[pos_state], LOW_BITS); + + if (lz_rd_decode_bit(rd, &lm->choice2) == 0) { + return LOW_SYMBOLS + + lz_rd_decode_tree(rd, lm->bm_mid[pos_state], MID_BITS); + } + + return LOW_SYMBOLS + MID_SYMBOLS + + lz_rd_decode_tree(rd, lm->bm_high, HIGH_BITS); +} + +struct lz_decoder { + FILE *fin, *fout; + off_t pos, ppos, spos, dict_size; + bool wrapped; + uint32_t crc; + uint8_t *obuf; + struct lz_range_decoder rdec; +}; + +static int +lz_flush(struct lz_decoder *lz) +{ + off_t offs = lz->pos - lz->spos; + if (offs <= 0) + return -1; + + size_t size = (size_t)offs; + lz_crc_update(&lz->crc, lz->obuf + lz->spos, size); + if (fwrite(lz->obuf + lz->spos, 1, size, lz->fout) != size) + return -1; + + lz->wrapped = lz->pos >= lz->dict_size; + if (lz->wrapped) { + lz->ppos += lz->pos; + lz->pos = 0; + } + lz->spos = lz->pos; + return 0; +} + +static void +lz_destroy(struct lz_decoder *lz) +{ + if (lz->fin) + fclose(lz->fin); + if (lz->fout) + fclose(lz->fout); + free(lz->obuf); +} + +static int +lz_create(struct lz_decoder *lz, int fin, int fdout, int dict_size) +{ + memset(lz, 0, sizeof(*lz)); + + lz->fin = fdopen(dup(fin), "r"); + if (lz->fin == NULL) + goto out; + + lz->fout = fdopen(dup(fdout), "w"); + if (lz->fout == NULL) + goto out; + + lz->pos = lz->ppos = lz->spos = 0; + lz->crc = ~0; + lz->dict_size = dict_size; + lz->wrapped = false; + + lz->obuf = malloc(dict_size); + if (lz->obuf == NULL) + goto out; + + if (lz_rd_create(&lz->rdec, lz->fin) == -1) + goto out; + return 0; +out: + lz_destroy(lz); + return -1; +} + +static uint8_t +lz_peek(const struct lz_decoder *lz, unsigned ahead) +{ + off_t diff = lz->pos - ahead - 1; + + if (diff >= 0) + return lz->obuf[diff]; + + if (lz->wrapped) + return lz->obuf[lz->dict_size + diff]; + + return 0; +} + +static void +lz_put(struct lz_decoder *lz, uint8_t b) +{ + lz->obuf[lz->pos++] = b; + if (lz->dict_size == lz->pos) + lz_flush(lz); +} + +static off_t +lz_get_data_position(const struct lz_decoder *lz) +{ + return lz->ppos + lz->pos; +} + +static unsigned +lz_get_crc(const struct lz_decoder *lz) +{ + return lz->crc ^ 0xffffffffU; +} + +static void +lz_bm_init(int *a, size_t l) +{ + for (size_t i = 0; i < l; i++) + a[i] = BIT_MODEL_INIT; +} + +#define LZ_BM_INIT(a) lz_bm_init(a, nitems(a)) +#define LZ_BM_INIT2(a) do { \ + size_t l = nitems(a[0]); \ + for (size_t i = 0; i < nitems(a); i++) \ + lz_bm_init(a[i], l); \ +} while (/*CONSTCOND*/0) + +#define LZ_MODEL_INIT(a) do { \ + a.choice1 = BIT_MODEL_INIT; \ + a.choice2 = BIT_MODEL_INIT; \ + LZ_BM_INIT2(a.bm_low); \ + LZ_BM_INIT2(a.bm_mid); \ + LZ_BM_INIT(a.bm_high); \ +} while (/*CONSTCOND*/0) + +static bool +lz_decode_member(struct lz_decoder *lz) +{ + int bm_literal[1 << LITERAL_CONTEXT_BITS][0x300]; + int bm_match[LZ_STATES][POS_STATES]; + int bm_rep[4][LZ_STATES]; + int bm_len[LZ_STATES][POS_STATES]; + int bm_dis_slot[LZ_STATES][1 << DIS_SLOT_BITS]; + int bm_dis[MODELED_DISTANCES - DIS_MODEL_END + 1]; + int bm_align[DIS_ALIGN_SIZE]; + + LZ_BM_INIT2(bm_literal); + LZ_BM_INIT2(bm_match); + LZ_BM_INIT2(bm_rep); + LZ_BM_INIT2(bm_len); + LZ_BM_INIT2(bm_dis_slot); + LZ_BM_INIT(bm_dis); + LZ_BM_INIT(bm_align); + + struct lz_len_model match_len_model; + struct lz_len_model rep_len_model; + + LZ_MODEL_INIT(match_len_model); + LZ_MODEL_INIT(rep_len_model); + + struct lz_range_decoder *rd = &lz->rdec; + unsigned rep[4] = { 0 }; + + + int state = 0; + + while (!feof(lz->fin) && !ferror(lz->fin)) { + const int pos_state = lz_get_data_position(lz) & POS_STATE_MASK; + // bit 1 + if (lz_rd_decode_bit(rd, &bm_match[state][pos_state]) == 0) { + const uint8_t prev_byte = lz_peek(lz, 0); + const int literal_state = + prev_byte >> (8 - LITERAL_CONTEXT_BITS); + int *bm = bm_literal[literal_state]; + if (lz_st_is_char(state)) + lz_put(lz, lz_rd_decode_tree(rd, bm, 8)); + else { + int peek = lz_peek(lz, rep[0]); + lz_put(lz, lz_rd_decode_matched(rd, bm, peek)); + } + state = lz_st_get_char(state); + continue; + } + int len; + // bit 2 + if (lz_rd_decode_bit(rd, &bm_rep[0][state]) != 0) { + // bit 3 + if (lz_rd_decode_bit(rd, &bm_rep[1][state]) == 0) { + // bit 4 + if (lz_rd_decode_bit(rd, + &bm_len[state][pos_state]) == 0) + { + state = lz_st_get_short_rep(state); + lz_put(lz, lz_peek(lz, rep[0])); + continue; + } + } else { + unsigned distance; + // bit 4 + if (lz_rd_decode_bit(rd, &bm_rep[2][state]) + == 0) + distance = rep[1]; + else { + // bit 5 + if (lz_rd_decode_bit(rd, + &bm_rep[3][state]) == 0) + distance = rep[2]; + else { + distance = rep[3]; + rep[3] = rep[2]; + } + rep[2] = rep[1]; + } + rep[1] = rep[0]; + rep[0] = distance; + } + state = lz_st_get_rep(state); + len = MIN_MATCH_LEN + + lz_rd_decode_len(rd, &rep_len_model, pos_state); + } else { + rep[3] = rep[2]; rep[2] = rep[1]; rep[1] = rep[0]; + len = MIN_MATCH_LEN + + lz_rd_decode_len(rd, &match_len_model, pos_state); + const int len_state = + MIN(len - MIN_MATCH_LEN, STATES - 1); + rep[0] = lz_rd_decode_tree(rd, bm_dis_slot[len_state], + DIS_SLOT_BITS); + if (rep[0] >= DIS_MODEL_START) { + const unsigned dis_slot = rep[0]; + const int direct_bits = (dis_slot >> 1) - 1; + rep[0] = (2 | (dis_slot & 1)) << direct_bits; + if (dis_slot < DIS_MODEL_END) + rep[0] += lz_rd_decode_tree_reversed(rd, + &bm_dis[rep[0] - dis_slot], + direct_bits); + else { + rep[0] += lz_rd_decode(rd, direct_bits + - DIS_ALIGN_BITS) << DIS_ALIGN_BITS; + rep[0] += lz_rd_decode_tree_reversed(rd, + bm_align, DIS_ALIGN_BITS); + if (rep[0] == 0xFFFFFFFFU) { + lz_flush(lz); + return len == MIN_MATCH_LEN; + } + } + } + state = lz_st_get_match(state); + if (rep[0] >= lz->dict_size || + (rep[0] >= lz->pos && !lz->wrapped)) { + lz_flush(lz); + return false; + } + } + for (int i = 0; i < len; i++) + lz_put(lz, lz_peek(lz, rep[0])); + } + lz_flush(lz); + return false; +} + +/* + * 0-3 CRC32 of the uncompressed data + * 4-11 size of the uncompressed data + * 12-19 member size including header and trailer + */ +#define TRAILER_SIZE 20 + + +static off_t +lz_decode(int fin, int fdout, unsigned dict_size, off_t *insize) +{ + struct lz_decoder lz; + off_t rv = -1; + + if (lz_create(&lz, fin, fdout, dict_size) == -1) + return -1; + + if (!lz_decode_member(&lz)) + goto out; + + uint8_t trailer[TRAILER_SIZE]; + + for(size_t i = 0; i < nitems(trailer); i++) + trailer[i] = (uint8_t)getc(lz.fin); + + unsigned crc = 0; + for (int i = 3; i >= 0; --i) { + crc <<= 8; + crc += trailer[i]; + } + + int64_t data_size = 0; + for (int i = 11; i >= 4; --i) { + data_size <<= 8; + data_size += trailer[i]; + } + + if (crc != lz_get_crc(&lz) || data_size != lz_get_data_position(&lz)) + goto out; + + rv = 0; + for (int i = 19; i >= 12; --i) { + rv <<= 8; + rv += trailer[i]; + } + if (insize) + *insize = rv; +#if 0 + /* Does not work with pipes */ + rv = ftello(lz.fout); +#else + rv = data_size; +#endif +out: + lz_destroy(&lz); + return rv; +} + + +/* + * 0-3 magic + * 4 version + * 5 coded dict_size + */ +#define HDR_SIZE 6 +#define MIN_DICTIONARY_SIZE (1 << 12) +#define MAX_DICTIONARY_SIZE (1 << 29) + +static const char hdrmagic[] = { 'L', 'Z', 'I', 'P', 1 }; + +static unsigned +lz_get_dict_size(unsigned char c) +{ + unsigned dict_size = 1 << (c & 0x1f); + dict_size -= (dict_size >> 2) * ( (c >> 5) & 0x7); + if (dict_size < MIN_DICTIONARY_SIZE || dict_size > MAX_DICTIONARY_SIZE) + return 0; + return dict_size; +} + +static off_t +unlz(int fin, int fout, char *pre, size_t prelen, off_t *bytes_in) +{ + if (lz_crc[0] == 0) + lz_crc_init(); + + char header[HDR_SIZE]; + + if (prelen > sizeof(header)) + return -1; + if (pre && prelen) + memcpy(header, pre, prelen); + + ssize_t nr = read(fin, header + prelen, sizeof(header) - prelen); + switch (nr) { + case -1: + return -1; + case 0: + return prelen ? -1 : 0; + default: + if ((size_t)nr != sizeof(header) - prelen) + return -1; + break; + } + + if (memcmp(header, hdrmagic, sizeof(hdrmagic)) != 0) + return -1; + + unsigned dict_size = lz_get_dict_size(header[5]); + if (dict_size == 0) + return -1; + + return lz_decode(fin, fout, dict_size, bytes_in); +} Modified: stable/12/usr.bin/gzip/unxz.c ============================================================================== --- stable/12/usr.bin/gzip/unxz.c Mon Jan 21 04:50:56 2019 (r343249) +++ stable/12/usr.bin/gzip/unxz.c Mon Jan 21 06:14:26 2019 (r343250) @@ -1,4 +1,4 @@ -/* $NetBSD: unxz.c,v 1.7 2017/08/04 07:27:08 mrg Exp $ */ +/* $NetBSD: unxz.c,v 1.8 2018/10/06 16:36:45 martin Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -156,3 +156,322 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *by } } } + +#include + +/* + * Copied various bits and pieces from xz support code or brute force + * replacements. + */ + +#define my_min(A,B) ((A)<(B)?(A):(B)) + +// Some systems have suboptimal BUFSIZ. Use a bit bigger value on them. +// We also need that IO_BUFFER_SIZE is a multiple of 8 (sizeof(uint64_t)) +#if BUFSIZ <= 1024 +# define IO_BUFFER_SIZE 8192 +#else +# define IO_BUFFER_SIZE (BUFSIZ & ~7U) +#endif + +/// is_sparse() accesses the buffer as uint64_t for maximum speed. +/// Use an union to make sure that the buffer is properly aligned. +typedef union { + uint8_t u8[IO_BUFFER_SIZE]; + uint32_t u32[IO_BUFFER_SIZE / sizeof(uint32_t)]; + uint64_t u64[IO_BUFFER_SIZE / sizeof(uint64_t)]; +} io_buf; + + +static bool +io_pread(int fd, io_buf *buf, size_t size, off_t pos) +{ + // Using lseek() and read() is more portable than pread() and + // for us it is as good as real pread(). + if (lseek(fd, pos, SEEK_SET) != pos) { + return true; + } + + const size_t amount = read(fd, buf, size); + if (amount == SIZE_MAX) + return true; + + if (amount != size) { + return true; + } + + return false; +} + +/* + * Most of the following is copied (mostly verbatim) from the xz + * distribution, from file src/xz/list.c + */ + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file list.c +/// \brief Listing information about .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + + +/// Information about a .xz file +typedef struct { + /// Combined Index of all Streams in the file + lzma_index *idx; + + /// Total amount of Stream Padding + uint64_t stream_padding; + + /// Highest memory usage so far + uint64_t memusage_max; + + /// True if all Blocks so far have Compressed Size and + /// Uncompressed Size fields + bool all_have_sizes; + + /// Oldest XZ Utils version that will decompress the file + uint32_t min_version; + +} xz_file_info; + +#define XZ_FILE_INFO_INIT { NULL, 0, 0, true, 50000002 } + + +/// \brief Parse the Index(es) from the given .xz file +/// +/// \param xfi Pointer to structure where the decoded information +/// is stored. +/// \param pair Input file +/// +/// \return On success, false is returned. On error, true is returned. +/// +// TODO: This function is pretty big. liblzma should have a function that +// takes a callback function to parse the Index(es) from a .xz file to make +// it easy for applications. +static bool +parse_indexes(xz_file_info *xfi, int src_fd) +{ + struct stat st; + + fstat(src_fd, &st); + if (st.st_size <= 0) { + return true; + } + + if (st.st_size < 2 * LZMA_STREAM_HEADER_SIZE) { + return true; + } + + io_buf buf; + lzma_stream_flags header_flags; + lzma_stream_flags footer_flags; + lzma_ret ret; + + // lzma_stream for the Index decoder + lzma_stream strm = LZMA_STREAM_INIT; + + // All Indexes decoded so far + lzma_index *combined_index = NULL; + + // The Index currently being decoded + lzma_index *this_index = NULL; + + // Current position in the file. We parse the file backwards so + // initialize it to point to the end of the file. + off_t pos = st.st_size; + + // Each loop iteration decodes one Index. + do { + // Check that there is enough data left to contain at least + // the Stream Header and Stream Footer. This check cannot + // fail in the first pass of this loop. + if (pos < 2 * LZMA_STREAM_HEADER_SIZE) { + goto error; + } + + pos -= LZMA_STREAM_HEADER_SIZE; + lzma_vli stream_padding = 0; + + // Locate the Stream Footer. There may be Stream Padding which + // we must skip when reading backwards. + while (true) { + if (pos < LZMA_STREAM_HEADER_SIZE) { + goto error; + } + + if (io_pread(src_fd, &buf, + LZMA_STREAM_HEADER_SIZE, pos)) + goto error; + + // Stream Padding is always a multiple of four bytes. + int i = 2; + if (buf.u32[i] != 0) + break; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 21 06:52:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B041492801; Mon, 21 Jan 2019 06:52:36 +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 1DA1971579; Mon, 21 Jan 2019 06:52:36 +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 0CC06E1F7; Mon, 21 Jan 2019 06:52:36 +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 x0L6qajA045675; Mon, 21 Jan 2019 06:52:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L6qZI3045672; Mon, 21 Jan 2019 06:52:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901210652.x0L6qZI3045672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 21 Jan 2019 06:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343251 - stable/11/usr.bin/gzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/gzip X-SVN-Commit-Revision: 343251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DA1971579 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 06:52:36 -0000 Author: delphij Date: Mon Jan 21 06:52:35 2019 New Revision: 343251 URL: https://svnweb.freebsd.org/changeset/base/343251 Log: MFC r342845,342846: Port NetBSD improvements: - Add -l support for xz files - Add lzip support to gzip based on the example lzip decoder. Obtained from: NetBSD Relnotes: yes Added: stable/11/usr.bin/gzip/unlz.c - copied unchanged from r342845, head/usr.bin/gzip/unlz.c Modified: stable/11/usr.bin/gzip/gzip.1 stable/11/usr.bin/gzip/gzip.c stable/11/usr.bin/gzip/unxz.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/gzip/gzip.1 ============================================================================== --- stable/11/usr.bin/gzip/gzip.1 Mon Jan 21 06:14:26 2019 (r343250) +++ stable/11/usr.bin/gzip/gzip.1 Mon Jan 21 06:52:35 2019 (r343251) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.30 2017/10/22 17:36:49 abhinav Exp $ +.\" $NetBSD: gzip.1,v 1.31 2018/10/26 22:10:15 christos Exp $ .\" .\" Copyright (c) 1997, 2003, 2004, 2008, 2009, 2015, 2017 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd November 21, 2017 +.Dd January 7, 2019 .Dt GZIP 1 .Os .Sh NAME @@ -109,6 +109,7 @@ This version of is also capable of decompressing files compressed using .Xr compress 1 , .Xr bzip2 1 , +.Ar lzip , or .Xr xz 1 . .Sh OPTIONS @@ -224,7 +225,7 @@ This implementation of was ported based on the .Nx .Nm -version 20170803, +version 20181111, and first appeared in .Fx 7.0 . .Sh AUTHORS Modified: stable/11/usr.bin/gzip/gzip.c ============================================================================== --- stable/11/usr.bin/gzip/gzip.c Mon Jan 21 06:14:26 2019 (r343250) +++ stable/11/usr.bin/gzip/gzip.c Mon Jan 21 06:52:35 2019 (r343251) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.113 2018/06/12 00:42:17 kamil Exp $ */ +/* $NetBSD: gzip.c,v 1.116 2018/10/27 11:39:12 skrll Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -84,6 +84,9 @@ enum filetype { #ifndef NO_XZ_SUPPORT FT_XZ, #endif +#ifndef NO_LZ_SUPPORT + FT_LZ, +#endif FT_LAST, FT_UNKNOWN }; @@ -110,6 +113,11 @@ enum filetype { #define XZ_MAGIC "\3757zXZ" #endif +#ifndef NO_LZ_SUPPORT +#define LZ_SUFFIX ".lz" +#define LZ_MAGIC "LZIP" +#endif + #define GZ_SUFFIX ".gz" #define BUFLEN (64 * 1024) @@ -155,6 +163,9 @@ static suffixes_t suffixes[] = { #ifndef NO_XZ_SUPPORT SUFFIX(XZ_SUFFIX, ""), #endif +#ifndef NO_LZ_SUPPORT + SUFFIX(LZ_SUFFIX, ""), +#endif SUFFIX(GZ_SUFFIX, ""), /* Overwritten by -S "" */ #endif /* SMALL */ #undef SUFFIX @@ -162,7 +173,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (nitems(suffixes)) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20171121"; +static const char gzip_version[] = "FreeBSD gzip 20190107"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -246,6 +257,7 @@ static void display_license(void); static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); static ssize_t write_retry(int, const void *, size_t); +static void print_list_out(off_t, off_t, const char*); #ifdef SMALL #define infile_set(f,t) infile_set(f) @@ -289,8 +301,13 @@ static off_t unpack(int, int, char *, size_t, off_t *) #ifndef NO_XZ_SUPPORT static off_t unxz(int, int, char *, size_t, off_t *); +static off_t unxz_len(int); #endif +#ifndef NO_LZ_SUPPORT +static off_t unlz(int, int, char *, size_t, off_t *); +#endif + #ifdef SMALL #define getopt_long(a,b,c,d,e) getopt(a,b,c) #else @@ -1159,6 +1176,11 @@ file_gettype(u_char *buf) return FT_XZ; else #endif +#ifndef NO_LZ_SUPPORT + if (memcmp(buf, LZ_MAGIC, 4) == 0) + return FT_LZ; + else +#endif return FT_UNKNOWN; } @@ -1633,14 +1655,23 @@ file_uncompress(char *file, char *outfile, size_t outs #ifndef NO_XZ_SUPPORT case FT_XZ: if (lflag) { - maybe_warnx("no -l with xz files"); - goto lose; + size = unxz_len(fd); + print_list_out(in_size, size, file); + return -1; } - size = unxz(fd, zfd, NULL, 0, NULL); break; #endif +#ifndef NO_LZ_SUPPORT + case FT_LZ: + if (lflag) { + maybe_warnx("no -l with lzip files"); + goto lose; + } + size = unlz(fd, zfd, NULL, 0, NULL); + break; +#endif #ifndef SMALL case FT_UNKNOWN: if (lflag) { @@ -1873,6 +1904,12 @@ handle_stdin(void) (char *)header1, sizeof header1, &gsize); break; #endif +#ifndef NO_LZ_SUPPORT + case FT_LZ: + usize = unlz(STDIN_FILENO, STDOUT_FILENO, + (char *)header1, sizeof header1, &gsize); + break; +#endif } #ifndef SMALL @@ -2198,6 +2235,12 @@ print_list(int fd, off_t out, const char *outfile, tim #else (void)&ts; /* XXX */ #endif + print_list_out(out, in, outfile); +} + +static void +print_list_out(off_t out, off_t in, const char *outfile) +{ printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in); print_ratio(in, out, stdout); printf(" %s\n", outfile); @@ -2271,6 +2314,9 @@ display_version(void) #endif #ifndef NO_XZ_SUPPORT #include "unxz.c" +#endif +#ifndef NO_LZ_SUPPORT +#include "unlz.c" #endif static ssize_t Copied: stable/11/usr.bin/gzip/unlz.c (from r342845, head/usr.bin/gzip/unlz.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/gzip/unlz.c Mon Jan 21 06:52:35 2019 (r343251, copy of r342845, head/usr.bin/gzip/unlz.c) @@ -0,0 +1,646 @@ +/* $NetBSD: unlz.c,v 1.6 2018/11/11 01:42:36 christos Exp $ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + */ + +/* Lzd - Educational decompressor for the lzip format + Copyright (C) 2013-2018 Antonio Diaz Diaz. + + This program is free software. 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 program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LZ_STATES 12 + +#define LITERAL_CONTEXT_BITS 3 +#define POS_STATE_BITS 2 +#define POS_STATES (1 << POS_STATE_BITS) +#define POS_STATE_MASK (POS_STATES - 1) + +#define STATES 4 +#define DIS_SLOT_BITS 6 + +#define DIS_MODEL_START 4 +#define DIS_MODEL_END 14 + +#define MODELED_DISTANCES (1 << (DIS_MODEL_END / 2)) +#define DIS_ALIGN_BITS 4 +#define DIS_ALIGN_SIZE (1 << DIS_ALIGN_BITS) + +#define LOW_BITS 3 +#define MID_BITS 3 +#define HIGH_BITS 8 + +#define LOW_SYMBOLS (1 << LOW_BITS) +#define MID_SYMBOLS (1 << MID_BITS) +#define HIGH_SYMBOLS (1 << HIGH_BITS) + +#define MAX_SYMBOLS (LOW_SYMBOLS + MID_SYMBOLS + HIGH_SYMBOLS) + +#define MIN_MATCH_LEN 2 + +#define BIT_MODEL_MOVE_BITS 5 +#define BIT_MODEL_TOTAL_BITS 11 +#define BIT_MODEL_TOTAL (1 << BIT_MODEL_TOTAL_BITS) +#define BIT_MODEL_INIT (BIT_MODEL_TOTAL / 2) + +static const int lz_st_next[] = { + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, +}; + +static bool +lz_st_is_char(int st) { + return st < 7; +} + +static int +lz_st_get_char(int st) { + return lz_st_next[st]; +} + +static int +lz_st_get_match(int st) { + return st < 7 ? 7 : 10; +} + +static int +lz_st_get_rep(int st) { + return st < 7 ? 8 : 11; +} + +static int +lz_st_get_short_rep(int st) { + return st < 7 ? 9 : 11; +} + +struct lz_len_model { + int choice1; + int choice2; + int bm_low[POS_STATES][LOW_SYMBOLS]; + int bm_mid[POS_STATES][MID_SYMBOLS]; + int bm_high[HIGH_SYMBOLS]; +}; + +static uint32_t lz_crc[256]; + +static void +lz_crc_init(void) +{ + for (unsigned i = 0; i < nitems(lz_crc); i++) { + unsigned c = i; + for (unsigned j = 0; j < 8; j++) { + if (c & 1) + c = 0xEDB88320U ^ (c >> 1); + else + c >>= 1; + } + lz_crc[i] = c; + } +} + +static void +lz_crc_update(uint32_t *crc, const uint8_t *buf, size_t len) +{ + for (size_t i = 0; i < len; i++) + *crc = lz_crc[(*crc ^ buf[i]) & 0xFF] ^ (*crc >> 8); +} + +struct lz_range_decoder { + FILE *fp; + uint32_t code; + uint32_t range; +}; + +static int +lz_rd_create(struct lz_range_decoder *rd, FILE *fp) +{ + rd->fp = fp; + rd->code = 0; + rd->range = ~0; + for (int i = 0; i < 5; i++) + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + return ferror(rd->fp) ? -1 : 0; +} + +static unsigned +lz_rd_decode(struct lz_range_decoder *rd, int num_bits) +{ + unsigned symbol = 0; + + for (int i = num_bits; i > 0; i--) { + rd->range >>= 1; + symbol <<= 1; + if (rd->code >= rd->range) { + rd->code -= rd->range; + symbol |= 1; + } + if (rd->range <= 0x00FFFFFFU) { + rd->range <<= 8; + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + } + } + + return symbol; +} + +static unsigned +lz_rd_decode_bit(struct lz_range_decoder *rd, int *bm) +{ + unsigned symbol; + const uint32_t bound = (rd->range >> BIT_MODEL_TOTAL_BITS) * *bm; + + if(rd->code < bound) { + rd->range = bound; + *bm += (BIT_MODEL_TOTAL - *bm) >> BIT_MODEL_MOVE_BITS; + symbol = 0; + } + else { + rd->range -= bound; + rd->code -= bound; + *bm -= *bm >> BIT_MODEL_MOVE_BITS; + symbol = 1; + } + + if (rd->range <= 0x00FFFFFFU) { + rd->range <<= 8; + rd->code = (rd->code << 8) | (uint8_t)getc(rd->fp); + } + return symbol; +} + +static unsigned +lz_rd_decode_tree(struct lz_range_decoder *rd, int *bm, int num_bits) +{ + unsigned symbol = 1; + + for (int i = 0; i < num_bits; i++) + symbol = (symbol << 1) | lz_rd_decode_bit(rd, &bm[symbol]); + + return symbol - (1 << num_bits); +} + +static unsigned +lz_rd_decode_tree_reversed(struct lz_range_decoder *rd, int *bm, int num_bits) +{ + unsigned symbol = lz_rd_decode_tree(rd, bm, num_bits); + unsigned reversed_symbol = 0; + + for (int i = 0; i < num_bits; i++) { + reversed_symbol = (reversed_symbol << 1) | (symbol & 1); + symbol >>= 1; + } + + return reversed_symbol; +} + +static unsigned +lz_rd_decode_matched(struct lz_range_decoder *rd, int *bm, int match_byte) +{ + unsigned symbol = 1; + + for (int i = 7; i >= 0; i--) { + const unsigned match_bit = (match_byte >> i) & 1; + const unsigned bit = lz_rd_decode_bit(rd, + &bm[symbol + (match_bit << 8) + 0x100]); + symbol = (symbol << 1) | bit; + if (match_bit != bit) { + while (symbol < 0x100) { + symbol = (symbol << 1) | + lz_rd_decode_bit(rd, &bm[symbol]); + } + break; + } + } + return symbol & 0xFF; +} + +static unsigned +lz_rd_decode_len(struct lz_range_decoder *rd, struct lz_len_model *lm, + int pos_state) +{ + if (lz_rd_decode_bit(rd, &lm->choice1) == 0) + return lz_rd_decode_tree(rd, lm->bm_low[pos_state], LOW_BITS); + + if (lz_rd_decode_bit(rd, &lm->choice2) == 0) { + return LOW_SYMBOLS + + lz_rd_decode_tree(rd, lm->bm_mid[pos_state], MID_BITS); + } + + return LOW_SYMBOLS + MID_SYMBOLS + + lz_rd_decode_tree(rd, lm->bm_high, HIGH_BITS); +} + +struct lz_decoder { + FILE *fin, *fout; + off_t pos, ppos, spos, dict_size; + bool wrapped; + uint32_t crc; + uint8_t *obuf; + struct lz_range_decoder rdec; +}; + +static int +lz_flush(struct lz_decoder *lz) +{ + off_t offs = lz->pos - lz->spos; + if (offs <= 0) + return -1; + + size_t size = (size_t)offs; + lz_crc_update(&lz->crc, lz->obuf + lz->spos, size); + if (fwrite(lz->obuf + lz->spos, 1, size, lz->fout) != size) + return -1; + + lz->wrapped = lz->pos >= lz->dict_size; + if (lz->wrapped) { + lz->ppos += lz->pos; + lz->pos = 0; + } + lz->spos = lz->pos; + return 0; +} + +static void +lz_destroy(struct lz_decoder *lz) +{ + if (lz->fin) + fclose(lz->fin); + if (lz->fout) + fclose(lz->fout); + free(lz->obuf); +} + +static int +lz_create(struct lz_decoder *lz, int fin, int fdout, int dict_size) +{ + memset(lz, 0, sizeof(*lz)); + + lz->fin = fdopen(dup(fin), "r"); + if (lz->fin == NULL) + goto out; + + lz->fout = fdopen(dup(fdout), "w"); + if (lz->fout == NULL) + goto out; + + lz->pos = lz->ppos = lz->spos = 0; + lz->crc = ~0; + lz->dict_size = dict_size; + lz->wrapped = false; + + lz->obuf = malloc(dict_size); + if (lz->obuf == NULL) + goto out; + + if (lz_rd_create(&lz->rdec, lz->fin) == -1) + goto out; + return 0; +out: + lz_destroy(lz); + return -1; +} + +static uint8_t +lz_peek(const struct lz_decoder *lz, unsigned ahead) +{ + off_t diff = lz->pos - ahead - 1; + + if (diff >= 0) + return lz->obuf[diff]; + + if (lz->wrapped) + return lz->obuf[lz->dict_size + diff]; + + return 0; +} + +static void +lz_put(struct lz_decoder *lz, uint8_t b) +{ + lz->obuf[lz->pos++] = b; + if (lz->dict_size == lz->pos) + lz_flush(lz); +} + +static off_t +lz_get_data_position(const struct lz_decoder *lz) +{ + return lz->ppos + lz->pos; +} + +static unsigned +lz_get_crc(const struct lz_decoder *lz) +{ + return lz->crc ^ 0xffffffffU; +} + +static void +lz_bm_init(int *a, size_t l) +{ + for (size_t i = 0; i < l; i++) + a[i] = BIT_MODEL_INIT; +} + +#define LZ_BM_INIT(a) lz_bm_init(a, nitems(a)) +#define LZ_BM_INIT2(a) do { \ + size_t l = nitems(a[0]); \ + for (size_t i = 0; i < nitems(a); i++) \ + lz_bm_init(a[i], l); \ +} while (/*CONSTCOND*/0) + +#define LZ_MODEL_INIT(a) do { \ + a.choice1 = BIT_MODEL_INIT; \ + a.choice2 = BIT_MODEL_INIT; \ + LZ_BM_INIT2(a.bm_low); \ + LZ_BM_INIT2(a.bm_mid); \ + LZ_BM_INIT(a.bm_high); \ +} while (/*CONSTCOND*/0) + +static bool +lz_decode_member(struct lz_decoder *lz) +{ + int bm_literal[1 << LITERAL_CONTEXT_BITS][0x300]; + int bm_match[LZ_STATES][POS_STATES]; + int bm_rep[4][LZ_STATES]; + int bm_len[LZ_STATES][POS_STATES]; + int bm_dis_slot[LZ_STATES][1 << DIS_SLOT_BITS]; + int bm_dis[MODELED_DISTANCES - DIS_MODEL_END + 1]; + int bm_align[DIS_ALIGN_SIZE]; + + LZ_BM_INIT2(bm_literal); + LZ_BM_INIT2(bm_match); + LZ_BM_INIT2(bm_rep); + LZ_BM_INIT2(bm_len); + LZ_BM_INIT2(bm_dis_slot); + LZ_BM_INIT(bm_dis); + LZ_BM_INIT(bm_align); + + struct lz_len_model match_len_model; + struct lz_len_model rep_len_model; + + LZ_MODEL_INIT(match_len_model); + LZ_MODEL_INIT(rep_len_model); + + struct lz_range_decoder *rd = &lz->rdec; + unsigned rep[4] = { 0 }; + + + int state = 0; + + while (!feof(lz->fin) && !ferror(lz->fin)) { + const int pos_state = lz_get_data_position(lz) & POS_STATE_MASK; + // bit 1 + if (lz_rd_decode_bit(rd, &bm_match[state][pos_state]) == 0) { + const uint8_t prev_byte = lz_peek(lz, 0); + const int literal_state = + prev_byte >> (8 - LITERAL_CONTEXT_BITS); + int *bm = bm_literal[literal_state]; + if (lz_st_is_char(state)) + lz_put(lz, lz_rd_decode_tree(rd, bm, 8)); + else { + int peek = lz_peek(lz, rep[0]); + lz_put(lz, lz_rd_decode_matched(rd, bm, peek)); + } + state = lz_st_get_char(state); + continue; + } + int len; + // bit 2 + if (lz_rd_decode_bit(rd, &bm_rep[0][state]) != 0) { + // bit 3 + if (lz_rd_decode_bit(rd, &bm_rep[1][state]) == 0) { + // bit 4 + if (lz_rd_decode_bit(rd, + &bm_len[state][pos_state]) == 0) + { + state = lz_st_get_short_rep(state); + lz_put(lz, lz_peek(lz, rep[0])); + continue; + } + } else { + unsigned distance; + // bit 4 + if (lz_rd_decode_bit(rd, &bm_rep[2][state]) + == 0) + distance = rep[1]; + else { + // bit 5 + if (lz_rd_decode_bit(rd, + &bm_rep[3][state]) == 0) + distance = rep[2]; + else { + distance = rep[3]; + rep[3] = rep[2]; + } + rep[2] = rep[1]; + } + rep[1] = rep[0]; + rep[0] = distance; + } + state = lz_st_get_rep(state); + len = MIN_MATCH_LEN + + lz_rd_decode_len(rd, &rep_len_model, pos_state); + } else { + rep[3] = rep[2]; rep[2] = rep[1]; rep[1] = rep[0]; + len = MIN_MATCH_LEN + + lz_rd_decode_len(rd, &match_len_model, pos_state); + const int len_state = + MIN(len - MIN_MATCH_LEN, STATES - 1); + rep[0] = lz_rd_decode_tree(rd, bm_dis_slot[len_state], + DIS_SLOT_BITS); + if (rep[0] >= DIS_MODEL_START) { + const unsigned dis_slot = rep[0]; + const int direct_bits = (dis_slot >> 1) - 1; + rep[0] = (2 | (dis_slot & 1)) << direct_bits; + if (dis_slot < DIS_MODEL_END) + rep[0] += lz_rd_decode_tree_reversed(rd, + &bm_dis[rep[0] - dis_slot], + direct_bits); + else { + rep[0] += lz_rd_decode(rd, direct_bits + - DIS_ALIGN_BITS) << DIS_ALIGN_BITS; + rep[0] += lz_rd_decode_tree_reversed(rd, + bm_align, DIS_ALIGN_BITS); + if (rep[0] == 0xFFFFFFFFU) { + lz_flush(lz); + return len == MIN_MATCH_LEN; + } + } + } + state = lz_st_get_match(state); + if (rep[0] >= lz->dict_size || + (rep[0] >= lz->pos && !lz->wrapped)) { + lz_flush(lz); + return false; + } + } + for (int i = 0; i < len; i++) + lz_put(lz, lz_peek(lz, rep[0])); + } + lz_flush(lz); + return false; +} + +/* + * 0-3 CRC32 of the uncompressed data + * 4-11 size of the uncompressed data + * 12-19 member size including header and trailer + */ +#define TRAILER_SIZE 20 + + +static off_t +lz_decode(int fin, int fdout, unsigned dict_size, off_t *insize) +{ + struct lz_decoder lz; + off_t rv = -1; + + if (lz_create(&lz, fin, fdout, dict_size) == -1) + return -1; + + if (!lz_decode_member(&lz)) + goto out; + + uint8_t trailer[TRAILER_SIZE]; + + for(size_t i = 0; i < nitems(trailer); i++) + trailer[i] = (uint8_t)getc(lz.fin); + + unsigned crc = 0; + for (int i = 3; i >= 0; --i) { + crc <<= 8; + crc += trailer[i]; + } + + int64_t data_size = 0; + for (int i = 11; i >= 4; --i) { + data_size <<= 8; + data_size += trailer[i]; + } + + if (crc != lz_get_crc(&lz) || data_size != lz_get_data_position(&lz)) + goto out; + + rv = 0; + for (int i = 19; i >= 12; --i) { + rv <<= 8; + rv += trailer[i]; + } + if (insize) + *insize = rv; +#if 0 + /* Does not work with pipes */ + rv = ftello(lz.fout); +#else + rv = data_size; +#endif +out: + lz_destroy(&lz); + return rv; +} + + +/* + * 0-3 magic + * 4 version + * 5 coded dict_size + */ +#define HDR_SIZE 6 +#define MIN_DICTIONARY_SIZE (1 << 12) +#define MAX_DICTIONARY_SIZE (1 << 29) + +static const char hdrmagic[] = { 'L', 'Z', 'I', 'P', 1 }; + +static unsigned +lz_get_dict_size(unsigned char c) +{ + unsigned dict_size = 1 << (c & 0x1f); + dict_size -= (dict_size >> 2) * ( (c >> 5) & 0x7); + if (dict_size < MIN_DICTIONARY_SIZE || dict_size > MAX_DICTIONARY_SIZE) + return 0; + return dict_size; +} + +static off_t +unlz(int fin, int fout, char *pre, size_t prelen, off_t *bytes_in) +{ + if (lz_crc[0] == 0) + lz_crc_init(); + + char header[HDR_SIZE]; + + if (prelen > sizeof(header)) + return -1; + if (pre && prelen) + memcpy(header, pre, prelen); + + ssize_t nr = read(fin, header + prelen, sizeof(header) - prelen); + switch (nr) { + case -1: + return -1; + case 0: + return prelen ? -1 : 0; + default: + if ((size_t)nr != sizeof(header) - prelen) + return -1; + break; + } + + if (memcmp(header, hdrmagic, sizeof(hdrmagic)) != 0) + return -1; + + unsigned dict_size = lz_get_dict_size(header[5]); + if (dict_size == 0) + return -1; + + return lz_decode(fin, fout, dict_size, bytes_in); +} Modified: stable/11/usr.bin/gzip/unxz.c ============================================================================== --- stable/11/usr.bin/gzip/unxz.c Mon Jan 21 06:14:26 2019 (r343250) +++ stable/11/usr.bin/gzip/unxz.c Mon Jan 21 06:52:35 2019 (r343251) @@ -1,4 +1,4 @@ -/* $NetBSD: unxz.c,v 1.7 2017/08/04 07:27:08 mrg Exp $ */ +/* $NetBSD: unxz.c,v 1.8 2018/10/06 16:36:45 martin Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -156,3 +156,322 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *by } } } + +#include + +/* + * Copied various bits and pieces from xz support code or brute force + * replacements. + */ + +#define my_min(A,B) ((A)<(B)?(A):(B)) + +// Some systems have suboptimal BUFSIZ. Use a bit bigger value on them. +// We also need that IO_BUFFER_SIZE is a multiple of 8 (sizeof(uint64_t)) +#if BUFSIZ <= 1024 +# define IO_BUFFER_SIZE 8192 +#else +# define IO_BUFFER_SIZE (BUFSIZ & ~7U) +#endif + +/// is_sparse() accesses the buffer as uint64_t for maximum speed. +/// Use an union to make sure that the buffer is properly aligned. +typedef union { + uint8_t u8[IO_BUFFER_SIZE]; + uint32_t u32[IO_BUFFER_SIZE / sizeof(uint32_t)]; + uint64_t u64[IO_BUFFER_SIZE / sizeof(uint64_t)]; +} io_buf; + + +static bool +io_pread(int fd, io_buf *buf, size_t size, off_t pos) +{ + // Using lseek() and read() is more portable than pread() and + // for us it is as good as real pread(). + if (lseek(fd, pos, SEEK_SET) != pos) { + return true; + } + + const size_t amount = read(fd, buf, size); + if (amount == SIZE_MAX) + return true; + + if (amount != size) { + return true; + } + + return false; +} + +/* + * Most of the following is copied (mostly verbatim) from the xz + * distribution, from file src/xz/list.c + */ + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file list.c +/// \brief Listing information about .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + + +/// Information about a .xz file +typedef struct { + /// Combined Index of all Streams in the file + lzma_index *idx; + + /// Total amount of Stream Padding + uint64_t stream_padding; + + /// Highest memory usage so far + uint64_t memusage_max; + + /// True if all Blocks so far have Compressed Size and + /// Uncompressed Size fields + bool all_have_sizes; + + /// Oldest XZ Utils version that will decompress the file + uint32_t min_version; + +} xz_file_info; + +#define XZ_FILE_INFO_INIT { NULL, 0, 0, true, 50000002 } + + +/// \brief Parse the Index(es) from the given .xz file +/// +/// \param xfi Pointer to structure where the decoded information +/// is stored. +/// \param pair Input file +/// +/// \return On success, false is returned. On error, true is returned. +/// +// TODO: This function is pretty big. liblzma should have a function that +// takes a callback function to parse the Index(es) from a .xz file to make +// it easy for applications. +static bool +parse_indexes(xz_file_info *xfi, int src_fd) +{ + struct stat st; + + fstat(src_fd, &st); + if (st.st_size <= 0) { + return true; + } + + if (st.st_size < 2 * LZMA_STREAM_HEADER_SIZE) { + return true; + } + + io_buf buf; + lzma_stream_flags header_flags; + lzma_stream_flags footer_flags; + lzma_ret ret; + + // lzma_stream for the Index decoder + lzma_stream strm = LZMA_STREAM_INIT; + + // All Indexes decoded so far + lzma_index *combined_index = NULL; + + // The Index currently being decoded + lzma_index *this_index = NULL; + + // Current position in the file. We parse the file backwards so + // initialize it to point to the end of the file. + off_t pos = st.st_size; + + // Each loop iteration decodes one Index. + do { + // Check that there is enough data left to contain at least + // the Stream Header and Stream Footer. This check cannot + // fail in the first pass of this loop. + if (pos < 2 * LZMA_STREAM_HEADER_SIZE) { + goto error; + } + + pos -= LZMA_STREAM_HEADER_SIZE; + lzma_vli stream_padding = 0; + + // Locate the Stream Footer. There may be Stream Padding which + // we must skip when reading backwards. + while (true) { + if (pos < LZMA_STREAM_HEADER_SIZE) { + goto error; + } + + if (io_pread(src_fd, &buf, + LZMA_STREAM_HEADER_SIZE, pos)) + goto error; + + // Stream Padding is always a multiple of four bytes. + int i = 2; + if (buf.u32[i] != 0) + break; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 21 07:44:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BEF0149AB8B; Mon, 21 Jan 2019 07:44:47 +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 A63E372F89; Mon, 21 Jan 2019 07:44:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99FAAEA6C; Mon, 21 Jan 2019 07:44:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L7ik0r072508; Mon, 21 Jan 2019 07:44:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L7ikCK072507; Mon, 21 Jan 2019 07:44:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901210744.x0L7ikCK072507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Jan 2019 07:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343253 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 343253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A63E372F89 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 07:44:47 -0000 Author: kib Date: Mon Jan 21 07:44:46 2019 New Revision: 343253 URL: https://svnweb.freebsd.org/changeset/base/343253 Log: MFC r343017: Handle overflow in calculating max kmem size. Modified: stable/12/sys/kern/kern_malloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_malloc.c ============================================================================== --- stable/12/sys/kern/kern_malloc.c Mon Jan 21 06:52:55 2019 (r343252) +++ stable/12/sys/kern/kern_malloc.c Mon Jan 21 07:44:46 2019 (r343253) @@ -920,13 +920,16 @@ kmeminit(void) * variable: */ if (vm_kmem_size == 0) { - vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; - + vm_kmem_size = mem_size / vm_kmem_size_scale; + vm_kmem_size = vm_kmem_size * PAGE_SIZE < vm_kmem_size ? + vm_kmem_size_max : vm_kmem_size * PAGE_SIZE; if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) vm_kmem_size = vm_kmem_size_min; if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) vm_kmem_size = vm_kmem_size_max; } + if (vm_kmem_size == 0) + panic("Tune VM_KMEM_SIZE_* for the platform"); /* * The amount of KVA space that is preallocated to the From owner-svn-src-all@freebsd.org Mon Jan 21 08:24:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73398149C419; Mon, 21 Jan 2019 08:24:50 +0000 (UTC) (envelope-from jah@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 19AE7750AD; Mon, 21 Jan 2019 08:24:50 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0897F151; Mon, 21 Jan 2019 08:24:49 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L8OnPI093981; Mon, 21 Jan 2019 08:24:49 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L8On2k093980; Mon, 21 Jan 2019 08:24:49 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201901210824.x0L8On2k093980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Mon, 21 Jan 2019 08:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343254 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jah X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 343254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19AE7750AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 08:24:50 -0000 Author: jah Date: Mon Jan 21 08:24:49 2019 New Revision: 343254 URL: https://svnweb.freebsd.org/changeset/base/343254 Log: MFC r343005: Handle SIGIO for listening sockets r319722 separated struct socket and parts of the socket I/O path into listening-socket-specific and dataflow-socket-specific pieces. Listening socket connection notifications are now handled by solisten_wakeup() instead of sowakeup(), but solisten_wakeup() does not currently post SIGIO to the owning process. PR: 234258 Modified: stable/12/sys/kern/uipc_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_socket.c ============================================================================== --- stable/12/sys/kern/uipc_socket.c Mon Jan 21 07:44:46 2019 (r343253) +++ stable/12/sys/kern/uipc_socket.c Mon Jan 21 08:24:49 2019 (r343254) @@ -886,6 +886,8 @@ solisten_wakeup(struct socket *sol) } SOLISTEN_UNLOCK(sol); wakeup_one(&sol->sol_comp); + if ((sol->so_state & SS_ASYNC) && sol->so_sigio != NULL) + pgsigio(&sol->so_sigio, SIGIO, 0); } /* From owner-svn-src-all@freebsd.org Mon Jan 21 14:35:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50D3914AB51B; Mon, 21 Jan 2019 14:35:37 +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 BEDFD8BF8B; Mon, 21 Jan 2019 14:35:36 +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 A76A61AF8F; Mon, 21 Jan 2019 14:35:36 +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 x0LEZaZU089228; Mon, 21 Jan 2019 14:35:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LEZaCH089227; Mon, 21 Jan 2019 14:35:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901211435.x0LEZaCH089227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 14:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343255 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 343255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEDFD8BF8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 14:35:37 -0000 Author: kevans Date: Mon Jan 21 14:35:36 2019 New Revision: 343255 URL: https://svnweb.freebsd.org/changeset/base/343255 Log: awg: fix soft reset failure with no link U-Boot will leave the ephy reset de-asserted and the MAC soft reset will fail on these boards with internal PHY and no link established. Toggle reset again before proceeding to attach/init. MFC after: 1 week Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Jan 21 08:24:49 2019 (r343254) +++ head/sys/arm/allwinner/if_awg.c Mon Jan 21 14:35:36 2019 (r343255) @@ -1466,6 +1466,12 @@ awg_setup_extres(device_t dev) goto fail; } if (rst_ephy != NULL) { + /* + * The ephy reset is left de-asserted by U-Boot. Assert it + * here to make sure that we're in a known good state going + * into the PHY reset. + */ + hwreset_assert(rst_ephy); error = hwreset_deassert(rst_ephy); if (error != 0) { device_printf(dev, "cannot de-assert ephy reset\n"); From owner-svn-src-all@freebsd.org Mon Jan 21 14:52:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EF5F14ABEDA; Mon, 21 Jan 2019 14:52:50 +0000 (UTC) (envelope-from pfg@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 017658CB52; Mon, 21 Jan 2019 14:52:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7678C1B2F2; Mon, 21 Jan 2019 14:52:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LEqn6L099804; Mon, 21 Jan 2019 14:52:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LEqniM099802; Mon, 21 Jan 2019 14:52:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901211452.x0LEqniM099802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Jan 2019 14:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343256 - stable/12/lib/msun/src X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/12/lib/msun/src X-SVN-Commit-Revision: 343256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 017658CB52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 14:52:50 -0000 Author: pfg Date: Mon Jan 21 14:52:48 2019 New Revision: 343256 URL: https://svnweb.freebsd.org/changeset/base/343256 Log: MFC r343023: msun: reduce diff between src/e_j0.c and src/e_j0f.c PR: 229501 Modified: stable/12/lib/msun/src/e_j0.c stable/12/lib/msun/src/e_j0f.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/msun/src/e_j0.c ============================================================================== --- stable/12/lib/msun/src/e_j0.c Mon Jan 21 14:35:36 2019 (r343255) +++ stable/12/lib/msun/src/e_j0.c Mon Jan 21 14:52:48 2019 (r343256) @@ -80,7 +80,7 @@ S02 = 1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD S03 = 5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ -static const double zero = 0.0; +static const double zero = 0, qrtr = 0.25; double __ieee754_j0(double x) @@ -97,7 +97,7 @@ __ieee754_j0(double x) c = cos(x); ss = s-c; cc = s+c; - if(ix<0x7fe00000) { /* make sure x+x not overflow */ + if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ z = -cos(x+x); if ((s*c) Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 472CF14ABF67; Mon, 21 Jan 2019 14:54:02 +0000 (UTC) (envelope-from pfg@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 E090F8CCFA; Mon, 21 Jan 2019 14:54:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B78071B2F7; Mon, 21 Jan 2019 14:54:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LEs1u0099914; Mon, 21 Jan 2019 14:54:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LEs1Mq099913; Mon, 21 Jan 2019 14:54:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901211454.x0LEs1Mq099913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Jan 2019 14:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343257 - stable/11/lib/msun/src X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/msun/src X-SVN-Commit-Revision: 343257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E090F8CCFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 14:54:02 -0000 Author: pfg Date: Mon Jan 21 14:54:01 2019 New Revision: 343257 URL: https://svnweb.freebsd.org/changeset/base/343257 Log: MFC r343023: msun: reduce diff between src/e_j0.c and src/e_j0f.c PR: 229501 Modified: stable/11/lib/msun/src/e_j0.c stable/11/lib/msun/src/e_j0f.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/src/e_j0.c ============================================================================== --- stable/11/lib/msun/src/e_j0.c Mon Jan 21 14:52:48 2019 (r343256) +++ stable/11/lib/msun/src/e_j0.c Mon Jan 21 14:54:01 2019 (r343257) @@ -80,7 +80,7 @@ S02 = 1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD S03 = 5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ -static const double zero = 0.0; +static const double zero = 0, qrtr = 0.25; double __ieee754_j0(double x) @@ -97,7 +97,7 @@ __ieee754_j0(double x) c = cos(x); ss = s-c; cc = s+c; - if(ix<0x7fe00000) { /* make sure x+x not overflow */ + if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ z = -cos(x+x); if ((s*c) Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B4314AC036; Mon, 21 Jan 2019 14:55:11 +0000 (UTC) (envelope-from pfg@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 E46DF8CEC2; Mon, 21 Jan 2019 14:55:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6AAE1B2F9; Mon, 21 Jan 2019 14:55:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LEtA08000144; Mon, 21 Jan 2019 14:55:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LEtAm3000142; Mon, 21 Jan 2019 14:55:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901211455.x0LEtAm3000142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Jan 2019 14:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343258 - stable/10/lib/msun/src X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/msun/src X-SVN-Commit-Revision: 343258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E46DF8CEC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 14:55:11 -0000 Author: pfg Date: Mon Jan 21 14:55:10 2019 New Revision: 343258 URL: https://svnweb.freebsd.org/changeset/base/343258 Log: MFC r343023: msun: reduce diff between src/e_j0.c and src/e_j0f.c PR: 229501 Modified: stable/10/lib/msun/src/e_j0.c stable/10/lib/msun/src/e_j0f.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/src/e_j0.c ============================================================================== --- stable/10/lib/msun/src/e_j0.c Mon Jan 21 14:54:01 2019 (r343257) +++ stable/10/lib/msun/src/e_j0.c Mon Jan 21 14:55:10 2019 (r343258) @@ -81,7 +81,7 @@ S02 = 1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD S03 = 5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ -static const double zero = 0.0; +static const double zero = 0, qrtr = 0.25; double __ieee754_j0(double x) @@ -98,7 +98,7 @@ __ieee754_j0(double x) c = cos(x); ss = s-c; cc = s+c; - if(ix<0x7fe00000) { /* make sure x+x not overflow */ + if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ z = -cos(x+x); if ((s*c) Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99E114ACAF5; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@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 694808E00F; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 587021B7F2; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LFRxOi015748; Mon, 21 Jan 2019 15:27:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LFRxJb015747; Mon, 21 Jan 2019 15:27:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901211527.x0LFRxJb015747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 21 Jan 2019 15:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343259 - head/usr.bin/units X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.bin/units X-SVN-Commit-Revision: 343259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 694808E00F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 15:28:00 -0000 Author: gjb Date: Mon Jan 21 15:27:58 2019 New Revision: 343259 URL: https://svnweb.freebsd.org/changeset/base/343259 Log: Correct a typo: was -> way. Submitted by: Larry Hynes MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/units/units.1 Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Jan 21 14:55:10 2019 (r343258) +++ head/usr.bin/units/units.1 Mon Jan 21 15:27:58 2019 (r343259) @@ -158,7 +158,7 @@ by careless unit definitions. Comments in the unit definition file begin with a '#' or '/' character at the beginning of a line. .Pp -Prefixes are defined in the same was as standard units, but with +Prefixes are defined in the same way as standard units, but with a trailing dash at the end of the prefix name. If a unit is not found even after removing trailing 's' or 'es', then it will be checked From owner-svn-src-all@freebsd.org Mon Jan 21 16:19:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD4714AE168; Mon, 21 Jan 2019 16:19:03 +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 233DF680A8; Mon, 21 Jan 2019 16:19:03 +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 10FA01C056; Mon, 21 Jan 2019 16:19:03 +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 x0LGJ2CZ041818; Mon, 21 Jan 2019 16:19:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGJ2OW041817; Mon, 21 Jan 2019 16:19:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211619.x0LGJ2OW041817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343260 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DF680A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:19:03 -0000 Author: emaste Date: Mon Jan 21 16:19:02 2019 New Revision: 343260 URL: https://svnweb.freebsd.org/changeset/base/343260 Log: linuxulator: fix stack memory disclosure in linux_ioctl_v4l admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 15:27:58 2019 (r343259) +++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019 (r343260) @@ -2843,6 +2843,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st static int bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) { + memset(lvw, 0, sizeof(*lvw)); + lvw->x = vw->x; lvw->y = vw->y; lvw->width = vw->width; From owner-svn-src-all@freebsd.org Mon Jan 21 16:21:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF85914AE33B; Mon, 21 Jan 2019 16:21:04 +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 645D2683F8; Mon, 21 Jan 2019 16:21:04 +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 580781C074; Mon, 21 Jan 2019 16:21:04 +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 x0LGL4fV044197; Mon, 21 Jan 2019 16:21:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGL4nA044196; Mon, 21 Jan 2019 16:21:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211621.x0LGL4nA044196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343261 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 645D2683F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:21:04 -0000 Author: emaste Date: Mon Jan 21 16:21:03 2019 New Revision: 343261 URL: https://svnweb.freebsd.org/changeset/base/343261 Log: linuxulator: fix stack memory disclosure in linux_ioctl_termio admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019 (r343260) +++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:21:03 2019 (r343261) @@ -686,6 +686,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux { struct linux_termios lios; + memset(lio, 0, sizeof(*lio)); bsd_to_linux_termios(bios, &lios); lio->c_iflag = lios.c_iflag; lio->c_oflag = lios.c_oflag; From owner-svn-src-all@freebsd.org Mon Jan 21 16:25:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D22AF14AE41D; Mon, 21 Jan 2019 16:25:41 +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 7216369A93; Mon, 21 Jan 2019 16:25:41 +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 229501C1FC; Mon, 21 Jan 2019 16:25:41 +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 x0LGPfaH047018; Mon, 21 Jan 2019 16:25:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGPfBd047017; Mon, 21 Jan 2019 16:25:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211625.x0LGPfBd047017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343262 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 343262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7216369A93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:25:42 -0000 Author: emaste Date: Mon Jan 21 16:25:40 2019 New Revision: 343262 URL: https://svnweb.freebsd.org/changeset/base/343262 Log: linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_machdep.c Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Mon Jan 21 16:21:03 2019 (r343261) +++ head/sys/amd64/linux/linux_machdep.c Mon Jan 21 16:25:40 2019 (r343262) @@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; + memset(&lss, 0, sizeof(lss)); LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); if (uap->uss != NULL) { From owner-svn-src-all@freebsd.org Mon Jan 21 17:12:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8950114B05BE; Mon, 21 Jan 2019 17:12:17 +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 314E86C52B; Mon, 21 Jan 2019 17:12:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24DE91CA5E; Mon, 21 Jan 2019 17:12:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LHCH81072653; Mon, 21 Jan 2019 17:12:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LHCHwl072652; Mon, 21 Jan 2019 17:12:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211712.x0LHCHwl072652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343263 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 314E86C52B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:12:17 -0000 Author: emaste Date: Mon Jan 21 17:12:16 2019 New Revision: 343263 URL: https://svnweb.freebsd.org/changeset/base/343263 Log: linuxulator: fix stack memory disclosure in linux_sigaltstack Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before callit it, but linux_waitid did not. Instead of zeroing in the called function to address linux_waitid (as in commit 2e6ebe70), just do it in linux_waitid. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: Andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Jan 21 16:25:40 2019 (r343262) +++ head/sys/compat/linux/linux_misc.c Mon Jan 21 17:12:16 2019 (r343263) @@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar } if (args->info != NULL) { p = td->td_proc; - if (td->td_retval[0] == 0) - bzero(&lsi, sizeof(lsi)); - else { + bzero(&lsi, sizeof(lsi)); + if (td->td_retval[0] != 0) { sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); } From owner-svn-src-all@freebsd.org Mon Jan 21 17:21:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05C014B0861; Mon, 21 Jan 2019 17:21:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 955D06CC55; Mon, 21 Jan 2019 17:21:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id g85so17414516ita.3; Mon, 21 Jan 2019 09:21:08 -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; bh=XHYUH0JjfzDSy0ndi9KGnooiUSfSejsBa+Cumd7t5UY=; b=YP4u6G5956/o65TuBaE0PgEFbkj++aPzQotcKseq4gy3b7Hr8h0XPQ5qgQ0lQM5Q8q uRhQPJb/RpUqedUZH4qkI6z+VykTVLIU8Patv412llLqqiSaWfwHnaBWqAedK2lD0sr6 pL3sPgwy48Zn3gdjTdbzygk+wf0K+5fwewRY7LCvqFbcXGoSLa68jEbkMbBaIV3YCspO if3vN7ORFnq6dH70A4RL+0zhvmR7QQUgLdUYEp+npxjwtUvUDotEvDyfsPlAbo0eQ7MG H9joLrELSWHTJW6Tm7J7+BqZcy1WZ0jP/Xklsnc7vcuRrSpVMmzK1HEQ2y+50gY6XR4X BOgQ== X-Gm-Message-State: AHQUAubDmHb+ewI0bORcQEwyVur0NVIOASv1r+0ZAY5MBu2CZaBKBVOr crzSNHs6mQslv4oJ8sH/Ypi/giRaYv2r85fjirvVI3j8 X-Google-Smtp-Source: ALg8bN7bD/icILYkgTt9Plf+GFhQJBv1zMWvCQgCN+yccNbmQRf/+d7fFAH3rAFQQsr3cwrthFW5XBeC+2oGpQEo6Bg= X-Received: by 2002:a05:660c:84e:: with SMTP id f14mr167179itl.33.1548090927484; Mon, 21 Jan 2019 09:15:27 -0800 (PST) MIME-Version: 1.0 References: <201901211712.x0LHCHwl072652@repo.freebsd.org> In-Reply-To: <201901211712.x0LHCHwl072652@repo.freebsd.org> From: Ed Maste Date: Mon, 21 Jan 2019 12:15:13 -0500 Message-ID: Subject: Re: svn commit: r343263 - head/sys/compat/linux To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 955D06CC55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:21:09 -0000 On Mon, 21 Jan 2019 at 12:12, Ed Maste wrote: > > Author: emaste > Date: Mon Jan 21 17:12:16 2019 > New Revision: 343263 > URL: https://svnweb.freebsd.org/changeset/base/343263 > > Log: > linuxulator: fix stack memory disclosure in linux_sigaltstack > > Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before > callit it, but linux_waitid did not. Instead of zeroing in the called > function to address linux_waitid (as in commit 2e6ebe70), just do it in > linux_waitid. Oops, I meant to edit the commit message to remove the git hash (from my WIP tree). My original change for this issue zeroed the struct in siginfo_to_lsiginfo. From owner-svn-src-all@freebsd.org Mon Jan 21 17:58:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10D614B16CC; Mon, 21 Jan 2019 17:58:07 +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 56E666E0E0; Mon, 21 Jan 2019 17:58:07 +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 453D41D143; Mon, 21 Jan 2019 17:58:07 +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 x0LHw7Qb093590; Mon, 21 Jan 2019 17:58:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LHw7aS093589; Mon, 21 Jan 2019 17:58:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901211758.x0LHw7aS093589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Jan 2019 17:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343264 - 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: 343264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56E666E0E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:58:07 -0000 Author: np Date: Mon Jan 21 17:58:06 2019 New Revision: 343264 URL: https://svnweb.freebsd.org/changeset/base/343264 Log: cxgbe(4): Use a truncated firmware header for version checks. All the version numbers are towards the begining of the header. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 21 17:12:16 2019 (r343263) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 21 17:58:06 2019 (r343264) @@ -3324,17 +3324,38 @@ restart: V_FW_HDR_FW_VER_BUILD(chip##FW_VERSION_BUILD)) #define FW_INTFVER(chip, intf) (chip##FW_HDR_INTFVER_##intf) +/* Just enough of fw_hdr to cover all version info. */ +struct fw_h { + __u8 ver; + __u8 chip; + __be16 len512; + __be32 fw_ver; + __be32 tp_microcode_ver; + __u8 intfver_nic; + __u8 intfver_vnic; + __u8 intfver_ofld; + __u8 intfver_ri; + __u8 intfver_iscsipdu; + __u8 intfver_iscsi; + __u8 intfver_fcoepdu; + __u8 intfver_fcoe; +}; +/* Spot check a couple of fields. */ +CTASSERT(offsetof(struct fw_h, fw_ver) == offsetof(struct fw_hdr, fw_ver)); +CTASSERT(offsetof(struct fw_h, intfver_nic) == offsetof(struct fw_hdr, intfver_nic)); +CTASSERT(offsetof(struct fw_h, intfver_fcoe) == offsetof(struct fw_hdr, intfver_fcoe)); + struct fw_info { uint8_t chip; char *kld_name; char *fw_mod_name; - struct fw_hdr fw_hdr; /* XXX: waste of space, need a sparse struct */ + struct fw_h fw_h; } fw_info[] = { { .chip = CHELSIO_T4, .kld_name = "t4fw_cfg", .fw_mod_name = "t4fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T4, .fw_ver = htobe32(FW_VERSION(T4)), .intfver_nic = FW_INTFVER(T4, NIC), @@ -3350,7 +3371,7 @@ struct fw_info { .chip = CHELSIO_T5, .kld_name = "t5fw_cfg", .fw_mod_name = "t5fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T5, .fw_ver = htobe32(FW_VERSION(T5)), .intfver_nic = FW_INTFVER(T5, NIC), @@ -3366,7 +3387,7 @@ struct fw_info { .chip = CHELSIO_T6, .kld_name = "t6fw_cfg", .fw_mod_name = "t6fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T6, .fw_ver = htobe32(FW_VERSION(T6)), .intfver_nic = FW_INTFVER(T6, NIC), @@ -3398,7 +3419,7 @@ find_fw_info(int chip) * with? */ static int -fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2) +fw_compatible(const struct fw_h *hdr1, const struct fw_h *hdr2) { /* short circuit if it's the exact same firmware version */ @@ -3465,8 +3486,8 @@ unload_fw_module(struct adapter *sc, const struct firm * +ve errno means a firmware install was attempted but failed. */ static int -install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw, - const struct fw_hdr *drv_fw, const char *reason, int *already) +install_kld_firmware(struct adapter *sc, struct fw_h *card_fw, + const struct fw_h *drv_fw, const char *reason, int *already) { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); @@ -3571,7 +3592,7 @@ contact_firmware(struct adapter *sc) enum dev_state state; struct fw_info *fw_info; struct fw_hdr *card_fw; /* fw on the card */ - const struct fw_hdr *drv_fw; /* fw bundled with the driver */ + const struct fw_h *drv_fw; fw_info = find_fw_info(chip_id(sc)); if (fw_info == NULL) { @@ -3580,7 +3601,7 @@ contact_firmware(struct adapter *sc) chip_id(sc)); return (EINVAL); } - drv_fw = &fw_info->fw_hdr; + drv_fw = &fw_info->fw_h; /* Read the header of the firmware on the card */ card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK); @@ -3593,7 +3614,8 @@ restart: goto done; } - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, NULL, + &already); if (rc == ERESTART) goto restart; if (rc != 0) @@ -3606,7 +3628,7 @@ restart: "failed to connect to the firmware: %d, %d. " "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); #if 0 - if (install_kld_firmware(sc, card_fw, drv_fw, + if (install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, "not responding properly to HELLO", &already) == ERESTART) goto restart; #endif @@ -3617,7 +3639,8 @@ restart: if (rc == sc->pf) { sc->flags |= MASTER_PF; - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, + NULL, &already); if (rc == ERESTART) rc = 0; else if (rc != 0) From owner-svn-src-all@freebsd.org Mon Jan 21 18:07:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38AED14B1D3D; Mon, 21 Jan 2019 18:07:03 +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 D475C6E9DE; Mon, 21 Jan 2019 18:07:02 +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 C474E1D2EB; Mon, 21 Jan 2019 18:07:02 +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 x0LI721g098831; Mon, 21 Jan 2019 18:07:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LI722p098830; Mon, 21 Jan 2019 18:07:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211807.x0LI722p098830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 18:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343265 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 343265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D475C6E9DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:07:03 -0000 Author: markj Date: Mon Jan 21 18:07:02 2019 New Revision: 343265 URL: https://svnweb.freebsd.org/changeset/base/343265 Log: hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}. admbugs: 765 Reported by: Vlad Tsyrklevich MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Jan 21 17:58:06 2019 (r343264) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jan 21 18:07:02 2019 (r343265) @@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_classdep *pcd; int cl; + memset(&gci, 0, sizeof(gci)); gci.pm_cputype = md->pmd_cputype; gci.pm_ncpu = pmc_cpu_max(); gci.pm_npmc = md->pmd_npmc; @@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO); p = pmcinfo; From owner-svn-src-all@freebsd.org Mon Jan 21 18:34:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A81E14B2BA5; Mon, 21 Jan 2019 18:34:34 +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 B14EA700DE; Mon, 21 Jan 2019 18:34:33 +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 A69291D7F3; Mon, 21 Jan 2019 18:34:33 +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 x0LIYXMc014792; Mon, 21 Jan 2019 18:34:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIYXRr014791; Mon, 21 Jan 2019 18:34:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211834.x0LIYXRr014791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 18:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343266 - stable/12/usr.sbin/freebsd-update X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B14EA700DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:34:34 -0000 Author: emaste Date: Mon Jan 21 18:34:33 2019 New Revision: 343266 URL: https://svnweb.freebsd.org/changeset/base/343266 Log: MFC r343153: freebsd-update.8: mandoc -Tlint fixes PR: 185389 Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/12/usr.sbin/freebsd-update/freebsd-update.8 Mon Jan 21 18:07:02 2019 (r343265) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.8 Mon Jan 21 18:34:33 2019 (r343266) @@ -27,7 +27,7 @@ .\" .Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 -.Os FreeBSD +.Os .Sh NAME .Nm freebsd-update .Nd fetch and install binary updates to FreeBSD @@ -47,9 +47,12 @@ The .Nm tool is used to fetch, install, and rollback binary -updates to the FreeBSD base system. +updates to the +.Fx +base system. Note that updates are only available if they are being built for the -FreeBSD release and architecture being used; in particular, the +.Fx +release and architecture being used; in particular, the .Fx Security Team only builds updates for releases shipped in binary form by the From owner-svn-src-all@freebsd.org Mon Jan 21 18:35:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB0614B2C27; Mon, 21 Jan 2019 18:35:40 +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 3110970260; Mon, 21 Jan 2019 18:35:40 +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 23EFD1D7F5; Mon, 21 Jan 2019 18:35:40 +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 x0LIZemC014912; Mon, 21 Jan 2019 18:35:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIZeS5014911; Mon, 21 Jan 2019 18:35:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211835.x0LIZeS5014911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 18:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343267 - stable/11/usr.sbin/freebsd-update X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3110970260 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:35:40 -0000 Author: emaste Date: Mon Jan 21 18:35:39 2019 New Revision: 343267 URL: https://svnweb.freebsd.org/changeset/base/343267 Log: MFC r343153: freebsd-update.8: mandoc -Tlint fixes PR: 185389 Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/11/usr.sbin/freebsd-update/freebsd-update.8 Mon Jan 21 18:34:33 2019 (r343266) +++ stable/11/usr.sbin/freebsd-update/freebsd-update.8 Mon Jan 21 18:35:39 2019 (r343267) @@ -27,7 +27,7 @@ .\" .Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 -.Os FreeBSD +.Os .Sh NAME .Nm freebsd-update .Nd fetch and install binary updates to FreeBSD @@ -47,9 +47,12 @@ The .Nm tool is used to fetch, install, and rollback binary -updates to the FreeBSD base system. +updates to the +.Fx +base system. Note that updates are only available if they are being built for the -FreeBSD release and architecture being used; in particular, the +.Fx +release and architecture being used; in particular, the .Fx Security Team only builds updates for releases shipped in binary form by the From owner-svn-src-all@freebsd.org Mon Jan 21 18:41:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFBC314B309C; Mon, 21 Jan 2019 18:41:57 +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 866AD70995; Mon, 21 Jan 2019 18:41:57 +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 7AD961D96F; Mon, 21 Jan 2019 18:41:57 +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 x0LIfveg020292; Mon, 21 Jan 2019 18:41:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIfvjM020291; Mon, 21 Jan 2019 18:41:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211841.x0LIfvjM020291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 18:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343268 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 866AD70995 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:41:58 -0000 Author: emaste Date: Mon Jan 21 18:41:57 2019 New Revision: 343268 URL: https://svnweb.freebsd.org/changeset/base/343268 Log: frebsd-update: fix --currently-running after r343122 PR: 234771 Submitted by: Gerald Aryeetey Reported by: Brandon Schneider MFC with: r343122 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18896 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:35:39 2019 (r343267) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:41:57 2019 (r343268) @@ -310,6 +310,7 @@ config_SourceRelease () { if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then UNAME_r="${UNAME_r}-RELEASE" fi + export UNAME_r } # Define what happens to output of utilities From owner-svn-src-all@freebsd.org Mon Jan 21 18:42:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DD314B30D2; Mon, 21 Jan 2019 18:42:17 +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 1FA0370C0C; Mon, 21 Jan 2019 18:42:17 +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 EB7D01D98A; Mon, 21 Jan 2019 18:42:16 +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 x0LIgG8h020362; Mon, 21 Jan 2019 18:42:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIgGVB020361; Mon, 21 Jan 2019 18:42:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901211842.x0LIgGVB020361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Jan 2019 18:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343269 - 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: 343269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FA0370C0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:42:17 -0000 Author: np Date: Mon Jan 21 18:42:16 2019 New Revision: 343269 URL: https://svnweb.freebsd.org/changeset/base/343269 Log: cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to mean that the driver should taste the firmware in the KLD and use that firmware's version for all its fw_install checks. The driver gets firmware version information from compiled-in values by default and this change allows custom (or older/newer) firmware modules to be used with the stock driver. There is no change in default behavior. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 21 18:41:57 2019 (r343268) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 21 18:42:16 2019 (r343269) @@ -480,9 +480,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN /* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, - * encouraged respectively). + * encouraged respectively). '-n' is the same as 'n' except the firmware + * version used in the checks is read from the firmware bundled with the driver. */ -static unsigned int t4_fw_install = 1; +static int t4_fw_install = 1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, &t4_fw_install, 0, "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)"); @@ -3491,10 +3492,15 @@ install_kld_firmware(struct adapter *sc, struct fw_h * { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); - const uint32_t d = be32toh(drv_fw->fw_ver); - uint32_t k; - int rc; + uint32_t d, k; + int rc, fw_install; + struct fw_h bundled_fw; + bool load_attempted; + cfg = fw = NULL; + load_attempted = false; + fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; + if (reason != NULL) goto install; @@ -3508,7 +3514,23 @@ install_kld_firmware(struct adapter *sc, struct fw_h * return (0); } - if (!fw_compatible(card_fw, drv_fw)) { + memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); + if (t4_fw_install < 0) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p;" + " will use compiled-in firmware version for" + "hw.cxgbe.fw_install checks.\n", + rc, cfg, fw); + } else { + memcpy(&bundled_fw, fw->data, sizeof(bundled_fw)); + } + load_attempted = true; + } + d = be32toh(bundled_fw.fw_ver); + + if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; goto install; } @@ -3518,52 +3540,72 @@ install_kld_firmware(struct adapter *sc, struct fw_h * goto install; } - if (t4_fw_install == 2 && d != c) { + if (fw_install == 2 && d != c) { reason = "different than the version bundled with this driver"; goto install; } - return (0); + /* No reason to do anything to the firmware already on the card. */ + rc = 0; + goto done; install: + rc = 0; if ((*already)++) - return (0); + goto done; - if (t4_fw_install == 0) { + if (fw_install == 0) { device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " "but the driver is prohibited from installing a firmware " "on the card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); - return (0); + goto done; } - device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " - "installing firmware %u.%u.%u.%u on card.\n", - G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), - G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, - G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), - G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); - - rc = load_fw_module(sc, &cfg, &fw); - if (rc != 0 || fw == NULL) { - device_printf(sc->dev, - "failed to load firmware module: %d. cfg %p, fw %p\n", rc, - cfg, fw); + /* + * We'll attempt to install a firmware. Load the module first (if it + * hasn't been loaded already). + */ + if (!load_attempted) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p\n", + rc, cfg, fw); + /* carry on */ + } + } + if (fw == NULL) { + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "but the driver cannot take corrective action because it " + "is unable to load the firmware module.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); rc = sc->flags & FW_OK ? 0 : ENOENT; goto done; } k = be32toh(((const struct fw_hdr *)fw->data)->fw_ver); if (k != d) { + MPASS(t4_fw_install > 0); device_printf(sc->dev, "firmware in KLD (%u.%u.%u.%u) is not what the driver was " - "compiled with and will not be used.\n", + "expecting (%u.%u.%u.%u) and will not be used.\n", G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), - G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k), + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = sc->flags & FW_OK ? 0 : EINVAL; goto done; } + + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "installing firmware %u.%u.%u.%u on card.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); if (rc != 0) { From owner-svn-src-all@freebsd.org Mon Jan 21 19:02:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B754414B3E0D; Mon, 21 Jan 2019 19:02:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 18E5072172; Mon, 21 Jan 2019 19:02:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id leq0gAn158uQmleq1gaK7v; Mon, 21 Jan 2019 12:02:26 -0700 X-Authority-Analysis: v=2.3 cv=XKpOtjpE c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=hinadew-AAAA:8 a=YxBL1-UpAAAA:8 a=x7BMxHKl1PyEs5WXwGYA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=LikKuh5RR83Sn2yGlEXi:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 49214D9A; Mon, 21 Jan 2019 11:02:50 -0800 (PST) Date: Mon, 21 Jan 2019 09:27:46 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <201901211625.x0LGPfBd047017@repo.freebsd.org> References: <201901211625.x0LGPfBd047017@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343262 - head/sys/amd64/linux To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfJfVXiNw0WZoLheo4CU7ZhoI2SyJA9fzUaU5KRuyXAQEyuq1G7g7i20sT6zIh1lRAob/O/6Cc0JcjMGHKHLIYdKVwU2pyPSxe5j4Q0VmbcR4MI/hg1Il hYBc91sQuzFW6BZ6hjlzKk5ksLIul1bzCW5TLpWLfEtlWKxBlmPYcBQNS2OmC0j2zlqgfblJEIeUsZAC8x1xxJ/yTmyXdqoZOsq+mxLynl495G+co+6dMOxV elsI5QzMM9vX03KH7roiKoQ/VXmlcrjaXXfiUsxJw7fO4p3YZcK56IeTpFVVg7nO X-Rspamd-Queue-Id: 18E5072172 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:02:29 -0000 On January 21, 2019 8:25:41 AM PST, Ed Maste wrote: >Author: emaste >Date: Mon Jan 21 16:25:40 2019 >New Revision: 343262 >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343262 > >Log: > linuxulator: fix stack memory disclosure in linux_sigaltstack > =20 > admbugs: 765 > Reported by: Vlad Tsyrklevich > Reviewed by: andrew > MFC after: 1 day > Security: Kernel memory disclosure > Sponsored by: The FreeBSD Foundation > >Modified: > head/sys/amd64/linux/linux_machdep=2Ec > >Modified: head/sys/amd64/linux/linux_machdep=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >--- head/sys/amd64/linux/linux_machdep=2Ec Mon Jan 21 16:21:03 >2019 (r343261) >+++ head/sys/amd64/linux/linux_machdep=2Ec Mon Jan 21 16:25:40 >2019 (r343262) >@@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct >linux_siga > l_stack_t lss; > int error; >=20 >+ memset(&lss, 0, sizeof(lss)); > LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); >=20 > if (uap->uss !=3D NULL) { Do we have a CVE for this? --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-all@freebsd.org Mon Jan 21 19:04:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E72414B3F64; Mon, 21 Jan 2019 19:04: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 233DD72508; Mon, 21 Jan 2019 19:04: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 109071DD12; Mon, 21 Jan 2019 19:04: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 x0LJ4bLV031198; Mon, 21 Jan 2019 19:04:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJ4b2g031197; Mon, 21 Jan 2019 19:04:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211904.x0LJ4b2g031197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 19:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343270 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DD72508 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:04:38 -0000 Author: emaste Date: Mon Jan 21 19:04:37 2019 New Revision: 343270 URL: https://svnweb.freebsd.org/changeset/base/343270 Log: freebsd-update: Update /etc/passwd after password db changes Add -p to pwd_mkdb in order to ensure password db changes are also included in /etc/passwd. PR: 165954, 232921, 229487 Submitted by: Gerald Aryeetey Reviewed by: jilles MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18827 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:42:16 2019 (r343269) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:04:37 2019 (r343270) @@ -2918,10 +2918,11 @@ Kernel updates have been installed. Please reboot and install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 - # Rebuild /etc/spwd.db and /etc/pwd.db if necessary. + # Rebuild generated pwd files. if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ]; then - pwd_mkdb -d ${BASEDIR}/etc ${BASEDIR}/etc/master.passwd + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ] || + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/passwd ]; then + pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd fi # Rebuild /etc/login.conf.db if necessary. From owner-svn-src-all@freebsd.org Mon Jan 21 19:21:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F036914B49BA; Mon, 21 Jan 2019 19:21:11 +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 8D82373277; Mon, 21 Jan 2019 19:21:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 814A91DFF7; Mon, 21 Jan 2019 19:21:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LJLBUO038336; Mon, 21 Jan 2019 19:21:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJLB14038335; Mon, 21 Jan 2019 19:21:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211921.x0LJLB14038335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 19:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343271 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D82373277 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:21:12 -0000 Author: emaste Date: Mon Jan 21 19:21:11 2019 New Revision: 343271 URL: https://svnweb.freebsd.org/changeset/base/343271 Log: freebsd-update: Allow upgrade from pre-release builds Update r343122 to include -ALPHA, -BETA and -RC releases as upgrade-able via freebsd-update. PR: 234771 Submitted by: Gerald Aryeetey Reported by: delphij, des Reviewed by: delphij MFC with: r343122 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18881 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:04:37 2019 (r343270) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:21:11 2019 (r343271) @@ -668,17 +668,23 @@ fetchupgrade_check_params () { FETCHDIR=${RELNUM}/${ARCH} PATCHDIR=${RELNUM}/${ARCH}/bp - # Disallow upgrade from a version that is not `-RELEASE` - if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then - echo -n "`basename $0`: " - cat <<- EOF - Cannot upgrade from a version that is not a '-RELEASE' using `basename $0`. - Instead, FreeBSD can be directly upgraded by source or upgraded to a - RELEASE/RELENG version prior to running `basename $0`. - EOF - echo "System version: ${RELNUM}" - exit 1 - fi + # Disallow upgrade from a version that is not a release + case ${RELNUM} in + *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) + ;; + *) + echo -n "`basename $0`: " + cat <<- EOF + Cannot upgrade from a version that is not a release + (including alpha, beta and release candidates) + using `basename $0`. Instead, FreeBSD can be directly + upgraded by source or upgraded to a RELEASE/RELENG version + prior to running `basename $0`. + Currently running: ${RELNUM} + EOF + exit 1 + ;; + esac # Figure out what directory contains the running kernel BOOTFILE=`sysctl -n kern.bootfile` From owner-svn-src-all@freebsd.org Mon Jan 21 19:22:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 835E314B4BF3; Mon, 21 Jan 2019 19:22:03 +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 2819773623; Mon, 21 Jan 2019 19:22:03 +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 1C5591E040; Mon, 21 Jan 2019 19:22:03 +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 x0LJM2GG041615; Mon, 21 Jan 2019 19:22:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJM2jm041614; Mon, 21 Jan 2019 19:22:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901211922.x0LJM2jm041614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 21 Jan 2019 19:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343272 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 343272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2819773623 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:22:03 -0000 Author: brooks Date: Mon Jan 21 19:22:02 2019 New Revision: 343272 URL: https://svnweb.freebsd.org/changeset/base/343272 Log: MFC r343162: Make SIFTR work again after r342125 (D18443). Correct a logic error. Only disable when already enabled or enable when disabled. Submitted by: Richard Scheffenegger Reviewed by: Cheng Cui Obtained from: Cheng Cui Differential Revision: https://reviews.freebsd.org/D18885 Modified: stable/12/sys/netinet/siftr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/siftr.c ============================================================================== --- stable/12/sys/netinet/siftr.c Mon Jan 21 19:21:11 2019 (r343271) +++ stable/12/sys/netinet/siftr.c Mon Jan 21 19:22:02 2019 (r343272) @@ -1219,7 +1219,7 @@ siftr_manage_ops(uint8_t action) if ((s = sbuf_new(NULL, NULL, 200, SBUF_AUTOEXTEND)) == NULL) return (-1); - if (action == SIFTR_ENABLE) { + if (action == SIFTR_ENABLE && siftr_pkt_manager_thr == NULL) { /* * Create our alq * XXX: We should abort if alq_open fails! @@ -1424,7 +1424,8 @@ siftr_manage_ops(uint8_t action) alq_close(siftr_alq); siftr_alq = NULL; - } + } else + error = EINVAL; sbuf_delete(s); @@ -1445,13 +1446,15 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) new = siftr_enabled; error = sysctl_handle_int(oidp, &new, 0, req); - if (error != 0 && req->newptr != NULL) { + if (error == 0 && req->newptr != NULL) { if (new > 1) return (EINVAL); else if (new != siftr_enabled) { - error = siftr_manage_ops(new); - if (error != 0) + if ((error = siftr_manage_ops(new)) == 0) { + siftr_enabled = new; + } else { siftr_manage_ops(SIFTR_DISABLE); + } } } @@ -1462,7 +1465,9 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) static void siftr_shutdown_handler(void *arg) { - siftr_manage_ops(SIFTR_DISABLE); + if (siftr_enabled == 1) { + siftr_manage_ops(SIFTR_DISABLE); + } } From owner-svn-src-all@freebsd.org Mon Jan 21 19:33:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A09114B53C6; Mon, 21 Jan 2019 19:33:06 +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 F10327465B; Mon, 21 Jan 2019 19:33:05 +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 E5C251E21B; Mon, 21 Jan 2019 19:33:05 +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 x0LJX57k046843; Mon, 21 Jan 2019 19:33:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJX51e046842; Mon, 21 Jan 2019 19:33:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901211933.x0LJX51e046842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 21 Jan 2019 19:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343273 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 343273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F10327465B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:33:06 -0000 Author: brooks Date: Mon Jan 21 19:33:05 2019 New Revision: 343273 URL: https://svnweb.freebsd.org/changeset/base/343273 Log: MFC r343162: Make SIFTR work again after r342125 (D18443). Correct a logic error. Only disable when already enabled or enable when disabled. Submitted by: Richard Scheffenegger Reviewed by: Cheng Cui Obtained from: Cheng Cui Differential Revision: https://reviews.freebsd.org/D18885 Modified: stable/11/sys/netinet/siftr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/siftr.c ============================================================================== --- stable/11/sys/netinet/siftr.c Mon Jan 21 19:22:02 2019 (r343272) +++ stable/11/sys/netinet/siftr.c Mon Jan 21 19:33:05 2019 (r343273) @@ -1217,7 +1217,7 @@ siftr_manage_ops(uint8_t action) if ((s = sbuf_new(NULL, NULL, 200, SBUF_AUTOEXTEND)) == NULL) return (-1); - if (action == SIFTR_ENABLE) { + if (action == SIFTR_ENABLE && siftr_pkt_manager_thr == NULL) { /* * Create our alq * XXX: We should abort if alq_open fails! @@ -1422,7 +1422,8 @@ siftr_manage_ops(uint8_t action) alq_close(siftr_alq); siftr_alq = NULL; - } + } else + error = EINVAL; sbuf_delete(s); @@ -1443,13 +1444,15 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) new = siftr_enabled; error = sysctl_handle_int(oidp, &new, 0, req); - if (error != 0 && req->newptr != NULL) { + if (error == 0 && req->newptr != NULL) { if (new > 1) return (EINVAL); else if (new != siftr_enabled) { - error = siftr_manage_ops(new); - if (error != 0) + if ((error = siftr_manage_ops(new)) == 0) { + siftr_enabled = new; + } else { siftr_manage_ops(SIFTR_DISABLE); + } } } @@ -1460,7 +1463,9 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) static void siftr_shutdown_handler(void *arg) { - siftr_manage_ops(SIFTR_DISABLE); + if (siftr_enabled == 1) { + siftr_manage_ops(SIFTR_DISABLE); + } } From owner-svn-src-all@freebsd.org Mon Jan 21 19:37:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576A714B561F; Mon, 21 Jan 2019 19:37:13 +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 F0D42749F1; Mon, 21 Jan 2019 19:37:12 +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 C68C31E221; Mon, 21 Jan 2019 19:37:12 +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 x0LJbCMD047061; Mon, 21 Jan 2019 19:37:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJbCLa047060; Mon, 21 Jan 2019 19:37:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211937.x0LJbCLa047060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 19:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343274 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 343274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0D42749F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:37:13 -0000 Author: markj Date: Mon Jan 21 19:37:12 2019 New Revision: 343274 URL: https://svnweb.freebsd.org/changeset/base/343274 Log: Deduplicate common code in copyin()/copyout() with a macro. No functional change intended. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18850 Modified: head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:33:05 2019 (r343273) +++ head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:37:12 2019 (r343274) @@ -52,60 +52,61 @@ copyio_fault_nopcb: END(copyio_fault) /* - * Copies from a kernel to user address + * copycommon - common copy routine * - * int copyout(const void *kaddr, void *udaddr, size_t len) + * a0 - Source address + * a1 - Destination address + * a2 - Size of copy */ -ENTRY(copyout) - beqz a2, 2f /* If len == 0 then skip loop */ - add a3, a1, a2 - li a4, VM_MAXUSER_ADDRESS - bgt a3, a4, copyio_fault_nopcb - + .macro copycommon la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ ENTER_USER_ACCESS(a7) -1: lb a4, 0(a0) /* Load from kaddr */ +1: lb a4, 0(a0) /* Load from src */ addi a0, a0, 1 - sb a4, 0(a1) /* Store in uaddr */ + sb a4, 0(a1) /* Store in dest */ addi a1, a1, 1 addi a2, a2, -1 /* len-- */ bnez a2, 1b EXIT_USER_ACCESS(a7) SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ + .endm -2: li a0, 0 /* return 0 */ +/* + * Copies from a kernel to user address + * + * int copyout(const void *kaddr, void *udaddr, size_t len) + */ +ENTRY(copyout) + beqz a2, copyout_end /* If len == 0 then skip loop */ + add a3, a1, a2 + li a4, VM_MAXUSER_ADDRESS + bgt a3, a4, copyio_fault_nopcb + + copycommon + +copyout_end: + li a0, 0 /* return 0 */ ret END(copyout) /* * Copies from a user to kernel address * - * int copyin(const void *uaddr, void *kdaddr, size_t len) + * int copyin(const void *uaddr, void *kaddr, size_t len) */ ENTRY(copyin) - beqz a2, 2f /* If len == 0 then skip loop */ + beqz a2, copyin_end /* If len == 0 then skip loop */ add a3, a0, a2 li a4, VM_MAXUSER_ADDRESS bgt a3, a4, copyio_fault_nopcb - la a6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(a6, a7) /* Set the handler */ - ENTER_USER_ACCESS(a7) + copycommon -1: lb a4, 0(a0) /* Load from uaddr */ - addi a0, a0, 1 - sb a4, 0(a1) /* Store in kaddr */ - addi a1, a1, 1 - addi a2, a2, -1 /* len-- */ - bnez a2, 1b - - EXIT_USER_ACCESS(a7) - SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ - -2: li a0, 0 /* return 0 */ +copyin_end: + li a0, 0 /* return 0 */ ret END(copyin) From owner-svn-src-all@freebsd.org Mon Jan 21 19:38:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA24A14B572E; Mon, 21 Jan 2019 19:38:54 +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 51A2674BCE; Mon, 21 Jan 2019 19:38:54 +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 4702D1E223; Mon, 21 Jan 2019 19:38:54 +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 x0LJcsPe047181; Mon, 21 Jan 2019 19:38:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJcrXg047179; Mon, 21 Jan 2019 19:38:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211938.x0LJcrXg047179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 19:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343275 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 343275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51A2674BCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:38:54 -0000 Author: markj Date: Mon Jan 21 19:38:53 2019 New Revision: 343275 URL: https://svnweb.freebsd.org/changeset/base/343275 Log: Optimize RISC-V copyin(9)/copyout(9) routines. The existing copyin(9) and copyout(9) routines on RISC-V perform only a simple byte-by-byte copy. Improve their performance by performing word-sized copies where possible. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18851 Modified: head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Mon Jan 21 19:37:12 2019 (r343274) +++ head/sys/riscv/include/riscvreg.h Mon Jan 21 19:38:53 2019 (r343275) @@ -155,7 +155,8 @@ #define SATP_MODE_SV39 (8ULL << SATP_MODE_S) #define SATP_MODE_SV48 (9ULL << SATP_MODE_S) -#define XLEN 8 +#define XLEN __riscv_xlen +#define XLEN_BYTES (XLEN / 8) #define INSN_SIZE 4 #define INSN_C_SIZE 2 Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:37:12 2019 (r343274) +++ head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:38:53 2019 (r343275) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2019 Mitchell Horne * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -59,19 +60,52 @@ END(copyio_fault) * a2 - Size of copy */ .macro copycommon - la a6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(a6, a7) /* Set the handler */ + la a6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(a6, a7) /* Set the handler */ ENTER_USER_ACCESS(a7) -1: lb a4, 0(a0) /* Load from src */ + li t2, XLEN_BYTES + blt a2, t2, 3f /* Byte-copy if len < XLEN_BYTES */ + + /* + * Compare lower bits of src and dest. + * If they are aligned with each other, we can do word copy. + */ + andi t0, a0, (XLEN_BYTES-1) /* Low bits of src */ + andi t1, a1, (XLEN_BYTES-1) /* Low bits of dest */ + bne t0, t1, 3f /* Misaligned. Go to byte copy */ + beqz t0, 2f /* Already word-aligned, skip ahead */ + + /* Byte copy until the first word-aligned address */ +1: lb a4, 0(a0) /* Load byte from src */ addi a0, a0, 1 - sb a4, 0(a1) /* Store in dest */ + sb a4, 0(a1) /* Store byte in dest */ addi a1, a1, 1 - addi a2, a2, -1 /* len-- */ - bnez a2, 1b + addi a2, a2, -1 /* len-- */ + andi t0, a0, (XLEN_BYTES-1) + bnez t0, 1b - EXIT_USER_ACCESS(a7) - SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ + /* Copy words */ +2: ld a4, 0(a0) /* Load word from src */ + addi a0, a0, XLEN_BYTES + sd a4, 0(a1) /* Store word in dest */ + addi a1, a1, XLEN_BYTES + addi a2, a2, -XLEN_BYTES /* len -= XLEN_BYTES */ + bgeu a2, t2, 2b /* Again if len >= XLEN_BYTES */ + + /* Check if we're finished */ + beqz a2, 4f + + /* Copy any remaining bytes */ +3: lb a4, 0(a0) /* Load byte from src */ + addi a0, a0, 1 + sb a4, 0(a1) /* Store byte in dest */ + addi a1, a1, 1 + addi a2, a2, -1 /* len-- */ + bnez a2, 3b + +4: EXIT_USER_ACCESS(a7) + SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ .endm /* From owner-svn-src-all@freebsd.org Mon Jan 21 20:01:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1803114B62B0; Mon, 21 Jan 2019 20:01:43 +0000 (UTC) (envelope-from sjg@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 B2B6E762A7; Mon, 21 Jan 2019 20:01:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8A5311E6E8; Mon, 21 Jan 2019 20:01:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LK1gwq060224; Mon, 21 Jan 2019 20:01:42 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LK1gbw060223; Mon, 21 Jan 2019 20:01:42 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901212001.x0LK1gbw060223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 21 Jan 2019 20:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r343277 - vendor/bearssl X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/bearssl X-SVN-Commit-Revision: 343277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2B6E762A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:01:43 -0000 Author: sjg Date: Mon Jan 21 20:01:42 2019 New Revision: 343277 URL: https://svnweb.freebsd.org/changeset/base/343277 Log: bearssl for importing BearSSL BearSSL is a tiny SSL lib for embedded systems. Reviewed by: emaste Added: vendor/bearssl/ vendor/bearssl/import.sh (contents, props changed) Added: vendor/bearssl/import.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bearssl/import.sh Mon Jan 21 20:01:42 2019 (r343277) @@ -0,0 +1,101 @@ +#!/bin/sh + +# $FreeBSD$ + +# Set SVN variables +# select the local subversion site +SVN=${SVN:-/usr/local/bin/svn} +GIT=${GIT:-/usr/local/bin/git} + +# For consistency... +Error() { + echo ERROR: ${1+"$@"} >&2 + exit 1 +} + +Cd() { + [ $# -eq 1 ] || Error "Cd() takes a single parameter." + cd $1 || Error "cannot \"cd $1\" from $PWD" +} + +SKIP_PULL= + +# Call this function and then follow it by any specific import script additions +option_parsing() { + local _shift=$# + # Parse command line options + while : + do + case "$1" in + *=*) eval "$1"; shift;; + --) shift; break;; + --skip-pull) SKIP_PULL=:; shift;; + --help|-h) cat < $TF.old +# use * rather than . to skip .git +('cd' BearSSL && find * -type f ) | sort > $TF.new +comm -23 $TF.old $TF.new > $TF.rmlist +comm -13 $TF.old $TF.new > $TF.addlist +[ -s $TF.rmlist ] && { echo rm:; cat $TF.rmlist; } +[ -s $TF.addlist ] && { echo add:; cat $TF.addlist; } +('cd' BearSSL && tar cf - * | tar xf - -C ../dist) +('cd' dist +test -s $TF.rmlist && xargs $SVN rm < $TF.rmlist +test -s $TF.addlist && xargs $SVN --parents add < $TF.addlist +) + +url=`$SVN info | sed -n '/^URL:/s,URL: ,,p'` +echo "After committing dist... run; sh ./tag.sh" +echo "$SVN cp -m 'tag $thing-$VERSION' $url/dist $url/$VERSION" > tag.sh + +rm -f $TF.* From owner-svn-src-all@freebsd.org Mon Jan 21 20:23:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE82814B6AA5; Mon, 21 Jan 2019 20:23:04 +0000 (UTC) (envelope-from sjg@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 60DAE7754A; Mon, 21 Jan 2019 20:23:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 545CA1EA7D; Mon, 21 Jan 2019 20:23:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKN4Kb074143; Mon, 21 Jan 2019 20:23:04 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKN4SZ074142; Mon, 21 Jan 2019 20:23:04 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901212023.x0LKN4SZ074142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 21 Jan 2019 20:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r343279 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 343279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60DAE7754A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:23:04 -0000 Author: sjg Date: Mon Jan 21 20:23:03 2019 New Revision: 343279 URL: https://svnweb.freebsd.org/changeset/base/343279 Log: For initial BearSSL import Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jan 21 20:22:11 2019 (r343278) +++ svnadmin/conf/sizelimit.conf Mon Jan 21 20:23:03 2019 (r343279) @@ -27,3 +27,4 @@ np obrien peter rwatson +sjg From owner-svn-src-all@freebsd.org Mon Jan 21 20:23:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04A3114B6B1E; Mon, 21 Jan 2019 20:23:51 +0000 (UTC) (envelope-from sjg@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 8E05577762; Mon, 21 Jan 2019 20:23:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7FE7F1EA81; Mon, 21 Jan 2019 20:23:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKNopt074275; Mon, 21 Jan 2019 20:23:50 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKNoRf074273; Mon, 21 Jan 2019 20:23:50 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901212023.x0LKNoRf074273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 21 Jan 2019 20:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r343281 - in vendor/bearssl/dist: . T0 build conf inc mk samples src src/aead src/codec src/ec src/hash src/int src/kdf src/mac src/rand src/rsa src/ssl src/symcipher src/x509 test test... X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/bearssl/dist: . T0 build conf inc mk samples src src/aead src/codec src/ec src/hash src/int src/kdf src/mac src/rand src/rsa src/ssl src/symcipher src/x509 test test/x509 tools X-SVN-Commit-Revision: 343281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E05577762 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:23:51 -0000 Author: sjg Date: Mon Jan 21 20:23:49 2019 New Revision: 343281 URL: https://svnweb.freebsd.org/changeset/base/343281 Log: Import bearssl-6433cc2 Added: vendor/bearssl/dist/ vendor/bearssl/dist/Doxyfile vendor/bearssl/dist/LICENSE.txt (contents, props changed) vendor/bearssl/dist/Makefile (contents, props changed) vendor/bearssl/dist/README.txt (contents, props changed) vendor/bearssl/dist/T0/ vendor/bearssl/dist/T0/BlobWriter.cs vendor/bearssl/dist/T0/CPU.cs vendor/bearssl/dist/T0/CodeElement.cs vendor/bearssl/dist/T0/CodeElementJump.cs vendor/bearssl/dist/T0/CodeElementUInt.cs vendor/bearssl/dist/T0/CodeElementUIntExpr.cs vendor/bearssl/dist/T0/CodeElementUIntInt.cs vendor/bearssl/dist/T0/CodeElementUIntUInt.cs vendor/bearssl/dist/T0/ConstData.cs vendor/bearssl/dist/T0/Opcode.cs vendor/bearssl/dist/T0/OpcodeCall.cs vendor/bearssl/dist/T0/OpcodeConst.cs vendor/bearssl/dist/T0/OpcodeGetLocal.cs vendor/bearssl/dist/T0/OpcodeJump.cs vendor/bearssl/dist/T0/OpcodeJumpIf.cs vendor/bearssl/dist/T0/OpcodeJumpIfNot.cs vendor/bearssl/dist/T0/OpcodeJumpUncond.cs vendor/bearssl/dist/T0/OpcodePutLocal.cs vendor/bearssl/dist/T0/OpcodeRet.cs vendor/bearssl/dist/T0/SType.cs vendor/bearssl/dist/T0/T0Comp.cs vendor/bearssl/dist/T0/TPointerBase.cs vendor/bearssl/dist/T0/TPointerBlob.cs vendor/bearssl/dist/T0/TPointerExpr.cs vendor/bearssl/dist/T0/TPointerNull.cs vendor/bearssl/dist/T0/TPointerXT.cs vendor/bearssl/dist/T0/TValue.cs vendor/bearssl/dist/T0/Word.cs vendor/bearssl/dist/T0/WordBuilder.cs vendor/bearssl/dist/T0/WordData.cs vendor/bearssl/dist/T0/WordInterpreted.cs vendor/bearssl/dist/T0/WordNative.cs vendor/bearssl/dist/T0/kern.t0 vendor/bearssl/dist/T0Comp.exe (contents, props changed) vendor/bearssl/dist/build/ vendor/bearssl/dist/build/.do_not_remove vendor/bearssl/dist/conf/ vendor/bearssl/dist/conf/Unix.mk (contents, props changed) vendor/bearssl/dist/conf/Unix32.mk (contents, props changed) vendor/bearssl/dist/conf/UnixClang.mk (contents, props changed) vendor/bearssl/dist/conf/Win.mk (contents, props changed) vendor/bearssl/dist/conf/samd20.mk (contents, props changed) vendor/bearssl/dist/inc/ vendor/bearssl/dist/inc/bearssl.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_aead.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_block.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_ec.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_hash.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_hmac.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_kdf.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_pem.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_prf.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_rand.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_rsa.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_ssl.h (contents, props changed) vendor/bearssl/dist/inc/bearssl_x509.h (contents, props changed) vendor/bearssl/dist/mk/ vendor/bearssl/dist/mk/Defaults.mk (contents, props changed) vendor/bearssl/dist/mk/NMake.mk (contents, props changed) vendor/bearssl/dist/mk/Rules.mk (contents, props changed) vendor/bearssl/dist/mk/SingleUnix.mk (contents, props changed) vendor/bearssl/dist/mk/mkT0.cmd vendor/bearssl/dist/mk/mkT0.sh (contents, props changed) vendor/bearssl/dist/mk/mkrules.sh (contents, props changed) vendor/bearssl/dist/samples/ vendor/bearssl/dist/samples/README.txt (contents, props changed) vendor/bearssl/dist/samples/cert-ee-ec+rsa.pem vendor/bearssl/dist/samples/cert-ee-ec.pem vendor/bearssl/dist/samples/cert-ee-rsa.pem vendor/bearssl/dist/samples/cert-ica-ec.pem vendor/bearssl/dist/samples/cert-ica-rsa.pem vendor/bearssl/dist/samples/cert-root-ec.pem vendor/bearssl/dist/samples/cert-root-rsa.pem vendor/bearssl/dist/samples/chain-ec+rsa.h (contents, props changed) vendor/bearssl/dist/samples/chain-ec.h (contents, props changed) vendor/bearssl/dist/samples/chain-rsa.h (contents, props changed) vendor/bearssl/dist/samples/client_basic.c (contents, props changed) vendor/bearssl/dist/samples/custom_profile.c (contents, props changed) vendor/bearssl/dist/samples/key-ec.h (contents, props changed) vendor/bearssl/dist/samples/key-ee-ec.pem vendor/bearssl/dist/samples/key-ee-rsa.pem vendor/bearssl/dist/samples/key-ica-ec.pem vendor/bearssl/dist/samples/key-ica-rsa.pem vendor/bearssl/dist/samples/key-root-ec.pem vendor/bearssl/dist/samples/key-root-rsa.pem vendor/bearssl/dist/samples/key-rsa.h (contents, props changed) vendor/bearssl/dist/samples/server_basic.c (contents, props changed) vendor/bearssl/dist/src/ vendor/bearssl/dist/src/aead/ vendor/bearssl/dist/src/aead/ccm.c (contents, props changed) vendor/bearssl/dist/src/aead/eax.c (contents, props changed) vendor/bearssl/dist/src/aead/gcm.c (contents, props changed) vendor/bearssl/dist/src/codec/ vendor/bearssl/dist/src/codec/ccopy.c (contents, props changed) vendor/bearssl/dist/src/codec/dec16be.c (contents, props changed) vendor/bearssl/dist/src/codec/dec16le.c (contents, props changed) vendor/bearssl/dist/src/codec/dec32be.c (contents, props changed) vendor/bearssl/dist/src/codec/dec32le.c (contents, props changed) vendor/bearssl/dist/src/codec/dec64be.c (contents, props changed) vendor/bearssl/dist/src/codec/dec64le.c (contents, props changed) vendor/bearssl/dist/src/codec/enc16be.c (contents, props changed) vendor/bearssl/dist/src/codec/enc16le.c (contents, props changed) vendor/bearssl/dist/src/codec/enc32be.c (contents, props changed) vendor/bearssl/dist/src/codec/enc32le.c (contents, props changed) vendor/bearssl/dist/src/codec/enc64be.c (contents, props changed) vendor/bearssl/dist/src/codec/enc64le.c (contents, props changed) vendor/bearssl/dist/src/codec/pemdec.c (contents, props changed) vendor/bearssl/dist/src/codec/pemdec.t0 vendor/bearssl/dist/src/codec/pemenc.c (contents, props changed) vendor/bearssl/dist/src/config.h (contents, props changed) vendor/bearssl/dist/src/ec/ vendor/bearssl/dist/src/ec/ec_all_m15.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_all_m31.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_i15.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_i31.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_m15.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_m31.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_m62.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_c25519_m64.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_curve25519.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_default.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_keygen.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_p256_m15.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_p256_m31.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_p256_m62.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_p256_m64.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_prime_i15.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_prime_i31.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_pubkey.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_secp256r1.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_secp384r1.c (contents, props changed) vendor/bearssl/dist/src/ec/ec_secp521r1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_atr.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_default_sign_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_default_sign_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_default_vrfy_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_default_vrfy_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i15_bits.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i15_sign_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i15_sign_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i15_vrfy_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i15_vrfy_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i31_bits.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i31_sign_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i31_sign_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i31_vrfy_asn1.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_i31_vrfy_raw.c (contents, props changed) vendor/bearssl/dist/src/ec/ecdsa_rta.c (contents, props changed) vendor/bearssl/dist/src/hash/ vendor/bearssl/dist/src/hash/dig_oid.c (contents, props changed) vendor/bearssl/dist/src/hash/dig_size.c (contents, props changed) vendor/bearssl/dist/src/hash/ghash_ctmul.c (contents, props changed) vendor/bearssl/dist/src/hash/ghash_ctmul32.c (contents, props changed) vendor/bearssl/dist/src/hash/ghash_ctmul64.c (contents, props changed) vendor/bearssl/dist/src/hash/ghash_pclmul.c (contents, props changed) vendor/bearssl/dist/src/hash/ghash_pwr8.c (contents, props changed) vendor/bearssl/dist/src/hash/md5.c (contents, props changed) vendor/bearssl/dist/src/hash/md5sha1.c (contents, props changed) vendor/bearssl/dist/src/hash/mgf1.c (contents, props changed) vendor/bearssl/dist/src/hash/multihash.c (contents, props changed) vendor/bearssl/dist/src/hash/sha1.c (contents, props changed) vendor/bearssl/dist/src/hash/sha2big.c (contents, props changed) vendor/bearssl/dist/src/hash/sha2small.c (contents, props changed) vendor/bearssl/dist/src/inner.h (contents, props changed) vendor/bearssl/dist/src/int/ vendor/bearssl/dist/src/int/i15_add.c (contents, props changed) vendor/bearssl/dist/src/int/i15_bitlen.c (contents, props changed) vendor/bearssl/dist/src/int/i15_decmod.c (contents, props changed) vendor/bearssl/dist/src/int/i15_decode.c (contents, props changed) vendor/bearssl/dist/src/int/i15_decred.c (contents, props changed) vendor/bearssl/dist/src/int/i15_encode.c (contents, props changed) vendor/bearssl/dist/src/int/i15_fmont.c (contents, props changed) vendor/bearssl/dist/src/int/i15_iszero.c (contents, props changed) vendor/bearssl/dist/src/int/i15_moddiv.c (contents, props changed) vendor/bearssl/dist/src/int/i15_modpow.c (contents, props changed) vendor/bearssl/dist/src/int/i15_modpow2.c (contents, props changed) vendor/bearssl/dist/src/int/i15_montmul.c (contents, props changed) vendor/bearssl/dist/src/int/i15_mulacc.c (contents, props changed) vendor/bearssl/dist/src/int/i15_muladd.c (contents, props changed) vendor/bearssl/dist/src/int/i15_ninv15.c (contents, props changed) vendor/bearssl/dist/src/int/i15_reduce.c (contents, props changed) vendor/bearssl/dist/src/int/i15_rshift.c (contents, props changed) vendor/bearssl/dist/src/int/i15_sub.c (contents, props changed) vendor/bearssl/dist/src/int/i15_tmont.c (contents, props changed) vendor/bearssl/dist/src/int/i31_add.c (contents, props changed) vendor/bearssl/dist/src/int/i31_bitlen.c (contents, props changed) vendor/bearssl/dist/src/int/i31_decmod.c (contents, props changed) vendor/bearssl/dist/src/int/i31_decode.c (contents, props changed) vendor/bearssl/dist/src/int/i31_decred.c (contents, props changed) vendor/bearssl/dist/src/int/i31_encode.c (contents, props changed) vendor/bearssl/dist/src/int/i31_fmont.c (contents, props changed) vendor/bearssl/dist/src/int/i31_iszero.c (contents, props changed) vendor/bearssl/dist/src/int/i31_moddiv.c (contents, props changed) vendor/bearssl/dist/src/int/i31_modpow.c (contents, props changed) vendor/bearssl/dist/src/int/i31_modpow2.c (contents, props changed) vendor/bearssl/dist/src/int/i31_montmul.c (contents, props changed) vendor/bearssl/dist/src/int/i31_mulacc.c (contents, props changed) vendor/bearssl/dist/src/int/i31_muladd.c (contents, props changed) vendor/bearssl/dist/src/int/i31_ninv31.c (contents, props changed) vendor/bearssl/dist/src/int/i31_reduce.c (contents, props changed) vendor/bearssl/dist/src/int/i31_rshift.c (contents, props changed) vendor/bearssl/dist/src/int/i31_sub.c (contents, props changed) vendor/bearssl/dist/src/int/i31_tmont.c (contents, props changed) vendor/bearssl/dist/src/int/i32_add.c (contents, props changed) vendor/bearssl/dist/src/int/i32_bitlen.c (contents, props changed) vendor/bearssl/dist/src/int/i32_decmod.c (contents, props changed) vendor/bearssl/dist/src/int/i32_decode.c (contents, props changed) vendor/bearssl/dist/src/int/i32_decred.c (contents, props changed) vendor/bearssl/dist/src/int/i32_div32.c (contents, props changed) vendor/bearssl/dist/src/int/i32_encode.c (contents, props changed) vendor/bearssl/dist/src/int/i32_fmont.c (contents, props changed) vendor/bearssl/dist/src/int/i32_iszero.c (contents, props changed) vendor/bearssl/dist/src/int/i32_modpow.c (contents, props changed) vendor/bearssl/dist/src/int/i32_montmul.c (contents, props changed) vendor/bearssl/dist/src/int/i32_mulacc.c (contents, props changed) vendor/bearssl/dist/src/int/i32_muladd.c (contents, props changed) vendor/bearssl/dist/src/int/i32_ninv32.c (contents, props changed) vendor/bearssl/dist/src/int/i32_reduce.c (contents, props changed) vendor/bearssl/dist/src/int/i32_sub.c (contents, props changed) vendor/bearssl/dist/src/int/i32_tmont.c (contents, props changed) vendor/bearssl/dist/src/int/i62_modpow2.c (contents, props changed) vendor/bearssl/dist/src/kdf/ vendor/bearssl/dist/src/kdf/hkdf.c (contents, props changed) vendor/bearssl/dist/src/kdf/shake.c (contents, props changed) vendor/bearssl/dist/src/mac/ vendor/bearssl/dist/src/mac/hmac.c (contents, props changed) vendor/bearssl/dist/src/mac/hmac_ct.c (contents, props changed) vendor/bearssl/dist/src/rand/ vendor/bearssl/dist/src/rand/aesctr_drbg.c (contents, props changed) vendor/bearssl/dist/src/rand/hmac_drbg.c (contents, props changed) vendor/bearssl/dist/src/rand/sysrng.c (contents, props changed) vendor/bearssl/dist/src/rsa/ vendor/bearssl/dist/src/rsa/rsa_default_keygen.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_modulus.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_oaep_decrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_oaep_encrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pkcs1_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pkcs1_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_priv.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_privexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pss_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pss_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pub.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_default_pubexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_keygen.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_modulus.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_oaep_decrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_oaep_encrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pkcs1_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pkcs1_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_priv.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_privexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pss_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pss_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pub.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i15_pubexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_keygen.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_keygen_inner.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_modulus.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_oaep_decrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_oaep_encrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pkcs1_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pkcs1_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_priv.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_privexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pss_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pss_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pub.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i31_pubexp.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_oaep_decrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_oaep_encrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_pkcs1_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_pkcs1_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_priv.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_pss_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_pss_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i32_pub.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_keygen.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_oaep_decrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_oaep_encrypt.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_pkcs1_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_pkcs1_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_priv.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_pss_sign.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_pss_vrfy.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_i62_pub.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_oaep_pad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_oaep_unpad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_pkcs1_sig_pad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_pkcs1_sig_unpad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_pss_sig_pad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_pss_sig_unpad.c (contents, props changed) vendor/bearssl/dist/src/rsa/rsa_ssl_decrypt.c (contents, props changed) vendor/bearssl/dist/src/settings.c (contents, props changed) vendor/bearssl/dist/src/ssl/ vendor/bearssl/dist/src/ssl/prf.c (contents, props changed) vendor/bearssl/dist/src/ssl/prf_md5sha1.c (contents, props changed) vendor/bearssl/dist/src/ssl/prf_sha256.c (contents, props changed) vendor/bearssl/dist/src/ssl/prf_sha384.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_ccert_single_ec.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_ccert_single_rsa.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_client.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_client_default_rsapub.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_client_full.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_aescbc.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_aesccm.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_aesgcm.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_chapol.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_descbc.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_ec.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_ecdsa.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_engine_default_rsavrfy.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_hashes.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_hs_client.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_hs_client.t0 vendor/bearssl/dist/src/ssl/ssl_hs_common.t0 vendor/bearssl/dist/src/ssl/ssl_hs_server.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_hs_server.t0 vendor/bearssl/dist/src/ssl/ssl_io.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_keyexport.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_lru.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_rec_cbc.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_rec_ccm.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_rec_chapol.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_rec_gcm.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_scert_single_ec.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_scert_single_rsa.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_full_ec.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_full_rsa.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_mine2c.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_mine2g.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_minf2c.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_minf2g.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_minr2g.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_minu2g.c (contents, props changed) vendor/bearssl/dist/src/ssl/ssl_server_minv2g.c (contents, props changed) vendor/bearssl/dist/src/symcipher/ vendor/bearssl/dist/src/symcipher/aes_big_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_big_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_big_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_big_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_big_dec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_big_enc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_common.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_dec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct64_enc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_dec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_ct_enc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_pwr8.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_pwr8_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_pwr8_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_pwr8_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_pwr8_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_dec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_small_enc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_x86ni.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_x86ni_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_x86ni_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_x86ni_ctr.c (contents, props changed) vendor/bearssl/dist/src/symcipher/aes_x86ni_ctrcbc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/chacha20_ct.c (contents, props changed) vendor/bearssl/dist/src/symcipher/chacha20_sse2.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_ct.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_ct_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_ct_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_support.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_tab.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_tab_cbcdec.c (contents, props changed) vendor/bearssl/dist/src/symcipher/des_tab_cbcenc.c (contents, props changed) vendor/bearssl/dist/src/symcipher/poly1305_ctmul.c (contents, props changed) vendor/bearssl/dist/src/symcipher/poly1305_ctmul32.c (contents, props changed) vendor/bearssl/dist/src/symcipher/poly1305_ctmulq.c (contents, props changed) vendor/bearssl/dist/src/symcipher/poly1305_i15.c (contents, props changed) vendor/bearssl/dist/src/x509/ vendor/bearssl/dist/src/x509/asn1.t0 vendor/bearssl/dist/src/x509/asn1enc.c (contents, props changed) vendor/bearssl/dist/src/x509/encode_ec_pk8der.c (contents, props changed) vendor/bearssl/dist/src/x509/encode_ec_rawder.c (contents, props changed) vendor/bearssl/dist/src/x509/encode_rsa_pk8der.c (contents, props changed) vendor/bearssl/dist/src/x509/encode_rsa_rawder.c (contents, props changed) vendor/bearssl/dist/src/x509/skey_decoder.c (contents, props changed) vendor/bearssl/dist/src/x509/skey_decoder.t0 vendor/bearssl/dist/src/x509/x509_decoder.c (contents, props changed) vendor/bearssl/dist/src/x509/x509_decoder.t0 vendor/bearssl/dist/src/x509/x509_knownkey.c (contents, props changed) vendor/bearssl/dist/src/x509/x509_minimal.c (contents, props changed) vendor/bearssl/dist/src/x509/x509_minimal.t0 vendor/bearssl/dist/src/x509/x509_minimal_full.c (contents, props changed) vendor/bearssl/dist/test/ vendor/bearssl/dist/test/test_crypto.c (contents, props changed) vendor/bearssl/dist/test/test_math.c (contents, props changed) vendor/bearssl/dist/test/test_speed.c (contents, props changed) vendor/bearssl/dist/test/test_x509.c (contents, props changed) vendor/bearssl/dist/test/x509/ vendor/bearssl/dist/test/x509/alltests.txt (contents, props changed) vendor/bearssl/dist/test/x509/dn-ee.der (contents, props changed) vendor/bearssl/dist/test/x509/dn-ica1.der (contents, props changed) vendor/bearssl/dist/test/x509/dn-ica2.der (contents, props changed) vendor/bearssl/dist/test/x509/dn-root-new.der (contents, props changed) vendor/bearssl/dist/test/x509/dn-root.der (contents, props changed) vendor/bearssl/dist/test/x509/ee-badsig1.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-badsig2.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-cp1.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-cp2.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-cp3.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-cp4.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-dates.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-md5.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-names.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-names2.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-names3.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-names4.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256-sha1.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256-sha224.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256-sha256.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256-sha384.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256-sha512.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p256.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p384.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-p521.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-sha1.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-sha224.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-sha384.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-sha512.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee-trailing.crt (contents, props changed) vendor/bearssl/dist/test/x509/ee.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-1016.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-1017.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-4096.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-p256.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-p384.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1-p521.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica1.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-1016.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-1017.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-4096.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-notCA.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-p256.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-p384.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2-p521.crt (contents, props changed) vendor/bearssl/dist/test/x509/ica2.crt (contents, props changed) vendor/bearssl/dist/test/x509/junk.crt (contents, props changed) vendor/bearssl/dist/test/x509/names.crt (contents, props changed) vendor/bearssl/dist/test/x509/root-p256.crt (contents, props changed) vendor/bearssl/dist/test/x509/root-p384.crt (contents, props changed) vendor/bearssl/dist/test/x509/root-p521.crt (contents, props changed) vendor/bearssl/dist/test/x509/root.crt (contents, props changed) vendor/bearssl/dist/tools/ vendor/bearssl/dist/tools/brssl.c (contents, props changed) vendor/bearssl/dist/tools/brssl.h (contents, props changed) vendor/bearssl/dist/tools/certs.c (contents, props changed) vendor/bearssl/dist/tools/chain.c (contents, props changed) vendor/bearssl/dist/tools/client.c (contents, props changed) vendor/bearssl/dist/tools/errors.c (contents, props changed) vendor/bearssl/dist/tools/files.c (contents, props changed) vendor/bearssl/dist/tools/impl.c (contents, props changed) vendor/bearssl/dist/tools/keys.c (contents, props changed) vendor/bearssl/dist/tools/names.c (contents, props changed) vendor/bearssl/dist/tools/server.c (contents, props changed) vendor/bearssl/dist/tools/skey.c (contents, props changed) vendor/bearssl/dist/tools/sslio.c (contents, props changed) vendor/bearssl/dist/tools/ta.c (contents, props changed) vendor/bearssl/dist/tools/twrch.c (contents, props changed) vendor/bearssl/dist/tools/vector.c (contents, props changed) vendor/bearssl/dist/tools/verify.c (contents, props changed) vendor/bearssl/dist/tools/xmem.c (contents, props changed) Added: vendor/bearssl/dist/Doxyfile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bearssl/dist/Doxyfile Mon Jan 21 20:23:49 2019 (r343281) @@ -0,0 +1,2427 @@ +# Doxyfile 1.8.11 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "BearSSL" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = apidoc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = inc/bearssl.h inc/bearssl_aead.h inc/bearssl_block.h inc/bearssl_ec.h inc/bearssl_hash.h inc/bearssl_hmac.h inc/bearssl_kdf.h inc/bearssl_pem.h inc/bearssl_prf.h inc/bearssl_rand.h inc/bearssl_rsa.h inc/bearssl_ssl.h inc/bearssl_x509.h + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, +# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 21 20:24:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1199314B6B47; Mon, 21 Jan 2019 20:24:02 +0000 (UTC) (envelope-from sjg@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 A9C6C77839; Mon, 21 Jan 2019 20:24:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 78DC31EA82; Mon, 21 Jan 2019 20:24:00 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKO0sc074328; Mon, 21 Jan 2019 20:24:00 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKO0KG074327; Mon, 21 Jan 2019 20:24:00 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901212024.x0LKO0KG074327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 21 Jan 2019 20:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r343282 - vendor/bearssl/6433cc2 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/bearssl/6433cc2 X-SVN-Commit-Revision: 343282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9C6C77839 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:24:02 -0000 Author: sjg Date: Mon Jan 21 20:24:00 2019 New Revision: 343282 URL: https://svnweb.freebsd.org/changeset/base/343282 Log: tag bearssl-6433cc2 Added: vendor/bearssl/6433cc2/ - copied from r343281, vendor/bearssl/dist/ From owner-svn-src-all@freebsd.org Mon Jan 21 20:25:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E349E14B6C4F; Mon, 21 Jan 2019 20:25:09 +0000 (UTC) (envelope-from sjg@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 8BF1977ACA; Mon, 21 Jan 2019 20:25:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 79E5C1EA83; Mon, 21 Jan 2019 20:25:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKP9is074430; Mon, 21 Jan 2019 20:25:09 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKP9VB074429; Mon, 21 Jan 2019 20:25:09 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901212025.x0LKP9VB074429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 21 Jan 2019 20:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r343283 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 343283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8BF1977ACA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:25:10 -0000 Author: sjg Date: Mon Jan 21 20:25:08 2019 New Revision: 343283 URL: https://svnweb.freebsd.org/changeset/base/343283 Log: Done with initial BearSSL import Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jan 21 20:24:00 2019 (r343282) +++ svnadmin/conf/sizelimit.conf Mon Jan 21 20:25:08 2019 (r343283) @@ -27,4 +27,3 @@ np obrien peter rwatson -sjg From owner-svn-src-all@freebsd.org Mon Jan 21 20:35:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 296C214B74BD; Mon, 21 Jan 2019 20:35:19 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD0E8807CE; Mon, 21 Jan 2019 20:35:18 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id D8B1227000ED; Mon, 21 Jan 2019 15:35:11 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu D8B1227000ED DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1548102912; bh=xKF5dTojImrFHnXYW/BbxG5ttGdpoKbOduSLtkCq9gc=; h=Subject:To:From:Date:From; b=rSGwdzYnugmWYS7+KdVKNJst76gERomUzD1fh3hC3drVJMmHj9oXRrFwkr1OS8tYm Hx9Cu7D1ZFnY1/tROLP+tSSxZpvOWUNYlCoYfvhmsHl5d6IO8gYICIeZhYWvLF8E4u nEVH2J2qgfSbwFxkRg2jmLIikNraVkNUjuBPYw0bEfl54bOL3RSARfrvRCkQu/DmMV Mi+2Kn3hZkNvEhpT9dyiEFRBoZEFF1o4gZ4IJQagB2rrgIIaJ3L5zbsllWqjCy0brP 9Aa+lx5v6iS57IuD4QffgETIAJyruLFig0u25Bbtt4ElkbPWopVdWyu5D/3xnolMeP sxB5BDOqtMk8w== Subject: Re: svn commit: r343269 - head/sys/dev/cxgbe To: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901211842.x0LIgGVB020361@repo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Mon, 21 Jan 2019 15:35:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901211842.x0LIgGVB020361@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BD0E8807CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:35:19 -0000 On 1/21/19 1:42 PM, Navdeep Parhar wrote: > Log: > cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to Thank you! Drew From owner-svn-src-all@freebsd.org Mon Jan 21 20:56:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0790414B822F; Mon, 21 Jan 2019 20:56:30 +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 A232281BEB; Mon, 21 Jan 2019 20:56:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9176A1EF94; Mon, 21 Jan 2019 20:56:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKuTfX091061; Mon, 21 Jan 2019 20:56:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKuTIm091060; Mon, 21 Jan 2019 20:56:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901212056.x0LKuTIm091060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 20:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343284 - head/lib/libcapsicum X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcapsicum X-SVN-Commit-Revision: 343284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A232281BEB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:56:30 -0000 Author: markj Date: Mon Jan 21 20:56:29 2019 New Revision: 343284 URL: https://svnweb.freebsd.org/changeset/base/343284 Log: List caph_limit_stream() in the synopsis. Fix typos while here. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libcapsicum/capsicum_helpers.3 Modified: head/lib/libcapsicum/capsicum_helpers.3 ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:25:08 2019 (r343283) +++ head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:56:29 2019 (r343284) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2018 +.Dd January 21, 2019 .Dt CAPSICUM_HELPERS 3 .Os .Sh NAME @@ -50,11 +50,13 @@ .Ft int .Fn caph_enter_casper "void" .Ft int -.Fn caph_rights_limit "inf fd" "const cap_righst_t *rights" +.Fn caph_rights_limit "int fd" "const cap_righst_t *rights" .Ft int -.Fn caph_ioctls_limit "inf fd" "const unsigned long *cmds" "size_t ncmds" +.Fn caph_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds" .Ft int -.Fn caph_fcntls_limit "inf fd" "uint32_t fcntlrights" +.Fn caph_fcntls_limit "int fd" "uint32_t fcntlrights" +.Ft int +.Fn caph_limit_stream "int fd" "int flags" .Ft int .Fn caph_limit_stdin "void" .Ft int From owner-svn-src-all@freebsd.org Mon Jan 21 23:54:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86301148DF79; Mon, 21 Jan 2019 23:54:34 +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 27D61880FF; Mon, 21 Jan 2019 23:54:34 +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 1906820DC9; Mon, 21 Jan 2019 23:54:34 +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 x0LNsXqW085293; Mon, 21 Jan 2019 23:54:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LNsXw7085292; Mon, 21 Jan 2019 23:54:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901212354.x0LNsXw7085292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 23:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343286 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 343286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27D61880FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 23:54:34 -0000 Author: markj Date: Mon Jan 21 23:54:33 2019 New Revision: 343286 URL: https://svnweb.freebsd.org/changeset/base/343286 Log: nfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS. Note that these interfaces are available only to root. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: rmacklem MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 21 20:58:33 2019 (r343285) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 21 23:54:33 2019 (r343286) @@ -3614,8 +3614,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u error = EPERM; if (!error) { len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size; - dumpclients = (struct nfsd_dumpclients *)malloc(len, - M_TEMP, M_WAITOK); + dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumpclients(dumpclients, dumplist.ndl_size); error = copyout(dumpclients, CAST_USER_ADDR_T(dumplist.ndl_list), len); @@ -3633,8 +3632,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u if (!error) { len = sizeof (struct nfsd_dumplocks) * dumplocklist.ndllck_size; - dumplocks = (struct nfsd_dumplocks *)malloc(len, - M_TEMP, M_WAITOK); + dumplocks = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumplocks(nd.ni_vp, dumplocks, dumplocklist.ndllck_size, p); vput(nd.ni_vp); From owner-svn-src-all@freebsd.org Tue Jan 22 00:50:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8AEC149085C; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@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 487788A927; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 355B921662; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M0oPTr012757; Tue, 22 Jan 2019 00:50:25 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M0oOB1012753; Tue, 22 Jan 2019 00:50:24 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220050.x0M0oOB1012753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 00:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343287 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 343287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 487788A927 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 00:50:26 -0000 Author: pkelsey Date: Tue Jan 22 00:50:24 2019 New Revision: 343287 URL: https://svnweb.freebsd.org/changeset/base/343287 Log: Reduce pf.conf parsing cost for configs that define N queues from O(N^2) to O(N) The number of syscalls made during parsing of any config that defines tables is also reduced, and incorrect warnings that HFSC parent queue bandwidths were smaller than the sum of their child bandwidths have been fixed. Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18759 Modified: head/sbin/pfctl/pfctl.h head/sbin/pfctl/pfctl_altq.c head/sbin/pfctl/pfctl_parser.c head/sbin/pfctl/pfctl_parser.h Modified: head/sbin/pfctl/pfctl.h ============================================================================== --- head/sbin/pfctl/pfctl.h Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl.h Tue Jan 22 00:50:24 2019 (r343287) @@ -114,7 +114,6 @@ extern int loadopt; int check_commit_altq(int, int); void pfaltq_store(struct pf_altq *); -struct pf_altq *pfaltq_lookup(const char *); char *rate2str(double); void print_addr(struct pf_addr_wrap *, sa_family_t, int); Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl_altq.c Tue Jan 22 00:50:24 2019 (r343287) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #define PFIOC_USE_LATEST #include +#include #include #include @@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,33 +55,40 @@ __FBSDID("$FreeBSD$"); #define is_sc_null(sc) (((sc) == NULL) || ((sc)->m1 == 0 && (sc)->m2 == 0)) -static TAILQ_HEAD(altqs, pf_altq) altqs = TAILQ_HEAD_INITIALIZER(altqs); -static LIST_HEAD(gen_sc, segment) rtsc, lssc; +static STAILQ_HEAD(interfaces, pfctl_altq) interfaces = STAILQ_HEAD_INITIALIZER(interfaces); +static struct hsearch_data queue_map; +static struct hsearch_data if_map; +static struct hsearch_data qid_map; -struct pf_altq *qname_to_pfaltq(const char *, const char *); -u_int32_t qname_to_qid(const char *); +static struct pfctl_altq *pfaltq_lookup(char *ifname); +static struct pfctl_altq *qname_to_pfaltq(const char *, const char *); +static u_int32_t qname_to_qid(char *); -static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *); +static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *); static int cbq_compute_idletime(struct pfctl *, struct pf_altq *); -static int check_commit_cbq(int, int, struct pf_altq *); +static int check_commit_cbq(int, int, struct pfctl_altq *); static int print_cbq_opts(const struct pf_altq *); static int print_codel_opts(const struct pf_altq *, const struct node_queue_opt *); -static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *); -static int check_commit_priq(int, int, struct pf_altq *); +static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *); +static int check_commit_priq(int, int, struct pfctl_altq *); static int print_priq_opts(const struct pf_altq *); -static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *); -static int check_commit_hfsc(int, int, struct pf_altq *); +static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *, + struct pfctl_altq *, struct pfctl_altq *); +static int check_commit_hfsc(int, int, struct pfctl_altq *); static int print_hfsc_opts(const struct pf_altq *, const struct node_queue_opt *); -static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *); +static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *, struct pfctl_altq *); static int print_fairq_opts(const struct pf_altq *, const struct node_queue_opt *); -static int check_commit_fairq(int, int, struct pf_altq *); +static int check_commit_fairq(int, int, struct pfctl_altq *); static void gsc_add_sc(struct gen_sc *, struct service_curve *); static int is_gsc_under_sc(struct gen_sc *, @@ -104,59 +113,101 @@ void print_hfsc_sc(const char *, u_int, u_int, u_int void print_fairq_sc(const char *, u_int, u_int, u_int, const struct node_fairq_sc *); +static __attribute__((constructor)) void +pfctl_altq_init(void) +{ + /* + * As hdestroy() will never be called on these tables, it will be + * safe to use references into the stored data as keys. + */ + if (hcreate_r(0, &queue_map) == 0) + err(1, "Failed to create altq queue map"); + if (hcreate_r(0, &if_map) == 0) + err(1, "Failed to create altq interface map"); + if (hcreate_r(0, &qid_map) == 0) + err(1, "Failed to create altq queue id map"); +} + void pfaltq_store(struct pf_altq *a) { - struct pf_altq *altq; - + struct pfctl_altq *altq; + ENTRY item; + ENTRY *ret_item; + size_t key_size; + if ((altq = malloc(sizeof(*altq))) == NULL) - err(1, "malloc"); - memcpy(altq, a, sizeof(struct pf_altq)); - TAILQ_INSERT_TAIL(&altqs, altq, entries); + err(1, "queue malloc"); + memcpy(&altq->pa, a, sizeof(struct pf_altq)); + memset(&altq->meta, 0, sizeof(altq->meta)); + + if (a->qname[0] == 0) { + item.key = altq->pa.ifname; + item.data = altq; + if (hsearch_r(item, ENTER, &ret_item, &if_map) == 0) + err(1, "interface map insert"); + STAILQ_INSERT_TAIL(&interfaces, altq, meta.link); + } else { + key_size = sizeof(a->ifname) + sizeof(a->qname); + if ((item.key = malloc(key_size)) == NULL) + err(1, "queue map key malloc"); + snprintf(item.key, key_size, "%s:%s", a->ifname, a->qname); + item.data = altq; + if (hsearch_r(item, ENTER, &ret_item, &queue_map) == 0) + err(1, "queue map insert"); + + item.key = altq->pa.qname; + item.data = &altq->pa.qid; + if (hsearch_r(item, ENTER, &ret_item, &qid_map) == 0) + err(1, "qid map insert"); + } } -struct pf_altq * -pfaltq_lookup(const char *ifname) +static struct pfctl_altq * +pfaltq_lookup(char *ifname) { - struct pf_altq *altq; + ENTRY item; + ENTRY *ret_item; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(ifname, altq->ifname, IFNAMSIZ) == 0 && - altq->qname[0] == 0) - return (altq); - } - return (NULL); + item.key = ifname; + if (hsearch_r(item, FIND, &ret_item, &if_map) == 0) + return (NULL); + + return (ret_item->data); } -struct pf_altq * +static struct pfctl_altq * qname_to_pfaltq(const char *qname, const char *ifname) { - struct pf_altq *altq; + ENTRY item; + ENTRY *ret_item; + char key[IFNAMSIZ + PF_QNAME_SIZE]; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(ifname, altq->ifname, IFNAMSIZ) == 0 && - strncmp(qname, altq->qname, PF_QNAME_SIZE) == 0) - return (altq); - } - return (NULL); + item.key = key; + snprintf(item.key, sizeof(key), "%s:%s", ifname, qname); + if (hsearch_r(item, FIND, &ret_item, &queue_map) == 0) + return (NULL); + + return (ret_item->data); } -u_int32_t -qname_to_qid(const char *qname) +static u_int32_t +qname_to_qid(char *qname) { - struct pf_altq *altq; - + ENTRY item; + ENTRY *ret_item; + uint32_t qid; + /* * We guarantee that same named queues on different interfaces - * have the same qid, so we do NOT need to limit matching on - * one interface! + * have the same qid. */ + item.key = qname; + if (hsearch_r(item, FIND, &ret_item, &qid_map) == 0) + return (0); - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(qname, altq->qname, PF_QNAME_SIZE) == 0) - return (altq->qid); - } - return (0); + qid = *(uint32_t *)ret_item->data; + return (qid); } void @@ -315,28 +366,26 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, stru int check_commit_altq(int dev, int opts) { - struct pf_altq *altq; - int error = 0; + struct pfctl_altq *if_ppa; + int error = 0; /* call the discipline check for each interface. */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (altq->qname[0] == 0) { - switch (altq->scheduler) { - case ALTQT_CBQ: - error = check_commit_cbq(dev, opts, altq); - break; - case ALTQT_PRIQ: - error = check_commit_priq(dev, opts, altq); - break; - case ALTQT_HFSC: - error = check_commit_hfsc(dev, opts, altq); - break; - case ALTQT_FAIRQ: - error = check_commit_fairq(dev, opts, altq); - break; - default: - break; - } + STAILQ_FOREACH(if_ppa, &interfaces, meta.link) { + switch (if_ppa->pa.scheduler) { + case ALTQT_CBQ: + error = check_commit_cbq(dev, opts, if_ppa); + break; + case ALTQT_PRIQ: + error = check_commit_priq(dev, opts, if_ppa); + break; + case ALTQT_HFSC: + error = check_commit_hfsc(dev, opts, if_ppa); + break; + case ALTQT_FAIRQ: + error = check_commit_fairq(dev, opts, if_ppa); + break; + default: + break; } } return (error); @@ -350,17 +399,16 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str struct node_queue_opt *opts) { /* should be merged with expand_queue */ - struct pf_altq *if_pa, *parent, *altq; - u_int64_t bwsum; - int error = 0; + struct pfctl_altq *if_ppa, *parent; + int error = 0; /* find the corresponding interface and copy fields used by queues */ - if ((if_pa = pfaltq_lookup(pa->ifname)) == NULL) { + if ((if_ppa = pfaltq_lookup(pa->ifname)) == NULL) { fprintf(stderr, "altq not defined on %s\n", pa->ifname); return (1); } - pa->scheduler = if_pa->scheduler; - pa->ifbandwidth = if_pa->ifbandwidth; + pa->scheduler = if_ppa->pa.scheduler; + pa->ifbandwidth = if_ppa->pa.ifbandwidth; if (qname_to_pfaltq(pa->qname, pa->ifname) != NULL) { fprintf(stderr, "queue %s already exists on interface %s\n", @@ -377,16 +425,32 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str pa->parent, pa->qname); return (1); } - pa->parent_qid = parent->qid; + pa->parent_qid = parent->pa.qid; } if (pa->qlimit == 0) pa->qlimit = DEFAULT_QLIMIT; + if (eval_queue_opts(pa, opts, + parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth)) + return (1); + if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC || pa->scheduler == ALTQT_FAIRQ) { pa->bandwidth = eval_bwspec(bw, - parent == NULL ? pa->ifbandwidth : parent->bandwidth); + parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth); + /* + * For HFSC, if the linkshare service curve m2 parameter is + * set, it overrides the provided queue bandwidth parameter, + * so adjust the queue bandwidth parameter accordingly here + * to avoid false positives in the total child bandwidth + * check below. + */ + if ((pa->scheduler == ALTQT_HFSC) && + (pa->pq_u.hfsc_opts.lssc_m2 != 0)) { + pa->bandwidth = pa->pq_u.hfsc_opts.lssc_m2; + } + if (pa->bandwidth > pa->ifbandwidth) { fprintf(stderr, "bandwidth for %s higher than " "interface\n", pa->qname); @@ -394,44 +458,36 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str } /* check the sum of the child bandwidth is under parent's */ if (parent != NULL) { - if (pa->bandwidth > parent->bandwidth) { + if (pa->bandwidth > parent->pa.bandwidth) { warnx("bandwidth for %s higher than parent", pa->qname); return (1); } - bwsum = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, - IFNAMSIZ) == 0 && - altq->qname[0] != 0 && - strncmp(altq->parent, pa->parent, - PF_QNAME_SIZE) == 0) - bwsum += altq->bandwidth; + parent->meta.bwsum += pa->bandwidth; + if (parent->meta.bwsum > parent->pa.bandwidth) { + warnx("the sum of the child bandwidth (%" PRIu64 + ") higher than parent \"%s\" (%" PRIu64 ")", + parent->meta.bwsum, parent->pa.qname, + parent->pa.bandwidth); } - bwsum += pa->bandwidth; - if (bwsum > parent->bandwidth) { - warnx("the sum of the child bandwidth higher" - " than parent \"%s\"", parent->qname); - } } } - if (eval_queue_opts(pa, opts, - parent == NULL ? pa->ifbandwidth : parent->bandwidth)) - return (1); - + if (parent != NULL) + parent->meta.children++; + switch (pa->scheduler) { case ALTQT_CBQ: - error = eval_pfqueue_cbq(pf, pa); + error = eval_pfqueue_cbq(pf, pa, if_ppa); break; case ALTQT_PRIQ: - error = eval_pfqueue_priq(pf, pa); + error = eval_pfqueue_priq(pf, pa, if_ppa); break; case ALTQT_HFSC: - error = eval_pfqueue_hfsc(pf, pa); + error = eval_pfqueue_hfsc(pf, pa, if_ppa, parent); break; case ALTQT_FAIRQ: - error = eval_pfqueue_fairq(pf, pa); + error = eval_pfqueue_fairq(pf, pa, if_ppa, parent); break; default: break; @@ -446,7 +502,7 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str #define RM_NS_PER_SEC (1000000000) static int -eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) { struct cbq_opts *opts; u_int ifmtu; @@ -476,6 +532,11 @@ eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa) if (pa->parent[0] == 0) opts->flags |= (CBQCLF_ROOTCLASS | CBQCLF_WRR); + if (pa->pq_u.cbq_opts.flags & CBQCLF_ROOTCLASS) + if_ppa->meta.root_classes++; + if (pa->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) + if_ppa->meta.default_classes++; + cbq_compute_idletime(pf, pa); return (0); } @@ -568,33 +629,20 @@ cbq_compute_idletime(struct pfctl *pf, struct pf_altq } static int -check_commit_cbq(int dev, int opts, struct pf_altq *pa) +check_commit_cbq(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; - int root_class, default_class; - int error = 0; + int error = 0; /* * check if cbq has one root queue and one default queue * for this interface */ - root_class = default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.cbq_opts.flags & CBQCLF_ROOTCLASS) - root_class++; - if (altq->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) - default_class++; - } - if (root_class != 1) { - warnx("should have one root queue on %s", pa->ifname); + if (if_ppa->meta.root_classes != 1) { + warnx("should have one root queue on %s", if_ppa->pa.ifname); error++; } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); error++; } return (error); @@ -641,51 +689,37 @@ print_cbq_opts(const struct pf_altq *a) * PRIQ support functions */ static int -eval_pfqueue_priq(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_priq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; if (pa->priority >= PRIQ_MAXPRI) { warnx("priority out of range: max %d", PRIQ_MAXPRI - 1); return (-1); } - /* the priority should be unique for the interface */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) == 0 && - altq->qname[0] != 0 && altq->priority == pa->priority) { - warnx("%s and %s have the same priority", - altq->qname, pa->qname); - return (-1); - } - } + if (BIT_ISSET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris)) { + warnx("%s does not have a unique priority on interface %s", + pa->qname, pa->ifname); + return (-1); + } else + BIT_SET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris); + if (pa->pq_u.priq_opts.flags & PRCF_DEFAULTCLASS) + if_ppa->meta.default_classes++; return (0); } static int -check_commit_priq(int dev, int opts, struct pf_altq *pa) +check_commit_priq(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; - int default_class; - int error = 0; /* * check if priq has one default class for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.priq_opts.flags & PRCF_DEFAULTCLASS) - default_class++; + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); + return (1); } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); - error++; - } - return (error); + return (0); } static int @@ -720,15 +754,15 @@ print_priq_opts(const struct pf_altq *a) * HFSC support functions */ static int -eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa, + struct pfctl_altq *parent) { - struct pf_altq *altq, *parent; struct hfsc_opts_v1 *opts; struct service_curve sc; opts = &pa->pq_u.hfsc_opts; - if (pa->parent[0] == 0) { + if (parent == NULL) { /* root queue */ opts->lssc_m1 = pa->ifbandwidth; opts->lssc_m2 = pa->ifbandwidth; @@ -736,9 +770,21 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa return (0); } - LIST_INIT(&rtsc); - LIST_INIT(&lssc); + /* First child initializes the parent's service curve accumulators. */ + if (parent->meta.children == 1) { + LIST_INIT(&parent->meta.rtsc); + LIST_INIT(&parent->meta.lssc); + } + if (parent->pa.pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) { + warnx("adding %s would make default queue %s not a leaf", + pa->qname, pa->parent); + return (-1); + } + + if (pa->pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) + if_ppa->meta.default_classes++; + /* if link_share is not specified, use bandwidth */ if (opts->lssc_m2 == 0) opts->lssc_m2 = pa->bandwidth; @@ -768,51 +814,22 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa * be smaller than the interface bandwidth, and the upper-limit should * be larger than the real-time service curve when both are defined. */ - parent = qname_to_pfaltq(pa->parent, pa->ifname); - if (parent == NULL) - errx(1, "parent %s not found for %s", pa->parent, pa->qname); - - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - - /* if the class has a real-time service curve, add it. */ - if (opts->rtsc_m2 != 0 && altq->pq_u.hfsc_opts.rtsc_m2 != 0) { - sc.m1 = altq->pq_u.hfsc_opts.rtsc_m1; - sc.d = altq->pq_u.hfsc_opts.rtsc_d; - sc.m2 = altq->pq_u.hfsc_opts.rtsc_m2; - gsc_add_sc(&rtsc, &sc); - } - - if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0) - continue; - - /* if the class has a linkshare service curve, add it. */ - if (opts->lssc_m2 != 0 && altq->pq_u.hfsc_opts.lssc_m2 != 0) { - sc.m1 = altq->pq_u.hfsc_opts.lssc_m1; - sc.d = altq->pq_u.hfsc_opts.lssc_d; - sc.m2 = altq->pq_u.hfsc_opts.lssc_m2; - gsc_add_sc(&lssc, &sc); - } - } - + /* check the real-time service curve. reserve 20% of interface bw */ if (opts->rtsc_m2 != 0) { /* add this queue to the sum */ sc.m1 = opts->rtsc_m1; sc.d = opts->rtsc_d; sc.m2 = opts->rtsc_m2; - gsc_add_sc(&rtsc, &sc); + gsc_add_sc(&parent->meta.rtsc, &sc); /* compare the sum with 80% of the interface */ sc.m1 = 0; sc.d = 0; sc.m2 = pa->ifbandwidth / 100 * 80; - if (!is_gsc_under_sc(&rtsc, &sc)) { + if (!is_gsc_under_sc(&parent->meta.rtsc, &sc)) { warnx("real-time sc exceeds 80%% of the interface " "bandwidth (%s)", rate2str((double)sc.m2)); - goto err_ret; + return (-1); } } @@ -822,14 +839,14 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa sc.m1 = opts->lssc_m1; sc.d = opts->lssc_d; sc.m2 = opts->lssc_m2; - gsc_add_sc(&lssc, &sc); + gsc_add_sc(&parent->meta.lssc, &sc); /* compare the sum of the children with parent's sc */ - sc.m1 = parent->pq_u.hfsc_opts.lssc_m1; - sc.d = parent->pq_u.hfsc_opts.lssc_d; - sc.m2 = parent->pq_u.hfsc_opts.lssc_m2; - if (!is_gsc_under_sc(&lssc, &sc)) { + sc.m1 = parent->pa.pq_u.hfsc_opts.lssc_m1; + sc.d = parent->pa.pq_u.hfsc_opts.lssc_d; + sc.m2 = parent->pa.pq_u.hfsc_opts.lssc_m2; + if (!is_gsc_under_sc(&parent->meta.lssc, &sc)) { warnx("linkshare sc exceeds parent's sc"); - goto err_ret; + return (-1); } } @@ -838,38 +855,30 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa if (opts->ulsc_m1 > pa->ifbandwidth || opts->ulsc_m2 > pa->ifbandwidth) { warnx("upper-limit larger than interface bandwidth"); - goto err_ret; + return (-1); } if (opts->rtsc_m2 != 0 && opts->rtsc_m2 > opts->ulsc_m2) { warnx("upper-limit sc smaller than real-time sc"); - goto err_ret; + return (-1); } } - gsc_destroy(&rtsc); - gsc_destroy(&lssc); - return (0); - -err_ret: - gsc_destroy(&rtsc); - gsc_destroy(&lssc); - return (-1); } /* * FAIRQ support functions */ static int -eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa) +eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa, + struct pfctl_altq *if_ppa, struct pfctl_altq *parent) { - struct pf_altq *altq, *parent; struct fairq_opts *opts; struct service_curve sc; opts = &pa->pq_u.fairq_opts; - if (pa->parent[0] == 0) { + if (pa->parent == NULL) { /* root queue */ opts->lssc_m1 = pa->ifbandwidth; opts->lssc_m2 = pa->ifbandwidth; @@ -877,8 +886,19 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct p return (0); } - LIST_INIT(&lssc); + /* First child initializes the parent's service curve accumulator. */ + if (parent->meta.children == 1) + LIST_INIT(&parent->meta.lssc); + if (parent->pa.pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { + warnx("adding %s would make default queue %s not a leaf", + pa->qname, pa->parent); + return (-1); + } + + if (pa->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) + if_ppa->meta.default_classes++; + /* if link_share is not specified, use bandwidth */ if (opts->lssc_m2 == 0) opts->lssc_m2 = pa->bandwidth; @@ -894,122 +914,49 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct p * be smaller than the interface bandwidth, and the upper-limit should * be larger than the real-time service curve when both are defined. */ - parent = qname_to_pfaltq(pa->parent, pa->ifname); - if (parent == NULL) - errx(1, "parent %s not found for %s", pa->parent, pa->qname); - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - - if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0) - continue; - - /* if the class has a link-sharing service curve, add it. */ - if (opts->lssc_m2 != 0 && altq->pq_u.fairq_opts.lssc_m2 != 0) { - sc.m1 = altq->pq_u.fairq_opts.lssc_m1; - sc.d = altq->pq_u.fairq_opts.lssc_d; - sc.m2 = altq->pq_u.fairq_opts.lssc_m2; - gsc_add_sc(&lssc, &sc); - } - } - - /* check the link-sharing service curve. */ + /* check the linkshare service curve. */ if (opts->lssc_m2 != 0) { - sc.m1 = parent->pq_u.fairq_opts.lssc_m1; - sc.d = parent->pq_u.fairq_opts.lssc_d; - sc.m2 = parent->pq_u.fairq_opts.lssc_m2; - if (!is_gsc_under_sc(&lssc, &sc)) { + /* add this queue to the child sum */ + sc.m1 = opts->lssc_m1; + sc.d = opts->lssc_d; + sc.m2 = opts->lssc_m2; + gsc_add_sc(&parent->meta.lssc, &sc); + /* compare the sum of the children with parent's sc */ + sc.m1 = parent->pa.pq_u.fairq_opts.lssc_m1; + sc.d = parent->pa.pq_u.fairq_opts.lssc_d; + sc.m2 = parent->pa.pq_u.fairq_opts.lssc_m2; + if (!is_gsc_under_sc(&parent->meta.lssc, &sc)) { warnx("link-sharing sc exceeds parent's sc"); - goto err_ret; + return (-1); } } - gsc_destroy(&lssc); - return (0); - -err_ret: - gsc_destroy(&lssc); - return (-1); } static int -check_commit_hfsc(int dev, int opts, struct pf_altq *pa) +check_commit_hfsc(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq, *def = NULL; - int default_class; - int error = 0; /* check if hfsc has one default queue for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->parent[0] == 0) /* dummy root */ - continue; - if (altq->pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) { - default_class++; - def = altq; - } - } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); return (1); } - /* make sure the default queue is a leaf */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) { - warnx("default queue is not a leaf"); - error++; - } - } - return (error); + return (0); } static int -check_commit_fairq(int dev __unused, int opts __unused, struct pf_altq *pa) +check_commit_fairq(int dev __unused, int opts __unused, struct pfctl_altq *if_ppa) { - struct pf_altq *altq, *def = NULL; - int default_class; - int error = 0; /* check if fairq has one default queue for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { - default_class++; - def = altq; - } - } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); return (1); } - /* make sure the default queue is a leaf */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) { - warnx("default queue is not a leaf"); - error++; - } - } - return (error); + return (0); } static int @@ -1351,8 +1298,7 @@ getifspeed(char *ifname) struct ifreq ifr; struct if_data ifrdat; - if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) - err(1, "socket"); + s = get_query_socket(); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) @@ -1360,8 +1306,6 @@ getifspeed(char *ifname) ifr.ifr_data = (caddr_t)&ifrdat; if (ioctl(s, SIOCGIFDATA, (caddr_t)&ifr) == -1) err(1, "SIOCGIFDATA"); - if (close(s)) - err(1, "close"); return ((u_int32_t)ifrdat.ifi_baudrate); } #endif @@ -1372,8 +1316,7 @@ getifmtu(char *ifname) int s; struct ifreq ifr; - if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) - err(1, "socket"); + s = get_query_socket(); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) @@ -1384,8 +1327,6 @@ getifmtu(char *ifname) #else err(1, "SIOCGIFMTU"); #endif - if (close(s)) - err(1, "close"); if (ifr.ifr_mtu > 0) return (ifr.ifr_mtu); else { Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl_parser.c Tue Jan 22 00:50:24 2019 (r343287) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -72,7 +73,6 @@ void print_fromto(struct pf_rule_addr *, pf_osfp_t, struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); -struct node_host *ifa_grouplookup(const char *, int); struct node_host *host_if(const char *, int); struct node_host *host_v4(const char *, int); struct node_host *host_v6(const char *, int); @@ -209,6 +209,19 @@ const struct pf_timeout pf_timeouts[] = { { NULL, 0 } }; +static struct hsearch_data isgroup_map; + +static __attribute__((constructor)) void +pfctl_parser_init(void) +{ + /* + * As hdestroy() will never be called on these tables, it will be + * safe to use references into the stored data as keys. + */ + if (hcreate_r(0, &isgroup_map) == 0) + err(1, "Failed to create interface group query response map"); +} + const struct icmptypeent * geticmptypebynumber(u_int8_t type, sa_family_t af) { @@ -1153,6 +1166,71 @@ check_netmask(struct node_host *h, sa_family_t af) static struct node_host *iftab; +/* + * Retrieve the list of groups this interface is a member of and make sure + * each group is in the group map. + */ +static void +ifa_add_groups_to_map(char *ifa_name) +{ + int s, len; + struct ifgroupreq ifgr; + struct ifg_req *ifg; + + s = get_query_socket(); + + /* Get size of group list for this interface */ + memset(&ifgr, 0, sizeof(ifgr)); + strlcpy(ifgr.ifgr_name, ifa_name, IFNAMSIZ); + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + err(1, "SIOCGIFGROUP"); + + /* Retrieve group list for this interface */ + len = ifgr.ifgr_len; + ifgr.ifgr_groups = + (struct ifg_req *)calloc(len / sizeof(struct ifg_req), + sizeof(struct ifg_req)); + if (ifgr.ifgr_groups == NULL) + err(1, "calloc"); + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + err(1, "SIOCGIFGROUP"); + + ifg = ifgr.ifgr_groups; + for (; ifg && len >= sizeof(struct ifg_req); ifg++) { + len -= sizeof(struct ifg_req); + if (strcmp(ifg->ifgrq_group, "all")) { + ENTRY item; + ENTRY *ret_item; + int *answer; + + item.key = ifg->ifgrq_group; + if (hsearch_r(item, FIND, &ret_item, &isgroup_map) == 0) { + struct ifgroupreq ifgr2; + + /* Don't know the answer yet */ + if ((answer = malloc(sizeof(int))) == NULL) + err(1, "malloc"); + + bzero(&ifgr2, sizeof(ifgr2)); + strlcpy(ifgr2.ifgr_name, ifg->ifgrq_group, + sizeof(ifgr2.ifgr_name)); + if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr2) == 0) + *answer = ifgr2.ifgr_len; + else + *answer = 0; + + item.key = strdup(ifg->ifgrq_group); + item.data = answer; + if (hsearch_r(item, ENTER, &ret_item, + &isgroup_map) == 0) + err(1, "interface group query response" + " map insert"); + } + } + } + free(ifgr.ifgr_groups); +} + void ifa_load(void) { @@ -1220,6 +1298,8 @@ ifa_load(void) sizeof(struct in6_addr)); n->ifindex = ((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_scope_id; + } else if (n->af == AF_LINK) { + ifa_add_groups_to_map(ifa->ifa_name); } if ((n->ifname = strdup(ifa->ifa_name)) == NULL) err(1, "ifa_load: strdup"); @@ -1237,7 +1317,7 @@ ifa_load(void) freeifaddrs(ifap); } -int +static int get_socket_domain(void) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 22 00:56:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93A201490C03; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@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 382BA8AE4C; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C8A721807; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M0ujER017680; Tue, 22 Jan 2019 00:56:45 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M0ujpf017679; Tue, 22 Jan 2019 00:56:45 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220056.x0M0ujpf017679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 00:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343288 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 382BA8AE4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 00:56:45 -0000 Author: pkelsey Date: Tue Jan 22 00:56:44 2019 New Revision: 343288 URL: https://svnweb.freebsd.org/changeset/base/343288 Log: Fix various resource leaks that can occur in the error paths of iflib_device_register() and iflib_pseudo_register(). Reviewed by: shurd MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18760 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jan 22 00:50:24 2019 (r343287) +++ head/sys/net/iflib.c Tue Jan 22 00:56:44 2019 (r343288) @@ -4368,11 +4368,8 @@ iflib_device_register(device_t dev, void *sc, if_share ctx->ifc_softc = sc; if ((err = iflib_register(ctx)) != 0) { - if (ctx->ifc_flags & IFC_SC_ALLOCATED) - free(sc, M_IFLIB); - free(ctx, M_IFLIB); device_printf(dev, "iflib_register failed %d\n", err); - return (err); + goto fail_ctx_free; } iflib_add_device_sysctl_pre(ctx); @@ -4382,9 +4379,8 @@ iflib_device_register(device_t dev, void *sc, if_share iflib_reset_qvalues(ctx); CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { - CTX_UNLOCK(ctx); device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); - return (err); + goto fail_unlock; } _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; @@ -4414,7 +4410,7 @@ iflib_device_register(device_t dev, void *sc, if_share /* round down instead? */ device_printf(dev, "# rx descriptors must be a power of 2\n"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4422,7 +4418,7 @@ iflib_device_register(device_t dev, void *sc, if_share device_printf(dev, "# tx descriptors must be a power of 2"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } @@ -4492,7 +4488,7 @@ iflib_device_register(device_t dev, void *sc, if_share /* Get memory for the station queues */ if ((err = iflib_queues_alloc(ctx))) { device_printf(dev, "Unable to allocate queue memory\n"); - goto fail; + goto fail_intr_free; } if ((err = iflib_qset_structures_setup(ctx))) @@ -4511,7 +4507,7 @@ iflib_device_register(device_t dev, void *sc, if_share IFDI_INTR_DISABLE(ctx); if (msix > 1 && (err = IFDI_MSIX_INTR_ASSIGN(ctx, msix)) != 0) { device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", err); - goto fail_intr_free; + goto fail_queues; } if (msix <= 1) { rid = 0; @@ -4521,7 +4517,7 @@ iflib_device_register(device_t dev, void *sc, if_share } if ((err = iflib_legacy_setup(ctx, ctx->isc_legacy_intr, ctx->ifc_softc, &rid, "irq0")) != 0) { device_printf(dev, "iflib_legacy_setup failed %d\n", err); - goto fail_intr_free; + goto fail_queues; } } @@ -4557,14 +4553,18 @@ iflib_device_register(device_t dev, void *sc, if_share fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_intr_free: + iflib_free_intr_mem(ctx); fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail: - iflib_free_intr_mem(ctx); +fail_iflib_detach: IFDI_DETACH(ctx); +fail_unlock: CTX_UNLOCK(ctx); - +fail_ctx_free: + if (ctx->ifc_flags & IFC_SC_ALLOCATED) + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } @@ -4593,9 +4593,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if ((err = iflib_register(ctx)) != 0) { device_printf(dev, "%s: iflib_register failed %d\n", __func__, err); - free(sc, M_IFLIB); - free(ctx, M_IFLIB); - return (err); + goto fail_ctx_free; } iflib_add_device_sysctl_pre(ctx); @@ -4609,14 +4607,14 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); - return (err); + goto fail_ctx_free; } if (sctx->isc_flags & IFLIB_GEN_MAC) iflib_gen_mac(ctx); if ((err = IFDI_CLONEATTACH(ctx, clctx->cc_ifc, clctx->cc_name, clctx->cc_params)) != 0) { device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err); - return (err); + goto fail_ctx_free; } ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -4674,7 +4672,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* round down instead? */ device_printf(dev, "# rx descriptors must be a power of 2\n"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4682,7 +4680,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc device_printf(dev, "# tx descriptors must be a power of 2"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } @@ -4728,7 +4726,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* Get memory for the station queues */ if ((err = iflib_queues_alloc(ctx))) { device_printf(dev, "Unable to allocate queue memory\n"); - goto fail; + goto fail_iflib_detach; } if ((err = iflib_qset_structures_setup(ctx))) { @@ -4768,8 +4766,11 @@ fail_detach: fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail: +fail_iflib_detach: IFDI_DETACH(ctx); +fail_ctx_free: + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } From owner-svn-src-all@freebsd.org Tue Jan 22 01:07:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE7D41490FEC; Tue, 22 Jan 2019 01:07:19 +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 5F4978B3EE; Tue, 22 Jan 2019 01:07:19 +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 52E93219C7; Tue, 22 Jan 2019 01:07:19 +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 x0M17Jxg023220; Tue, 22 Jan 2019 01:07:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M17Jve023219; Tue, 22 Jan 2019 01:07:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220107.x0M17Jve023219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 01:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343289 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 343289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F4978B3EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:07:19 -0000 Author: kp Date: Tue Jan 22 01:07:18 2019 New Revision: 343289 URL: https://svnweb.freebsd.org/changeset/base/343289 Log: MFC r343041 pf: silence a runtime warning Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'. This warning does not clarify anything for users, so silence it, just as OpenBSD has. PR: 234874 Modified: stable/12/sys/netpfil/pf/pf_table.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_table.c Tue Jan 22 00:56:44 2019 (r343288) +++ stable/12/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:18 2019 (r343289) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x + #define ACCEPT_FLAGS(flags, oklist) \ do { \ if ((flags & ~(oklist)) & \ @@ -1992,7 +1994,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) - printf("pfr_update_stats: assertion failed.\n"); + DPFPRINTF(PF_DEBUG_URGENT, + ("pfr_update_stats: assertion failed.\n")); op_pass = PFR_OP_XPASS; } kt->pfrkt_packets[dir_out][op_pass]++; From owner-svn-src-all@freebsd.org Tue Jan 22 01:07:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B221490FF6; Tue, 22 Jan 2019 01:07:21 +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 BFD758B3F2; Tue, 22 Jan 2019 01:07:20 +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 B3290219C9; Tue, 22 Jan 2019 01:07:20 +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 x0M17KXc023278; Tue, 22 Jan 2019 01:07:20 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M17K7A023277; Tue, 22 Jan 2019 01:07:20 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220107.x0M17K7A023277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 01:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343290 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 343290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFD758B3F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:07:21 -0000 Author: kp Date: Tue Jan 22 01:07:20 2019 New Revision: 343290 URL: https://svnweb.freebsd.org/changeset/base/343290 Log: MFC r343041 pf: silence a runtime warning Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'. This warning does not clarify anything for users, so silence it, just as OpenBSD has. PR: 234874 Modified: stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:18 2019 (r343289) +++ stable/11/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:20 2019 (r343290) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x + #define ACCEPT_FLAGS(flags, oklist) \ do { \ if ((flags & ~(oklist)) & \ @@ -1985,7 +1987,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) - printf("pfr_update_stats: assertion failed.\n"); + DPFPRINTF(PF_DEBUG_URGENT, + ("pfr_update_stats: assertion failed.\n")); op_pass = PFR_OP_XPASS; } kt->pfrkt_packets[dir_out][op_pass]++; From owner-svn-src-all@freebsd.org Tue Jan 22 01:11:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC4D1491BF8; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@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 22B118BC75; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 161D221A96; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M1BHvD025065; Tue, 22 Jan 2019 01:11:17 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M1BHS1025063; Tue, 22 Jan 2019 01:11:17 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220111.x0M1BHS1025063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 01:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: in head/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 343291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22B118BC75 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:11:19 -0000 Author: pkelsey Date: Tue Jan 22 01:11:17 2019 New Revision: 343291 URL: https://svnweb.freebsd.org/changeset/base/343291 Log: onvert vmx(4) to being an iflib driver. Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add iflib_dma_alloc_align() to the iflib API. Performance is generally better with the tunable/sysctl dev.vmx..iflib.tx_abdicate=1. Reviewed by: shurd MFC after: 1 week Relnotes: yes Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18761 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Tue Jan 22 01:07:20 2019 (r343290) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Tue Jan 22 01:11:17 2019 (r343291) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2013 Tsubai Masanari * Copyright (c) 2013 Bryan Venteicher + * Copyright (c) 2018 Patrick Kelsey * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -24,7 +25,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -46,9 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -#include - #include #include #include @@ -57,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -67,139 +63,95 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ifdi_if.h" + #include "if_vmxreg.h" #include "if_vmxvar.h" #include "opt_inet.h" #include "opt_inet6.h" -#ifdef VMXNET3_FAILPOINTS -#include -static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0, - "vmxnet3 fail points"); -#define VMXNET3_FP _debug_fail_point_vmxnet3 -#endif -static int vmxnet3_probe(device_t); -static int vmxnet3_attach(device_t); -static int vmxnet3_detach(device_t); -static int vmxnet3_shutdown(device_t); +#define VMXNET3_VMWARE_VENDOR_ID 0x15AD +#define VMXNET3_VMWARE_DEVICE_ID 0x07B0 +static pci_vendor_info_t vmxnet3_vendor_info_array[] = +{ + PVID(VMXNET3_VMWARE_VENDOR_ID, VMXNET3_VMWARE_DEVICE_ID, "VMware VMXNET3 Ethernet Adapter"), + /* required last entry */ + PVID_END +}; + +static void *vmxnet3_register(device_t); +static int vmxnet3_attach_pre(if_ctx_t); +static int vmxnet3_msix_intr_assign(if_ctx_t, int); +static void vmxnet3_free_irqs(struct vmxnet3_softc *); +static int vmxnet3_attach_post(if_ctx_t); +static int vmxnet3_detach(if_ctx_t); +static int vmxnet3_shutdown(if_ctx_t); +static int vmxnet3_suspend(if_ctx_t); +static int vmxnet3_resume(if_ctx_t); + static int vmxnet3_alloc_resources(struct vmxnet3_softc *); static void vmxnet3_free_resources(struct vmxnet3_softc *); static int vmxnet3_check_version(struct vmxnet3_softc *); -static void vmxnet3_initial_config(struct vmxnet3_softc *); -static void vmxnet3_check_multiqueue(struct vmxnet3_softc *); +static void vmxnet3_set_interrupt_idx(struct vmxnet3_softc *); -static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_interrupt(struct vmxnet3_softc *, int, int, - struct vmxnet3_interrupt *); -static int vmxnet3_alloc_intr_resources(struct vmxnet3_softc *); -static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *); -static int vmxnet3_setup_legacy_interrupt(struct vmxnet3_softc *); -static int vmxnet3_setup_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_interrupts(struct vmxnet3_softc *); +static int vmxnet3_queues_shared_alloc(struct vmxnet3_softc *); +static void vmxnet3_init_txq(struct vmxnet3_softc *, int); +static int vmxnet3_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static void vmxnet3_init_rxq(struct vmxnet3_softc *, int, int); +static int vmxnet3_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static void vmxnet3_queues_free(if_ctx_t); -static void vmxnet3_free_interrupt(struct vmxnet3_softc *, - struct vmxnet3_interrupt *); -static void vmxnet3_free_interrupts(struct vmxnet3_softc *); - -#ifndef VMXNET3_LEGACY_TX -static int vmxnet3_alloc_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_start_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_drain_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_free_taskqueue(struct vmxnet3_softc *); -#endif - -static int vmxnet3_init_rxq(struct vmxnet3_softc *, int); -static int vmxnet3_init_txq(struct vmxnet3_softc *, int); -static int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *); -static void vmxnet3_destroy_rxq(struct vmxnet3_rxqueue *); -static void vmxnet3_destroy_txq(struct vmxnet3_txqueue *); -static void vmxnet3_free_rxtx_queues(struct vmxnet3_softc *); - static int vmxnet3_alloc_shared_data(struct vmxnet3_softc *); static void vmxnet3_free_shared_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_txq_data(struct vmxnet3_softc *); -static void vmxnet3_free_txq_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_rxq_data(struct vmxnet3_softc *); -static void vmxnet3_free_rxq_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_queue_data(struct vmxnet3_softc *); -static void vmxnet3_free_queue_data(struct vmxnet3_softc *); static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *); +static void vmxnet3_free_mcast_table(struct vmxnet3_softc *); static void vmxnet3_init_shared_data(struct vmxnet3_softc *); -static void vmxnet3_init_hwassist(struct vmxnet3_softc *); -static void vmxnet3_reinit_interface(struct vmxnet3_softc *); static void vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *); static int vmxnet3_alloc_data(struct vmxnet3_softc *); static void vmxnet3_free_data(struct vmxnet3_softc *); -static int vmxnet3_setup_interface(struct vmxnet3_softc *); static void vmxnet3_evintr(struct vmxnet3_softc *); -static void vmxnet3_txq_eof(struct vmxnet3_txqueue *); -static void vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *, struct mbuf *); -static int vmxnet3_newbuf(struct vmxnet3_softc *, struct vmxnet3_rxring *); -static void vmxnet3_rxq_eof_discard(struct vmxnet3_rxqueue *, - struct vmxnet3_rxring *, int); -static void vmxnet3_rxq_eof(struct vmxnet3_rxqueue *); -static void vmxnet3_legacy_intr(void *); -static void vmxnet3_txq_intr(void *); -static void vmxnet3_rxq_intr(void *); -static void vmxnet3_event_intr(void *); +static int vmxnet3_isc_txd_encap(void *, if_pkt_info_t); +static void vmxnet3_isc_txd_flush(void *, uint16_t, qidx_t); +static int vmxnet3_isc_txd_credits_update(void *, uint16_t, bool); +static int vmxnet3_isc_rxd_available(void *, uint16_t, qidx_t, qidx_t); +static int vmxnet3_isc_rxd_pkt_get(void *, if_rxd_info_t); +static void vmxnet3_isc_rxd_refill(void *, if_rxd_update_t); +static void vmxnet3_isc_rxd_flush(void *, uint16_t, uint8_t, qidx_t); +static int vmxnet3_legacy_intr(void *); +static int vmxnet3_rxq_intr(void *); +static int vmxnet3_event_intr(void *); -static void vmxnet3_txstop(struct vmxnet3_softc *, struct vmxnet3_txqueue *); -static void vmxnet3_rxstop(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); -static void vmxnet3_stop(struct vmxnet3_softc *); +static void vmxnet3_stop(if_ctx_t); static void vmxnet3_txinit(struct vmxnet3_softc *, struct vmxnet3_txqueue *); -static int vmxnet3_rxinit(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); -static int vmxnet3_reinit_queues(struct vmxnet3_softc *); +static void vmxnet3_rxinit(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); +static void vmxnet3_reinit_queues(struct vmxnet3_softc *); static int vmxnet3_enable_device(struct vmxnet3_softc *); static void vmxnet3_reinit_rxfilters(struct vmxnet3_softc *); -static int vmxnet3_reinit(struct vmxnet3_softc *); -static void vmxnet3_init_locked(struct vmxnet3_softc *); -static void vmxnet3_init(void *); +static void vmxnet3_init(if_ctx_t); +static void vmxnet3_multi_set(if_ctx_t); +static int vmxnet3_mtu_set(if_ctx_t, uint32_t); +static void vmxnet3_media_status(if_ctx_t, struct ifmediareq *); +static int vmxnet3_media_change(if_ctx_t); +static int vmxnet3_promisc_set(if_ctx_t, int); +static uint64_t vmxnet3_get_counter(if_ctx_t, ift_counter); +static void vmxnet3_update_admin_status(if_ctx_t); +static void vmxnet3_txq_timer(if_ctx_t, uint16_t); -static int vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *,struct mbuf *, - int *, int *, int *); -static int vmxnet3_txq_load_mbuf(struct vmxnet3_txqueue *, struct mbuf **, - bus_dmamap_t, bus_dma_segment_t [], int *); -static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); -static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); -#ifdef VMXNET3_LEGACY_TX -static void vmxnet3_start_locked(struct ifnet *); -static void vmxnet3_start(struct ifnet *); -#else -static int vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *, - struct mbuf *); -static int vmxnet3_txq_mq_start(struct ifnet *, struct mbuf *); -static void vmxnet3_txq_tq_deferred(void *, int); -#endif -static void vmxnet3_txq_start(struct vmxnet3_txqueue *); -static void vmxnet3_tx_start_all(struct vmxnet3_softc *); - static void vmxnet3_update_vlan_filter(struct vmxnet3_softc *, int, uint16_t); -static void vmxnet3_register_vlan(void *, struct ifnet *, uint16_t); -static void vmxnet3_unregister_vlan(void *, struct ifnet *, uint16_t); -static void vmxnet3_set_rxfilter(struct vmxnet3_softc *); -static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); -static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); -static uint64_t vmxnet3_get_counter(struct ifnet *, ift_counter); +static void vmxnet3_vlan_register(if_ctx_t, uint16_t); +static void vmxnet3_vlan_unregister(if_ctx_t, uint16_t); +static void vmxnet3_set_rxfilter(struct vmxnet3_softc *, int); -#ifndef VMXNET3_LEGACY_TX -static void vmxnet3_qflush(struct ifnet *); -#endif - -static int vmxnet3_watchdog(struct vmxnet3_txqueue *); static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *); -static void vmxnet3_tick(void *); +static int vmxnet3_link_is_up(struct vmxnet3_softc *); static void vmxnet3_link_status(struct vmxnet3_softc *); -static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); -static int vmxnet3_media_change(struct ifnet *); static void vmxnet3_set_lladdr(struct vmxnet3_softc *); static void vmxnet3_get_lladdr(struct vmxnet3_softc *); @@ -219,18 +171,14 @@ static void vmxnet3_write_bar1(struct vmxnet3_softc *, static void vmxnet3_write_cmd(struct vmxnet3_softc *, uint32_t); static uint32_t vmxnet3_read_cmd(struct vmxnet3_softc *, uint32_t); +static int vmxnet3_tx_queue_intr_enable(if_ctx_t, uint16_t); +static int vmxnet3_rx_queue_intr_enable(if_ctx_t, uint16_t); +static void vmxnet3_link_intr_enable(if_ctx_t); static void vmxnet3_enable_intr(struct vmxnet3_softc *, int); static void vmxnet3_disable_intr(struct vmxnet3_softc *, int); -static void vmxnet3_enable_all_intrs(struct vmxnet3_softc *); -static void vmxnet3_disable_all_intrs(struct vmxnet3_softc *); +static void vmxnet3_intr_enable_all(if_ctx_t); +static void vmxnet3_intr_disable_all(if_ctx_t); -static int vmxnet3_dma_malloc(struct vmxnet3_softc *, bus_size_t, - bus_size_t, struct vmxnet3_dma_alloc *); -static void vmxnet3_dma_free(struct vmxnet3_softc *, - struct vmxnet3_dma_alloc *); -static int vmxnet3_tunable_int(struct vmxnet3_softc *, - const char *, int); - typedef enum { VMXNET3_BARRIER_RD, VMXNET3_BARRIER_WR, @@ -239,25 +187,16 @@ typedef enum { static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); -/* Tunables. */ -static int vmxnet3_mq_disable = 0; -TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); -static int vmxnet3_default_txnqueue = VMXNET3_DEF_TX_QUEUES; -TUNABLE_INT("hw.vmx.txnqueue", &vmxnet3_default_txnqueue); -static int vmxnet3_default_rxnqueue = VMXNET3_DEF_RX_QUEUES; -TUNABLE_INT("hw.vmx.rxnqueue", &vmxnet3_default_rxnqueue); -static int vmxnet3_default_txndesc = VMXNET3_DEF_TX_NDESC; -TUNABLE_INT("hw.vmx.txndesc", &vmxnet3_default_txndesc); -static int vmxnet3_default_rxndesc = VMXNET3_DEF_RX_NDESC; -TUNABLE_INT("hw.vmx.rxndesc", &vmxnet3_default_rxndesc); static device_method_t vmxnet3_methods[] = { - /* Device interface. */ - DEVMETHOD(device_probe, vmxnet3_probe), - DEVMETHOD(device_attach, vmxnet3_attach), - DEVMETHOD(device_detach, vmxnet3_detach), - DEVMETHOD(device_shutdown, vmxnet3_shutdown), - + /* Device interface */ + DEVMETHOD(device_register, vmxnet3_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + DEVMETHOD(device_shutdown, iflib_device_shutdown), + DEVMETHOD(device_suspend, iflib_device_suspend), + DEVMETHOD(device_resume, iflib_device_resume), DEVMETHOD_END }; @@ -267,153 +206,382 @@ static driver_t vmxnet3_driver = { static devclass_t vmxnet3_devclass; DRIVER_MODULE(vmx, pci, vmxnet3_driver, vmxnet3_devclass, 0, 0); +IFLIB_PNP_INFO(pci, vmx, vmxnet3_vendor_info_array); +MODULE_VERSION(vmx, 2); MODULE_DEPEND(vmx, pci, 1, 1, 1); MODULE_DEPEND(vmx, ether, 1, 1, 1); +MODULE_DEPEND(vmx, iflib, 1, 1, 1); -#define VMXNET3_VMWARE_VENDOR_ID 0x15AD -#define VMXNET3_VMWARE_DEVICE_ID 0x07B0 +static device_method_t vmxnet3_iflib_methods[] = { + DEVMETHOD(ifdi_tx_queues_alloc, vmxnet3_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, vmxnet3_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, vmxnet3_queues_free), -static int -vmxnet3_probe(device_t dev) -{ + DEVMETHOD(ifdi_attach_pre, vmxnet3_attach_pre), + DEVMETHOD(ifdi_attach_post, vmxnet3_attach_post), + DEVMETHOD(ifdi_detach, vmxnet3_detach), - if (pci_get_vendor(dev) == VMXNET3_VMWARE_VENDOR_ID && - pci_get_device(dev) == VMXNET3_VMWARE_DEVICE_ID) { - device_set_desc(dev, "VMware VMXNET3 Ethernet Adapter"); - return (BUS_PROBE_DEFAULT); - } + DEVMETHOD(ifdi_init, vmxnet3_init), + DEVMETHOD(ifdi_stop, vmxnet3_stop), + DEVMETHOD(ifdi_multi_set, vmxnet3_multi_set), + DEVMETHOD(ifdi_mtu_set, vmxnet3_mtu_set), + DEVMETHOD(ifdi_media_status, vmxnet3_media_status), + DEVMETHOD(ifdi_media_change, vmxnet3_media_change), + DEVMETHOD(ifdi_promisc_set, vmxnet3_promisc_set), + DEVMETHOD(ifdi_get_counter, vmxnet3_get_counter), + DEVMETHOD(ifdi_update_admin_status, vmxnet3_update_admin_status), + DEVMETHOD(ifdi_timer, vmxnet3_txq_timer), - return (ENXIO); + DEVMETHOD(ifdi_tx_queue_intr_enable, vmxnet3_tx_queue_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, vmxnet3_rx_queue_intr_enable), + DEVMETHOD(ifdi_link_intr_enable, vmxnet3_link_intr_enable), + DEVMETHOD(ifdi_intr_enable, vmxnet3_intr_enable_all), + DEVMETHOD(ifdi_intr_disable, vmxnet3_intr_disable_all), + DEVMETHOD(ifdi_msix_intr_assign, vmxnet3_msix_intr_assign), + + DEVMETHOD(ifdi_vlan_register, vmxnet3_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, vmxnet3_vlan_unregister), + + DEVMETHOD(ifdi_shutdown, vmxnet3_shutdown), + DEVMETHOD(ifdi_suspend, vmxnet3_suspend), + DEVMETHOD(ifdi_resume, vmxnet3_resume), + + DEVMETHOD_END +}; + +static driver_t vmxnet3_iflib_driver = { + "vmx", vmxnet3_iflib_methods, sizeof(struct vmxnet3_softc) +}; + +struct if_txrx vmxnet3_txrx = { + .ift_txd_encap = vmxnet3_isc_txd_encap, + .ift_txd_flush = vmxnet3_isc_txd_flush, + .ift_txd_credits_update = vmxnet3_isc_txd_credits_update, + .ift_rxd_available = vmxnet3_isc_rxd_available, + .ift_rxd_pkt_get = vmxnet3_isc_rxd_pkt_get, + .ift_rxd_refill = vmxnet3_isc_rxd_refill, + .ift_rxd_flush = vmxnet3_isc_rxd_flush, + .ift_legacy_intr = vmxnet3_legacy_intr +}; + +static struct if_shared_ctx vmxnet3_sctx_init = { + .isc_magic = IFLIB_MAGIC, + .isc_q_align = 512, + + .isc_tx_maxsize = VMXNET3_TX_MAXSIZE, + .isc_tx_maxsegsize = VMXNET3_TX_MAXSEGSIZE, + .isc_tso_maxsize = VMXNET3_TSO_MAXSIZE + sizeof(struct ether_vlan_header), + .isc_tso_maxsegsize = VMXNET3_TX_MAXSEGSIZE, + + /* + * These values are used to configure the busdma tag used for + * receive descriptors. Each receive descriptor only points to one + * buffer. + */ + .isc_rx_maxsize = VMXNET3_RX_MAXSEGSIZE, /* One buf per descriptor */ + .isc_rx_nsegments = 1, /* One mapping per descriptor */ + .isc_rx_maxsegsize = VMXNET3_RX_MAXSEGSIZE, + + .isc_admin_intrcnt = 1, + .isc_vendor_info = vmxnet3_vendor_info_array, + .isc_driver_version = "2", + .isc_driver = &vmxnet3_iflib_driver, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + + /* + * Number of receive queues per receive queue set, with associated + * descriptor settings for each. + */ + .isc_nrxqs = 3, + .isc_nfl = 2, /* one free list for each receive command queue */ + .isc_nrxd_min = {VMXNET3_MIN_RX_NDESC, VMXNET3_MIN_RX_NDESC, VMXNET3_MIN_RX_NDESC}, + .isc_nrxd_max = {VMXNET3_MAX_RX_NDESC, VMXNET3_MAX_RX_NDESC, VMXNET3_MAX_RX_NDESC}, + .isc_nrxd_default = {VMXNET3_DEF_RX_NDESC, VMXNET3_DEF_RX_NDESC, VMXNET3_DEF_RX_NDESC}, + + /* + * Number of transmit queues per transmit queue set, with associated + * descriptor settings for each. + */ + .isc_ntxqs = 2, + .isc_ntxd_min = {VMXNET3_MIN_TX_NDESC, VMXNET3_MIN_TX_NDESC}, + .isc_ntxd_max = {VMXNET3_MAX_TX_NDESC, VMXNET3_MAX_TX_NDESC}, + .isc_ntxd_default = {VMXNET3_DEF_TX_NDESC, VMXNET3_DEF_TX_NDESC}, +}; + +static void * +vmxnet3_register(device_t dev) +{ + return (&vmxnet3_sctx_init); } static int -vmxnet3_attach(device_t dev) +vmxnet3_attach_pre(if_ctx_t ctx) { + device_t dev; + if_softc_ctx_t scctx; struct vmxnet3_softc *sc; + uint32_t intr_config; int error; - sc = device_get_softc(dev); + dev = iflib_get_dev(ctx); + sc = iflib_get_softc(ctx); sc->vmx_dev = dev; + sc->vmx_ctx = ctx; + sc->vmx_sctx = iflib_get_sctx(ctx); + sc->vmx_scctx = iflib_get_softc_ctx(ctx); + sc->vmx_ifp = iflib_get_ifp(ctx); + sc->vmx_media = iflib_get_media(ctx); + scctx = sc->vmx_scctx; - pci_enable_busmaster(dev); + scctx->isc_tx_nsegments = VMXNET3_TX_MAXSEGS; + scctx->isc_tx_tso_segments_max = VMXNET3_TX_MAXSEGS; + /* isc_tx_tso_size_max doesn't include possible vlan header */ + scctx->isc_tx_tso_size_max = VMXNET3_TSO_MAXSIZE; + scctx->isc_tx_tso_segsize_max = VMXNET3_TX_MAXSEGSIZE; + scctx->isc_txrx = &vmxnet3_txrx; - VMXNET3_CORE_LOCK_INIT(sc, device_get_nameunit(dev)); - callout_init_mtx(&sc->vmx_tick, &sc->vmx_mtx, 0); + /* If 0, the iflib tunable was not set, so set to the default */ + if (scctx->isc_nrxqsets == 0) + scctx->isc_nrxqsets = VMXNET3_DEF_RX_QUEUES; + scctx->isc_nrxqsets_max = min(VMXNET3_MAX_RX_QUEUES, mp_ncpus); - vmxnet3_initial_config(sc); + /* If 0, the iflib tunable was not set, so set to the default */ + if (scctx->isc_ntxqsets == 0) + scctx->isc_ntxqsets = VMXNET3_DEF_TX_QUEUES; + scctx->isc_ntxqsets_max = min(VMXNET3_MAX_TX_QUEUES, mp_ncpus); - error = vmxnet3_alloc_resources(sc); - if (error) - goto fail; + /* + * Enforce that the transmit completion queue descriptor count is + * the same as the transmit command queue descriptor count. + */ + scctx->isc_ntxd[0] = scctx->isc_ntxd[1]; + scctx->isc_txqsizes[0] = + sizeof(struct vmxnet3_txcompdesc) * scctx->isc_ntxd[0]; + scctx->isc_txqsizes[1] = + sizeof(struct vmxnet3_txdesc) * scctx->isc_ntxd[1]; - error = vmxnet3_check_version(sc); - if (error) - goto fail; + /* + * Enforce that the receive completion queue descriptor count is the + * sum of the receive command queue descriptor counts, and that the + * second receive command queue descriptor count is the same as the + * first one. + */ + scctx->isc_nrxd[2] = scctx->isc_nrxd[1]; + scctx->isc_nrxd[0] = scctx->isc_nrxd[1] + scctx->isc_nrxd[2]; + scctx->isc_rxqsizes[0] = + sizeof(struct vmxnet3_rxcompdesc) * scctx->isc_nrxd[0]; + scctx->isc_rxqsizes[1] = + sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[1]; + scctx->isc_rxqsizes[2] = + sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[2]; - error = vmxnet3_alloc_rxtx_queues(sc); - if (error) - goto fail; + scctx->isc_rss_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; -#ifndef VMXNET3_LEGACY_TX - error = vmxnet3_alloc_taskqueue(sc); + /* Map PCI BARs */ + error = vmxnet3_alloc_resources(sc); if (error) goto fail; -#endif - error = vmxnet3_alloc_interrupts(sc); + /* Check device versions */ + error = vmxnet3_check_version(sc); if (error) goto fail; - vmxnet3_check_multiqueue(sc); + /* + * The interrupt mode can be set in the hypervisor configuration via + * the parameter ethernet.intrMode. + */ + intr_config = vmxnet3_read_cmd(sc, VMXNET3_CMD_GET_INTRCFG); + sc->vmx_intr_mask_mode = (intr_config >> 2) & 0x03; - error = vmxnet3_alloc_data(sc); - if (error) - goto fail; + /* + * Configure the softc context to attempt to configure the interrupt + * mode now indicated by intr_config. iflib will follow the usual + * fallback path MSIX -> MSI -> LEGACY, starting at the configured + * starting mode. + */ + switch (intr_config & 0x03) { + case VMXNET3_IT_AUTO: + case VMXNET3_IT_MSIX: + scctx->isc_msix_bar = pci_msix_table_bar(dev); + break; + case VMXNET3_IT_MSI: + scctx->isc_msix_bar = -1; + scctx->isc_disable_msix = 1; + break; + case VMXNET3_IT_LEGACY: + scctx->isc_msix_bar = 0; + break; + } - error = vmxnet3_setup_interface(sc); - if (error) - goto fail; + scctx->isc_tx_csum_flags = VMXNET3_CSUM_ALL_OFFLOAD; + scctx->isc_capabilities = scctx->isc_capenable = + IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | + IFCAP_TSO4 | IFCAP_TSO6 | + IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO | + IFCAP_JUMBO_MTU; - error = vmxnet3_setup_interrupts(sc); - if (error) { - ether_ifdetach(sc->vmx_ifp); - device_printf(dev, "could not set up interrupt\n"); - goto fail; - } + /* These capabilities are not enabled by default. */ + scctx->isc_capabilities |= IFCAP_LRO | IFCAP_VLAN_HWFILTER; - vmxnet3_setup_sysctl(sc); -#ifndef VMXNET3_LEGACY_TX - vmxnet3_start_taskqueue(sc); -#endif + vmxnet3_get_lladdr(sc); + iflib_set_mac(ctx, sc->vmx_lladdr); + return (0); fail: - if (error) - vmxnet3_detach(dev); + /* + * We must completely clean up anything allocated above as iflib + * will not invoke any other driver entry points as a result of this + * failure. + */ + vmxnet3_free_resources(sc); return (error); } static int -vmxnet3_detach(device_t dev) +vmxnet3_msix_intr_assign(if_ctx_t ctx, int msix) { struct vmxnet3_softc *sc; - struct ifnet *ifp; + if_softc_ctx_t scctx; + struct vmxnet3_rxqueue *rxq; + int error; + int i; + char irq_name[16]; - sc = device_get_softc(dev); - ifp = sc->vmx_ifp; + sc = iflib_get_softc(ctx); + scctx = sc->vmx_scctx; + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "rxq%d", i); - if (device_is_attached(dev)) { - VMXNET3_CORE_LOCK(sc); - vmxnet3_stop(sc); - VMXNET3_CORE_UNLOCK(sc); + rxq = &sc->vmx_rxq[i]; + error = iflib_irq_alloc_generic(ctx, &rxq->vxrxq_irq, i + 1, + IFLIB_INTR_RX, vmxnet3_rxq_intr, rxq, i, irq_name); + if (error) { + device_printf(iflib_get_dev(ctx), + "Failed to register rxq %d interrupt handler\n", i); + return (error); + } + } - callout_drain(&sc->vmx_tick); -#ifndef VMXNET3_LEGACY_TX - vmxnet3_drain_taskqueue(sc); -#endif + for (i = 0; i < scctx->isc_ntxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "txq%d", i); - ether_ifdetach(ifp); + /* + * Don't provide the corresponding rxq irq for reference - + * we want the transmit task to be attached to a task queue + * that is different from the one used by the corresponding + * rxq irq. That is because the TX doorbell writes are very + * expensive as virtualized MMIO operations, so we want to + * be able to defer them to another core when possible so + * that they don't steal receive processing cycles during + * stack turnarounds like TCP ACK generation. The other + * piece to this approach is enabling the iflib abdicate + * option (currently via an interface-specific + * tunable/sysctl). + */ + iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_TX, NULL, i, + irq_name); } - if (sc->vmx_vlan_attach != NULL) { - EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_attach); - sc->vmx_vlan_attach = NULL; + error = iflib_irq_alloc_generic(ctx, &sc->vmx_event_intr_irq, + scctx->isc_nrxqsets + 1, IFLIB_INTR_ADMIN, vmxnet3_event_intr, sc, 0, + "event"); + if (error) { + device_printf(iflib_get_dev(ctx), + "Failed to register event interrupt handler\n"); + return (error); } - if (sc->vmx_vlan_detach != NULL) { - EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_detach); - sc->vmx_vlan_detach = NULL; - } -#ifndef VMXNET3_LEGACY_TX - vmxnet3_free_taskqueue(sc); -#endif - vmxnet3_free_interrupts(sc); + return (0); +} - if (ifp != NULL) { - if_free(ifp); - sc->vmx_ifp = NULL; +static void +vmxnet3_free_irqs(struct vmxnet3_softc *sc) +{ + if_softc_ctx_t scctx; + struct vmxnet3_rxqueue *rxq; + int i; + + scctx = sc->vmx_scctx; + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + rxq = &sc->vmx_rxq[i]; + iflib_irq_free(sc->vmx_ctx, &rxq->vxrxq_irq); } - ifmedia_removeall(&sc->vmx_media); + iflib_irq_free(sc->vmx_ctx, &sc->vmx_event_intr_irq); +} +static int +vmxnet3_attach_post(if_ctx_t ctx) +{ + device_t dev; + if_softc_ctx_t scctx; + struct vmxnet3_softc *sc; + int error; + + dev = iflib_get_dev(ctx); + scctx = iflib_get_softc_ctx(ctx); + sc = iflib_get_softc(ctx); + + if (scctx->isc_nrxqsets > 1) + sc->vmx_flags |= VMXNET3_FLAG_RSS; + + error = vmxnet3_alloc_data(sc); + if (error) + goto fail; + + vmxnet3_set_interrupt_idx(sc); + vmxnet3_setup_sysctl(sc); + + ifmedia_add(sc->vmx_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(sc->vmx_media, IFM_ETHER | IFM_AUTO); + +fail: + return (error); +} + +static int +vmxnet3_detach(if_ctx_t ctx) +{ + struct vmxnet3_softc *sc; + + sc = iflib_get_softc(ctx); + + vmxnet3_free_irqs(sc); vmxnet3_free_data(sc); vmxnet3_free_resources(sc); - vmxnet3_free_rxtx_queues(sc); - VMXNET3_CORE_LOCK_DESTROY(sc); + return (0); +} +static int +vmxnet3_shutdown(if_ctx_t ctx) +{ + return (0); } static int -vmxnet3_shutdown(device_t dev) +vmxnet3_suspend(if_ctx_t ctx) { return (0); } static int +vmxnet3_resume(if_ctx_t ctx) +{ + + return (0); +} + +static int vmxnet3_alloc_resources(struct vmxnet3_softc *sc) { device_t dev; @@ -445,15 +613,6 @@ vmxnet3_alloc_resources(struct vmxnet3_softc *sc) sc->vmx_iot1 = rman_get_bustag(sc->vmx_res1); sc->vmx_ioh1 = rman_get_bushandle(sc->vmx_res1); - if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) { - rid = PCIR_BAR(2); - sc->vmx_msix_res = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE); - } - - if (sc->vmx_msix_res == NULL) - sc->vmx_flags |= VMXNET3_FLAG_NO_MSIX; - return (0); } @@ -476,13 +635,6 @@ vmxnet3_free_resources(struct vmxnet3_softc *sc) bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res1); sc->vmx_res1 = NULL; } - - if (sc->vmx_msix_res != NULL) { - rid = PCIR_BAR(2); - bus_release_resource(dev, SYS_RES_MEMORY, rid, - sc->vmx_msix_res); - sc->vmx_msix_res = NULL; - } } static int @@ -511,603 +663,282 @@ vmxnet3_check_version(struct vmxnet3_softc *sc) return (0); } -static int -trunc_powerof2(int val) -{ - - return (1U << (fls(val) - 1)); -} - static void -vmxnet3_initial_config(struct vmxnet3_softc *sc) -{ - int nqueue, ndesc; - - nqueue = vmxnet3_tunable_int(sc, "txnqueue", vmxnet3_default_txnqueue); - if (nqueue > VMXNET3_MAX_TX_QUEUES || nqueue < 1) - nqueue = VMXNET3_DEF_TX_QUEUES; - if (nqueue > mp_ncpus) - nqueue = mp_ncpus; - sc->vmx_max_ntxqueues = trunc_powerof2(nqueue); - - nqueue = vmxnet3_tunable_int(sc, "rxnqueue", vmxnet3_default_rxnqueue); - if (nqueue > VMXNET3_MAX_RX_QUEUES || nqueue < 1) - nqueue = VMXNET3_DEF_RX_QUEUES; - if (nqueue > mp_ncpus) - nqueue = mp_ncpus; - sc->vmx_max_nrxqueues = trunc_powerof2(nqueue); - - if (vmxnet3_tunable_int(sc, "mq_disable", vmxnet3_mq_disable)) { - sc->vmx_max_nrxqueues = 1; - sc->vmx_max_ntxqueues = 1; - } - - ndesc = vmxnet3_tunable_int(sc, "txd", vmxnet3_default_txndesc); - if (ndesc > VMXNET3_MAX_TX_NDESC || ndesc < VMXNET3_MIN_TX_NDESC) - ndesc = VMXNET3_DEF_TX_NDESC; - if (ndesc & VMXNET3_MASK_TX_NDESC) - ndesc &= ~VMXNET3_MASK_TX_NDESC; - sc->vmx_ntxdescs = ndesc; - - ndesc = vmxnet3_tunable_int(sc, "rxd", vmxnet3_default_rxndesc); - if (ndesc > VMXNET3_MAX_RX_NDESC || ndesc < VMXNET3_MIN_RX_NDESC) - ndesc = VMXNET3_DEF_RX_NDESC; - if (ndesc & VMXNET3_MASK_RX_NDESC) - ndesc &= ~VMXNET3_MASK_RX_NDESC; - sc->vmx_nrxdescs = ndesc; - sc->vmx_max_rxsegs = VMXNET3_MAX_RX_SEGS; -} - -static void -vmxnet3_check_multiqueue(struct vmxnet3_softc *sc) -{ - - if (sc->vmx_intr_type != VMXNET3_IT_MSIX) - goto out; - - /* BMV: Just use the maximum configured for now. */ - sc->vmx_nrxqueues = sc->vmx_max_nrxqueues; - sc->vmx_ntxqueues = sc->vmx_max_ntxqueues; - - if (sc->vmx_nrxqueues > 1) - sc->vmx_flags |= VMXNET3_FLAG_RSS; - - return; - -out: - sc->vmx_ntxqueues = 1; - sc->vmx_nrxqueues = 1; -} - -static int -vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - int nmsix, cnt, required; - - dev = sc->vmx_dev; - - if (sc->vmx_flags & VMXNET3_FLAG_NO_MSIX) - return (1); - - /* Allocate an additional vector for the events interrupt. */ - required = sc->vmx_max_nrxqueues + sc->vmx_max_ntxqueues + 1; - - nmsix = pci_msix_count(dev); - if (nmsix < required) - return (1); - - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vmx_nintrs = required; - return (0); - } else - pci_release_msi(dev); - - /* BMV TODO Fallback to sharing MSIX vectors if possible. */ - - return (1); -} - -static int -vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - int nmsi, cnt, required; - - dev = sc->vmx_dev; - required = 1; - - nmsi = pci_msi_count(dev); - if (nmsi < required) - return (1); - - cnt = required; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { - sc->vmx_nintrs = 1; - return (0); - } else - pci_release_msi(dev); - - return (1); -} - -static int -vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *sc) -{ - - sc->vmx_nintrs = 1; - return (0); -} - -static int -vmxnet3_alloc_interrupt(struct vmxnet3_softc *sc, int rid, int flags, - struct vmxnet3_interrupt *intr) -{ - struct resource *irq; - - irq = bus_alloc_resource_any(sc->vmx_dev, SYS_RES_IRQ, &rid, flags); - if (irq == NULL) - return (ENXIO); - - intr->vmxi_irq = irq; - intr->vmxi_rid = rid; - - return (0); -} - -static int -vmxnet3_alloc_intr_resources(struct vmxnet3_softc *sc) -{ - int i, rid, flags, error; - - rid = 0; - flags = RF_ACTIVE; - - if (sc->vmx_intr_type == VMXNET3_IT_LEGACY) - flags |= RF_SHAREABLE; - else - rid = 1; - - for (i = 0; i < sc->vmx_nintrs; i++, rid++) { - error = vmxnet3_alloc_interrupt(sc, rid, flags, - &sc->vmx_intrs[i]); - if (error) - return (error); - } - - return (0); -} - -static int -vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - struct vmxnet3_txqueue *txq; - struct vmxnet3_rxqueue *rxq; - struct vmxnet3_interrupt *intr; - enum intr_type type; - int i, error; - - dev = sc->vmx_dev; - intr = &sc->vmx_intrs[0]; - type = INTR_TYPE_NET | INTR_MPSAFE; - - for (i = 0; i < sc->vmx_ntxqueues; i++, intr++) { - txq = &sc->vmx_txq[i]; - error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, - vmxnet3_txq_intr, txq, &intr->vmxi_handler); - if (error) - return (error); - bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, - "tq%d", i); - txq->vxtxq_intr_idx = intr->vmxi_rid - 1; - } - - for (i = 0; i < sc->vmx_nrxqueues; i++, intr++) { - rxq = &sc->vmx_rxq[i]; - error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, - vmxnet3_rxq_intr, rxq, &intr->vmxi_handler); - if (error) - return (error); - bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, - "rq%d", i); - rxq->vxrxq_intr_idx = intr->vmxi_rid - 1; - } - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 22 01:44:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B960114A229B; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@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 1C3CC8EF45; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10AC722420; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M1ilQB043761; Tue, 22 Jan 2019 01:44:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M1ilT9043760; Tue, 22 Jan 2019 01:44:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901220144.x0M1ilT9043760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 22 Jan 2019 01:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343292 - head/sys/dev/iwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwn X-SVN-Commit-Revision: 343292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C3CC8EF45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:44:48 -0000 Author: avos Date: Tue Jan 22 01:44:47 2019 New Revision: 343292 URL: https://svnweb.freebsd.org/changeset/base/343292 Log: iwn(4): drop i_seq field initialization for A-MPDU frames. It is done by net80211 since r319460. MFC after: 24 days X-MFC-With: 343094 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Jan 22 01:11:17 2019 (r343291) +++ head/sys/dev/iwn/if_iwn.c Tue Jan 22 01:44:47 2019 (r343292) @@ -4587,10 +4587,6 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru if (!IEEE80211_AMPDU_RUNNING(tap)) return (EINVAL); - /* NB: clear Fragment Number field. */ - /* XXX move this to net80211 */ - *(uint16_t *)wh->i_seq = 0; - ac = *(int *)tap->txa_private; } From owner-svn-src-all@freebsd.org Tue Jan 22 02:02:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EDBD14A466F; Tue, 22 Jan 2019 02:02:13 +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 3236869A45; Tue, 22 Jan 2019 02:02:13 +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 2721B22829; Tue, 22 Jan 2019 02:02:13 +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 x0M22CmS053086; Tue, 22 Jan 2019 02:02:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M22C4W053085; Tue, 22 Jan 2019 02:02:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901220202.x0M22C4W053085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 22 Jan 2019 02:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343293 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 343293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3236869A45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:02:13 -0000 Author: markj Date: Tue Jan 22 02:02:12 2019 New Revision: 343293 URL: https://svnweb.freebsd.org/changeset/base/343293 Log: MFC r342864: Specify the correct option level when emulating SO_PEERCRED. PR: 234722 Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Tue Jan 22 01:44:47 2019 (r343292) +++ stable/12/sys/compat/linux/linux_socket.c Tue Jan 22 02:02:12 2019 (r343293) @@ -1632,6 +1632,11 @@ linux_getsockopt(struct thread *td, struct linux_getso case LOCAL_PEERCRED: if (args->optlen < sizeof(lxu)) return (EINVAL); + /* + * LOCAL_PEERCRED is not served at the SOL_SOCKET level, + * but by the Unix socket's level 0. + */ + bsd_args.level = 0; xulen = sizeof(xu); error = kern_getsockopt(td, args->s, bsd_args.level, name, &xu, UIO_SYSSPACE, &xulen); From owner-svn-src-all@freebsd.org Tue Jan 22 02:04:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470AA14A4B63; Tue, 22 Jan 2019 02:04:38 +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 E476F69DEE; Tue, 22 Jan 2019 02:04:37 +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 CF7F32284F; Tue, 22 Jan 2019 02:04:37 +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 x0M24bdV054089; Tue, 22 Jan 2019 02:04:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M24bCC054088; Tue, 22 Jan 2019 02:04:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901220204.x0M24bCC054088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 22 Jan 2019 02:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343294 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 343294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E476F69DEE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:04:38 -0000 Author: markj Date: Tue Jan 22 02:04:37 2019 New Revision: 343294 URL: https://svnweb.freebsd.org/changeset/base/343294 Log: MFC r342864: Specify the correct option level when emulating SO_PEERCRED. PR: 234722 Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Tue Jan 22 02:02:12 2019 (r343293) +++ stable/11/sys/compat/linux/linux_socket.c Tue Jan 22 02:04:37 2019 (r343294) @@ -1635,6 +1635,11 @@ linux_getsockopt(struct thread *td, struct linux_getso case LOCAL_PEERCRED: if (args->optlen < sizeof(lxu)) return (EINVAL); + /* + * LOCAL_PEERCRED is not served at the SOL_SOCKET level, + * but by the Unix socket's level 0. + */ + bsd_args.level = 0; xulen = sizeof(xu); error = kern_getsockopt(td, args->s, bsd_args.level, name, &xu, UIO_SYSSPACE, &xulen); From owner-svn-src-all@freebsd.org Tue Jan 22 02:13:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0D614A5A23; Tue, 22 Jan 2019 02:13:34 +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 73F546AAFE; Tue, 22 Jan 2019 02:13:34 +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 5BE5022A2E; Tue, 22 Jan 2019 02:13:34 +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 x0M2DYYJ059589; Tue, 22 Jan 2019 02:13:34 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2DYiP059588; Tue, 22 Jan 2019 02:13:34 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220213.x0M2DYiP059588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 02:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343295 - 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: 343295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73F546AAFE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:13:35 -0000 Author: kp Date: Tue Jan 22 02:13:33 2019 New Revision: 343295 URL: https://svnweb.freebsd.org/changeset/base/343295 Log: pf: Validate psn_len in DIOCGETSRCNODES psn_len is controlled by user space, but we allocated memory based on it. Check how much memory we might need at most (i.e. how many source nodes we have) and limit the allocation to that. Reported by: markj MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Jan 22 02:04:37 2019 (r343294) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Jan 22 02:13:33 2019 (r343295) @@ -3577,14 +3577,18 @@ DIOCCHANGEADDR_error: struct pf_src_node *n, *p, *pstore; uint32_t i, nr = 0; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + i++, sh++) { + PF_HASHROW_LOCK(sh); + LIST_FOREACH(n, &sh->nodes, entry) + nr++; + PF_HASHROW_UNLOCK(sh); + } + + psn->psn_len = min(psn->psn_len, + sizeof(struct pf_src_node) * nr); + if (psn->psn_len == 0) { - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; - i++, sh++) { - PF_HASHROW_LOCK(sh); - LIST_FOREACH(n, &sh->nodes, entry) - nr++; - PF_HASHROW_UNLOCK(sh); - } psn->psn_len = sizeof(struct pf_src_node) * nr; break; } From owner-svn-src-all@freebsd.org Tue Jan 22 02:54:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B618814A9126; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@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 59D3B6CBF5; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D6252313A; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M2s0Pr080080; Tue, 22 Jan 2019 02:54:00 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2s099080077; Tue, 22 Jan 2019 02:54:00 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220254.x0M2s099080077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 02:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343296 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 343296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59D3B6CBF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:54:00 -0000 Author: pkelsey Date: Tue Jan 22 02:53:59 2019 New Revision: 343296 URL: https://svnweb.freebsd.org/changeset/base/343296 Log: Remove unused function gsc_destroy() gsc_destroy() is no longer needed as of r343287. MFC after: 1 week Modified: head/sbin/pfctl/pfctl_altq.c Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Tue Jan 22 02:13:33 2019 (r343295) +++ head/sbin/pfctl/pfctl_altq.c Tue Jan 22 02:53:59 2019 (r343296) @@ -93,7 +93,6 @@ static int check_commit_fairq(int, int, struct pfctl_a static void gsc_add_sc(struct gen_sc *, struct service_curve *); static int is_gsc_under_sc(struct gen_sc *, struct service_curve *); -static void gsc_destroy(struct gen_sc *); static struct segment *gsc_getentry(struct gen_sc *, double); static int gsc_add_seg(struct gen_sc *, double, double, double, double); @@ -1127,17 +1126,6 @@ is_gsc_under_sc(struct gen_sc *gsc, struct service_cur return (0); } return (1); -} - -static void -gsc_destroy(struct gen_sc *gsc) -{ - struct segment *s; - - while ((s = LIST_FIRST(gsc)) != NULL) { - LIST_REMOVE(s, _next); - free(s); - } } /* From owner-svn-src-all@freebsd.org Tue Jan 22 02:56:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C1614A9306; Tue, 22 Jan 2019 02:56: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 4B8696CE0B; Tue, 22 Jan 2019 02:56: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 3C1AE23147; Tue, 22 Jan 2019 02:56: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 x0M2ubt7080257; Tue, 22 Jan 2019 02:56:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2ubm5080256; Tue, 22 Jan 2019 02:56:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220256.x0M2ubm5080256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 02:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343297 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 343297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B8696CE0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:56:38 -0000 Author: kp Date: Tue Jan 22 02:56:36 2019 New Revision: 343297 URL: https://svnweb.freebsd.org/changeset/base/343297 Log: pf tests: Check size validation in DIOCGETSRCNODES Ensure that invalid sizes for DIOCGETSRCNODES do not cause panics. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Tue Jan 22 02:53:59 2019 (r343296) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Tue Jan 22 02:56:36 2019 (r343297) @@ -753,6 +753,38 @@ ATF_TC_CLEANUP(commit, tc) COMMON_CLEANUP(); } +ATF_TC_WITH_CLEANUP(getsrcnodes); +ATF_TC_HEAD(getsrcnodes, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(getsrcnodes, tc) +{ + struct pfioc_src_nodes psn; + + COMMON_HEAD(); + + bzero(&psn, sizeof(psn)); + + psn.psn_len = -1; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size -1 failed"); + + psn.psn_len = 1 << 30; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size << 30 failed"); + + psn.psn_len = 1 << 31; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size << 30 failed"); +} + +ATF_TC_CLEANUP(getsrcnodes, tc) +{ + COMMON_CLEANUP(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, addtables); @@ -772,6 +804,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cxbegin); ATF_TP_ADD_TC(tp, cxrollback); ATF_TP_ADD_TC(tp, commit); + ATF_TP_ADD_TC(tp, getsrcnodes); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Jan 22 03:53:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C635D14AB2C3; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@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 60A956F30C; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D1A723C2A; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M3rhOG012251; Tue, 22 Jan 2019 03:53:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M3rge9012248; Tue, 22 Jan 2019 03:53:42 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901220353.x0M3rge9012248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 22 Jan 2019 03:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343298 - head/sys/compat/ndis X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/compat/ndis X-SVN-Commit-Revision: 343298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60A956F30C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 03:53:44 -0000 Author: gonzo Date: Tue Jan 22 03:53:42 2019 New Revision: 343298 URL: https://svnweb.freebsd.org/changeset/base/343298 Log: [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64 amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use of FPU in kernel" panic. Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave. To reduce amount of allocations/deallocations done via fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements. Based on the patch by Paul B Mahol PR: 165622 Submitted by: Vlad Movchan MFC after: 1 month Modified: head/sys/compat/ndis/kern_windrv.c head/sys/compat/ndis/pe_var.h Modified: head/sys/compat/ndis/kern_windrv.c ============================================================================== --- head/sys/compat/ndis/kern_windrv.c Tue Jan 22 02:56:36 2019 (r343297) +++ head/sys/compat/ndis/kern_windrv.c Tue Jan 22 03:53:42 2019 (r343298) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __amd64__ +#include +#endif + #include #include @@ -68,6 +72,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __amd64__ +struct fpu_cc_ent { + struct fpu_kern_ctx *ctx; + LIST_ENTRY(fpu_cc_ent) entries; +}; +static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head = + LIST_HEAD_INITIALIZER(fpu_free_head); +static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head = + LIST_HEAD_INITIALIZER(fpu_busy_head); +static struct mtx fpu_free_mtx; +static struct mtx fpu_busy_mtx; +#endif + static struct mtx drvdb_mtx; static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head; @@ -98,6 +115,13 @@ windrv_libinit(void) mtx_init(&drvdb_mtx, "Windows driver DB lock", "Windows internal lock", MTX_DEF); +#ifdef __amd64__ + LIST_INIT(&fpu_free_head); + LIST_INIT(&fpu_busy_head); + mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF); + mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF); +#endif + /* * PCI and pccard devices don't need to use IRPs to * interact with their bus drivers (usually), so our @@ -132,6 +156,9 @@ int windrv_libfini(void) { struct drvdb_ent *d; +#ifdef __amd64__ + struct fpu_cc_ent *ent; +#endif mtx_lock(&drvdb_mtx); while(STAILQ_FIRST(&drvdb_head) != NULL) { @@ -150,6 +177,18 @@ windrv_libfini(void) smp_rendezvous(NULL, x86_oldldt, NULL, NULL); ExFreePool(my_tids); #endif +#ifdef __amd64__ + while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + fpu_kern_free_ctx(ent->ctx); + free(ent, M_DEVBUF); + } + mtx_destroy(&fpu_free_mtx); + + ent = LIST_FIRST(&fpu_busy_head); + KASSERT(ent == NULL, ("busy fpu context list is not empty")); + mtx_destroy(&fpu_busy_mtx); +#endif return (0); } @@ -614,6 +653,148 @@ windrv_wrap(func, wrap, argcnt, ftype) *wrap = p; return (0); +} + +static struct fpu_cc_ent * +request_fpu_cc_ent(void) +{ + struct fpu_cc_ent *ent; + + mtx_lock(&fpu_free_mtx); + if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_free_mtx); + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + return (ent); + } + mtx_unlock(&fpu_free_mtx); + + if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT | + M_ZERO)) != NULL) { + ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | + FPU_KERN_NOWAIT); + if (ent->ctx != NULL) { + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + } else { + free(ent, M_DEVBUF); + ent = NULL; + } + } + + return (ent); +} + +static void +release_fpu_cc_ent(struct fpu_cc_ent *ent) +{ + mtx_lock(&fpu_busy_mtx); + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_busy_mtx); + mtx_lock(&fpu_free_mtx); + LIST_INSERT_HEAD(&fpu_free_head, ent, entries); + mtx_unlock(&fpu_free_mtx); +} + +uint64_t +_x86_64_call1(void *fn, uint64_t a) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call1(fn, a); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call2(void *fn, uint64_t a, uint64_t b) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call2(fn, a, b); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call3(void *fn, uint64_t a, uint64_t b, uint64_t c) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call3(fn, a, b, c); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call4(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call4(fn, a, b, c, d); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call5(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call5(fn, a, b, c, d, e); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call6(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e, uint64_t f) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call6(fn, a, b, c, d, e, f); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); } #endif /* __amd64__ */ Modified: head/sys/compat/ndis/pe_var.h ============================================================================== --- head/sys/compat/ndis/pe_var.h Tue Jan 22 02:56:36 2019 (r343297) +++ head/sys/compat/ndis/pe_var.h Tue Jan 22 03:53:42 2019 (r343298) @@ -460,22 +460,30 @@ extern uint64_t x86_64_call5(void *, uint64_t, uint64_ extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call1(void *, uint64_t); +uint64_t _x86_64_call2(void *, uint64_t, uint64_t); +uint64_t _x86_64_call3(void *, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call4(void *, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call5(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t); +uint64_t _x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t, uint64_t); #define MSCALL1(fn, a) \ - x86_64_call1((fn), (uint64_t)(a)) + _x86_64_call1((fn), (uint64_t)(a)) #define MSCALL2(fn, a, b) \ - x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) + _x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) #define MSCALL3(fn, a, b, c) \ - x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c)) #define MSCALL4(fn, a, b, c, d) \ - x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d)) #define MSCALL5(fn, a, b, c, d, e) \ - x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e)) #define MSCALL6(fn, a, b, c, d, e, f) \ - x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f)) #endif /* __amd64__ */ From owner-svn-src-all@freebsd.org Tue Jan 22 04:20:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B814814AC090; Tue, 22 Jan 2019 04:20:01 +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 5D10D700EE; Tue, 22 Jan 2019 04:20:01 +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 52AB323FBD; Tue, 22 Jan 2019 04:20:01 +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 x0M4K1UW023422; Tue, 22 Jan 2019 04:20:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M4K0oQ023418; Tue, 22 Jan 2019 04:20:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901220420.x0M4K0oQ023418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 22 Jan 2019 04:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343299 - stable/12/sys/dev/oce X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/dev/oce X-SVN-Commit-Revision: 343299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D10D700EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 04:20:02 -0000 Author: delphij Date: Tue Jan 22 04:20:00 2019 New Revision: 343299 URL: https://svnweb.freebsd.org/changeset/base/343299 Log: MFC r342856: Added support for the SIOCGI2C ioctl. Submitted by: Ram Kishore Vegesna Obtained from: Broadcom Modified: stable/12/sys/dev/oce/oce_if.c stable/12/sys/dev/oce/oce_if.h stable/12/sys/dev/oce/oce_mbox.c stable/12/sys/dev/oce/oce_sysctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/oce/oce_if.c ============================================================================== --- stable/12/sys/dev/oce/oce_if.c Tue Jan 22 03:53:42 2019 (r343298) +++ stable/12/sys/dev/oce/oce_if.c Tue Jan 22 04:20:00 2019 (r343299) @@ -475,6 +475,8 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d { struct ifreq *ifr = (struct ifreq *)data; POCE_SOFTC sc = ifp->if_softc; + struct ifi2creq i2c; + uint8_t offset = 0; int rc = 0; uint32_t u; @@ -584,6 +586,38 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d } #endif + break; + + case SIOCGI2C: + rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); + if (rc) + break; + + if (i2c.dev_addr != PAGE_NUM_A0 && + i2c.dev_addr != PAGE_NUM_A2) { + rc = EINVAL; + break; + } + + if (i2c.len > sizeof(i2c.data)) { + rc = EINVAL; + break; + } + + rc = oce_mbox_read_transrecv_data(sc, i2c.dev_addr); + if(rc) { + rc = -rc; + break; + } + + if (i2c.dev_addr == PAGE_NUM_A0) + offset = i2c.offset; + else + offset = TRANSCEIVER_A0_SIZE + i2c.offset; + + memcpy(&i2c.data[0], &sfp_vpd_dump_buffer[offset], i2c.len); + + rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; case SIOCGPRIVATE_0: Modified: stable/12/sys/dev/oce/oce_if.h ============================================================================== --- stable/12/sys/dev/oce/oce_if.h Tue Jan 22 03:53:42 2019 (r343298) +++ stable/12/sys/dev/oce/oce_if.h Tue Jan 22 04:20:00 2019 (r343299) @@ -1188,6 +1188,7 @@ static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc) #define PAGE_NUM_A2 0xa2 #define IS_QNQ_OR_UMC(sc) ((sc->pvid && (sc->function_mode & FNM_UMC_MODE ))\ || (sc->qnqid && (sc->function_mode & FNM_FLEX10_MODE))) +extern uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE]; struct oce_rdma_info; extern struct oce_rdma_if *oce_rdma_if; Modified: stable/12/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/12/sys/dev/oce/oce_mbox.c Tue Jan 22 03:53:42 2019 (r343298) +++ stable/12/sys/dev/oce/oce_mbox.c Tue Jan 22 04:20:00 2019 (r343299) @@ -41,7 +41,6 @@ /* $FreeBSD$ */ #include "oce_if.h" -extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; int oce_wait_ready(POCE_SOFTC sc) @@ -1966,15 +1965,15 @@ oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t p if(fwcmd->params.rsp.page_num == PAGE_NUM_A0) { bcopy((char *)fwcmd->params.rsp.page_data, - (char *)&sfp_vpd_dump_buffer[0], - TRANSCEIVER_A0_SIZE); + &sfp_vpd_dump_buffer[0], + TRANSCEIVER_A0_SIZE); } if(fwcmd->params.rsp.page_num == PAGE_NUM_A2) { bcopy((char *)fwcmd->params.rsp.page_data, - (char *)&sfp_vpd_dump_buffer[32], - TRANSCEIVER_A2_SIZE); + &sfp_vpd_dump_buffer[TRANSCEIVER_A0_SIZE], + TRANSCEIVER_A2_SIZE); } error: oce_dma_free(sc, &dma); Modified: stable/12/sys/dev/oce/oce_sysctl.c ============================================================================== --- stable/12/sys/dev/oce/oce_sysctl.c Tue Jan 22 03:53:42 2019 (r343298) +++ stable/12/sys/dev/oce/oce_sysctl.c Tue Jan 22 04:20:00 2019 (r343299) @@ -66,7 +66,7 @@ static void oce_add_stats_sysctls_xe201(POCE_SOFTC sc, extern char component_revision[32]; -uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; +uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE]; struct flash_img_attri { int img_offset; From owner-svn-src-all@freebsd.org Tue Jan 22 04:20:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CB614AC13A; Tue, 22 Jan 2019 04:20: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 D35127027D; Tue, 22 Jan 2019 04:20: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 C84C023FD2; Tue, 22 Jan 2019 04:20: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 x0M4KrZH023515; Tue, 22 Jan 2019 04:20:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M4KreP023512; Tue, 22 Jan 2019 04:20:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901220420.x0M4KreP023512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 22 Jan 2019 04:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343300 - stable/11/sys/dev/oce X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sys/dev/oce X-SVN-Commit-Revision: 343300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D35127027D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 04:20:54 -0000 Author: delphij Date: Tue Jan 22 04:20:52 2019 New Revision: 343300 URL: https://svnweb.freebsd.org/changeset/base/343300 Log: MFC r342856: Added support for the SIOCGI2C ioctl. Submitted by: Ram Kishore Vegesna Obtained from: Broadcom Modified: stable/11/sys/dev/oce/oce_if.c stable/11/sys/dev/oce/oce_if.h stable/11/sys/dev/oce/oce_mbox.c stable/11/sys/dev/oce/oce_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/oce/oce_if.c ============================================================================== --- stable/11/sys/dev/oce/oce_if.c Tue Jan 22 04:20:00 2019 (r343299) +++ stable/11/sys/dev/oce/oce_if.c Tue Jan 22 04:20:52 2019 (r343300) @@ -470,6 +470,8 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d { struct ifreq *ifr = (struct ifreq *)data; POCE_SOFTC sc = ifp->if_softc; + struct ifi2creq i2c; + uint8_t offset = 0; int rc = 0; uint32_t u; @@ -579,6 +581,38 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d } #endif + break; + + case SIOCGI2C: + rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); + if (rc) + break; + + if (i2c.dev_addr != PAGE_NUM_A0 && + i2c.dev_addr != PAGE_NUM_A2) { + rc = EINVAL; + break; + } + + if (i2c.len > sizeof(i2c.data)) { + rc = EINVAL; + break; + } + + rc = oce_mbox_read_transrecv_data(sc, i2c.dev_addr); + if(rc) { + rc = -rc; + break; + } + + if (i2c.dev_addr == PAGE_NUM_A0) + offset = i2c.offset; + else + offset = TRANSCEIVER_A0_SIZE + i2c.offset; + + memcpy(&i2c.data[0], &sfp_vpd_dump_buffer[offset], i2c.len); + + rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; case SIOCGPRIVATE_0: Modified: stable/11/sys/dev/oce/oce_if.h ============================================================================== --- stable/11/sys/dev/oce/oce_if.h Tue Jan 22 04:20:00 2019 (r343299) +++ stable/11/sys/dev/oce/oce_if.h Tue Jan 22 04:20:52 2019 (r343300) @@ -1186,6 +1186,7 @@ static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc) #define PAGE_NUM_A2 0xa2 #define IS_QNQ_OR_UMC(sc) ((sc->pvid && (sc->function_mode & FNM_UMC_MODE ))\ || (sc->qnqid && (sc->function_mode & FNM_FLEX10_MODE))) +extern uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE]; struct oce_rdma_info; extern struct oce_rdma_if *oce_rdma_if; Modified: stable/11/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/11/sys/dev/oce/oce_mbox.c Tue Jan 22 04:20:00 2019 (r343299) +++ stable/11/sys/dev/oce/oce_mbox.c Tue Jan 22 04:20:52 2019 (r343300) @@ -39,7 +39,6 @@ /* $FreeBSD$ */ #include "oce_if.h" -extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; int oce_wait_ready(POCE_SOFTC sc) @@ -1964,15 +1963,15 @@ oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t p if(fwcmd->params.rsp.page_num == PAGE_NUM_A0) { bcopy((char *)fwcmd->params.rsp.page_data, - (char *)&sfp_vpd_dump_buffer[0], - TRANSCEIVER_A0_SIZE); + &sfp_vpd_dump_buffer[0], + TRANSCEIVER_A0_SIZE); } if(fwcmd->params.rsp.page_num == PAGE_NUM_A2) { bcopy((char *)fwcmd->params.rsp.page_data, - (char *)&sfp_vpd_dump_buffer[32], - TRANSCEIVER_A2_SIZE); + &sfp_vpd_dump_buffer[TRANSCEIVER_A0_SIZE], + TRANSCEIVER_A2_SIZE); } error: oce_dma_free(sc, &dma); Modified: stable/11/sys/dev/oce/oce_sysctl.c ============================================================================== --- stable/11/sys/dev/oce/oce_sysctl.c Tue Jan 22 04:20:00 2019 (r343299) +++ stable/11/sys/dev/oce/oce_sysctl.c Tue Jan 22 04:20:52 2019 (r343300) @@ -64,7 +64,7 @@ static void oce_add_stats_sysctls_xe201(POCE_SOFTC sc, extern char component_revision[32]; -uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; +uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE]; struct flash_img_attri { int img_offset; From owner-svn-src-all@freebsd.org Tue Jan 22 04:36:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EFF214ACA06; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@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 35D2E70BC1; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 297A524338; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M4aK9c033510; Tue, 22 Jan 2019 04:36:20 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M4aK57033509; Tue, 22 Jan 2019 04:36:20 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220436.x0M4aK57033509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 04:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343301 - head/sys/modules/vmware/vmxnet3 X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/modules/vmware/vmxnet3 X-SVN-Commit-Revision: 343301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35D2E70BC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 04:36:20 -0000 Author: pkelsey Date: Tue Jan 22 04:36:19 2019 New Revision: 343301 URL: https://svnweb.freebsd.org/changeset/base/343301 Log: Add missing dependency to vmxnet3 Makefile and clean it up a bit otherwise. MFC after: 1 week Modified: head/sys/modules/vmware/vmxnet3/Makefile Modified: head/sys/modules/vmware/vmxnet3/Makefile ============================================================================== --- head/sys/modules/vmware/vmxnet3/Makefile Tue Jan 22 04:20:52 2019 (r343300) +++ head/sys/modules/vmware/vmxnet3/Makefile Tue Jan 22 04:36:19 2019 (r343301) @@ -27,10 +27,7 @@ KMOD= if_vmx SRCS= if_vmx.c -SRCS+= bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h - -# With VMXNET3_LEGACY_TX, the driver will use the non-multiqueue -# capable if_start interface. -#CFLAGS+= -DVMXNET3_LEGACY_TX +SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h +SRCS+= opt_inet.h opt_inet6.h .include From owner-svn-src-all@freebsd.org Tue Jan 22 12:56:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1278114BBF0D; Tue, 22 Jan 2019 12:56:51 +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 73DF78B388; Tue, 22 Jan 2019 12:56:50 +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 634A71944; Tue, 22 Jan 2019 12:56:50 +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 x0MCuobp095419; Tue, 22 Jan 2019 12:56:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MCun47095417; Tue, 22 Jan 2019 12:56:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901221256.x0MCun47095417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Jan 2019 12:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343302 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 343302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73DF78B388 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 12:56:51 -0000 Author: kib Date: Tue Jan 22 12:56:49 2019 New Revision: 343302 URL: https://svnweb.freebsd.org/changeset/base/343302 Log: Remove unused *_sysinit_flags() declarations. Submitted by: Sebastian Huber MFC after: 3 days Modified: head/sys/sys/rmlock.h head/sys/sys/rwlock.h Modified: head/sys/sys/rmlock.h ============================================================================== --- head/sys/sys/rmlock.h Tue Jan 22 04:36:19 2019 (r343301) +++ head/sys/sys/rmlock.h Tue Jan 22 12:56:49 2019 (r343302) @@ -54,7 +54,6 @@ void rm_init_flags(struct rmlock *rm, const char *name void rm_destroy(struct rmlock *rm); int rm_wowned(const struct rmlock *rm); void rm_sysinit(void *arg); -void rm_sysinit_flags(void *arg); void _rm_wlock_debug(struct rmlock *rm, const char *file, int line); void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line); Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Tue Jan 22 04:36:19 2019 (r343301) +++ head/sys/sys/rwlock.h Tue Jan 22 12:56:49 2019 (r343302) @@ -130,7 +130,6 @@ void _rw_init_flags(volatile uintptr_t *c, const char *name, int opts); void _rw_destroy(volatile uintptr_t *c); void rw_sysinit(void *arg); -void rw_sysinit_flags(void *arg); int _rw_wowned(const volatile uintptr_t *c); void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); int __rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); From owner-svn-src-all@freebsd.org Tue Jan 22 13:11:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1057614814E1; Tue, 22 Jan 2019 13:11:16 +0000 (UTC) (envelope-from se@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 AC3988BCD3; Tue, 22 Jan 2019 13:11:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9FB981B39; Tue, 22 Jan 2019 13:11:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MDBF1p002122; Tue, 22 Jan 2019 13:11:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MDBFic002121; Tue, 22 Jan 2019 13:11:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901221311.x0MDBFic002121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Tue, 22 Jan 2019 13:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343303 - head/usr.sbin/kbdmap X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.sbin/kbdmap X-SVN-Commit-Revision: 343303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC3988BCD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 13:11:16 -0000 Author: se Date: Tue Jan 22 13:11:15 2019 New Revision: 343303 URL: https://svnweb.freebsd.org/changeset/base/343303 Log: Silence a CI warning regarding the use of strcpy(). While this is a false positive (a sufficiently large buffer has been allocated in the line above), the use of strdup() simplifies and clarifies the code. MFC after: 2 weeks Modified: head/usr.sbin/kbdmap/kbdmap.c Modified: head/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.c Tue Jan 22 12:56:49 2019 (r343302) +++ head/usr.sbin/kbdmap/kbdmap.c Tue Jan 22 13:11:15 2019 (r343303) @@ -241,8 +241,7 @@ get_font(void) if (strcmp(buf, "NO")) { if (fnt) free(fnt); - fnt = (char *) malloc(strlen(buf) + 1); - strcpy(fnt, buf); + fnt = strdup(buf); } } } From owner-svn-src-all@freebsd.org Tue Jan 22 17:34:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F7E14A9666; Tue, 22 Jan 2019 17:34:54 +0000 (UTC) (envelope-from gallatin@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 E92F79585E; Tue, 22 Jan 2019 17:34:53 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DB4EF4B36; Tue, 22 Jan 2019 17:34:53 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MHYrPT047136; Tue, 22 Jan 2019 17:34:53 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MHYrxY047134; Tue, 22 Jan 2019 17:34:53 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901221734.x0MHYrxY047134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 22 Jan 2019 17:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343304 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 343304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E92F79585E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 17:34:54 -0000 Author: gallatin Date: Tue Jan 22 17:34:53 2019 New Revision: 343304 URL: https://svnweb.freebsd.org/changeset/base/343304 Log: MFC r341095: Use busdma unconditionally in iflib - Remove the complex mechanism to choose between using busdma and raw pmap_kextract at runtime. The reduced complexity makes the code easier to read and maintain. - Fix a bug in the small packet receive path where clusters were repeatedly mapped but never unmapped. We now store the cluster's bus address and avoid re-mapping the cluster each time a small packet is received. This patch fixes bugs I've seen where ixl(4) will not even respond to ping without seeing DMAR faults. I see a small improvement (14%) on packet forwarding tests using a Haswell based Xeon E5-2697 v3. Olivier sees a small regression (-3% to -6%) with lower end hardware. Reviewed by: mmacy Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D17901 Modified: stable/12/sys/net/iflib.c stable/12/sys/net/iflib_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Tue Jan 22 13:11:15 2019 (r343303) +++ stable/12/sys/net/iflib.c Tue Jan 22 17:34:53 2019 (r343304) @@ -92,15 +92,6 @@ __FBSDID("$FreeBSD$"); #include "ifdi_if.h" -#if defined(__i386__) || defined(__amd64__) -#include -#include -#include -#include -#include -#include -#endif - #ifdef PCI_IOV #include #endif @@ -282,24 +273,16 @@ iflib_get_sctx(if_ctx_t ctx) #define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP) #define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) -#define RX_SW_DESC_MAP_CREATED (1 << 0) -#define TX_SW_DESC_MAP_CREATED (1 << 1) -#define RX_SW_DESC_INUSE (1 << 3) -#define TX_SW_DESC_MAPPED (1 << 4) - -#define M_TOOBIG M_PROTO1 - typedef struct iflib_sw_rx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ caddr_t *ifsd_cl; /* direct cluster pointer for rx */ - uint8_t *ifsd_flags; + bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ } iflib_rxsd_array_t; typedef struct iflib_sw_tx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ - uint8_t *ifsd_flags; } if_txsd_vec_t; @@ -940,9 +923,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl if_ctx_t ctx = ifp->if_softc; iflib_txq_t txq = &ctx->ifc_txqs[kring->ring_id]; - if (txq->ift_sds.ifsd_map) - bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* @@ -1024,9 +1006,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl kring->nr_hwcur = nm_i; /* synchronize the NIC ring */ - if (txq->ift_sds.ifsd_map) - bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* (re)start the tx unit up to slot nic_i (excluded) */ ctx->isc_txd_flush(ctx->ifc_softc, txq->ift_id, nic_i); @@ -1129,9 +1110,8 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; ring->slot[nm_i].flags = 0; - if (fl->ifl_sds.ifsd_map) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, - fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, + fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); } @@ -1210,9 +1190,6 @@ iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) slot = netmap_reset(na, NR_TX, txq->ift_id, 0); if (slot == NULL) return; - if (txq->ift_sds.ifsd_map == NULL) - return; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxd[0]; i++) { /* @@ -1657,13 +1634,6 @@ iflib_txsd_alloc(iflib_txq_t txq) goto fail; } - if (!(txq->ift_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { - device_printf(dev, "Unable to allocate tx_buffer memory\n"); - err = ENOMEM; - goto fail; - } if (!(txq->ift_sds.ifsd_m = (struct mbuf **) malloc(sizeof(struct mbuf *) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { @@ -1673,10 +1643,6 @@ iflib_txsd_alloc(iflib_txq_t txq) } /* Create the descriptor buffer dma maps */ -#if defined(ACPI_DMAR) || (! (defined(__i386__) || defined(__amd64__))) - if ((ctx->ifc_flags & IFC_DMAR) == 0) - return (0); - if (!(txq->ift_sds.ifsd_map = (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); @@ -1691,7 +1657,6 @@ iflib_txsd_alloc(iflib_txq_t txq) goto fail; } } -#endif return (0); fail: /* We free all, it handles case where we are in the middle */ @@ -1729,10 +1694,6 @@ iflib_txq_destroy(iflib_txq_t txq) free(txq->ift_sds.ifsd_m, M_IFLIB); txq->ift_sds.ifsd_m = NULL; } - if (txq->ift_sds.ifsd_flags != NULL) { - free(txq->ift_sds.ifsd_flags, M_IFLIB); - txq->ift_sds.ifsd_flags = NULL; - } if (txq->ift_desc_tag != NULL) { bus_dma_tag_destroy(txq->ift_desc_tag); txq->ift_desc_tag = NULL; @@ -1834,13 +1795,6 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) __func__, err); goto fail; } - if (!(fl->ifl_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { - device_printf(dev, "Unable to allocate tx_buffer memory\n"); - err = ENOMEM; - goto fail; - } if (!(fl->ifl_sds.ifsd_m = (struct mbuf **) malloc(sizeof(struct mbuf *) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { @@ -1856,11 +1810,15 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) goto fail; } - /* Create the descriptor buffer dma maps */ -#if defined(ACPI_DMAR) || (! (defined(__i386__) || defined(__amd64__))) - if ((ctx->ifc_flags & IFC_DMAR) == 0) - continue; + if (!(fl->ifl_sds.ifsd_ba = + (bus_addr_t *) malloc(sizeof(bus_addr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + device_printf(dev, "Unable to allocate rx bus addr memory\n"); + err = ENOMEM; + goto fail; + } + /* Create the descriptor buffer dma maps */ if (!(fl->ifl_sds.ifsd_map = (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); @@ -1875,7 +1833,6 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) goto fail; } } -#endif } return (0); @@ -1905,13 +1862,6 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int cb_arg->nseg = nseg; } - -#ifdef ACPI_DMAR -#define IS_DMAR(ctx) (ctx->ifc_flags & IFC_DMAR) -#else -#define IS_DMAR(ctx) (0) -#endif - /** * rxq_refill - refill an rxq free-buffer list * @ctx: the iflib context @@ -1929,18 +1879,18 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun int pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; - uint8_t *sd_flags; struct if_rxd_update iru; + struct rxq_refill_cb_arg cb_arg; bus_dmamap_t *sd_map; int n, i = 0; - uint64_t bus_addr; + bus_addr_t bus_addr, *sd_ba; int err; qidx_t credits; sd_m = fl->ifl_sds.ifsd_m; sd_map = fl->ifl_sds.ifsd_map; sd_cl = fl->ifl_sds.ifsd_cl; - sd_flags = fl->ifl_sds.ifsd_flags; + sd_ba = fl->ifl_sds.ifsd_ba; idx = pidx; credits = fl->ifl_credits; @@ -1970,35 +1920,15 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); if ((cl = sd_cl[frag_idx]) == NULL) { - if ((cl = sd_cl[frag_idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) + if ((cl = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; -#if MEMORY_LOGGING - fl->ifl_cl_enqueued++; -#endif - } - if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { - break; - } -#if MEMORY_LOGGING - fl->ifl_m_enqueued++; -#endif - DBG_COUNTER_INC(rx_allocs); -#if defined(__i386__) || defined(__amd64__) - if (!IS_DMAR(ctx)) { - bus_addr = pmap_kextract((vm_offset_t)cl); - } else -#endif - { - struct rxq_refill_cb_arg cb_arg; - cb_arg.error = 0; MPASS(sd_map != NULL); - MPASS(sd_map[frag_idx] != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], - cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); + cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); + BUS_DMASYNC_PREREAD); if (err != 0 || cb_arg.error) { /* @@ -2006,18 +1936,29 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun */ if (fl->ifl_zone == zone_pack) uma_zfree(fl->ifl_zone, cl); - m_free(m); - n = 0; - goto done; + break; } - bus_addr = cb_arg.seg.ds_addr; + + sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; + sd_cl[frag_idx] = cl; +#if MEMORY_LOGGING + fl->ifl_cl_enqueued++; +#endif + } else { + bus_addr = sd_ba[frag_idx]; } - bit_set(fl->ifl_rx_bitmap, frag_idx); - sd_flags[frag_idx] |= RX_SW_DESC_INUSE; + bit_set(fl->ifl_rx_bitmap, frag_idx); MPASS(sd_m[frag_idx] == NULL); - sd_cl[frag_idx] = cl; + if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { + break; + } sd_m[frag_idx] = m; +#if MEMORY_LOGGING + fl->ifl_m_enqueued++; +#endif + + DBG_COUNTER_INC(rx_allocs); fl->ifl_rxd_idxs[i] = frag_idx; fl->ifl_bus_addrs[i] = bus_addr; fl->ifl_vm_addrs[i] = cl; @@ -2039,7 +1980,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } } -done: + if (i) { iru.iru_pidx = pidx; iru.iru_count = i; @@ -2053,9 +1994,8 @@ done: else pidx = fl->ifl_pidx - 1; - if (sd_map) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); fl->ifl_fragidx = frag_idx; } @@ -2094,24 +2034,20 @@ iflib_fl_bufs_free(iflib_fl_t fl) for (i = 0; i < fl->ifl_size; i++) { struct mbuf **sd_m = &fl->ifl_sds.ifsd_m[i]; - uint8_t *sd_flags = &fl->ifl_sds.ifsd_flags[i]; caddr_t *sd_cl = &fl->ifl_sds.ifsd_cl[i]; - if (*sd_flags & RX_SW_DESC_INUSE) { - if (fl->ifl_sds.ifsd_map != NULL) { - bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; - bus_dmamap_unload(fl->ifl_desc_tag, sd_map); - // XXX: Should this get moved out? - if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) - bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); - } + if (*sd_cl != NULL) { + bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; + bus_dmamap_unload(fl->ifl_desc_tag, sd_map); + if (*sd_cl != NULL) + uma_zfree(fl->ifl_zone, *sd_cl); + // XXX: Should this get moved out? + if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) + bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, *sd_m); } - if (*sd_cl != NULL) - uma_zfree(fl->ifl_zone, *sd_cl); - *sd_flags = 0; } else { MPASS(*sd_cl == NULL); MPASS(*sd_m == NULL); @@ -2125,7 +2061,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) } #ifdef INVARIANTS for (i = 0; i < fl->ifl_size; i++) { - MPASS(fl->ifl_sds.ifsd_flags[i] == 0); MPASS(fl->ifl_sds.ifsd_cl[i] == NULL); MPASS(fl->ifl_sds.ifsd_m[i] == NULL); } @@ -2216,10 +2151,12 @@ iflib_rx_sds_free(iflib_rxq_t rxq) } free(fl->ifl_sds.ifsd_m, M_IFLIB); free(fl->ifl_sds.ifsd_cl, M_IFLIB); + free(fl->ifl_sds.ifsd_ba, M_IFLIB); /* XXX destroy maps first */ free(fl->ifl_sds.ifsd_map, M_IFLIB); fl->ifl_sds.ifsd_m = NULL; fl->ifl_sds.ifsd_cl = NULL; + fl->ifl_sds.ifsd_ba = NULL; fl->ifl_sds.ifsd_map = NULL; } free(rxq->ifr_fl, M_IFLIB); @@ -2488,27 +2425,23 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int #endif if (rxq->ifr_ctx->ifc_flags & IFC_PREFETCH) prefetch_pkts(fl, cidx); - if (fl->ifl_sds.ifsd_map != NULL) { - next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); - prefetch(&fl->ifl_sds.ifsd_map[next]); - map = fl->ifl_sds.ifsd_map[cidx]; - di = fl->ifl_ifdi; - next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); - prefetch(&fl->ifl_sds.ifsd_flags[next]); - bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); + prefetch(&fl->ifl_sds.ifsd_map[next]); + map = fl->ifl_sds.ifsd_map[cidx]; + di = fl->ifl_ifdi; + next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); + bus_dmamap_sync(di->idi_tag, di->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* not valid assert if bxe really does SGE from non-contiguous elements */ - MPASS(fl->ifl_cidx == cidx); - if (unload) - bus_dmamap_unload(fl->ifl_desc_tag, map); - } + MPASS(fl->ifl_cidx == cidx); + if (unload) + bus_dmamap_unload(fl->ifl_desc_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); if (__predict_false(fl->ifl_cidx == 0)) fl->ifl_gen = 0; - if (map != NULL) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bit_clear(fl->ifl_rx_bitmap, cidx); } @@ -3071,147 +3004,24 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, static __noinline struct mbuf * iflib_remove_mbuf(iflib_txq_t txq) { - int ntxd, i, pidx; - struct mbuf *m, *mh, **ifsd_m; + int ntxd, pidx; + struct mbuf *m, **ifsd_m; + bus_dmamap_t *ifsd_map; - pidx = txq->ift_pidx; ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; - mh = m = ifsd_m[pidx]; + pidx = txq->ift_pidx & (ntxd - 1); + ifsd_m = txq->ift_sds.ifsd_m; + ifsd_map = txq->ift_sds.ifsd_map; + m = ifsd_m[pidx]; ifsd_m[pidx] = NULL; + bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[pidx]); #if MEMORY_LOGGING txq->ift_dequeued++; #endif - i = 1; - - while (m) { - ifsd_m[(pidx + i) & (ntxd -1)] = NULL; -#if MEMORY_LOGGING - txq->ift_dequeued++; -#endif - m = m->m_next; - i++; - } - return (mh); + return (m); } -static int -iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag_t tag, bus_dmamap_t map, - struct mbuf **m0, bus_dma_segment_t *segs, int *nsegs, - int max_segs, int flags) -{ - if_ctx_t ctx; - if_shared_ctx_t sctx; - if_softc_ctx_t scctx; - int i, next, pidx, err, ntxd, count; - struct mbuf *m, *tmp, **ifsd_m; - - m = *m0; - - /* - * Please don't ever do this - */ - MPASS(__predict_true(m->m_len > 0)); - - ctx = txq->ift_ctx; - sctx = ctx->ifc_sctx; - scctx = &ctx->ifc_softc_ctx; - ifsd_m = txq->ift_sds.ifsd_m; - ntxd = txq->ift_size; - pidx = txq->ift_pidx; - if (map != NULL) { - uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags; - - err = bus_dmamap_load_mbuf_sg(tag, map, - *m0, segs, nsegs, BUS_DMA_NOWAIT); - if (err) - return (err); - ifsd_flags[pidx] |= TX_SW_DESC_MAPPED; - count = 0; - m = *m0; - do { - if (__predict_false(m->m_len <= 0)) { - tmp = m; - m = m->m_next; - tmp->m_next = NULL; - m_free(tmp); - continue; - } - m = m->m_next; - count++; - } while (m != NULL); - if (count > *nsegs) { - ifsd_m[pidx] = *m0; - ifsd_m[pidx]->m_flags |= M_TOOBIG; - return (0); - } - m = *m0; - count = 0; - do { - next = (pidx + count) & (ntxd-1); - MPASS(ifsd_m[next] == NULL); - ifsd_m[next] = m; - count++; - tmp = m; - m = m->m_next; - } while (m != NULL); - } else { - int buflen, sgsize, maxsegsz, max_sgsize; - vm_offset_t vaddr; - vm_paddr_t curaddr; - - count = i = 0; - m = *m0; - if (m->m_pkthdr.csum_flags & CSUM_TSO) - maxsegsz = scctx->isc_tx_tso_segsize_max; - else - maxsegsz = sctx->isc_tx_maxsegsize; - - do { - if (__predict_false(m->m_len <= 0)) { - tmp = m; - m = m->m_next; - tmp->m_next = NULL; - m_free(tmp); - continue; - } - buflen = m->m_len; - vaddr = (vm_offset_t)m->m_data; - /* - * see if we can't be smarter about physically - * contiguous mappings - */ - next = (pidx + count) & (ntxd-1); - MPASS(ifsd_m[next] == NULL); -#if MEMORY_LOGGING - txq->ift_enqueued++; -#endif - ifsd_m[next] = m; - while (buflen > 0) { - if (i >= max_segs) - goto err; - max_sgsize = MIN(buflen, maxsegsz); - curaddr = pmap_kextract(vaddr); - sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); - sgsize = MIN(sgsize, max_sgsize); - segs[i].ds_addr = curaddr; - segs[i].ds_len = sgsize; - vaddr += sgsize; - buflen -= sgsize; - i++; - } - count++; - tmp = m; - m = m->m_next; - } while (m != NULL); - *nsegs = i; - } - return (0); -err: - *m0 = iflib_remove_mbuf(txq); - return (EFBIG); -} - static inline caddr_t calc_next_txd(iflib_txq_t txq, int cidx, uint8_t qid) { @@ -3282,7 +3092,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) if_shared_ctx_t sctx; if_softc_ctx_t scctx; bus_dma_segment_t *segs; - struct mbuf *m_head; + struct mbuf *m_head, **ifsd_m; void *next_txd; bus_dmamap_t map; struct if_pkt_info pi; @@ -3312,13 +3122,11 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) /* prefetch the next cache line of mbuf pointers and flags */ prefetch(&txq->ift_sds.ifsd_m[next]); - if (txq->ift_sds.ifsd_map != NULL) { - prefetch(&txq->ift_sds.ifsd_map[next]); - next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); - prefetch(&txq->ift_sds.ifsd_flags[next]); - } - } else if (txq->ift_sds.ifsd_map != NULL) - map = txq->ift_sds.ifsd_map[pidx]; + prefetch(&txq->ift_sds.ifsd_map[next]); + next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); + } + map = txq->ift_sds.ifsd_map[pidx]; + ifsd_m = txq->ift_sds.ifsd_m; if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { desc_tag = txq->ift_tso_desc_tag; @@ -3357,7 +3165,8 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) } retry: - err = iflib_busdma_load_mbuf_sg(txq, desc_tag, map, m_headp, segs, &nsegs, max_segs, BUS_DMA_NOWAIT); + err = bus_dmamap_load_mbuf_sg(desc_tag, map, m_head, segs, &nsegs, + BUS_DMA_NOWAIT); defrag: if (__predict_false(err)) { switch (err) { @@ -3394,7 +3203,7 @@ defrag: DBG_COUNTER_INC(encap_txd_encap_fail); return (err); } - + ifsd_m[pidx] = m_head; /* * XXX assumes a 1 to 1 relationship between segments and * descriptors - this does not hold true on all drivers, e.g. @@ -3402,8 +3211,7 @@ defrag: */ if (__predict_false(nsegs + 2 > TXQ_AVAIL(txq))) { txq->ift_no_desc_avail++; - if (map != NULL) - bus_dmamap_unload(desc_tag, map); + bus_dmamap_unload(desc_tag, map); DBG_COUNTER_INC(encap_txq_avail_fail); DBG_COUNTER_INC(encap_txd_encap_fail); if ((txq->ift_task.gt_task.ta_flags & TASK_ENQUEUED) == 0) @@ -3430,12 +3238,10 @@ defrag: #ifdef PKT_DEBUG print_pkt(&pi); #endif - if (map != NULL) - bus_dmamap_sync(desc_tag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(desc_tag, map, BUS_DMASYNC_PREWRITE); if ((err = ctx->isc_txd_encap(ctx->ifc_softc, &pi)) == 0) { - if (map != NULL) - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); DBG_COUNTER_INC(tx_encap); MPASS(pi.ipi_new_pidx < txq->ift_size); @@ -3489,10 +3295,8 @@ defrag_failed: static void iflib_tx_desc_free(iflib_txq_t txq, int n) { - int hasmap; uint32_t qsize, cidx, mask, gen; struct mbuf *m, **ifsd_m; - uint8_t *ifsd_flags; bus_dmamap_t *ifsd_map; bool do_prefetch; @@ -3500,8 +3304,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) gen = txq->ift_gen; qsize = txq->ift_size; mask = qsize-1; - hasmap = txq->ift_sds.ifsd_map != NULL; - ifsd_flags = txq->ift_sds.ifsd_flags; ifsd_m = txq->ift_sds.ifsd_m; ifsd_map = txq->ift_sds.ifsd_map; do_prefetch = (txq->ift_ctx->ifc_flags & IFC_PREFETCH); @@ -3511,35 +3313,17 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) prefetch(ifsd_m[(cidx + 3) & mask]); prefetch(ifsd_m[(cidx + 4) & mask]); } - if (ifsd_m[cidx] != NULL) { + if ((m = ifsd_m[cidx]) != NULL) { prefetch(&ifsd_m[(cidx + CACHE_PTR_INCREMENT) & mask]); - prefetch(&ifsd_flags[(cidx + CACHE_PTR_INCREMENT) & mask]); - if (hasmap && (ifsd_flags[cidx] & TX_SW_DESC_MAPPED)) { - /* - * does it matter if it's not the TSO tag? If so we'll - * have to add the type to flags - */ - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); - ifsd_flags[cidx] &= ~TX_SW_DESC_MAPPED; - } - if ((m = ifsd_m[cidx]) != NULL) { - /* XXX we don't support any drivers that batch packets yet */ - MPASS(m->m_nextpkt == NULL); - /* if the number of clusters exceeds the number of segments - * there won't be space on the ring to save a pointer to each - * cluster so we simply free the list here - */ - if (m->m_flags & M_TOOBIG) { - m_freem(m); - } else { - m_free(m); - } - ifsd_m[cidx] = NULL; + bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); + /* XXX we don't support any drivers that batch packets yet */ + MPASS(m->m_nextpkt == NULL); + m_freem(m); + ifsd_m[cidx] = NULL; #if MEMORY_LOGGING - txq->ift_dequeued++; + txq->ift_dequeued++; #endif - DBG_COUNTER_INC(tx_frees); - } + DBG_COUNTER_INC(tx_frees); } if (__predict_false(++cidx == qsize)) { cidx = 0; @@ -4537,14 +4321,6 @@ iflib_device_register(device_t dev, void *sc, if_share scctx->isc_ntxqsets = scctx->isc_ntxqsets_max; if (scctx->isc_nrxqsets == 0 || (scctx->isc_nrxqsets_max && scctx->isc_nrxqsets_max < scctx->isc_nrxqsets)) scctx->isc_nrxqsets = scctx->isc_nrxqsets_max; - -#ifdef ACPI_DMAR - if (dmar_get_dma_tag(device_get_parent(dev), dev) != NULL) - ctx->ifc_flags |= IFC_DMAR; -#elif !(defined(__i386__) || defined(__amd64__)) - /* set unconditionally for !x86 */ - ctx->ifc_flags |= IFC_DMAR; -#endif main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; Modified: stable/12/sys/net/iflib_private.h ============================================================================== --- stable/12/sys/net/iflib_private.h Tue Jan 22 13:11:15 2019 (r343303) +++ stable/12/sys/net/iflib_private.h Tue Jan 22 17:34:53 2019 (r343304) @@ -34,7 +34,7 @@ #define IFC_LEGACY 0x001 #define IFC_QFLUSH 0x002 #define IFC_MULTISEG 0x004 -#define IFC_DMAR 0x008 +#define IFC_SPARE1 0x008 #define IFC_SC_ALLOCATED 0x010 #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 From owner-svn-src-all@freebsd.org Tue Jan 22 17:39:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50F9B14A9777; Tue, 22 Jan 2019 17:39:27 +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 EB35795A44; Tue, 22 Jan 2019 17:39:26 +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 DB69D4B3A; Tue, 22 Jan 2019 17:39:26 +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 x0MHdQX5047361; Tue, 22 Jan 2019 17:39:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MHdQps047360; Tue, 22 Jan 2019 17:39:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901221739.x0MHdQps047360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 22 Jan 2019 17:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343305 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB35795A44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 17:39:27 -0000 Author: brooks Date: Tue Jan 22 17:39:26 2019 New Revision: 343305 URL: https://svnweb.freebsd.org/changeset/base/343305 Log: Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. This is more compatible with formatting tools and looks more normal. Reported by: jhb (on a different review) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18442 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) @@ -168,14 +168,14 @@ struct ifmediareq32 { #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct ifmediareq32) #define _CASE_IOC_IFGROUPREQ_32(cmd) \ - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case #else /* !COMPAT_FREEBSD32 */ #define _CASE_IOC_IFGROUPREQ_32(cmd) #endif /* !COMPAT_FREEBSD32 */ #define CASE_IOC_IFGROUPREQ(cmd) \ _CASE_IOC_IFGROUPREQ_32(cmd) \ - case (cmd) + (cmd) union ifreq_union { struct ifreq ifr; @@ -2894,7 +2894,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); @@ -2903,12 +2903,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, return (error); break; - CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): if ((error = if_getgroup((struct ifgroupreq *)data, ifp))) return (error); break; - CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): error = priv_check(td, PRIV_NET_DELIFGROUP); if (error) return (error); @@ -3063,7 +3063,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_list((struct if_clonereq *)data); goto out_noref; - CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): + case CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); goto out_noref; From owner-svn-src-all@freebsd.org Tue Jan 22 18:01:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93F1314AA075 for ; Tue, 22 Jan 2019 18:01:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EC49667B for ; Tue, 22 Jan 2019 18:01:30 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548179061; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=oOUBlm9JajN7+0ZEEUbG11uudqQM4GyzgST3k2TCV4TqSG6iaGsUce3MiGtYq5FW1VO+R3/yuo/CH /TjFZbDdhx1tnsMHeoTAkhMZiMuEG6EV53lfErTPZvN5JPIj0ZbCwWckRrBXnVShrA3xDIhztL81fL AJjwRA8i9E12Mrf0N6QW8NOQoYSOqGn+Mqc6OxWD6melk4xmAoPcF5C0FXyYu9dx81TfKv7lD7dBG5 ErkhyyaoeEs50Sr9VypOnRdEGZQwFKKruyoOimXXX1Pth8cyfdgMnkabBXoFDnP4umsQmKOTA1pnDb MrwDukxPUeXxSCUdofneO8yfhyouePg== 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:to:from:subject:message-id:dkim-signature:from; bh=y8SE+s26+b5A4cv8r00QVFwFf9GBwxNXwW/UBadoJSo=; b=NIq8YKZaObY1Cudb/12cbj7vSSeWSoVCpDJtmWzMme3nApEzqR2sjG7pAaydBrgWEBRg+AuUvOxks rT29z5NMcK9PErMKKN70HT9s8kaPzTUmzqAZi72CBhJ3HoLG6lmeRTLO9NG137J6jqn9U1tSlij4nY xHKResICkGcQAIheg1ipec8SRiIL/iAWrty2dMtiUK23a6JqcGYLQLE2EnocYU6h52VbommzZq2rQW qExWtnO1HULkggD35j1y6nUzGlAysd+d02gymCAxD7Rr6sKJBGmHecJFQCe3C7iKk1qhWg/f6iQYNr kXQR7mZBysb+6YOyVG3KFso+5Pvj7BA== ARC-Authentication-Results: i=1; outbound4.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:to:from:subject:message-id:from; bh=y8SE+s26+b5A4cv8r00QVFwFf9GBwxNXwW/UBadoJSo=; b=ImYpBIqc+Cmgc4L5cjoVg424ZDb7R17/J4TFHRVIc9m0ylyTi/NI6sjoa6GpTXYLWZ+wSx0ScU26S PzgXIrFJFw+V20NmQYF0J0WaHvnx2OQdNRfzbMvAfGKJNlrTKGLjUpXN13/OemcIrZTZ3fNBgsFbO8 qk7sK8YXgJvHIhItCKYTAgT1IEutrJ/KjD8Rboi0ZvwlqvysPNZwlGPWE1klAyPNXZDZRtTg5Mnj6f YSbZeJNHrC+SSer3qT0O6/b8nQ+R2cCLwrU+d3IxES3aapXr2XXkQbY7DpmvpuN0at4eFucGUl7nSa t/f0ZkjUI3dN6jpDgUpgxrT4L08REtA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 588bbae1-1e6d-11e9-befd-af03bedce89f 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 outbound4.ore.mailhop.org (Halon) with ESMTPSA id 588bbae1-1e6d-11e9-befd-af03bedce89f; Tue, 22 Jan 2019 17:44:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0MHjGPH095249; Tue, 22 Jan 2019 10:45:16 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r343305 - head/sys/net From: Ian Lepore To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 22 Jan 2019 10:45:16 -0700 In-Reply-To: <201901221739.x0MHdQps047360@repo.freebsd.org> References: <201901221739.x0MHdQps047360@repo.freebsd.org> 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: 18EC49667B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:01:30 -0000 On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Jan 22 17:39:26 2019 > New Revision: 343305 > URL: https://svnweb.freebsd.org/changeset/base/343305 > > Log: > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > This is more compatible with formatting tools and looks more > normal. > > Reported by: jhb (on a different review) > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18442 > > Modified: > head/sys/net/if.c > > Modified: head/sys/net/if.c > ===================================================================== > ========= > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > @@ -168,14 +168,14 @@ struct ifmediareq32 { > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > ifmediareq32) > > #define _CASE_IOC_IFGROUPREQ_32(cmd) > \ > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case That 'case' at the end of the line doesn't look right. -- Ian From owner-svn-src-all@freebsd.org Tue Jan 22 18:13:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597B814AA6D4; Tue, 22 Jan 2019 18:13:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8A8A97219; Tue, 22 Jan 2019 18:13:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd29.google.com with SMTP id k2so19876420iog.7; Tue, 22 Jan 2019 10:13:03 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DW0eb+zv2NZxrR/ceid+v2jLLPo6ps51j2M/byTTwBw=; b=sr++J1IC0X7RhuS4eugg3hadqNFOhJgmIBvz7xec2a5zpMeadNWJHQdcsdqRPfRxYr qnq4J2el7FH5oDp+W9VzRxGqQ3Z8JAOBzz0/9aT+2yFfLXUav7L7rTzbfFYB9KB6EY2a NHaBklkH29Dq26ZZnS2K00RLoSBBX5ezB+uYjxm+IPBBuDOqYfjPyMb9RjCZh8KD9eWS p6pPf1/0smiPuXr1t0eOGl8gbBQDgUH6Qgwjk4WqZGs3xpOC24C9lnk61zmz2pOuUfgx tHjQQWtdEX8NBBGw1kwcW7hvqb3BkI05m4viGjmnZFeVQUH2INzP5oWRjwzL43sfB6KT Ek6w== 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 :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DW0eb+zv2NZxrR/ceid+v2jLLPo6ps51j2M/byTTwBw=; b=cb/VfyfuiiDH53qruEpAqb4hmqhSBj8gs0Ir90NG4Xxf1Bx401Y7QVUWoW+ng4vMdl fiC0OqSVLaPRfPAUYKTcQYnFKo19Cv4c9vuOeNZwwdYIT2D6r+eFinSewCQgGiqCfprx ahSBonpnQBnJp6nO4ZDXEAqwqnUvKo+S2IUnKTtEcw/+hwgo+4Hl6/5ob9+9XKPj2q8r ApNx8T0hu9oCPAS4j22HmuuoFr1DQlzIIzxmuFe/B2fbu9q68FSnREff+9gualJlKfBM 3A2flH6oEeMdQzDq3qEytooUJSVrLC+wXTnm/c4IEQS2FqNFHloBGUQFyRLeRY4dZ5vY JnZQ== X-Gm-Message-State: AJcUukfYOktOZCHQO848h8eAYHJl58I/vnu2fE/bDWKty//XGjqMCgey 6NFOBsvWZQCxsSsJww+lAAeFGcwoEdc= X-Google-Smtp-Source: ALg8bN7/2mgAfEkApR6PmMK18F6tkn78GxmXF0edaI8xB20u6qq4oI9rs/SnQdBlWdTvCEvwxf9elQ== X-Received: by 2002:a6b:f017:: with SMTP id w23mr18090377ioc.12.1548180782782; Tue, 22 Jan 2019 10:13:02 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id e21sm8147064itc.6.2019.01.22.10.13.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 10:13:02 -0800 (PST) Sender: Mark Johnston Date: Tue, 22 Jan 2019 13:12:57 -0500 From: Mark Johnston To: Ian Lepore Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343305 - head/sys/net Message-ID: <20190122181257.GA81189@raichu> References: <201901221739.x0MHdQps047360@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: D8A8A97219 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:13:04 -0000 On Tue, Jan 22, 2019 at 10:45:16AM -0700, Ian Lepore wrote: > On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > > Author: brooks > > Date: Tue Jan 22 17:39:26 2019 > > New Revision: 343305 > > URL: https://svnweb.freebsd.org/changeset/base/343305 > > > > Log: > > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > > > This is more compatible with formatting tools and looks more > > normal. > > > > Reported by: jhb (on a different review) > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D18442 > > > > Modified: > > head/sys/net/if.c > > > > Modified: head/sys/net/if.c > > ===================================================================== > > ========= > > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > > @@ -168,14 +168,14 @@ struct ifmediareq32 { > > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > > ifmediareq32) > > > > #define _CASE_IOC_IFGROUPREQ_32(cmd) > > \ > > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case > > That 'case' at the end of the line doesn't look right. With the change, CASE_IOC_IFGROUPREQ(cmd) yields case 32: case : which seems to be the intent. From owner-svn-src-all@freebsd.org Tue Jan 22 18:57:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5141614AB8C7; Tue, 22 Jan 2019 18:57:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC4506A4D8; Tue, 22 Jan 2019 18:57:21 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 00EAB3C475F; Tue, 22 Jan 2019 18:57:14 +0000 (UTC) Date: Tue, 22 Jan 2019 18:57:14 +0000 From: Brooks Davis To: Mark Johnston Cc: Ian Lepore , Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343305 - head/sys/net Message-ID: <20190122185714.GA77653@spindle.one-eyed-alien.net> References: <201901221739.x0MHdQps047360@repo.freebsd.org> <20190122181257.GA81189@raichu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20190122181257.GA81189@raichu> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: EC4506A4D8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:57:22 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 22, 2019 at 01:12:57PM -0500, Mark Johnston wrote: > On Tue, Jan 22, 2019 at 10:45:16AM -0700, Ian Lepore wrote: > > On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Tue Jan 22 17:39:26 2019 > > > New Revision: 343305 > > > URL: https://svnweb.freebsd.org/changeset/base/343305 > > >=20 > > > Log: > > > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > > =20 > > > This is more compatible with formatting tools and looks more > > > normal. > > > =20 > > > Reported by: jhb (on a different review) > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D18442 > > >=20 > > > Modified: > > > head/sys/net/if.c > > >=20 > > > Modified: head/sys/net/if.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > > > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > > > @@ -168,14 +168,14 @@ struct ifmediareq32 { > > > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > > > ifmediareq32) > > > =20 > > > #define _CASE_IOC_IFGROUPREQ_32(cmd) =09 > > > \ > > > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > > > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case > >=20 > > That 'case' at the end of the line doesn't look right. >=20 > With the change, CASE_IOC_IFGROUPREQ(cmd) yields >=20 > case 32: case : >=20 > which seems to be the intent. This is the intent. This macro avoids a pile of #ifdef macros in the actual code (and makes more sense in my upstream branch where I have another set of ioctl values). -- Brooks --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcR2eKAAoJEKzQXbSebgfAOZMH/AsOazzb8/739uR36FiMCnov 8nJ9RrKUo2QYjvgsoHQi6yW+ol8NzZNyohKZgjt127l70I4Gdes0aovLSi8Rwkjn vaRsu0N4c9DqqVpZvRYPeU6feVC1FGCXie8HHZY8JpLHsJBgXBnZDnGZhodgNFqq xhFBhSBb5AWIOC0VIq1puCc76sTYUcu5KSS60ioxjpFzPH/7Iy34/F+pn2WeqtVU MwKmyxwmQKKC5GmJgIAdGDGD9cDC450p/Gj0Ix7tRx67eOElFfBf+7lHPdoPLbqV 9WLiwMOcyyuLQhgB4A93wowCohvhij8SSKKUxt8NcWEltyIUHHYo876XUUO2B3o= =8ILk -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-all@freebsd.org Tue Jan 22 21:04:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC1314AF6C5; Tue, 22 Jan 2019 21:04:04 +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 30D0570753; Tue, 22 Jan 2019 21:04:04 +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 0AA226E8C; Tue, 22 Jan 2019 21:04:04 +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 x0ML44gC059372; Tue, 22 Jan 2019 21:04:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ML43l9059369; Tue, 22 Jan 2019 21:04:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901222104.x0ML43l9059369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Jan 2019 21:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343322 - in stable/12/sys/dev: amdsmn amdtemp X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 343322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30D0570753 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:04:04 -0000 Author: mav Date: Tue Jan 22 21:04:03 2019 New Revision: 343322 URL: https://svnweb.freebsd.org/changeset/base/343322 Log: MFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h Family 15h is a bit of an oddball. Early models used the same temperature register and spec (mostly[1]) as earlier CPU families. Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service Management Network, communicating with it in a similar fashion. To support them, add support for their version of SMU indirection to amdsmn(4) and use it in amdtemp(4) on these models. While here, clarify some of the deviceid macros in amdtemp(4) that were added with arbitrary, incorrect family numbers, and remove ones that were not used. Additionally, clarify intent and condition of heterogenous multi-socket system detection. [1]: 15h adds the "adjust range by -49°C if a certain condition is met," which previous families did not have. Reported by: D. C. PR: 234657 Tested by: D. C. Modified: stable/12/sys/dev/amdsmn/amdsmn.c stable/12/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/12/sys/dev/amdsmn/amdsmn.c Tue Jan 22 20:34:42 2019 (r343321) +++ stable/12/sys/dev/amdsmn/amdsmn.c Tue Jan 22 21:04:03 2019 (r343322) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Conrad Meyer + * Copyright (c) 2017-2019 Conrad Meyer * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ */ /* - * Driver for the AMD Family 17h CPU System Management Network. + * Driver for the AMD Family 15h and 17h CPU System Management Network. */ #include @@ -51,24 +51,45 @@ __FBSDID("$FreeBSD$"); #include -#define SMN_ADDR_REG 0x60 -#define SMN_DATA_REG 0x64 +#define F15H_SMN_ADDR_REG 0xb8 +#define F15H_SMN_DATA_REG 0xbc +#define F17H_SMN_ADDR_REG 0x60 +#define F17H_SMN_DATA_REG 0x64 +#define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 -#define PCI_DEVICE_ID_AMD_17H_ROOT_DF_F3 0x1463 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3 0x15eb +struct pciid; struct amdsmn_softc { struct mtx smn_lock; + const struct pciid *smn_pciid; }; -static struct pciid { +static const struct pciid { uint16_t amdsmn_vendorid; uint16_t amdsmn_deviceid; + uint8_t amdsmn_addr_reg; + uint8_t amdsmn_data_reg; } amdsmn_ids[] = { - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT }, - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_15H_M60H_ROOT, + .amdsmn_addr_reg = F15H_SMN_ADDR_REG, + .amdsmn_data_reg = F15H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* @@ -101,7 +122,7 @@ MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdsmn, nitems(amdsmn_ids)); static bool -amdsmn_match(device_t parent) +amdsmn_match(device_t parent, const struct pciid **pciid_out) { uint16_t vendor, device; size_t i; @@ -109,10 +130,14 @@ amdsmn_match(device_t parent) vendor = pci_get_vendor(parent); device = pci_get_device(parent); - for (i = 0; i < nitems(amdsmn_ids); i++) + for (i = 0; i < nitems(amdsmn_ids); i++) { if (vendor == amdsmn_ids[i].amdsmn_vendorid && - device == amdsmn_ids[i].amdsmn_deviceid) + device == amdsmn_ids[i].amdsmn_deviceid) { + if (pciid_out != NULL) + *pciid_out = &amdsmn_ids[i]; return (true); + } + } return (false); } @@ -124,7 +149,7 @@ amdsmn_identify(driver_t *driver, device_t parent) /* Make sure we're not being doubly invoked. */ if (device_find_child(parent, "amdsmn", -1) != NULL) return; - if (!amdsmn_match(parent)) + if (!amdsmn_match(parent, NULL)) return; child = device_add_child(parent, "amdsmn", -1); @@ -136,21 +161,25 @@ static int amdsmn_probe(device_t dev) { uint32_t family; + char buf[64]; if (resource_disabled("amdsmn", 0)) return (ENXIO); - if (!amdsmn_match(device_get_parent(dev))) + if (!amdsmn_match(device_get_parent(dev), NULL)) return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); switch (family) { + case 0x15: case 0x17: break; default: return (ENXIO); } - device_set_desc(dev, "AMD Family 17h System Management Network"); + snprintf(buf, sizeof(buf), "AMD Family %xh System Management Network", + family); + device_set_desc_copy(dev, buf); return (BUS_PROBE_GENERIC); } @@ -160,6 +189,9 @@ amdsmn_attach(device_t dev) { struct amdsmn_softc *sc = device_get_softc(dev); + if (!amdsmn_match(device_get_parent(dev), &sc->smn_pciid)) + return (ENXIO); + mtx_init(&sc->smn_lock, "SMN mtx", "SMN", MTX_DEF); return (0); } @@ -182,8 +214,8 @@ amdsmn_read(device_t dev, uint32_t addr, uint32_t *val parent = device_get_parent(dev); mtx_lock(&sc->smn_lock); - pci_write_config(parent, SMN_ADDR_REG, addr, 4); - *value = pci_read_config(parent, SMN_DATA_REG, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); + *value = pci_read_config(parent, sc->smn_pciid->amdsmn_data_reg, 4); mtx_unlock(&sc->smn_lock); return (0); @@ -198,8 +230,8 @@ amdsmn_write(device_t dev, uint32_t addr, uint32_t val parent = device_get_parent(dev); mtx_lock(&sc->smn_lock); - pci_write_config(parent, SMN_ADDR_REG, addr, 4); - pci_write_config(parent, SMN_DATA_REG, value, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_data_reg, value, 4); mtx_unlock(&sc->smn_lock); return (0); Modified: stable/12/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/12/sys/dev/amdtemp/amdtemp.c Tue Jan 22 20:34:42 2019 (r343321) +++ stable/12/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:04:03 2019 (r343322) @@ -5,6 +5,8 @@ * Copyright (c) 2009 Norikatsu Shigemura * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. + * Copyright (c) 2017-2019 Conrad Meyer + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -76,44 +78,67 @@ struct amdtemp_softc { device_t sc_smn; }; +/* + * N.B. The numbers in macro names below are significant and represent CPU + * family and model numbers. Do not make up fictitious family or model numbers + * when adding support for new devices. + */ #define VENDORID_AMD 0x1022 #define DEVICEID_AMD_MISC0F 0x1103 #define DEVICEID_AMD_MISC10 0x1203 #define DEVICEID_AMD_MISC11 0x1303 -#define DEVICEID_AMD_MISC12 0x1403 #define DEVICEID_AMD_MISC14 0x1703 #define DEVICEID_AMD_MISC15 0x1603 +#define DEVICEID_AMD_MISC15_M10H 0x1403 +#define DEVICEID_AMD_MISC15_M30H 0x141d +#define DEVICEID_AMD_MISC15_M60H_ROOT 0x1576 #define DEVICEID_AMD_MISC16 0x1533 #define DEVICEID_AMD_MISC16_M30H 0x1583 -#define DEVICEID_AMD_MISC17 0x141d #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 -#define DEVICEID_AMD_HOSTB17H_DF_F3 0x1463 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 -#define DEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb -static struct amdtemp_product { +static const struct amdtemp_product { uint16_t amdtemp_vendorid; uint16_t amdtemp_deviceid; + /* + * 0xFC register is only valid on the D18F3 PCI device; SMN temp + * drivers do not attach to that device. + */ + bool amdtemp_has_cpuid; } amdtemp_products[] = { - { VENDORID_AMD, DEVICEID_AMD_MISC0F }, - { VENDORID_AMD, DEVICEID_AMD_MISC10 }, - { VENDORID_AMD, DEVICEID_AMD_MISC11 }, - { VENDORID_AMD, DEVICEID_AMD_MISC12 }, - { VENDORID_AMD, DEVICEID_AMD_MISC14 }, - { VENDORID_AMD, DEVICEID_AMD_MISC15 }, - { VENDORID_AMD, DEVICEID_AMD_MISC16 }, - { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, - { VENDORID_AMD, DEVICEID_AMD_MISC17 }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT }, + { VENDORID_AMD, DEVICEID_AMD_MISC0F, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC10, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC11, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC14, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M10H, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M30H, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_MISC16, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, }; /* - * Reported Temperature Control Register + * Reported Temperature Control Register, family 0Fh-15h (some models), 16h. */ #define AMDTEMP_REPTMP_CTRL 0xa4 +#define AMDTEMP_REPTMP10H_CURTMP_MASK 0x7ff +#define AMDTEMP_REPTMP10H_CURTMP_SHIFT 21 +#define AMDTEMP_REPTMP10H_TJSEL_MASK 0x3 +#define AMDTEMP_REPTMP10H_TJSEL_SHIFT 16 + /* + * Reported Temperature, Family 15h, M60+ + * + * Same register bit definitions as other Family 15h CPUs, but access is + * indirect via SMN, like Family 17h. + */ +#define AMDTEMP_15H_M60H_REPTMP_CTRL 0xd8200ca4 + +/* * Reported Temperature, Family 17h * * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register @@ -123,9 +148,13 @@ static struct amdtemp_product { */ #define AMDTEMP_17H_CUR_TMP 0x59800 #define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) -#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 /* + * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). + */ +#define AMDTEMP_CURTMP_RANGE_ADJUST 490 + +/* * Thermaltrip Status Register (Family 0Fh only) */ #define AMDTEMP_THERMTP_STAT 0xe4 @@ -151,9 +180,9 @@ static int amdtemp_probe(device_t dev); static int amdtemp_attach(device_t dev); static void amdtemp_intrhook(void *arg); static int amdtemp_detach(device_t dev); -static int amdtemp_match(device_t dev); static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); +static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); @@ -180,8 +209,8 @@ MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products, nitems(amdtemp_products)); -static int -amdtemp_match(device_t dev) +static bool +amdtemp_match(device_t dev, const struct amdtemp_product **product_out) { int i; uint16_t vendor, devid; @@ -191,11 +220,13 @@ amdtemp_match(device_t dev) for (i = 0; i < nitems(amdtemp_products); i++) { if (vendor == amdtemp_products[i].amdtemp_vendorid && - devid == amdtemp_products[i].amdtemp_deviceid) - return (1); + devid == amdtemp_products[i].amdtemp_deviceid) { + if (product_out != NULL) + *product_out = &amdtemp_products[i]; + return (true); + } } - - return (0); + return (false); } static void @@ -207,7 +238,7 @@ amdtemp_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "amdtemp", -1) != NULL) return; - if (amdtemp_match(parent)) { + if (amdtemp_match(parent, NULL)) { child = device_add_child(parent, "amdtemp", -1); if (child == NULL) device_printf(parent, "add amdtemp child failed\n"); @@ -221,7 +252,7 @@ amdtemp_probe(device_t dev) if (resource_disabled("amdtemp", 0)) return (ENXIO); - if (!amdtemp_match(device_get_parent(dev))) + if (!amdtemp_match(device_get_parent(dev), NULL)) return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); @@ -254,23 +285,42 @@ amdtemp_attach(device_t dev) { char tn[32]; u_int regs[4]; - struct amdtemp_softc *sc = device_get_softc(dev); + const struct amdtemp_product *product; + struct amdtemp_softc *sc; struct sysctl_ctx_list *sysctlctx; struct sysctl_oid *sysctlnode; uint32_t cpuid, family, model; u_int bid; int erratum319, unit; + bool needsmn; + sc = device_get_softc(dev); erratum319 = 0; + needsmn = false; - /* - * CPUID Register is available from Revision F. - */ + if (!amdtemp_match(device_get_parent(dev), &product)) + return (ENXIO); + cpuid = cpu_id; family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); - if ((family != 0x0f || model >= 0x40) && family != 0x17) { - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); + + /* + * This checks for the byzantine condition of running a heterogenous + * revision multi-socket system where the attach thread is potentially + * probing a remote socket's PCI device. + * + * Currently, such scenarios are unsupported on models using the SMN + * (because on those models, amdtemp(4) attaches to a different PCI + * device than the one that contains AMDTEMP_CPUID). + * + * The ancient 0x0F family of devices only supports this register from + * models 40h+. + */ + if (product->amdtemp_has_cpuid && (family > 0x0f || + (family == 0x0f && model >= 0x40))) { + cpuid = pci_read_config(device_get_parent(dev), AMDTEMP_CPUID, + 4); family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); } @@ -364,16 +414,30 @@ amdtemp_attach(device_t dev) case 0x14: case 0x15: case 0x16: + sc->sc_ntemps = 1; /* - * There is only one sensor per package. + * Some later (60h+) models of family 15h use a similar SMN + * network as family 17h. (However, the register index differs + * from 17h and the decoding matches other 10h-15h models, + * which differ from 17h.) */ - sc->sc_ntemps = 1; - - sc->sc_gettemp = amdtemp_gettemp; + if (family == 0x15 && model >= 0x60) { + sc->sc_gettemp = amdtemp_gettemp15hm60h; + needsmn = true; + } else + sc->sc_gettemp = amdtemp_gettemp; break; case 0x17: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; + needsmn = true; + break; + default: + device_printf(dev, "Bogus family 0x%x\n", family); + return (ENXIO); + } + + if (needsmn) { sc->sc_smn = device_find_child( device_get_parent(dev), "amdsmn", -1); if (sc->sc_smn == NULL) { @@ -381,7 +445,6 @@ amdtemp_attach(device_t dev) device_printf(dev, "No SMN device found\n"); return (ENXIO); } - break; } /* Find number of cores per package. */ @@ -585,6 +648,29 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) return (temp); } +static uint32_t +amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +{ + uint32_t temp; + + /* Convert raw register subfield units (0.125C) to units of 0.1C. */ + temp = ((val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT) & + AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + + /* + * On Family 15h and higher, if CurTmpTjSel is 11b, the range is + * adjusted down by 49.0 degrees Celsius. (This adjustment is not + * documented in BKDGs prior to family 15h model 00h.) + */ + if (CPUID_TO_FAMILY(cpu_id) >= 0x15 && + ((val >> AMDTEMP_REPTMP10H_TJSEL_SHIFT) & + AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3) + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + + temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; + return (temp); +} + static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor) { @@ -592,10 +678,19 @@ amdtemp_gettemp(device_t dev, amdsensor_t sensor) uint32_t temp; temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); - temp = ((temp >> 21) & 0x7ff) * 5 / 4; - temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, temp)); +} - return (temp); +static int32_t +amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t val; + int error; + + error = amdsmn_read(sc->sc_smn, AMDTEMP_15H_M60H_REPTMP_CTRL, &val); + KASSERT(error == 0, ("amdsmn_read")); + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, val)); } static int32_t @@ -610,7 +705,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) temp = ((val >> 21) & 0x7ff) * 5 / 4; if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) - temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; return (temp); From owner-svn-src-all@freebsd.org Tue Jan 22 21:33:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D5614B0656; Tue, 22 Jan 2019 21:33:15 +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 EFBAD71A47; Tue, 22 Jan 2019 21:33:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E27B373AF; Tue, 22 Jan 2019 21:33:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MLXE2a074873; Tue, 22 Jan 2019 21:33:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MLXEpL074871; Tue, 22 Jan 2019 21:33:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901222133.x0MLXEpL074871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Jan 2019 21:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343323 - in stable/11/sys/dev: amdsmn amdtemp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 343323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFBAD71A47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:33:15 -0000 Author: mav Date: Tue Jan 22 21:33:14 2019 New Revision: 343323 URL: https://svnweb.freebsd.org/changeset/base/343323 Log: MFC r340425 (by cem): amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges As reported, tested, and patch supplied by Johannes. There may be future work to do to support multiple sensors, but for now, any sensor at all is a strict improvement for Ryzen 2 systems. PR: 228480 Submitted by: Johannes Lundberg (earlier version) Reported by: deischen@, Johannes, and numerous others Modified: stable/11/sys/dev/amdsmn/amdsmn.c stable/11/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/11/sys/dev/amdsmn/amdsmn.c Tue Jan 22 21:04:03 2019 (r343322) +++ stable/11/sys/dev/amdsmn/amdsmn.c Tue Jan 22 21:33:14 2019 (r343323) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -53,14 +54,21 @@ __FBSDID("$FreeBSD$"); #define SMN_ADDR_REG 0x60 #define SMN_DATA_REG 0x64 +#define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 +#define PCI_DEVICE_ID_AMD_17H_ROOT_DF_F3 0x1463 +#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 +#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3 0x15eb + struct amdsmn_softc { struct mtx smn_lock; }; static struct pciid { - uint32_t device_id; + uint16_t amdsmn_vendorid; + uint16_t amdsmn_deviceid; } amdsmn_ids[] = { - { 0x14501022 }, + { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT }, + { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT }, }; /* @@ -93,12 +101,15 @@ MODULE_VERSION(amdsmn, 1); static bool amdsmn_match(device_t parent) { - uint32_t devid; + uint16_t vendor, device; size_t i; - devid = pci_get_devid(parent); + vendor = pci_get_vendor(parent); + device = pci_get_device(parent); + for (i = 0; i < nitems(amdsmn_ids); i++) - if (amdsmn_ids[i].device_id == devid) + if (vendor == amdsmn_ids[i].amdsmn_vendorid && + device == amdsmn_ids[i].amdsmn_deviceid) return (true); return (false); } Modified: stable/11/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:04:03 2019 (r343322) +++ stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:33:14 2019 (r343323) @@ -84,7 +84,10 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16 0x1533 #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_MISC17 0x141d -#define DEVICEID_AMD_HOSTB17H 0x1450 +#define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 +#define DEVICEID_AMD_HOSTB17H_DF_F3 0x1463 +#define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 +#define DEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb static struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -99,7 +102,8 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16 }, { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, { VENDORID_AMD, DEVICEID_AMD_MISC17 }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT }, { 0, 0 } }; From owner-svn-src-all@freebsd.org Tue Jan 22 21:34:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2280114B0722; Tue, 22 Jan 2019 21:34:26 +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 BC97C71BFD; Tue, 22 Jan 2019 21:34:25 +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 B125B73B2; Tue, 22 Jan 2019 21:34:25 +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 x0MLYPG1074985; Tue, 22 Jan 2019 21:34:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MLYPSJ074984; Tue, 22 Jan 2019 21:34:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901222134.x0MLYPSJ074984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Jan 2019 21:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343324 - stable/11/sys/dev/amdtemp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/amdtemp X-SVN-Commit-Revision: 343324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC97C71BFD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:34:26 -0000 Author: mav Date: Tue Jan 22 21:34:25 2019 New Revision: 343324 URL: https://svnweb.freebsd.org/changeset/base/343324 Log: MFC r340426 (by cem): amdtemp(4): Fix temperature reporting on AMD 2990WX Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 OSRR, section 4.2.1. For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the range -49..206; i.e., subtract 49°C. Submitted by: gallatin@ Reported by: bcran@ Modified: stable/11/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:33:14 2019 (r343323) +++ stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:34:25 2019 (r343324) @@ -114,8 +114,15 @@ static struct amdtemp_product { /* * Reported Temperature, Family 17h + * + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register + * provide the current temp. bit 19, when clear, means the temp is reported in + * a range 0.."225C" (probable typo for 255C), and when set changes the range + * to -49..206C. */ -#define AMDTEMP_17H_CUR_TMP 0x59800 +#define AMDTEMP_17H_CUR_TMP 0x59800 +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) +#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 /* * Thermaltrip Status Register (Family 0Fh only) @@ -592,13 +599,15 @@ static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp; + uint32_t temp, val; int error; - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &temp); + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); KASSERT(error == 0, ("amdsmn_read")); - temp = ((temp >> 21) & 0x7ff) * 5 / 4; + temp = ((val >> 21) & 0x7ff) * 5 / 4; + if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) + temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; return (temp); From owner-svn-src-all@freebsd.org Tue Jan 22 21:35:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B3D514B07B3; Tue, 22 Jan 2019 21:35:26 +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 E2A1871D53; Tue, 22 Jan 2019 21:35:25 +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 D630573B3; Tue, 22 Jan 2019 21:35:25 +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 x0MLZP9S075097; Tue, 22 Jan 2019 21:35:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MLZPBr075095; Tue, 22 Jan 2019 21:35:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901222135.x0MLZPBr075095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Jan 2019 21:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343325 - in stable/11/sys/dev: amdsmn amdtemp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 343325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2A1871D53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:35:26 -0000 Author: mav Date: Tue Jan 22 21:35:25 2019 New Revision: 343325 URL: https://svnweb.freebsd.org/changeset/base/343325 Log: MFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h Family 15h is a bit of an oddball. Early models used the same temperature register and spec (mostly[1]) as earlier CPU families. Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service Management Network, communicating with it in a similar fashion. To support them, add support for their version of SMU indirection to amdsmn(4) and use it in amdtemp(4) on these models. While here, clarify some of the deviceid macros in amdtemp(4) that were added with arbitrary, incorrect family numbers, and remove ones that were not used. Additionally, clarify intent and condition of heterogenous multi-socket system detection. [1]: 15h adds the "adjust range by -49°C if a certain condition is met," which previous families did not have. Reported by: D. C. PR: 234657 Tested by: D. C. Modified: stable/11/sys/dev/amdsmn/amdsmn.c stable/11/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/11/sys/dev/amdsmn/amdsmn.c Tue Jan 22 21:34:25 2019 (r343324) +++ stable/11/sys/dev/amdsmn/amdsmn.c Tue Jan 22 21:35:25 2019 (r343325) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Conrad Meyer + * Copyright (c) 2017-2019 Conrad Meyer * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ */ /* - * Driver for the AMD Family 17h CPU System Management Network. + * Driver for the AMD Family 15h and 17h CPU System Management Network. */ #include @@ -51,24 +51,45 @@ __FBSDID("$FreeBSD$"); #include -#define SMN_ADDR_REG 0x60 -#define SMN_DATA_REG 0x64 +#define F15H_SMN_ADDR_REG 0xb8 +#define F15H_SMN_DATA_REG 0xbc +#define F17H_SMN_ADDR_REG 0x60 +#define F17H_SMN_DATA_REG 0x64 +#define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 -#define PCI_DEVICE_ID_AMD_17H_ROOT_DF_F3 0x1463 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3 0x15eb +struct pciid; struct amdsmn_softc { struct mtx smn_lock; + const struct pciid *smn_pciid; }; -static struct pciid { +static const struct pciid { uint16_t amdsmn_vendorid; uint16_t amdsmn_deviceid; + uint8_t amdsmn_addr_reg; + uint8_t amdsmn_data_reg; } amdsmn_ids[] = { - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT }, - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_15H_M60H_ROOT, + .amdsmn_addr_reg = F15H_SMN_ADDR_REG, + .amdsmn_data_reg = F15H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* @@ -99,7 +120,7 @@ DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_dev MODULE_VERSION(amdsmn, 1); static bool -amdsmn_match(device_t parent) +amdsmn_match(device_t parent, const struct pciid **pciid_out) { uint16_t vendor, device; size_t i; @@ -107,10 +128,14 @@ amdsmn_match(device_t parent) vendor = pci_get_vendor(parent); device = pci_get_device(parent); - for (i = 0; i < nitems(amdsmn_ids); i++) + for (i = 0; i < nitems(amdsmn_ids); i++) { if (vendor == amdsmn_ids[i].amdsmn_vendorid && - device == amdsmn_ids[i].amdsmn_deviceid) + device == amdsmn_ids[i].amdsmn_deviceid) { + if (pciid_out != NULL) + *pciid_out = &amdsmn_ids[i]; return (true); + } + } return (false); } @@ -122,7 +147,7 @@ amdsmn_identify(driver_t *driver, device_t parent) /* Make sure we're not being doubly invoked. */ if (device_find_child(parent, "amdsmn", -1) != NULL) return; - if (!amdsmn_match(parent)) + if (!amdsmn_match(parent, NULL)) return; child = device_add_child(parent, "amdsmn", -1); @@ -134,21 +159,25 @@ static int amdsmn_probe(device_t dev) { uint32_t family; + char buf[64]; if (resource_disabled("amdsmn", 0)) return (ENXIO); - if (!amdsmn_match(device_get_parent(dev))) + if (!amdsmn_match(device_get_parent(dev), NULL)) return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); switch (family) { + case 0x15: case 0x17: break; default: return (ENXIO); } - device_set_desc(dev, "AMD Family 17h System Management Network"); + snprintf(buf, sizeof(buf), "AMD Family %xh System Management Network", + family); + device_set_desc_copy(dev, buf); return (BUS_PROBE_GENERIC); } @@ -158,6 +187,9 @@ amdsmn_attach(device_t dev) { struct amdsmn_softc *sc = device_get_softc(dev); + if (!amdsmn_match(device_get_parent(dev), &sc->smn_pciid)) + return (ENXIO); + mtx_init(&sc->smn_lock, "SMN mtx", "SMN", MTX_DEF); return (0); } @@ -180,8 +212,8 @@ amdsmn_read(device_t dev, uint32_t addr, uint32_t *val parent = device_get_parent(dev); mtx_lock(&sc->smn_lock); - pci_write_config(parent, SMN_ADDR_REG, addr, 4); - *value = pci_read_config(parent, SMN_DATA_REG, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); + *value = pci_read_config(parent, sc->smn_pciid->amdsmn_data_reg, 4); mtx_unlock(&sc->smn_lock); return (0); @@ -196,8 +228,8 @@ amdsmn_write(device_t dev, uint32_t addr, uint32_t val parent = device_get_parent(dev); mtx_lock(&sc->smn_lock); - pci_write_config(parent, SMN_ADDR_REG, addr, 4); - pci_write_config(parent, SMN_DATA_REG, value, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); + pci_write_config(parent, sc->smn_pciid->amdsmn_data_reg, value, 4); mtx_unlock(&sc->smn_lock); return (0); Modified: stable/11/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:34:25 2019 (r343324) +++ stable/11/sys/dev/amdtemp/amdtemp.c Tue Jan 22 21:35:25 2019 (r343325) @@ -3,6 +3,8 @@ * Copyright (c) 2009 Norikatsu Shigemura * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. + * Copyright (c) 2017-2019 Conrad Meyer + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -74,45 +76,68 @@ struct amdtemp_softc { device_t sc_smn; }; +/* + * N.B. The numbers in macro names below are significant and represent CPU + * family and model numbers. Do not make up fictitious family or model numbers + * when adding support for new devices. + */ #define VENDORID_AMD 0x1022 #define DEVICEID_AMD_MISC0F 0x1103 #define DEVICEID_AMD_MISC10 0x1203 #define DEVICEID_AMD_MISC11 0x1303 -#define DEVICEID_AMD_MISC12 0x1403 #define DEVICEID_AMD_MISC14 0x1703 #define DEVICEID_AMD_MISC15 0x1603 +#define DEVICEID_AMD_MISC15_M10H 0x1403 +#define DEVICEID_AMD_MISC15_M30H 0x141d +#define DEVICEID_AMD_MISC15_M60H_ROOT 0x1576 #define DEVICEID_AMD_MISC16 0x1533 #define DEVICEID_AMD_MISC16_M30H 0x1583 -#define DEVICEID_AMD_MISC17 0x141d #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 -#define DEVICEID_AMD_HOSTB17H_DF_F3 0x1463 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 -#define DEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb -static struct amdtemp_product { +static const struct amdtemp_product { uint16_t amdtemp_vendorid; uint16_t amdtemp_deviceid; + /* + * 0xFC register is only valid on the D18F3 PCI device; SMN temp + * drivers do not attach to that device. + */ + bool amdtemp_has_cpuid; } amdtemp_products[] = { - { VENDORID_AMD, DEVICEID_AMD_MISC0F }, - { VENDORID_AMD, DEVICEID_AMD_MISC10 }, - { VENDORID_AMD, DEVICEID_AMD_MISC11 }, - { VENDORID_AMD, DEVICEID_AMD_MISC12 }, - { VENDORID_AMD, DEVICEID_AMD_MISC14 }, - { VENDORID_AMD, DEVICEID_AMD_MISC15 }, - { VENDORID_AMD, DEVICEID_AMD_MISC16 }, - { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, - { VENDORID_AMD, DEVICEID_AMD_MISC17 }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT }, + { VENDORID_AMD, DEVICEID_AMD_MISC0F, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC10, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC11, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC14, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M10H, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M30H, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC15_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_MISC16, true }, + { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, { 0, 0 } }; /* - * Reported Temperature Control Register + * Reported Temperature Control Register, family 0Fh-15h (some models), 16h. */ #define AMDTEMP_REPTMP_CTRL 0xa4 +#define AMDTEMP_REPTMP10H_CURTMP_MASK 0x7ff +#define AMDTEMP_REPTMP10H_CURTMP_SHIFT 21 +#define AMDTEMP_REPTMP10H_TJSEL_MASK 0x3 +#define AMDTEMP_REPTMP10H_TJSEL_SHIFT 16 + /* + * Reported Temperature, Family 15h, M60+ + * + * Same register bit definitions as other Family 15h CPUs, but access is + * indirect via SMN, like Family 17h. + */ +#define AMDTEMP_15H_M60H_REPTMP_CTRL 0xd8200ca4 + +/* * Reported Temperature, Family 17h * * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register @@ -122,9 +147,13 @@ static struct amdtemp_product { */ #define AMDTEMP_17H_CUR_TMP 0x59800 #define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) -#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 /* + * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). + */ +#define AMDTEMP_CURTMP_RANGE_ADJUST 490 + +/* * Thermaltrip Status Register (Family 0Fh only) */ #define AMDTEMP_THERMTP_STAT 0xe4 @@ -150,9 +179,9 @@ static int amdtemp_probe(device_t dev); static int amdtemp_attach(device_t dev); static void amdtemp_intrhook(void *arg); static int amdtemp_detach(device_t dev); -static int amdtemp_match(device_t dev); static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); +static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); @@ -177,8 +206,8 @@ DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_ MODULE_VERSION(amdtemp, 1); MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); -static int -amdtemp_match(device_t dev) +static bool +amdtemp_match(device_t dev, const struct amdtemp_product **product_out) { int i; uint16_t vendor, devid; @@ -188,11 +217,13 @@ amdtemp_match(device_t dev) for (i = 0; amdtemp_products[i].amdtemp_vendorid != 0; i++) { if (vendor == amdtemp_products[i].amdtemp_vendorid && - devid == amdtemp_products[i].amdtemp_deviceid) - return (1); + devid == amdtemp_products[i].amdtemp_deviceid) { + if (product_out != NULL) + *product_out = &amdtemp_products[i]; + return (true); + } } - - return (0); + return (false); } static void @@ -204,7 +235,7 @@ amdtemp_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "amdtemp", -1) != NULL) return; - if (amdtemp_match(parent)) { + if (amdtemp_match(parent, NULL)) { child = device_add_child(parent, "amdtemp", -1); if (child == NULL) device_printf(parent, "add amdtemp child failed\n"); @@ -218,7 +249,7 @@ amdtemp_probe(device_t dev) if (resource_disabled("amdtemp", 0)) return (ENXIO); - if (!amdtemp_match(device_get_parent(dev))) + if (!amdtemp_match(device_get_parent(dev), NULL)) return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); @@ -251,23 +282,42 @@ amdtemp_attach(device_t dev) { char tn[32]; u_int regs[4]; - struct amdtemp_softc *sc = device_get_softc(dev); + const struct amdtemp_product *product; + struct amdtemp_softc *sc; struct sysctl_ctx_list *sysctlctx; struct sysctl_oid *sysctlnode; uint32_t cpuid, family, model; u_int bid; int erratum319, unit; + bool needsmn; + sc = device_get_softc(dev); erratum319 = 0; + needsmn = false; - /* - * CPUID Register is available from Revision F. - */ + if (!amdtemp_match(device_get_parent(dev), &product)) + return (ENXIO); + cpuid = cpu_id; family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); - if ((family != 0x0f || model >= 0x40) && family != 0x17) { - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); + + /* + * This checks for the byzantine condition of running a heterogenous + * revision multi-socket system where the attach thread is potentially + * probing a remote socket's PCI device. + * + * Currently, such scenarios are unsupported on models using the SMN + * (because on those models, amdtemp(4) attaches to a different PCI + * device than the one that contains AMDTEMP_CPUID). + * + * The ancient 0x0F family of devices only supports this register from + * models 40h+. + */ + if (product->amdtemp_has_cpuid && (family > 0x0f || + (family == 0x0f && model >= 0x40))) { + cpuid = pci_read_config(device_get_parent(dev), AMDTEMP_CPUID, + 4); family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); } @@ -361,16 +411,30 @@ amdtemp_attach(device_t dev) case 0x14: case 0x15: case 0x16: + sc->sc_ntemps = 1; /* - * There is only one sensor per package. + * Some later (60h+) models of family 15h use a similar SMN + * network as family 17h. (However, the register index differs + * from 17h and the decoding matches other 10h-15h models, + * which differ from 17h.) */ - sc->sc_ntemps = 1; - - sc->sc_gettemp = amdtemp_gettemp; + if (family == 0x15 && model >= 0x60) { + sc->sc_gettemp = amdtemp_gettemp15hm60h; + needsmn = true; + } else + sc->sc_gettemp = amdtemp_gettemp; break; case 0x17: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; + needsmn = true; + break; + default: + device_printf(dev, "Bogus family 0x%x\n", family); + return (ENXIO); + } + + if (needsmn) { sc->sc_smn = device_find_child( device_get_parent(dev), "amdsmn", -1); if (sc->sc_smn == NULL) { @@ -378,7 +442,6 @@ amdtemp_attach(device_t dev) device_printf(dev, "No SMN device found\n"); return (ENXIO); } - break; } /* Find number of cores per package. */ @@ -582,6 +645,29 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) return (temp); } +static uint32_t +amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +{ + uint32_t temp; + + /* Convert raw register subfield units (0.125C) to units of 0.1C. */ + temp = ((val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT) & + AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + + /* + * On Family 15h and higher, if CurTmpTjSel is 11b, the range is + * adjusted down by 49.0 degrees Celsius. (This adjustment is not + * documented in BKDGs prior to family 15h model 00h.) + */ + if (CPUID_TO_FAMILY(cpu_id) >= 0x15 && + ((val >> AMDTEMP_REPTMP10H_TJSEL_SHIFT) & + AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3) + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + + temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; + return (temp); +} + static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor) { @@ -589,10 +675,19 @@ amdtemp_gettemp(device_t dev, amdsensor_t sensor) uint32_t temp; temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); - temp = ((temp >> 21) & 0x7ff) * 5 / 4; - temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, temp)); +} - return (temp); +static int32_t +amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t val; + int error; + + error = amdsmn_read(sc->sc_smn, AMDTEMP_15H_M60H_REPTMP_CTRL, &val); + KASSERT(error == 0, ("amdsmn_read")); + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, val)); } static int32_t @@ -607,7 +702,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) temp = ((val >> 21) & 0x7ff) * 5 / 4; if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) - temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; return (temp); From owner-svn-src-all@freebsd.org Tue Jan 22 21:52:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94BE514B0D90; Tue, 22 Jan 2019 21:52:09 +0000 (UTC) (envelope-from rgrimes@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 3706072539; Tue, 22 Jan 2019 21:52:09 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2A14675F2; Tue, 22 Jan 2019 21:52:09 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MLq9YL085233; Tue, 22 Jan 2019 21:52:09 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MLq8ZD085230; Tue, 22 Jan 2019 21:52:08 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201901222152.x0MLq8ZD085230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Tue, 22 Jan 2019 21:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343326 - in stable: 10/lib/libc/string 11/lib/libc/string X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/lib/libc/string 11/lib/libc/string X-SVN-Commit-Revision: 343326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3706072539 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:52:09 -0000 Author: rgrimes Date: Tue Jan 22 21:52:07 2019 New Revision: 343326 URL: https://svnweb.freebsd.org/changeset/base/343326 Log: MFC: 325765 (imp) Add notes about overlapping copies. Add notes to each of these that specifically state that results are undefined if the strings overlap. In the case of memcpy, we document the overlapping behavior on FreeBSD (pre-existing). For str*, it is left unspecified, however, since the default (and x86) implementations do not handle overlapping strings properly. PR: 223653 Approved by: phk (mentor) Modified: stable/11/lib/libc/string/memcpy.3 stable/11/lib/libc/string/strcat.3 stable/11/lib/libc/string/strcpy.3 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/string/memcpy.3 stable/10/lib/libc/string/strcat.3 stable/10/lib/libc/string/strcpy.3 Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/string/memcpy.3 ============================================================================== --- stable/11/lib/libc/string/memcpy.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/11/lib/libc/string/memcpy.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -54,6 +54,11 @@ bytes from string .Fa src to string .Fa dst . +If +.Fa src +and +.Fa dst +overlap, the results are not defined. .Sh RETURN VALUES The .Fn memcpy Modified: stable/11/lib/libc/string/strcat.3 ============================================================================== --- stable/11/lib/libc/string/strcat.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/11/lib/libc/string/strcat.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -62,6 +62,11 @@ then add a terminating The string .Fa s must have sufficient space to hold the result. +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Pp The .Fn strncat @@ -72,6 +77,11 @@ characters from .Fa append , and then adds a terminating .Ql \e0 . +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcat Modified: stable/11/lib/libc/string/strcpy.3 ============================================================================== --- stable/11/lib/libc/string/strcpy.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/11/lib/libc/string/strcpy.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -63,6 +63,11 @@ to (including the terminating .Ql \e0 character.) +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Pp The .Fn stpncpy @@ -89,6 +94,11 @@ Otherwise, is .Em not terminated. +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcpy From owner-svn-src-all@freebsd.org Tue Jan 22 21:52:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2FB14B0D8B; Tue, 22 Jan 2019 21:52:08 +0000 (UTC) (envelope-from rgrimes@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 73A5572534; Tue, 22 Jan 2019 21:52:08 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5FB7975F0; Tue, 22 Jan 2019 21:52:08 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MLq8Tk085225; Tue, 22 Jan 2019 21:52:08 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MLq7LK085222; Tue, 22 Jan 2019 21:52:07 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201901222152.x0MLq7LK085222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Tue, 22 Jan 2019 21:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343326 - in stable: 10/lib/libc/string 11/lib/libc/string X-SVN-Group: stable-10 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/lib/libc/string 11/lib/libc/string X-SVN-Commit-Revision: 343326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73A5572534 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 21:52:09 -0000 Author: rgrimes Date: Tue Jan 22 21:52:07 2019 New Revision: 343326 URL: https://svnweb.freebsd.org/changeset/base/343326 Log: MFC: 325765 (imp) Add notes about overlapping copies. Add notes to each of these that specifically state that results are undefined if the strings overlap. In the case of memcpy, we document the overlapping behavior on FreeBSD (pre-existing). For str*, it is left unspecified, however, since the default (and x86) implementations do not handle overlapping strings properly. PR: 223653 Approved by: phk (mentor) Modified: stable/10/lib/libc/string/memcpy.3 stable/10/lib/libc/string/strcat.3 stable/10/lib/libc/string/strcpy.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/string/memcpy.3 stable/11/lib/libc/string/strcat.3 stable/11/lib/libc/string/strcpy.3 Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/string/memcpy.3 ============================================================================== --- stable/10/lib/libc/string/memcpy.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/10/lib/libc/string/memcpy.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -54,6 +54,11 @@ bytes from string .Fa src to string .Fa dst . +If +.Fa src +and +.Fa dst +overlap, the results are not defined. .Sh RETURN VALUES The .Fn memcpy Modified: stable/10/lib/libc/string/strcat.3 ============================================================================== --- stable/10/lib/libc/string/strcat.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/10/lib/libc/string/strcat.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -62,6 +62,11 @@ then add a terminating The string .Fa s must have sufficient space to hold the result. +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Pp The .Fn strncat @@ -72,6 +77,11 @@ characters from .Fa append , and then adds a terminating .Ql \e0 . +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcat Modified: stable/10/lib/libc/string/strcpy.3 ============================================================================== --- stable/10/lib/libc/string/strcpy.3 Tue Jan 22 21:35:25 2019 (r343325) +++ stable/10/lib/libc/string/strcpy.3 Tue Jan 22 21:52:07 2019 (r343326) @@ -63,6 +63,11 @@ to (including the terminating .Ql \e0 character.) +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Pp The .Fn stpncpy @@ -89,6 +94,11 @@ Otherwise, is .Em not terminated. +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcpy From owner-svn-src-all@freebsd.org Tue Jan 22 22:39:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F73B14B2188; Tue, 22 Jan 2019 22:39:47 +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 C8A8F74701; Tue, 22 Jan 2019 22:39:46 +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 BE4DD7DD8; Tue, 22 Jan 2019 22:39:46 +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 x0MMdksR006943; Tue, 22 Jan 2019 22:39:46 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MMdk5l006941; Tue, 22 Jan 2019 22:39:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201901222239.x0MMdk5l006941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 22 Jan 2019 22:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343327 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 343327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8A8F74701 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 22:39:47 -0000 Author: wulf Date: Tue Jan 22 22:39:46 2019 New Revision: 343327 URL: https://svnweb.freebsd.org/changeset/base/343327 Log: Add quirk to enable mic and headphones redirection on HP Spectre laptops. Tested on HP AF006UR. MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Jan 22 21:52:07 2019 (r343326) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Jan 22 22:39:46 2019 (r343327) @@ -410,6 +410,18 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC295 && subid == HP_AF006UR_SUBVENDOR) { + switch (nid) { + case 18: + patch = "as=2"; + break; + case 25: + patch = "as=2 seq=15"; + break; + case 33: + patch = "as=1 seq=15"; + break; + } } else if (id == HDA_CODEC_ALC298 && subid == DELL_XPS9560_SUBVENDOR) { switch (nid) { case 24: Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Tue Jan 22 21:52:07 2019 (r343326) +++ head/sys/dev/sound/pci/hda/hdac.h Tue Jan 22 22:39:46 2019 (r343327) @@ -188,6 +188,7 @@ #define HP_DV5000_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x30a5) #define HP_DC7700S_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x2801) #define HP_DC7700_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x2802) +#define HP_AF006UR_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x83a2) #define HP_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0xffff) /* What is wrong with XN 2563 anyway? (Got the picture ?) */ #define HP_NX6325_SUBVENDORX 0x103c30b0 From owner-svn-src-all@freebsd.org Wed Jan 23 00:54:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9956914B50AB; Wed, 23 Jan 2019 00:54:09 +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 3F7A681ADE; Wed, 23 Jan 2019 00:54:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 122B89557; Wed, 23 Jan 2019 00:54:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N0s8YT081950; Wed, 23 Jan 2019 00:54:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N0s8Fc081949; Wed, 23 Jan 2019 00:54:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230054.x0N0s8Fc081949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 00:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343328 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 343328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F7A681ADE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 00:54:09 -0000 Author: mav Date: Wed Jan 23 00:54:08 2019 New Revision: 343328 URL: https://svnweb.freebsd.org/changeset/base/343328 Log: MFC r342399: Remove CAM SIM lock from NVMe SIM. CAM does not require SIM lock since FreeBSD 10.4, and NVMe code never required it at all, using per-queue locks instead. This formally allows parallel request submission in CAM mode as much as single per-device and per-queue locks of CAM allow. Modified: stable/12/sys/dev/nvme/nvme_sim.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_sim.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_sim.c Tue Jan 22 22:39:46 2019 (r343327) +++ stable/12/sys/dev/nvme/nvme_sim.c Wed Jan 23 00:54:08 2019 (r343328) @@ -150,8 +150,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) ctrlr = sim2ctrlr(sim); - mtx_assert(&ctrlr->lock, MA_OWNED); - switch (ccb->ccb_h.func_code) { case XPT_CALC_GEOMETRY: /* Calculate Geometry Totally nuts ? XXX */ /* @@ -289,7 +287,7 @@ nvme_sim_new_controller(struct nvme_controller *ctrlr) sc->s_sim = cam_sim_alloc(nvme_sim_action, nvme_sim_poll, "nvme", sc, device_get_unit(ctrlr->dev), - &ctrlr->lock, max_trans, max_trans, devq); + NULL, max_trans, max_trans, devq); if (sc->s_sim == NULL) { printf("Failed to allocate a sim\n"); cam_simq_free(devq); @@ -320,11 +318,8 @@ static void * nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_arg) { struct nvme_sim_softc *sc = sc_arg; - struct nvme_controller *ctrlr = sc->s_ctrlr; union ccb *ccb; - mtx_lock(&ctrlr->lock); - ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { printf("unable to alloc CCB for rescan\n"); @@ -340,8 +335,6 @@ nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_ar xpt_rescan(ccb); - mtx_unlock(&ctrlr->lock); - return (ns); } @@ -349,14 +342,11 @@ static void nvme_sim_controller_fail(void *ctrlr_arg) { struct nvme_sim_softc *sc = ctrlr_arg; - struct nvme_controller *ctrlr = sc->s_ctrlr; - mtx_lock(&ctrlr->lock); xpt_async(AC_LOST_DEVICE, sc->s_path, NULL); xpt_free_path(sc->s_path); xpt_bus_deregister(cam_sim_path(sc->s_sim)); cam_sim_free(sc->s_sim, /*free_devq*/TRUE); - mtx_unlock(&ctrlr->lock); free(sc, M_NVME); } From owner-svn-src-all@freebsd.org Wed Jan 23 00:55:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E410B14B5354; Wed, 23 Jan 2019 00:55:57 +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 7DAC181E3B; Wed, 23 Jan 2019 00:55:57 +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 73CCC9559; Wed, 23 Jan 2019 00:55:57 +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 x0N0tvEw082115; Wed, 23 Jan 2019 00:55:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N0tvrD082114; Wed, 23 Jan 2019 00:55:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230055.x0N0tvrD082114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 00:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343329 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 343329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DAC181E3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 00:55:58 -0000 Author: mav Date: Wed Jan 23 00:55:57 2019 New Revision: 343329 URL: https://svnweb.freebsd.org/changeset/base/343329 Log: MFC r342400: Increase MTX_POOL_SLEEP_SIZE from 128 to 1024. This value remained unchanged for 15 years, and now this bump reduces lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM. While there, align struct mtx_pool fields to cache lines. Modified: stable/11/sys/kern/kern_mtxpool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mtxpool.c ============================================================================== --- stable/11/sys/kern/kern_mtxpool.c Wed Jan 23 00:54:08 2019 (r343328) +++ stable/11/sys/kern/kern_mtxpool.c Wed Jan 23 00:55:57 2019 (r343329) @@ -60,14 +60,14 @@ static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex poo /* Pool sizes must be a power of two */ #ifndef MTX_POOL_SLEEP_SIZE -#define MTX_POOL_SLEEP_SIZE 128 +#define MTX_POOL_SLEEP_SIZE 1024 #endif struct mtxpool_header { int mtxpool_size; int mtxpool_mask; int mtxpool_shift; - int mtxpool_next; + int mtxpool_next __aligned(CACHE_LINE_SIZE); }; struct mtx_pool { From owner-svn-src-all@freebsd.org Wed Jan 23 00:56:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EAE14B56C6; Wed, 23 Jan 2019 00:56:54 +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 6A6E582195; Wed, 23 Jan 2019 00:56:54 +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 56F35955A; Wed, 23 Jan 2019 00:56:54 +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 x0N0usvC082217; Wed, 23 Jan 2019 00:56:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N0usfA082216; Wed, 23 Jan 2019 00:56:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230056.x0N0usfA082216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 00:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343330 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 343330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A6E582195 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 00:56:54 -0000 Author: mav Date: Wed Jan 23 00:56:53 2019 New Revision: 343330 URL: https://svnweb.freebsd.org/changeset/base/343330 Log: Increase MTX_POOL_SLEEP_SIZE from 128 to 1024. This value remained unchanged for 15 years, and now this bump reduces lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM. While there, align struct mtx_pool fields to cache lines. Modified: stable/12/sys/kern/kern_mtxpool.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mtxpool.c ============================================================================== --- stable/12/sys/kern/kern_mtxpool.c Wed Jan 23 00:55:57 2019 (r343329) +++ stable/12/sys/kern/kern_mtxpool.c Wed Jan 23 00:56:53 2019 (r343330) @@ -62,14 +62,14 @@ static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex poo /* Pool sizes must be a power of two */ #ifndef MTX_POOL_SLEEP_SIZE -#define MTX_POOL_SLEEP_SIZE 128 +#define MTX_POOL_SLEEP_SIZE 1024 #endif struct mtxpool_header { int mtxpool_size; int mtxpool_mask; int mtxpool_shift; - int mtxpool_next; + int mtxpool_next __aligned(CACHE_LINE_SIZE); }; struct mtx_pool { From owner-svn-src-all@freebsd.org Wed Jan 23 01:16:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F1C914B5D99; Wed, 23 Jan 2019 01:16: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 D7E7D82B46; Wed, 23 Jan 2019 01:16: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 C7BB098BF; Wed, 23 Jan 2019 01:16: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 x0N1GJWR092609; Wed, 23 Jan 2019 01:16:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N1GJr0092608; Wed, 23 Jan 2019 01:16:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230116.x0N1GJr0092608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 01:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343331 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 343331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7E7D82B46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 01:16:20 -0000 Author: mav Date: Wed Jan 23 01:16:19 2019 New Revision: 343331 URL: https://svnweb.freebsd.org/changeset/base/343331 Log: MFC r342546: Add descriptions to NVMe interrupts. Modified: stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 23 00:56:53 2019 (r343330) +++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 23 01:16:19 2019 (r343331) @@ -561,6 +561,13 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_qpair_msix_handler, qpair, &qpair->tag); + if (id == 0) { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "admin"); + } else { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "io%d", id - 1); + } } mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); From owner-svn-src-all@freebsd.org Wed Jan 23 01:17:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35E8F14B5DE2; Wed, 23 Jan 2019 01:17:00 +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 D06B982C64; Wed, 23 Jan 2019 01:16:59 +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 C611E98C0; Wed, 23 Jan 2019 01:16:59 +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 x0N1GxcM092689; Wed, 23 Jan 2019 01:16:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N1Gxxf092688; Wed, 23 Jan 2019 01:16:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230116.x0N1Gxxf092688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 01:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343332 - stable/11/sys/dev/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/nvme X-SVN-Commit-Revision: 343332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D06B982C64 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 01:17:00 -0000 Author: mav Date: Wed Jan 23 01:16:59 2019 New Revision: 343332 URL: https://svnweb.freebsd.org/changeset/base/343332 Log: MFC r342546: Add descriptions to NVMe interrupts. Modified: stable/11/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_qpair.c Wed Jan 23 01:16:19 2019 (r343331) +++ stable/11/sys/dev/nvme/nvme_qpair.c Wed Jan 23 01:16:59 2019 (r343332) @@ -475,6 +475,13 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_qpair_msix_handler, qpair, &qpair->tag); + if (id == 0) { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "admin"); + } else { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "io%d", id - 1); + } } mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); From owner-svn-src-all@freebsd.org Wed Jan 23 01:23:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6DA814B5FF7; Wed, 23 Jan 2019 01:23: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 532D083089; Wed, 23 Jan 2019 01:23:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440319A69; Wed, 23 Jan 2019 01:23:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N1NKhm097903; Wed, 23 Jan 2019 01:23:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N1NKnQ097902; Wed, 23 Jan 2019 01:23:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230123.x0N1NKnQ097902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 01:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343333 - stable/12/sys/geom X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/geom X-SVN-Commit-Revision: 343333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 532D083089 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 01:23:21 -0000 Author: mav Date: Wed Jan 23 01:23:19 2019 New Revision: 343333 URL: https://svnweb.freebsd.org/changeset/base/343333 Log: MFC r342558: Switch from mutexes to atomics in GEOM_DEV I/O path. Mutexes in I/O path there were used twice per I/O to atomically access several variables to close and/or destroy the device on last request completion. I found the way to fit all required info into one integer, suitable for atomic operations. It opened race window on device close, but addition of timeout to the msleep() there should cover it. Profiling shows removal of significant spinning time on those mutexes and IOPS increase from ~600K to >800K to NVMe on 72-core systems. Modified: stable/12/sys/geom/geom_dev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/geom_dev.c ============================================================================== --- stable/12/sys/geom/geom_dev.c Wed Jan 23 01:16:59 2019 (r343332) +++ stable/12/sys/geom/geom_dev.c Wed Jan 23 01:23:19 2019 (r343333) @@ -64,7 +64,10 @@ struct g_dev_softc { struct cdev *sc_dev; struct cdev *sc_alias; int sc_open; - int sc_active; + u_int sc_active; +#define SC_A_DESTROY (1 << 31) +#define SC_A_OPEN (1 << 30) +#define SC_A_ACTIVE (SC_A_OPEN - 1) }; static d_open_t g_dev_open; @@ -420,9 +423,13 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struc if (error == 0) { sc = cp->private; mtx_lock(&sc->sc_mtx); - if (sc->sc_open == 0 && sc->sc_active != 0) + if (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) wakeup(&sc->sc_active); sc->sc_open += r + w + e; + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); mtx_unlock(&sc->sc_mtx); } return (error); @@ -465,8 +472,12 @@ g_dev_close(struct cdev *dev, int flags, int fmt, stru sc = cp->private; mtx_lock(&sc->sc_mtx); sc->sc_open += r + w + e; - while (sc->sc_open == 0 && sc->sc_active != 0) - msleep(&sc->sc_active, &sc->sc_mtx, 0, "PRIBIO", 0); + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); + while (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) + msleep(&sc->sc_active, &sc->sc_mtx, 0, "g_dev_close", hz / 10); mtx_unlock(&sc->sc_mtx); g_topology_lock(); error = g_access(cp, r, w, e); @@ -693,7 +704,7 @@ g_dev_done(struct bio *bp2) struct g_consumer *cp; struct g_dev_softc *sc; struct bio *bp; - int destroy; + int active; cp = bp2->bio_from; sc = cp->private; @@ -713,17 +724,13 @@ g_dev_done(struct bio *bp2) bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed); } g_destroy_bio(bp2); - destroy = 0; - mtx_lock(&sc->sc_mtx); - if ((--sc->sc_active) == 0) { - if (sc->sc_open == 0) + active = atomic_fetchadd_int(&sc->sc_active, -1) - 1; + if ((active & SC_A_ACTIVE) == 0) { + if ((active & SC_A_OPEN) == 0) wakeup(&sc->sc_active); - if (sc->sc_dev == NULL) - destroy = 1; + if (active & SC_A_DESTROY) + g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); } - mtx_unlock(&sc->sc_mtx); - if (destroy) - g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); biodone(bp); } @@ -755,10 +762,8 @@ g_dev_strategy(struct bio *bp) return; } #endif - mtx_lock(&sc->sc_mtx); KASSERT(sc->sc_open > 0, ("Closed device in g_dev_strategy")); - sc->sc_active++; - mtx_unlock(&sc->sc_mtx); + atomic_add_int(&sc->sc_active, 1); for (;;) { /* @@ -796,18 +801,16 @@ g_dev_callback(void *arg) { struct g_consumer *cp; struct g_dev_softc *sc; - int destroy; + int active; cp = arg; sc = cp->private; g_trace(G_T_TOPOLOGY, "g_dev_callback(%p(%s))", cp, cp->geom->name); - mtx_lock(&sc->sc_mtx); sc->sc_dev = NULL; sc->sc_alias = NULL; - destroy = (sc->sc_active == 0); - mtx_unlock(&sc->sc_mtx); - if (destroy) + active = atomic_fetchadd_int(&sc->sc_active, SC_A_DESTROY); + if ((active & SC_A_ACTIVE) == 0) g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); } From owner-svn-src-all@freebsd.org Wed Jan 23 01:23:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D7E514B6029; Wed, 23 Jan 2019 01:23:46 +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 33C9A83197; Wed, 23 Jan 2019 01:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27AE69A6A; Wed, 23 Jan 2019 01:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N1NkHD097981; Wed, 23 Jan 2019 01:23:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N1Nkfg097980; Wed, 23 Jan 2019 01:23:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901230123.x0N1Nkfg097980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Jan 2019 01:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343334 - stable/11/sys/geom X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/geom X-SVN-Commit-Revision: 343334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33C9A83197 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 01:23:46 -0000 Author: mav Date: Wed Jan 23 01:23:45 2019 New Revision: 343334 URL: https://svnweb.freebsd.org/changeset/base/343334 Log: MFC r342558: Switch from mutexes to atomics in GEOM_DEV I/O path. Mutexes in I/O path there were used twice per I/O to atomically access several variables to close and/or destroy the device on last request completion. I found the way to fit all required info into one integer, suitable for atomic operations. It opened race window on device close, but addition of timeout to the msleep() there should cover it. Profiling shows removal of significant spinning time on those mutexes and IOPS increase from ~600K to >800K to NVMe on 72-core systems. Modified: stable/11/sys/geom/geom_dev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom_dev.c ============================================================================== --- stable/11/sys/geom/geom_dev.c Wed Jan 23 01:23:19 2019 (r343333) +++ stable/11/sys/geom/geom_dev.c Wed Jan 23 01:23:45 2019 (r343334) @@ -62,7 +62,10 @@ struct g_dev_softc { struct cdev *sc_dev; struct cdev *sc_alias; int sc_open; - int sc_active; + u_int sc_active; +#define SC_A_DESTROY (1 << 31) +#define SC_A_OPEN (1 << 30) +#define SC_A_ACTIVE (SC_A_OPEN - 1) }; static d_open_t g_dev_open; @@ -393,9 +396,13 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struc if (error == 0) { sc = cp->private; mtx_lock(&sc->sc_mtx); - if (sc->sc_open == 0 && sc->sc_active != 0) + if (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) wakeup(&sc->sc_active); sc->sc_open += r + w + e; + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); mtx_unlock(&sc->sc_mtx); } return (error); @@ -438,8 +445,12 @@ g_dev_close(struct cdev *dev, int flags, int fmt, stru sc = cp->private; mtx_lock(&sc->sc_mtx); sc->sc_open += r + w + e; - while (sc->sc_open == 0 && sc->sc_active != 0) - msleep(&sc->sc_active, &sc->sc_mtx, 0, "PRIBIO", 0); + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); + while (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) + msleep(&sc->sc_active, &sc->sc_mtx, 0, "g_dev_close", hz / 10); mtx_unlock(&sc->sc_mtx); g_topology_lock(); error = g_access(cp, r, w, e); @@ -622,7 +633,7 @@ g_dev_done(struct bio *bp2) struct g_consumer *cp; struct g_dev_softc *sc; struct bio *bp; - int destroy; + int active; cp = bp2->bio_from; sc = cp->private; @@ -642,17 +653,13 @@ g_dev_done(struct bio *bp2) bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed); } g_destroy_bio(bp2); - destroy = 0; - mtx_lock(&sc->sc_mtx); - if ((--sc->sc_active) == 0) { - if (sc->sc_open == 0) + active = atomic_fetchadd_int(&sc->sc_active, -1) - 1; + if ((active & SC_A_ACTIVE) == 0) { + if ((active & SC_A_OPEN) == 0) wakeup(&sc->sc_active); - if (sc->sc_dev == NULL) - destroy = 1; + if (active & SC_A_DESTROY) + g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); } - mtx_unlock(&sc->sc_mtx); - if (destroy) - g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); biodone(bp); } @@ -683,10 +690,8 @@ g_dev_strategy(struct bio *bp) return; } #endif - mtx_lock(&sc->sc_mtx); KASSERT(sc->sc_open > 0, ("Closed device in g_dev_strategy")); - sc->sc_active++; - mtx_unlock(&sc->sc_mtx); + atomic_add_int(&sc->sc_active, 1); for (;;) { /* @@ -724,18 +729,16 @@ g_dev_callback(void *arg) { struct g_consumer *cp; struct g_dev_softc *sc; - int destroy; + int active; cp = arg; sc = cp->private; g_trace(G_T_TOPOLOGY, "g_dev_callback(%p(%s))", cp, cp->geom->name); - mtx_lock(&sc->sc_mtx); sc->sc_dev = NULL; sc->sc_alias = NULL; - destroy = (sc->sc_active == 0); - mtx_unlock(&sc->sc_mtx); - if (destroy) + active = atomic_fetchadd_int(&sc->sc_active, SC_A_DESTROY); + if ((active & SC_A_ACTIVE) == 0) g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); } From owner-svn-src-all@freebsd.org Wed Jan 23 02:09:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7AFA14B7031; Wed, 23 Jan 2019 02:09:16 +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 6CC8F8446B; Wed, 23 Jan 2019 02:09:16 +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 5BCE2A11C; Wed, 23 Jan 2019 02:09:16 +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 x0N29GHM018738; Wed, 23 Jan 2019 02:09:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N29Gaq018737; Wed, 23 Jan 2019 02:09:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901230209.x0N29Gaq018737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 23 Jan 2019 02:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343335 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 343335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CC8F8446B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:09:17 -0000 Author: kevans Date: Wed Jan 23 02:09:15 2019 New Revision: 343335 URL: https://svnweb.freebsd.org/changeset/base/343335 Log: libbe(3): simplify import, allow replication streams Previously, we directly used libzfs_core's lzc_receive to import to a temporary snapshot, then cloned the snapshot and setup the properties. This failed when attempting to import replication streams with questionable error. libzfs's zfs_receive is a much better fit here, so we now use it instead with the destination dataset and let libzfs take care of the dirty details. be_import is greatly simplified as a result. Reported by: Marie Helene Kvello-Aune MFC after: 1 week Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Wed Jan 23 01:23:45 2019 (r343334) +++ head/lib/libbe/be.c Wed Jan 23 02:09:15 2019 (r343335) @@ -649,32 +649,14 @@ int be_import(libbe_handle_t *lbh, const char *bootenv, int fd) { char buf[BE_MAXPATHLEN]; - time_t rawtime; nvlist_t *props; zfs_handle_t *zfs; - int err, len; - char nbuf[24]; + recvflags_t flags = { .nomount = 1 }; + int err; - /* - * We don't need this to be incredibly random, just unique enough that - * it won't conflict with an existing dataset name. Chopping time - * down to 32 bits is probably good enough for this. - */ - snprintf(nbuf, 24, "tmp%u", - (uint32_t)(time(NULL) & 0xFFFFFFFF)); - if ((err = be_root_concat(lbh, nbuf, buf)) != 0) - /* - * Technically this is our problem, but we try to use short - * enough names that we won't run into problems except in - * worst-case BE root approaching MAXPATHLEN. - */ - return (set_error(lbh, BE_ERR_PATHLEN)); + be_root_concat(lbh, bootenv, buf); - time(&rawtime); - len = strlen(buf); - strftime(buf + len, sizeof(buf) - len, "@%F-%T", localtime(&rawtime)); - - if ((err = lzc_receive(buf, NULL, NULL, false, fd)) != 0) { + if ((err = zfs_receive(lbh->lzh, buf, NULL, &flags, fd, NULL)) != 0) { switch (err) { case EINVAL: return (set_error(lbh, BE_ERR_NOORIGIN)); @@ -687,39 +669,22 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in } } - if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) + if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_FILESYSTEM)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); nvlist_add_string(props, "mountpoint", "/"); - be_root_concat(lbh, bootenv, buf); - - err = zfs_clone(zfs, buf, props); - zfs_close(zfs); + err = zfs_prop_set_list(zfs, props); nvlist_free(props); - if (err != 0) - return (set_error(lbh, BE_ERR_UNKNOWN)); - - /* - * Finally, we open up the dataset we just cloned the snapshot so that - * we may promote it. This is necessary in order to clean up the ghost - * snapshot that doesn't need to be seen after the operation is - * complete. - */ - if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (set_error(lbh, BE_ERR_ZFSOPEN)); - - err = zfs_promote(zfs); zfs_close(zfs); if (err != 0) return (set_error(lbh, BE_ERR_UNKNOWN)); - /* Clean up the temporary snapshot */ - return (be_destroy(lbh, nbuf, 0)); + return (0); } #if SOON From owner-svn-src-all@freebsd.org Wed Jan 23 02:40:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A60A714B7A1F; Wed, 23 Jan 2019 02:40:30 +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 4DE3685317; Wed, 23 Jan 2019 02:40:30 +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 37F69A629; Wed, 23 Jan 2019 02:40:30 +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 x0N2eTAS034099; Wed, 23 Jan 2019 02:40:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2eTHP034098; Wed, 23 Jan 2019 02:40:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230240.x0N2eTHP034098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343336 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DE3685317 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:40:30 -0000 Author: cy Date: Wed Jan 23 02:40:29 2019 New Revision: 343336 URL: https://svnweb.freebsd.org/changeset/base/343336 Log: MFC r343073: Remove an IRIX-only source file. Deleted: stable/11/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Deleted: stable/10/contrib/ipfilter/mli_ipl.c stable/12/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/10/ (props changed) stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:40:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FFB14B7A20; Wed, 23 Jan 2019 02:40:30 +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 7003285318; Wed, 23 Jan 2019 02:40:30 +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 602EFA62A; Wed, 23 Jan 2019 02:40:30 +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 x0N2eUBl034104; Wed, 23 Jan 2019 02:40:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2eUS4034103; Wed, 23 Jan 2019 02:40:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230240.x0N2eUS4034103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343336 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7003285318 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:40:31 -0000 Author: cy Date: Wed Jan 23 02:40:29 2019 New Revision: 343336 URL: https://svnweb.freebsd.org/changeset/base/343336 Log: MFC r343073: Remove an IRIX-only source file. Deleted: stable/12/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Deleted: stable/10/contrib/ipfilter/mli_ipl.c stable/11/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/10/ (props changed) stable/11/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:40:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 285F414B7A29; Wed, 23 Jan 2019 02:40:31 +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 BF6DB85319; Wed, 23 Jan 2019 02:40:30 +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 B43A7A62B; Wed, 23 Jan 2019 02:40:30 +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 x0N2eUFc034109; Wed, 23 Jan 2019 02:40:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2eUZA034108; Wed, 23 Jan 2019 02:40:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230240.x0N2eUZA034108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343336 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF6DB85319 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:40:31 -0000 Author: cy Date: Wed Jan 23 02:40:29 2019 New Revision: 343336 URL: https://svnweb.freebsd.org/changeset/base/343336 Log: MFC r343073: Remove an IRIX-only source file. Deleted: stable/10/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Deleted: stable/11/contrib/ipfilter/mli_ipl.c stable/12/contrib/ipfilter/mli_ipl.c Modified: Directory Properties: stable/11/ (props changed) stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:43:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE8A114B7D58; Wed, 23 Jan 2019 02:43:50 +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 61FA2859BD; Wed, 23 Jan 2019 02:43:50 +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 5921DA7CF; Wed, 23 Jan 2019 02:43:50 +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 x0N2hoBZ038990; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2ho4O038989; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230243.x0N2ho4O038989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343337 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61FA2859BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:43:50 -0000 Author: cy Date: Wed Jan 23 02:43:49 2019 New Revision: 343337 URL: https://svnweb.freebsd.org/changeset/base/343337 Log: MFC r343103: Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was no longer needed. Deleted: stable/11/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Deleted: stable/10/contrib/ipfilter/pcap-bpf.h stable/12/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/10/ (props changed) stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:43:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 194E514B7D5D; Wed, 23 Jan 2019 02:43:51 +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 B5F0E859BF; Wed, 23 Jan 2019 02:43:50 +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 AB924A7D0; Wed, 23 Jan 2019 02:43:50 +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 x0N2ho9e038995; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2hoEC038994; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230243.x0N2hoEC038994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343337 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5F0E859BF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:43:51 -0000 Author: cy Date: Wed Jan 23 02:43:49 2019 New Revision: 343337 URL: https://svnweb.freebsd.org/changeset/base/343337 Log: MFC r343103: Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was no longer needed. Deleted: stable/12/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Deleted: stable/10/contrib/ipfilter/pcap-bpf.h stable/11/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/10/ (props changed) stable/11/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:43:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E4814B7D64; Wed, 23 Jan 2019 02:43:51 +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 1F5CA859C3; Wed, 23 Jan 2019 02:43:51 +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 09BCEA7D1; Wed, 23 Jan 2019 02:43:51 +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 x0N2hoHi039000; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2hot3038999; Wed, 23 Jan 2019 02:43:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901230243.x0N2hot3038999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 23 Jan 2019 02:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343337 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter 12/contrib/ipfilter X-SVN-Commit-Revision: 343337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F5CA859C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:43:51 -0000 Author: cy Date: Wed Jan 23 02:43:49 2019 New Revision: 343337 URL: https://svnweb.freebsd.org/changeset/base/343337 Log: MFC r343103: Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was no longer needed. Deleted: stable/10/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Deleted: stable/11/contrib/ipfilter/pcap-bpf.h stable/12/contrib/ipfilter/pcap-bpf.h Modified: Directory Properties: stable/11/ (props changed) stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Jan 23 02:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC6E14B7ECD; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@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 427AC85DA0; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31C81A7D3; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N2kaXK039180; Wed, 23 Jan 2019 02:46:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2kaCt039179; Wed, 23 Jan 2019 02:46:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901230246.x0N2kaCt039179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 23 Jan 2019 02:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343338 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 427AC85DA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:46:36 -0000 Author: gonzo Date: Wed Jan 23 02:46:35 2019 New Revision: 343338 URL: https://svnweb.freebsd.org/changeset/base/343338 Log: Fix systat's :only command parser for the multiple arguments case According to systat(1) :only option is supposed to accept multiple drives but the parser for its arguments stops after first entry. Fix the parser logic to accept multiple drives. PR: 59220 Reported by: Andy Farkas MFC after: 1 week Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Wed Jan 23 02:43:49 2019 (r343337) +++ head/usr.bin/systat/devs.c Wed Jan 23 02:46:35 2019 (r343338) @@ -288,7 +288,7 @@ dsselect(const char *args, devstat_select_mode select_ ; if (*cp) *cp++ = '\0'; - if (cp - args == 0) + if (cp - tmpstr1 == 0) break; for (i = 0; i < num_devices; i++) { asprintf(&buffer, "%s%d", dev_select[i].device_name, @@ -312,7 +312,7 @@ dsselect(const char *args, devstat_select_mode select_ } if (i >= num_devices) error("%s: unknown drive", args); - args = cp; + tmpstr1 = cp; } free(tmpstr); From owner-svn-src-all@freebsd.org Wed Jan 23 10:05:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D70A14C154E; Wed, 23 Jan 2019 10:05:28 +0000 (UTC) (envelope-from se@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 030AA6C30B; Wed, 23 Jan 2019 10:05:28 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EC4EDF40C; Wed, 23 Jan 2019 10:05:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NA5R0x069932; Wed, 23 Jan 2019 10:05:27 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NA5RTp069931; Wed, 23 Jan 2019 10:05:27 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901231005.x0NA5RTp069931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 23 Jan 2019 10:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343339 - head/usr.sbin/kbdcontrol X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.sbin/kbdcontrol X-SVN-Commit-Revision: 343339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 030AA6C30B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 10:05:28 -0000 Author: se Date: Wed Jan 23 10:05:27 2019 New Revision: 343339 URL: https://svnweb.freebsd.org/changeset/base/343339 Log: Silence Clang Scan warning about use of unitialized variable. While the warning is a false positive, it is possible to clarify the code by always initializing the variable. This does also allow to make the sending of the "beep" control sequence depend on the validity of its parameters. I have left the redundant assignment of 0 to the now initialized variables in place since this makes the code simpler to understand and does not add any run-time overhead (the compiler completely removes the "else if" test and the assignments). There was an embedded literal escape character in a string, which messes up diplaying the source code on a terminal that interprets ANSI sequences. The literal escape has been replaced by \e (non-standard, but supported by all relevant compilers, and already used in other source files in base). MFC after: 2 weeks Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Jan 23 02:46:35 2019 (r343338) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Jan 23 10:05:27 2019 (r343339) @@ -961,6 +961,8 @@ set_bell_values(char *opt) int bell, duration, pitch; bell = 0; + duration = 0; + pitch = 0; if (!strncmp(opt, "quiet.", 6)) { bell = CONS_QUIET_BELL; opt += 6; @@ -991,8 +993,8 @@ badopt: } ioctl(0, CONS_BELLTYPE, &bell); - if (!(bell & CONS_VISUAL_BELL)) - fprintf(stderr, "[=%d;%dB", pitch, duration); + if (duration > 0 && pitch > 0) + fprintf(stderr, "\e[=%d;%dB", pitch, duration); } static void From owner-svn-src-all@freebsd.org Wed Jan 23 12:43:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFEBA14A7009; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@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 60E15712BC; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DA3118ED4; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NChlGG053025; Wed, 23 Jan 2019 12:43:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NChlul053024; Wed, 23 Jan 2019 12:43:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231243.x0NChlul053024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 12:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343340 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60E15712BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 12:43:48 -0000 Author: avos Date: Wed Jan 23 12:43:46 2019 New Revision: 343340 URL: https://svnweb.freebsd.org/changeset/base/343340 Log: net80211: fix channel list construction for non-auto operating mode. Change the way how channel list mode <-> desired mode match is done: - Match channel list mode for next non-auto desired modes: * 11b: 11g, 11ng, 11acg; * 11a: 11na, 11ac - Add pre-defined channels only when one of the next conditions met: * the desired channel mode is 'auto' or * the desired channel and selected channel list modes are exactly the same or * the previous rule (11g / 11n / 11ac promotion) applies. Before r275875 construction work properly for all except 11ng / 11na / 11acg / 11ac modes - these were broken at all (i.e., the scan list was empty); after r275875 all checks were removed, so scan table was populated by all device-compatible channels (desired mode was ignored). For example, if I will set 'ifconfig wlan0 mode 11ng' for RTL8821AU: - pre-r275875: nothing, scan will not work; - after r275875: both 11ng and 11na bands were scanned; also, since 11b channel list was used, 14th channel was scanned too. - after this change: only 11ng - 1-13 channels - are used for scanning. Tested with: * RTL8188EE, STA mode. * RTL8821AU, STA mode. MFC after: 5 days Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 10:05:27 2019 (r343339) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 12:43:46 2019 (r343340) @@ -472,6 +472,8 @@ static const u_int chanflags[IEEE80211_MODE_MAX] = { /* check legacy */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, + [IEEE80211_MODE_VHT_5GHZ] = IEEE80211_CHAN_A, + [IEEE80211_MODE_VHT_2GHZ] = IEEE80211_CHAN_G, }; static void @@ -618,32 +620,48 @@ makescanlist(struct ieee80211_scan_state *ss, struct i */ for (scan = table; scan->list != NULL; scan++) { mode = scan->mode; - if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { + + switch (mode) { + case IEEE80211_MODE_11B: + if (vap->iv_des_mode == IEEE80211_MODE_11B) + break; + /* - * If a desired mode was specified, scan only - * channels that satisfy that constraint. + * The scan table marks 2.4Ghz channels as b + * so if the desired mode is 11g / 11ng / 11acg, + * then use the 11b channel list but upgrade the mode. + * + * NB: 11b -> AUTO lets add_channels upgrade an + * 11b channel to 11g if available. */ - if (vap->iv_des_mode != mode) { - /* - * The scan table marks 2.4Ghz channels as b - * so if the desired mode is 11g, then use - * the 11b channel list but upgrade the mode. - */ - if (vap->iv_des_mode == IEEE80211_MODE_11G) { - if (mode == IEEE80211_MODE_11G) /* Skip the G check */ - continue; - else if (mode == IEEE80211_MODE_11B) - mode = IEEE80211_MODE_11G; /* upgrade */ - } + if (vap->iv_des_mode == IEEE80211_MODE_AUTO || + vap->iv_des_mode == IEEE80211_MODE_11G || + vap->iv_des_mode == IEEE80211_MODE_11NG || + vap->iv_des_mode == IEEE80211_MODE_VHT_2GHZ) { + mode = vap->iv_des_mode; + break; } - } else { + + continue; + case IEEE80211_MODE_11A: + /* Use 11a channel list for 11na / 11ac modes */ + if (vap->iv_des_mode == IEEE80211_MODE_11NA || + vap->iv_des_mode == IEEE80211_MODE_VHT_5GHZ) { + mode = vap->iv_des_mode; + break; + } + + /* FALLTHROUGH */ + default: /* - * This lets add_channels upgrade an 11b channel - * to 11g if available. + * If a desired mode was specified, scan only + * channels that satisfy that constraint. */ - if (mode == IEEE80211_MODE_11B) - mode = IEEE80211_MODE_AUTO; + if (vap->iv_des_mode != IEEE80211_MODE_AUTO && + vap->iv_des_mode != mode) + continue; } + #ifdef IEEE80211_F_XR /* XR does not operate on turbo channels */ if ((vap->iv_flags & IEEE80211_F_XR) && From owner-svn-src-all@freebsd.org Wed Jan 23 13:07:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708CF14A799A; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@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 1298571EAC; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0664019232; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ND75MF063549; Wed, 23 Jan 2019 13:07:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ND75Yj063548; Wed, 23 Jan 2019 13:07:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231307.x0ND75Yj063548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 13:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343341 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 343341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1298571EAC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:07:06 -0000 Author: avos Date: Wed Jan 23 13:07:05 2019 New Revision: 343341 URL: https://svnweb.freebsd.org/changeset/base/343341 Log: ifconfig: drop unused macros from ifieee80211.c MFC after: 5 days Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Jan 23 12:43:46 2019 (r343340) +++ head/sbin/ifconfig/ifieee80211.c Wed Jan 23 13:07:05 2019 (r343341) @@ -1528,9 +1528,6 @@ getmodeflags(const char *val) return flags; } -#define IEEE80211_CHAN_HTA (IEEE80211_CHAN_HT|IEEE80211_CHAN_5GHZ) -#define IEEE80211_CHAN_HTG (IEEE80211_CHAN_HT|IEEE80211_CHAN_2GHZ) - #define _APPLY(_flags, _base, _param, _v) do { \ if (_flags & IEEE80211_CHAN_HT) { \ if ((_flags & (IEEE80211_CHAN_5GHZ|IEEE80211_CHAN_2GHZ)) == 0) {\ @@ -1720,8 +1717,6 @@ DECL_CMD_FUNC(set80211maxretry, val, d) } #undef _APPLY_RATE #undef _APPLY -#undef IEEE80211_CHAN_HTA -#undef IEEE80211_CHAN_HTG static DECL_CMD_FUNC(set80211fragthreshold, val, d) From owner-svn-src-all@freebsd.org Wed Jan 23 13:17:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C5A14A7CA8; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@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 3CEAE723D7; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32264193D4; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NDH3db068960; Wed, 23 Jan 2019 13:17:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NDH3Tp068959; Wed, 23 Jan 2019 13:17:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231317.x0NDH3Tp068959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 13:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343342 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CEAE723D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:17:04 -0000 Author: avos Date: Wed Jan 23 13:17:03 2019 New Revision: 343342 URL: https://svnweb.freebsd.org/changeset/base/343342 Log: net80211: turn channel mode check into assertion. There is may be only 11b channel (since chanflags[] table maps MODE_AUTO to the corresponding 11b channel flags). Checked with RTL8812AU, STA mode. MFC after: 5 days Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 13:07:05 2019 (r343341) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 13:17:03 2019 (r343342) @@ -496,12 +496,15 @@ add_channels(struct ieee80211vap *vap, if (c == NULL || isexcluded(vap, c)) continue; if (mode == IEEE80211_MODE_AUTO) { + KASSERT(IEEE80211_IS_CHAN_B(c), + ("%s: wrong channel for 'auto' mode %u / %u\n", + __func__, c->ic_freq, c->ic_flags)); + /* * XXX special-case 11b/g channels so we select * the g channel if both are present. */ - if (IEEE80211_IS_CHAN_B(c) && - (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) + if ((cg = find11gchannel(ic, i, c->ic_freq)) != NULL) c = cg; } ss->ss_chans[ss->ss_last++] = c; From owner-svn-src-all@freebsd.org Wed Jan 23 13:18:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C57814A7D70; Wed, 23 Jan 2019 13:18:23 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2F217257F; Wed, 23 Jan 2019 13:18:22 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f177.google.com with SMTP id s5-v6so1864602ljd.12; Wed, 23 Jan 2019 05:18:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=ltCfjepHYAPGhuZLgAtb/7strNUvXaVT8egdNluQnmg=; b=dl7N63agrti9EZR5zaC8usYOhdxdPLyKEa8mlFUAe9tQfRUTCa9RiG5aMziGMq0nhs 2ect2DdFs38Sy1QQkLXhp2aftpDn2aY+Y2FxFfAGUbee1f/bGMis0UsZvDgshro0vaso tKxoPWLFl4DjtYnrcZ5cAiyLwjPKqn9g47oP0VX1TtwBayKErNN1zhiNmFo4IHITCOgO t1hM76Oyu122NgrBNV5xQUA6KJ2WqfjNuPobfzpjomQVt7Xui0sI0MjlsktQhaRqUEvr DspTT/xFc3uo2d4yOpPoOoFjiFCY69lJcZNIzl8UYEeUk9HcdDZCEro8tdronClgCn5R 4R0w== X-Gm-Message-State: AJcUukdbVnklWyYDPU0TsZOVrkOQhbUEUX1jDpkSo2a7U3MVpTHY2uK+ kII7dPtnPTBbMe1SlnxafiY9BS63qSDDDQ== X-Google-Smtp-Source: ALg8bN4agF/3amtfx5ZoqcoBsHqarNB5CUbuYltsfD7zaKwHoj092aU2OLyvwfukVX67lg0LFkWcuA== X-Received: by 2002:a2e:6595:: with SMTP id e21-v6mr1917128ljf.123.1548249499976; Wed, 23 Jan 2019 05:18:19 -0800 (PST) Received: from localhost (178-133-59-65.dialup.umc.net.ua. [178.133.59.65]) by smtp.gmail.com with ESMTPSA id b21sm477291lfi.7.2019.01.23.05.18.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 23 Jan 2019 05:18:19 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343342 - head/sys/net80211 References: <201901231317.x0NDH3Tp068959@repo.freebsd.org> Date: Wed, 23 Jan 2019 15:17:48 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901231317.x0NDH3Tp068959@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: D2F217257F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:18:23 -0000 Wed, 23 Jan 2019 15:17:03 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Wed Jan 23 13:17:03 2019 > New Revision: 343342 > URL: https://svnweb.freebsd.org/changeset/base/343342 > > Log: > net80211: turn channel mode check into assertion. > There is may be only 11b channel (since chanflags[] table > maps MODE_AUTO to the corresponding 11b channel flags). > Checked with RTL8812AU, STA mode. Typo: this should be RTL8821AU From owner-svn-src-all@freebsd.org Wed Jan 23 14:19:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1489F14A9792; Wed, 23 Jan 2019 14:19:42 +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 ADA2C748E2; Wed, 23 Jan 2019 14:19:41 +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 82FC919DD4; Wed, 23 Jan 2019 14:19:41 +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 x0NEJfML000367; Wed, 23 Jan 2019 14:19:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NEJexS000361; Wed, 23 Jan 2019 14:19:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901231419.x0NEJexS000361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Jan 2019 14:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343343 - in stable/12/sys: amd64/linux compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 343343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADA2C748E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:19:42 -0000 Author: emaste Date: Wed Jan 23 14:19:40 2019 New Revision: 343343 URL: https://svnweb.freebsd.org/changeset/base/343343 Log: MFC linuxulator stack memory disclosure fixes r343260 linuxulator: fix stack memory disclosure in linux_ioctl_v4l r343261 linuxulator: fix stack memory disclosure in linux_ioctl_termio r343262 linuxulator: fix stack memory disclosure in linux_sigaltstack r343263 linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/linux/linux_machdep.c stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/compat/linux/linux_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/12/sys/amd64/linux/linux_machdep.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/amd64/linux/linux_machdep.c Wed Jan 23 14:19:40 2019 (r343343) @@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; + memset(&lss, 0, sizeof(lss)); LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); if (uap->uss != NULL) { Modified: stable/12/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/compat/linux/linux_ioctl.c Wed Jan 23 14:19:40 2019 (r343343) @@ -686,6 +686,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux { struct linux_termios lios; + memset(lio, 0, sizeof(*lio)); bsd_to_linux_termios(bios, &lios); lio->c_iflag = lios.c_iflag; lio->c_oflag = lios.c_oflag; @@ -2843,6 +2844,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st static int bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) { + memset(lvw, 0, sizeof(*lvw)); + lvw->x = vw->x; lvw->y = vw->y; lvw->width = vw->width; Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/compat/linux/linux_misc.c Wed Jan 23 14:19:40 2019 (r343343) @@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar } if (args->info != NULL) { p = td->td_proc; - if (td->td_retval[0] == 0) - bzero(&lsi, sizeof(lsi)); - else { + bzero(&lsi, sizeof(lsi)); + if (td->td_retval[0] != 0) { sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); } From owner-svn-src-all@freebsd.org Wed Jan 23 14:21:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA9E214A986F; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@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 93F7D74B03; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 88B3219F24; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NELO29001361; Wed, 23 Jan 2019 14:21:24 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NELNFd001356; Wed, 23 Jan 2019 14:21:23 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901231421.x0NELNFd001356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 23 Jan 2019 14:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343344 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93F7D74B03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:21:25 -0000 Author: vmaffione Date: Wed Jan 23 14:21:23 2019 New Revision: 343344 URL: https://svnweb.freebsd.org/changeset/base/343344 Log: netmap: fix knote() argument to match the mutex state The nm_os_selwakeup function needs to call knote() to wake up kqueue(9) users. However, this function can be called from different code paths, with different lock requirements. This patch fixes the knote() call argument to match the relavant lock state. Also, comments have been updated to reflect current code. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219846 Reported by: Aleksandr Fedorov Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18876 Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap.c Wed Jan 23 14:21:23 2019 (r343344) @@ -2531,7 +2531,6 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } nifp = priv->np_nifp; - priv->np_td = td; /* for debugging purposes */ /* return the offset of the netmap_if object */ req->nr_rx_rings = na->num_rx_rings; @@ -3207,8 +3206,8 @@ nmreq_checkoptions(struct nmreq_header *hdr) * * Can be called for one or more queues. * Return true the event mask corresponding to ready events. - * If there are no ready events, do a selrecord on either individual - * selinfo or on the global one. + * If there are no ready events (and 'sr' is not NULL), do a + * selrecord on either individual selinfo or on the global one. * Device-dependent parts (locking and sync of tx/rx rings) * are done through callbacks. * Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Jan 23 14:21:23 2019 (r343344) @@ -85,7 +85,7 @@ void nm_os_selinfo_uninit(NM_SELINFO_T *si) { /* XXX kqueue(9) needed; these will mirror knlist_init. */ - knlist_delete(&si->si.si_note, curthread, 0 /* not locked */ ); + knlist_delete(&si->si.si_note, curthread, /*islocked=*/0); knlist_destroy(&si->si.si_note); /* now we don't need the mutex anymore */ mtx_destroy(&si->m); @@ -1294,21 +1294,21 @@ nm_os_kctx_destroy(struct nm_kctx *nmk) /******************** kqueue support ****************/ /* - * nm_os_selwakeup also needs to issue a KNOTE_UNLOCKED. - * We use a non-zero argument to distinguish the call from the one - * in kevent_scan() which instead also needs to run netmap_poll(). - * The knote uses a global mutex for the time being. We might - * try to reuse the one in the si, but it is not allocated - * permanently so it might be a bit tricky. + * In addition to calling selwakeuppri(), nm_os_selwakeup() also + * needs to call KNOTE to wake up kqueue listeners. + * We use a non-zero 'hint' argument to inform the netmap_knrw() + * function that it is being called from 'nm_os_selwakeup'; this + * is necessary because when netmap_knrw() is called by the kevent + * subsystem (i.e. kevent_scan()) we also need to call netmap_poll(). + * The knote uses a private mutex associated to the 'si' (see struct + * selinfo, struct nm_selinfo, and nm_os_selinfo_init). * - * The *kqfilter function registers one or another f_event - * depending on read or write mode. - * In the call to f_event() td_fpop is NULL so any child function - * calling devfs_get_cdevpriv() would fail - and we need it in - * netmap_poll(). As a workaround we store priv into kn->kn_hook - * and pass it as first argument to netmap_poll(), which then - * uses the failure to tell that we are called from f_event() - * and do not need the selrecord(). + * The netmap_kqfilter() function registers one or another f_event + * depending on read or write mode. A pointer to the struct + * 'netmap_priv_d' is stored into kn->kn_hook, so that it can later + * be passed to netmap_poll(). We pass NULL as a third argument to + * netmap_poll(), so that the latter only runs the txsync/rxsync + * (if necessary), and skips the nm_os_selrecord() calls. */ @@ -1316,12 +1316,13 @@ void nm_os_selwakeup(struct nm_selinfo *si) { if (netmap_verbose) - D("on knote %p", &si->si.si_note); + nm_prinf("on knote %p", &si->si.si_note); selwakeuppri(&si->si, PI_NET); - /* use a non-zero hint to tell the notification from the - * call done in kqueue_scan() which uses 0 + /* We use a non-zero hint to distinguish this notification call + * from the call done in kqueue_scan(), which uses hint=0. */ - KNOTE_UNLOCKED(&si->si.si_note, 0x100 /* notification */); + KNOTE(&si->si.si_note, /*hint=*/0x100, + mtx_owned(&si->m) ? KNF_LISTLOCKED : 0); } void @@ -1337,7 +1338,7 @@ netmap_knrdetach(struct knote *kn) struct selinfo *si = &priv->np_si[NR_RX]->si; D("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, 0); + knlist_remove(&si->si_note, kn, /*islocked=*/0); } static void @@ -1347,14 +1348,15 @@ netmap_knwdetach(struct knote *kn) struct selinfo *si = &priv->np_si[NR_TX]->si; D("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, 0); + knlist_remove(&si->si_note, kn, /*islocked=*/0); } /* - * callback from notifies (generated externally) and our - * calls to kevent(). The former we just return 1 (ready) - * since we do not know better. - * In the latter we call netmap_poll and return 0/1 accordingly. + * Callback triggered by netmap notifications (see netmap_notify()), + * and by the application calling kevent(). In the former case we + * just return 1 (events ready), since we are not able to do better. + * In the latter case we use netmap_poll() to see which events are + * ready. */ static int netmap_knrw(struct knote *kn, long hint, int events) @@ -1363,21 +1365,17 @@ netmap_knrw(struct knote *kn, long hint, int events) int revents; if (hint != 0) { - ND(5, "call from notify"); - return 1; /* assume we are ready */ - } - priv = kn->kn_hook; - /* the notification may come from an external thread, - * in which case we do not want to run the netmap_poll - * This should be filtered above, but check just in case. - */ - if (curthread != priv->np_td) { /* should not happen */ - RD(5, "curthread changed %p %p", curthread, priv->np_td); + /* Called from netmap_notify(), typically from a + * thread different from the one issuing kevent(). + * Assume we are ready. */ return 1; - } else { - revents = netmap_poll(priv, events, NULL); - return (events & revents) ? 1 : 0; } + + /* Called from kevent(). */ + priv = kn->kn_hook; + revents = netmap_poll(priv, events, /*thread=*/NULL); + + return (events & revents) ? 1 : 0; } static int @@ -1408,7 +1406,7 @@ static struct filterops netmap_wfiltops = { /* * This is called when a thread invokes kevent() to record * a change in the configuration of the kqueue(). - * The 'priv' should be the same as in the netmap device. + * The 'priv' is the one associated to the open netmap device. */ static int netmap_kqfilter(struct cdev *dev, struct knote *kn) @@ -1435,16 +1433,11 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) } /* the si is indicated in the priv */ si = priv->np_si[(ev == EVFILT_WRITE) ? NR_TX : NR_RX]; - // XXX lock(priv) ? kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; - knlist_add(&si->si.si_note, kn, 0); - // XXX unlock(priv) - ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", - na, na->ifp->if_xname, curthread, priv, kn, - priv->np_nifp, - kn->kn_fp == curthread->td_fpop ? "match" : "MISMATCH"); + knlist_add(&si->si.si_note, kn, /*islocked=*/0); + return 0; } Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:21:23 2019 (r343344) @@ -1946,7 +1946,6 @@ struct netmap_priv_d { * (N entries). */ struct nm_csb_ktoa *np_csb_ktoa_base; - struct thread *np_td; /* kqueue, just debugging */ #ifdef linux struct file *np_filp; /* used by sync kloop */ #endif /* linux */ From owner-svn-src-all@freebsd.org Wed Jan 23 14:22:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA63814A9906; Wed, 23 Jan 2019 14:22:22 +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 4FEBF74E45; Wed, 23 Jan 2019 14:22:22 +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 37B1B19F6D; Wed, 23 Jan 2019 14:22:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NEMMCS003174; Wed, 23 Jan 2019 14:22:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NEMLZC003172; Wed, 23 Jan 2019 14:22:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901231422.x0NEMLZC003172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Jan 2019 14:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343345 - in stable/11/sys: amd64/linux compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 343345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FEBF74E45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:22:22 -0000 Author: emaste Date: Wed Jan 23 14:22:21 2019 New Revision: 343345 URL: https://svnweb.freebsd.org/changeset/base/343345 Log: MFC linuxulator stack memory disclosure fixes r343260 linuxulator: fix stack memory disclosure in linux_ioctl_v4l r343261 linuxulator: fix stack memory disclosure in linux_ioctl_termio r343262 linuxulator: fix stack memory disclosure in linux_sigaltstack r343263 linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/amd64/linux/linux_machdep.c stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_misc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/11/sys/amd64/linux/linux_machdep.c Wed Jan 23 14:21:23 2019 (r343344) +++ stable/11/sys/amd64/linux/linux_machdep.c Wed Jan 23 14:22:21 2019 (r343345) @@ -200,6 +200,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; + memset(&lss, 0, sizeof(lss)); LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); if (uap->uss != NULL) { Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Wed Jan 23 14:21:23 2019 (r343344) +++ stable/11/sys/compat/linux/linux_ioctl.c Wed Jan 23 14:22:21 2019 (r343345) @@ -688,6 +688,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux { struct linux_termios lios; + memset(lio, 0, sizeof(*lio)); bsd_to_linux_termios(bios, &lios); lio->c_iflag = lios.c_iflag; lio->c_oflag = lios.c_oflag; @@ -2851,6 +2852,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st static int bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) { + memset(lvw, 0, sizeof(*lvw)); + lvw->x = vw->x; lvw->y = vw->y; lvw->width = vw->width; Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Wed Jan 23 14:21:23 2019 (r343344) +++ stable/11/sys/compat/linux/linux_misc.c Wed Jan 23 14:22:21 2019 (r343345) @@ -1079,9 +1079,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar } if (args->info != NULL) { p = td->td_proc; - if (td->td_retval[0] == 0) - bzero(&lsi, sizeof(lsi)); - else { + bzero(&lsi, sizeof(lsi)); + if (td->td_retval[0] != 0) { sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); } From owner-svn-src-all@freebsd.org Wed Jan 23 14:51:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391E914AA891; Wed, 23 Jan 2019 14:51:38 +0000 (UTC) (envelope-from vmaffione@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 D9FA776001; Wed, 23 Jan 2019 14:51:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C53571A439; Wed, 23 Jan 2019 14:51:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NEpb1Q019543; Wed, 23 Jan 2019 14:51:37 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NEpb9Y019540; Wed, 23 Jan 2019 14:51:37 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901231451.x0NEpb9Y019540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 23 Jan 2019 14:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343346 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 343346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9FA776001 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:51:38 -0000 Author: vmaffione Date: Wed Jan 23 14:51:36 2019 New Revision: 343346 URL: https://svnweb.freebsd.org/changeset/base/343346 Log: netmap: improvements to the netmap kloop (CSB mode) Changelist: - Add the proper memory barriers in the kloop ring processing functions. - Fix memory barriers usage in the user helpers (nm_sync_kloop_appl_write, nm_sync_kloop_appl_read). - Fix nm_kr_txempty() helper to look at rhead rather than rcur. This is important since the kloop can read a value of rcur which is ahead of the value of rhead (see explanation in nm_sync_kloop_appl_write) - Remove obsolete ptnetmap_guest_write_kring_csb() and ptnet_guest_read_kring_csb(), and update if_ptnet(4) to use those. - Prepare in advance the arguments for netmap_sync_kloop_[tr]x_ring(), to make the kloop faster. - Provide kernel and user implementation for nm_ldld_barrier() and nm_ldst_barrier() MFC after: 2 weeks Modified: head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_kloop.c head/sys/net/netmap.h Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/if_ptnet.c Wed Jan 23 14:51:36 2019 (r343346) @@ -1688,7 +1688,7 @@ ptnet_ring_update(struct ptnet_queue *pq, struct netma /* Mimic nm_txsync_prologue/nm_rxsync_prologue. */ kring->rcur = kring->rhead = head; - ptnetmap_guest_write_kring_csb(atok, kring->rcur, kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Kick the host if needed. */ if (NM_ACCESS_ONCE(ktoa->kern_need_kick)) { @@ -1764,7 +1764,12 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns * the host. */ atok->appl_need_kick = 1; - /* Double-check. */ + /* Double check. We need a full barrier to + * prevent the store to atok->appl_need_kick + * to be reordered with the load from + * ktoa->hwcur and ktoa->hwtail (store-load + * barrier). */ + nm_stld_barrier(); ptnet_sync_tail(ktoa, kring); if (likely(PTNET_TX_NOSPACE(head, kring, minspace))) { @@ -2046,7 +2051,12 @@ host_sync: * last interrupt. */ atok->appl_need_kick = 1; - /* Double-check. */ + /* Double check for more completed RX slots. + * We need a full barrier to prevent the store + * to atok->appl_need_kick to be reordered with + * the load from ktoa->hwcur and ktoa->hwtail + * (store-load barrier). */ + nm_stld_barrier(); ptnet_sync_tail(ktoa, kring); if (likely(head == ring->tail)) { break; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:51:36 2019 (r343346) @@ -1159,7 +1159,7 @@ nm_kr_rxspace(struct netmap_kring *k) static inline int nm_kr_txempty(struct netmap_kring *kring) { - return kring->rcur == kring->nr_hwtail; + return kring->rhead == kring->nr_hwtail; } /* True if no more completed slots in the rx ring, only valid after @@ -2245,61 +2245,14 @@ int ptnet_nm_krings_create(struct netmap_adapter *na); void ptnet_nm_krings_delete(struct netmap_adapter *na); void ptnet_nm_dtor(struct netmap_adapter *na); -/* Guest driver: Write kring pointers (cur, head) to the CSB. - * This routine is coupled with ptnetmap_host_read_kring_csb(). */ +/* Helper function wrapping nm_sync_kloop_appl_read(). */ static inline void -ptnetmap_guest_write_kring_csb(struct nm_csb_atok *atok, uint32_t cur, - uint32_t head) -{ - /* - * We need to write cur and head to the CSB but we cannot do it atomically. - * There is no way we can prevent the host from reading the updated value - * of one of the two and the old value of the other. However, if we make - * sure that the host never reads a value of head more recent than the - * value of cur we are safe. We can allow the host to read a value of cur - * more recent than the value of head, since in the netmap ring cur can be - * ahead of head and cur cannot wrap around head because it must be behind - * tail. Inverting the order of writes below could instead result into the - * host to think head went ahead of cur, which would cause the sync - * prologue to fail. - * - * The following memory barrier scheme is used to make this happen: - * - * Guest Host - * - * STORE(cur) LOAD(head) - * mb() <-----------> mb() - * STORE(head) LOAD(cur) - */ - atok->cur = cur; - nm_stst_barrier(); - atok->head = head; -} - -/* Guest driver: Read kring pointers (hwcur, hwtail) from the CSB. - * This routine is coupled with ptnetmap_host_write_kring_csb(). */ -static inline void -ptnetmap_guest_read_kring_csb(struct nm_csb_ktoa *ktoa, - struct netmap_kring *kring) -{ - /* - * We place a memory barrier to make sure that the update of hwtail never - * overtakes the update of hwcur. - * (see explanation in ptnetmap_host_write_kring_csb). - */ - kring->nr_hwtail = ktoa->hwtail; - nm_stst_barrier(); - kring->nr_hwcur = ktoa->hwcur; -} - -/* Helper function wrapping ptnetmap_guest_read_kring_csb(). */ -static inline void ptnet_sync_tail(struct nm_csb_ktoa *ktoa, struct netmap_kring *kring) { struct netmap_ring *ring = kring->ring; /* Update hwcur and hwtail as known by the host. */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); /* nm_sync_finalize */ ring->tail = kring->rtail = kring->nr_hwtail; Modified: head/sys/dev/netmap/netmap_kloop.c ============================================================================== --- head/sys/dev/netmap/netmap_kloop.c Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/netmap_kloop.c Wed Jan 23 14:51:36 2019 (r343346) @@ -66,8 +66,12 @@ static inline void sync_kloop_kernel_write(struct nm_csb_ktoa __user *ptr, uint32_t hwcur, uint32_t hwtail) { + /* Issue a first store-store barrier to make sure writes to the + * netmap ring do not overcome updates on ktoa->hwcur and ktoa->hwtail. */ + nm_stst_barrier(); + /* - * The same scheme used in ptnetmap_guest_write_kring_csb() applies here. + * The same scheme used in nm_sync_kloop_appl_write() applies here. * We allow the application to read a value of hwcur more recent than the value * of hwtail, since this would anyway result in a consistent view of the * ring state (and hwcur can never wraparound hwtail, since hwcur must be @@ -75,11 +79,11 @@ sync_kloop_kernel_write(struct nm_csb_ktoa __user *ptr * * The following memory barrier scheme is used to make this happen: * - * Application Kernel + * Application Kernel * - * STORE(hwcur) LOAD(hwtail) - * mb() <-------------> mb() - * STORE(hwtail) LOAD(hwcur) + * STORE(hwcur) LOAD(hwtail) + * wmb() <-------------> rmb() + * STORE(hwtail) LOAD(hwcur) */ CSB_WRITE(ptr, hwcur, hwcur); nm_stst_barrier(); @@ -96,12 +100,16 @@ sync_kloop_kernel_read(struct nm_csb_atok __user *ptr, /* * We place a memory barrier to make sure that the update of head never * overtakes the update of cur. - * (see explanation in ptnetmap_guest_write_kring_csb). + * (see explanation in sync_kloop_kernel_write). */ CSB_READ(ptr, head, shadow_ring->head); - nm_stst_barrier(); + nm_ldld_barrier(); CSB_READ(ptr, cur, shadow_ring->cur); CSB_READ(ptr, sync_flags, shadow_ring->flags); + + /* Make sure that loads from atok->head and atok->cur are not delayed + * after the loads from the netmap ring. */ + nm_ldld_barrier(); } /* Enable or disable application --> kernel kicks. */ @@ -127,10 +135,10 @@ csb_atok_intr_enabled(struct nm_csb_atok __user *csb_a static inline void sync_kloop_kring_dump(const char *title, const struct netmap_kring *kring) { - nm_prinf("%s - name: %s hwcur: %d hwtail: %d " - "rhead: %d rcur: %d rtail: %d", - title, kring->name, kring->nr_hwcur, kring->nr_hwtail, - kring->rhead, kring->rcur, kring->rtail); + nm_prinf("%s, kring %s, hwcur %d, rhead %d, " + "rcur %d, rtail %d, hwtail %d", + title, kring->name, kring->nr_hwcur, kring->rhead, + kring->rcur, kring->rtail, kring->nr_hwtail); } struct sync_kloop_ring_args { @@ -240,7 +248,8 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring */ /* Reenable notifications. */ csb_ktoa_kick_enable(csb_ktoa, 1); - /* Doublecheck. */ + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (shadow_ring.head != kring->rhead) { /* We won the race condition, there are more packets to @@ -358,7 +367,8 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring */ /* Reenable notifications. */ csb_ktoa_kick_enable(csb_ktoa, 1); - /* Doublecheck. */ + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (!sync_kloop_norxslots(kring, shadow_ring.head)) { /* We won the race condition, more slots are available. Disable @@ -439,6 +449,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n struct sync_kloop_poll_ctx *poll_ctx = NULL; #endif /* SYNC_KLOOP_POLL */ int num_rx_rings, num_tx_rings, num_rings; + struct sync_kloop_ring_args *args = NULL; uint32_t sleep_us = req->sleep_us; struct nm_csb_atok* csb_atok_base; struct nm_csb_ktoa* csb_ktoa_base; @@ -488,6 +499,12 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n num_tx_rings = priv->np_qlast[NR_TX] - priv->np_qfirst[NR_TX]; num_rings = num_tx_rings + num_rx_rings; + args = nm_os_malloc(num_rings * sizeof(args[0])); + if (!args) { + err = ENOMEM; + goto out; + } + /* Validate notification options. */ opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS); @@ -558,8 +575,8 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n si[NR_TX] = nm_si_user(priv, NR_TX) ? &na->si[NR_TX] : &na->tx_rings[priv->np_qfirst[NR_TX]]->si; NMG_UNLOCK(); - poll_wait(priv->np_filp, si[NR_RX], &poll_ctx->wait_table); poll_wait(priv->np_filp, si[NR_TX], &poll_ctx->wait_table); + poll_wait(priv->np_filp, si[NR_RX], &poll_ctx->wait_table); } #else /* SYNC_KLOOP_POLL */ opt->nro_status = EOPNOTSUPP; @@ -567,6 +584,31 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n #endif /* SYNC_KLOOP_POLL */ } + /* Prepare the arguments for netmap_sync_kloop_tx_ring() + * and netmap_sync_kloop_rx_ring(). */ + for (i = 0; i < num_tx_rings; i++) { + struct sync_kloop_ring_args *a = args + i; + + a->kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]]; + a->csb_atok = csb_atok_base + i; + a->csb_ktoa = csb_ktoa_base + i; +#ifdef SYNC_KLOOP_POLL + if (poll_ctx) + a->irq_ctx = poll_ctx->entries[i].irq_ctx; +#endif /* SYNC_KLOOP_POLL */ + } + for (i = 0; i < num_rx_rings; i++) { + struct sync_kloop_ring_args *a = args + num_tx_rings + i; + + a->kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]]; + a->csb_atok = csb_atok_base + num_tx_rings + i; + a->csb_ktoa = csb_ktoa_base + num_tx_rings + i; +#ifdef SYNC_KLOOP_POLL + if (poll_ctx) + a->irq_ctx = poll_ctx->entries[num_tx_rings + i].irq_ctx; +#endif /* SYNC_KLOOP_POLL */ + } + /* Main loop. */ for (;;) { if (unlikely(NM_ACCESS_ONCE(priv->np_kloop_state) & NM_SYNC_KLOOP_STOPPING)) { @@ -574,47 +616,40 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n } #ifdef SYNC_KLOOP_POLL - if (poll_ctx) - __set_current_state(TASK_INTERRUPTIBLE); + if (poll_ctx) { + /* It is important to set the task state as + * interruptible before processing any TX/RX ring, + * so that if a notification on ring Y comes after + * we have processed ring Y, but before we call + * schedule(), we don't miss it. This is true because + * the wake up function will change the the task state, + * and therefore the schedule_timeout() call below + * will observe the change). + */ + set_current_state(TASK_INTERRUPTIBLE); + } #endif /* SYNC_KLOOP_POLL */ /* Process all the TX rings bound to this file descriptor. */ for (i = 0; i < num_tx_rings; i++) { - struct sync_kloop_ring_args a = { - .kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]], - .csb_atok = csb_atok_base + i, - .csb_ktoa = csb_ktoa_base + i, - }; + struct sync_kloop_ring_args *a = args + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a.irq_ctx = poll_ctx->entries[i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - if (unlikely(nm_kr_tryget(a.kring, 1, NULL))) { + if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { continue; } - netmap_sync_kloop_tx_ring(&a); - nm_kr_put(a.kring); + netmap_sync_kloop_tx_ring(a); + nm_kr_put(a->kring); } /* Process all the RX rings bound to this file descriptor. */ for (i = 0; i < num_rx_rings; i++) { - struct sync_kloop_ring_args a = { - .kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]], - .csb_atok = csb_atok_base + num_tx_rings + i, - .csb_ktoa = csb_ktoa_base + num_tx_rings + i, - }; + struct sync_kloop_ring_args *a = args + num_tx_rings + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a.irq_ctx = poll_ctx->entries[num_tx_rings + i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - - if (unlikely(nm_kr_tryget(a.kring, 1, NULL))) { + if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { continue; } - netmap_sync_kloop_rx_ring(&a); - nm_kr_put(a.kring); + netmap_sync_kloop_rx_ring(a); + nm_kr_put(a->kring); } #ifdef SYNC_KLOOP_POLL @@ -622,7 +657,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n /* If a poll context is present, yield to the scheduler * waiting for a notification to come either from * netmap or the application. */ - schedule_timeout_interruptible(msecs_to_jiffies(1000)); + schedule_timeout(msecs_to_jiffies(20000)); } else #endif /* SYNC_KLOOP_POLL */ { @@ -657,6 +692,11 @@ out: } #endif /* SYNC_KLOOP_POLL */ + if (args) { + nm_os_free(args); + args = NULL; + } + /* Reset the kloop state. */ NMG_LOCK(); priv->np_kloop_state = 0; @@ -719,7 +759,7 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc * packets. */ kring->nr_hwcur = ktoa->hwcur; - ptnetmap_guest_write_kring_csb(atok, kring->rcur, kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Ask for a kick from a guest to the host if needed. */ if (((kring->rhead != kring->nr_hwcur || nm_kr_txempty(kring)) @@ -733,7 +773,8 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc * Second part: reclaim buffers for completed transmissions. */ if (nm_kr_txempty(kring) || (flags & NAF_FORCE_RECLAIM)) { - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); } /* @@ -744,8 +785,10 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc if (nm_kr_txempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; - /* Double check */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); /* If there is new free space, disable notifications */ if (unlikely(!nm_kr_txempty(kring))) { atok->appl_need_kick = 0; @@ -784,7 +827,7 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc * hwtail to the hwtail known from the host (read from the CSB). * This also updates the kring hwcur. */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); kring->nr_kflags &= ~NKR_PENDINTR; /* @@ -792,8 +835,7 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc * released, by updating cur and head in the CSB. */ if (kring->rhead != kring->nr_hwcur) { - ptnetmap_guest_write_kring_csb(atok, kring->rcur, - kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Ask for a kick from the guest to the host if needed. */ if (NM_ACCESS_ONCE(ktoa->kern_need_kick)) { atok->sync_flags = flags; @@ -809,8 +851,10 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc if (nm_kr_rxempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; - /* Double check */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); /* If there are new slots, disable notifications. */ if (!nm_kr_rxempty(kring)) { atok->appl_need_kick = 0; Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/net/netmap.h Wed Jan 23 14:51:36 2019 (r343346) @@ -769,6 +769,8 @@ struct nm_csb_ktoa { #ifdef __KERNEL__ #define nm_stst_barrier smp_wmb +#define nm_ldld_barrier smp_rmb +#define nm_stld_barrier smp_mb #else /* !__KERNEL__ */ static inline void nm_stst_barrier(void) { @@ -777,18 +779,31 @@ static inline void nm_stst_barrier(void) * which is fine for us. */ __atomic_thread_fence(__ATOMIC_RELEASE); } +static inline void nm_ldld_barrier(void) +{ + /* A memory barrier with acquire semantic has the combined + * effect of a load-load barrier and a store-load barrier, + * which is fine for us. */ + __atomic_thread_fence(__ATOMIC_ACQUIRE); +} #endif /* !__KERNEL__ */ #elif defined(__FreeBSD__) #ifdef _KERNEL #define nm_stst_barrier atomic_thread_fence_rel +#define nm_ldld_barrier atomic_thread_fence_acq +#define nm_stld_barrier atomic_thread_fence_seq_cst #else /* !_KERNEL */ #include static inline void nm_stst_barrier(void) { atomic_thread_fence(memory_order_release); } +static inline void nm_ldld_barrier(void) +{ + atomic_thread_fence(memory_order_acquire); +} #endif /* !_KERNEL */ #else /* !__linux__ && !__FreeBSD__ */ @@ -801,6 +816,10 @@ static inline void nm_sync_kloop_appl_write(struct nm_csb_atok *atok, uint32_t cur, uint32_t head) { + /* Issue a first store-store barrier to make sure writes to the + * netmap ring do not overcome updates on atok->cur and atok->head. */ + nm_stst_barrier(); + /* * We need to write cur and head to the CSB but we cannot do it atomically. * There is no way we can prevent the host from reading the updated value @@ -815,11 +834,11 @@ nm_sync_kloop_appl_write(struct nm_csb_atok *atok, uin * * The following memory barrier scheme is used to make this happen: * - * Guest Host + * Guest Host * - * STORE(cur) LOAD(head) - * mb() <-----------> mb() - * STORE(head) LOAD(cur) + * STORE(cur) LOAD(head) + * wmb() <-----------> rmb() + * STORE(head) LOAD(cur) * */ atok->cur = cur; @@ -839,8 +858,12 @@ nm_sync_kloop_appl_read(struct nm_csb_ktoa *ktoa, uint * (see explanation in sync_kloop_kernel_write). */ *hwtail = ktoa->hwtail; - nm_stst_barrier(); + nm_ldld_barrier(); *hwcur = ktoa->hwcur; + + /* Make sure that loads from ktoa->hwtail and ktoa->hwcur are not delayed + * after the loads from the netmap ring. */ + nm_ldld_barrier(); } /* From owner-svn-src-all@freebsd.org Wed Jan 23 16:44:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AD914ACA45; Wed, 23 Jan 2019 16:44:21 +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 7E6F7817FF; Wed, 23 Jan 2019 16:44:21 +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 723991B6C9; Wed, 23 Jan 2019 16:44:21 +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 x0NGiLmT078316; Wed, 23 Jan 2019 16:44:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NGiL4H078315; Wed, 23 Jan 2019 16:44:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901231644.x0NGiL4H078315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 23 Jan 2019 16:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343347 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 343347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E6F7817FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 16:44:22 -0000 Author: cem Date: Wed Jan 23 16:44:21 2019 New Revision: 343347 URL: https://svnweb.freebsd.org/changeset/base/343347 Log: gmirror: Relocate DEVICE_FLAGS to adjacent lines gmirror's sc_flags is shared between some on-disk state and some runtime only state. There's no real reason for that and they could probably be split up. Until they are, locate all of the flags for the same field nearby each other in the source, for clarity. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Jan 23 14:51:36 2019 (r343346) +++ head/sys/geom/mirror/g_mirror.h Wed Jan 23 16:44:21 2019 (r343347) @@ -78,6 +78,12 @@ G_MIRROR_DEVICE_FLAG_NOFAILSYNC) #ifdef _KERNEL +#define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL +#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL +#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL +#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL + extern int g_mirror_debug; #define G_MIRROR_DEBUG(lvl, ...) do { \ @@ -166,12 +172,6 @@ struct g_mirror_event { int e_error; TAILQ_ENTRY(g_mirror_event) e_next; }; - -#define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL -#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL -#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL -#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL -#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 From owner-svn-src-all@freebsd.org Wed Jan 23 17:28:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D7214ADA47; Wed, 23 Jan 2019 17:28:40 +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 EB4D583021; Wed, 23 Jan 2019 17:28:39 +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 D99E31BD88; Wed, 23 Jan 2019 17:28:39 +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 x0NHSdLu099507; Wed, 23 Jan 2019 17:28:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHSdqH099506; Wed, 23 Jan 2019 17:28:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231728.x0NHSdqH099506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343348 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 343348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB4D583021 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:28:40 -0000 Author: markj Date: Wed Jan 23 17:28:39 2019 New Revision: 343348 URL: https://svnweb.freebsd.org/changeset/base/343348 Log: ocs_fc: Ensure that we zero-initialize memory before copying it out. Note that the affected interface is available only to root. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: emaste, ram MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18914 Modified: head/sys/dev/ocs_fc/ocs_mgmt.c Modified: head/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 16:44:21 2019 (r343347) +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) @@ -851,6 +851,7 @@ ocs_mgmt_firmware_write(ocs_t *ocs, char *name, void * if (arg_out_length > sizeof(status_str)) { arg_out_length = sizeof(status_str); } + ocs_memset(status_str, 0, sizeof(status_str)); ocs_snprintf(status_str, arg_out_length, "%d", change_status); if (ocs_copy_to_user(arg_out, status_str, arg_out_length)) { ocs_log_test(ocs, "copy to user failed for change_status\n"); From owner-svn-src-all@freebsd.org Wed Jan 23 17:34:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C7C14ADC1B; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@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 9AE5C83496; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8D4871BF29; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NHY3Ix004654; Wed, 23 Jan 2019 17:34:03 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHY11I004644; Wed, 23 Jan 2019 17:34:01 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201901231734.x0NHY11I004644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Wed, 23 Jan 2019 17:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343349 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 343349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AE5C83496 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:34:04 -0000 Author: ram Date: Wed Jan 23 17:34:01 2019 New Revision: 343349 URL: https://svnweb.freebsd.org/changeset/base/343349 Log: Fixed issues reported by coverity scan. Approved by: mav MFC after: 3 weeks Modified: head/sys/dev/ocs_fc/ocs_cam.c head/sys/dev/ocs_fc/ocs_hw.c head/sys/dev/ocs_fc/ocs_hw_queues.c head/sys/dev/ocs_fc/ocs_ioctl.c head/sys/dev/ocs_fc/ocs_mgmt.c head/sys/dev/ocs_fc/ocs_node.c head/sys/dev/ocs_fc/ocs_pci.c head/sys/dev/ocs_fc/ocs_xport.c head/sys/dev/ocs_fc/sli4.c Modified: head/sys/dev/ocs_fc/ocs_cam.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 (r343349) @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_tar struct ocs_softc *ocs = node->ocs; ocs_fcport *fcp = NULL; ocs_fc_target_t *tgt = NULL; - uint32_t tgt_id; + int32_t tgt_id; + if (ocs == NULL) { + ocs_log_err(ocs,"OCS is NULL \n"); + return -1; + } + fcp = node->sport->tgt_data; if (fcp == NULL) { ocs_log_err(ocs,"FCP is NULL \n"); - return 0; + return -1; } tgt_id = ocs_tgt_find(fcp, node); + if (tgt_id == -1) { + ocs_log_err(ocs,"target is invalid\n"); + return -1; + } tgt = &fcp->tgt[tgt_id]; @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb ocs_io_t *io = NULL; ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; int32_t sgl_count; + ocs_fcport *fcp; - ocs_fcport *fcp = NULL; fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); - if (fcp == NULL) { - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); - return -1; - } if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { device_printf(ocs->dev, "%s: device LOST %d\n", __func__, @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) } case XPT_RESET_BUS: if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) == 0) { - ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); - + rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); + if (rc) { + ocs_log_debug(ocs, "Failed to bring port online" + " : %d\n", rc); + } ocs_set_ccb_status(ccb, CAM_REQ_CMP); } else { ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); Modified: head/sys/dev/ocs_fc/ocs_hw.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 (r343349) @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) static ocs_hw_rtn_e ocs_hw_link_event_init(ocs_hw_t *hw) { - if (hw == NULL) { - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); - return OCS_HW_RTN_ERROR; - } + ocs_hw_assert(hw); hw->link.status = SLI_LINK_STATUS_MAX; hw->link.topology = SLI_LINK_TOPO_NONE; @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 break; case OCS_HW_MAX_VPORTS: *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); + break; default: ocs_log_test(hw->os, "unsupported property %#x\n", prop); rc = OCS_HW_RTN_ERROR; @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 break; case OCS_ESOC: hw->config.esoc = value; + break; case OCS_HW_HIGH_LOGIN_MODE: rc = sli_set_hlm(&hw->sli, value); break; @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t *hdr, u OCS_STAT(wq->use_count++); - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; + return OCS_HW_RTN_SUCCESS; } ocs_hw_rtn_e @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t *io) } /* fail if we don't have an overflow SGL registered */ - if (io->ovfl_sgl == NULL) { + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { return OCS_HW_RTN_ERROR; } @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); + if (!buf) { + ocs_log_err(hw->os, "no buffer for command\n"); + return OCS_HW_RTN_NO_MEMORY; + } + sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, hw->watchdog_timeout); rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, ocs_hw_cb_cfg_watchdog, NULL); if (rc) { @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) break; case SLI_QENTRY_WQ_RELEASE: { uint32_t wq_id = rid; - uint32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); + int32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); + + if (unlikely(index < 0)) { + ocs_log_err(hw->os, "unknown idx=%#x rid=%#x\n", + index, rid); + break; + } + hw_wq_t *wq = hw->hw_wq[index]; /* Submit any HW IOs that are on the WQ pending list */ @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) hw->link.status = event->status; - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { + for (i = 0; i < SLI4_MAX_FCFI; i++) { + d = hw->domains[i]; if (d != NULL && hw->callback.domain != NULL) { hw->callback.domain(hw->args.domain, OCS_HW_DOMAIN_LOST, d); @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) ocs_domain_t *domain = NULL; sli4_fip_event_t *event = e; + ocs_hw_assert(event); + ocs_hw_assert(hw); + /* Find the associated domain object */ if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { ocs_domain_t *d = NULL; @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) /* Clear VLINK is different from the other FIP events as it passes back * a VPI instead of a FCF index. Check all attached SLI ports for a * matching VPI */ - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { + for (i = 0; i < SLI4_MAX_FCFI; i++) { + d = hw->domains[i]; if (d != NULL) { ocs_sport_t *sport = NULL; @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, ocs_hw_io_t *io_next = NULL; uint64_t ticks_current = ocs_get_os_ticks(); uint32_t sec_elapsed; + ocs_hw_rtn_e rc; sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t *)mqe; @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, /* loop through active WQE list and check for timeouts */ ocs_lock(&hw->io_lock); - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { - sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { + sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); - /* - * If elapsed time > timeout, abort it. No need to check type since - * it wouldn't be on this list unless it was a target WQE - */ - if (sec_elapsed > io->tgt_wqe_timeout) { - ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", - io->indicator, io->reqtag, io->type); + /* + * If elapsed time > timeout, abort it. No need to check type since + * it wouldn't be on this list unless it was a target WQE + */ + if (sec_elapsed > io->tgt_wqe_timeout) { + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", + io->indicator, io->reqtag, io->type); - /* remove from active_wqe list so won't try to abort again */ - ocs_list_remove(&hw->io_timed_wqe, io); + /* remove from active_wqe list so won't try to abort again */ + ocs_list_remove(&hw->io_timed_wqe, io); - /* save status of "timed out" for when abort completes */ - io->status_saved = 1; - io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; - io->saved_ext = 0; - io->saved_len = 0; + /* save status of "timed out" for when abort completes */ + io->status_saved = 1; + io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; + io->saved_ext = 0; + io->saved_len = 0; - /* now abort outstanding IO */ - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); + /* now abort outstanding IO */ + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); + if (rc) { + ocs_log_test(hw->os, + "abort failed xri=%#x tag=%#x rc=%d\n", + io->indicator, io->reqtag, rc); } - /* - * need to go through entire list since each IO could have a - * different timeout value - */ } + /* + * need to go through entire list since each IO could have a + * different timeout value + */ + } ocs_unlock(&hw->io_lock); /* if we're not in the middle of shutting down, schedule next timer */ Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 (r343349) @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) default_lengths[QTOP_CQ] = len; break; } + + if (!eq || !next_qt) { + goto fail; + } /* If this CQ is for MRQ, then delay the creation */ if (!use_mrq || next_qt->entry != QTOP_RQ) { cq = hw_new_cq(eq, len); if (cq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } } break; @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) hw_queue_teardown(hw); return OCS_HW_RTN_NO_MEMORY; } + + if (cq == NULL) + goto fail; wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + qt->ulp); if (wq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } /* Place this WQ on the EQ WQ array */ @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) break; } + if (cq == NULL) + goto fail; + mq = hw_new_mq(cq, len); if (mq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } break; @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) } return OCS_HW_RTN_SUCCESS; +fail: + hw_queue_teardown(hw); + return OCS_HW_RTN_NO_MEMORY; } @@ -737,8 +747,9 @@ error: for (i = 0; i < num_rq_pairs; i++) { if (rqs[i] != NULL) { if (rqs[i]->rq_tracker != NULL) { - ocs_free(hw->os, rq->rq_tracker, - sizeof(ocs_hw_sequence_t*) * rq->entry_count); + ocs_free(hw->os, rqs[i]->rq_tracker, + sizeof(ocs_hw_sequence_t*) * + rqs[i]->entry_count); } ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); } @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) void hw_del_rq(hw_rq_t *rq) { - ocs_hw_t *hw = rq->cq->eq->hw; if (rq != NULL) { + ocs_hw_t *hw = rq->cq->eq->hw; /* Free RQ tracker */ if (rq->rq_tracker != NULL) { ocs_free(hw->os, rq->rq_tracker, sizeof(ocs_hw_sequence_t*) * rq->entry_count); Modified: head/sys/dev/ocs_fc/ocs_ioctl.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 (r343349) @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ * 6. ioctl code releases the lock */ mtx_lock(&ocs->dbg_lock); - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, - __ocs_ioctl_mbox_cb, ocs); - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, + __ocs_ioctl_mbox_cb, ocs)) { + + device_printf(ocs->dev, "%s: command- %x failed\n", __func__, + ((sli4_mbox_command_header_t *)mcmd->payload)->command); + } + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); mtx_unlock(&ocs->dbg_lock); if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command Modified: head/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 (r343349) @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char *value) if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { /* Undefined failure */ ocs_log_err(ocs, "ocs_sem_p failed\n"); - rc = -ENXIO; + return -ENXIO; } if (result.status == 0) { /* Success. */ @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char *value if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { /* Undefined failure */ ocs_log_err(ocs, "ocs_sem_p failed\n"); - rc = -ENXIO; + return -ENXIO; } if (result.status == 0) { /* Success. */ @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) char *wwpn_p = NULL; char *wwnn_p = NULL; int32_t rc = -1; - int wwpn; - int wwnn; + int wwpn = 0; + int wwnn = 0; int i; /* This is a read-modify-write operation, so first we have to read @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) wwnn_p = wwn_p; } - wwpn = ocs_strcmp(wwpn_p, "NA"); - wwnn = ocs_strcmp(wwnn_p, "NA"); + if (wwpn_p != NULL) { + wwpn = ocs_strcmp(wwpn_p, "NA"); + } + + if (wwnn_p != NULL) { + wwnn = ocs_strcmp(wwnn_p, "NA"); + } /* Parse the new WWPN */ if ((wwpn_p != NULL) && (wwpn != 0)) { Modified: head/sys/dev/ocs_fc/ocs_node.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 (r343349) @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { - max_xfer_size = max_sge * num_sgl; + max_xfer_size = (max_sge * (uint64_t)num_sgl); } else { max_xfer_size = 65536; } Modified: head/sys/dev/ocs_fc/ocs_pci.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 (r343349) @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) } ocs_cam_detach(ocs); - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { if (bus_dmamap_destroy(ocs->buf_dmat, io->tgt_io.dmap)) { Modified: head/sys/dev/ocs_fc/ocs_xport.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 (r343349) @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: ocs_node_free_pool(ocs); } - if (rq_threads_created) { - ocs_xport_rq_threads_teardown(xport); - } - return -1; } Modified: head/sys/dev/ocs_fc/sli4.c ============================================================================== --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 (r343349) @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size } } break; - default: - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", if_type); - return -1; - } + } return (sli_config_off + cmd_size); } @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uin return -1; } + memset(&dma, 0, sizeof(dma)); + /* Align the queue DMA memory */ for (i = 0; i < num_cqs; i++) { if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, SLI4_CQE_BYTES, @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) } if (q->dma.virt != NULL) { - ocs_memset(q->dma.virt, 0, (q->size * q->length)); + ocs_memset(q->dma.virt, 0, (q->size * (uint64_t)q->length)); } ocs_unlock(&q->lock); @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t num_rq_pair ocs_dma_t dma; sli4_res_common_create_queue_set_t *rsp = NULL; sli4_req_fcoe_rq_create_v2_t *req = NULL; + + ocs_memset(&dma, 0, sizeof(dma)); for (i = 0; i < (num_rq_pairs * 2); i++) { if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, SLI4_FCOE_RQE_SIZE, From owner-svn-src-all@freebsd.org Wed Jan 23 17:37:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2478C14ADDEF; Wed, 23 Jan 2019 17:37:00 +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 B807083B3C; Wed, 23 Jan 2019 17:36:59 +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 ABD681BF31; Wed, 23 Jan 2019 17:36:59 +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 x0NHaxv3005591; Wed, 23 Jan 2019 17:36:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHax5J005590; Wed, 23 Jan 2019 17:36:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231736.x0NHax5J005590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343350 - in stable: 11/sys/dev/hwpmc 12/sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable: 11/sys/dev/hwpmc 12/sys/dev/hwpmc X-SVN-Commit-Revision: 343350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B807083B3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:37:00 -0000 Author: markj Date: Wed Jan 23 17:36:58 2019 New Revision: 343350 URL: https://svnweb.freebsd.org/changeset/base/343350 Log: MFC r343265: hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}. admbugs: 765 Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:34:01 2019 (r343349) +++ stable/12/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:36:58 2019 (r343350) @@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_classdep *pcd; int cl; + memset(&gci, 0, sizeof(gci)); gci.pm_cputype = md->pmd_cputype; gci.pm_ncpu = pmc_cpu_max(); gci.pm_npmc = md->pmd_npmc; @@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO); p = pmcinfo; From owner-svn-src-all@freebsd.org Wed Jan 23 17:36:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44EE14ADDEB; Wed, 23 Jan 2019 17:36:59 +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 74FF783B3B; Wed, 23 Jan 2019 17:36:59 +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 638C91BF30; Wed, 23 Jan 2019 17:36:59 +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 x0NHaxN8005585; Wed, 23 Jan 2019 17:36:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHaxbQ005584; Wed, 23 Jan 2019 17:36:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231736.x0NHaxbQ005584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343350 - in stable: 11/sys/dev/hwpmc 12/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable: 11/sys/dev/hwpmc 12/sys/dev/hwpmc X-SVN-Commit-Revision: 343350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74FF783B3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:37:00 -0000 Author: markj Date: Wed Jan 23 17:36:58 2019 New Revision: 343350 URL: https://svnweb.freebsd.org/changeset/base/343350 Log: MFC r343265: hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}. admbugs: 765 Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:34:01 2019 (r343349) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:36:58 2019 (r343350) @@ -2990,6 +2990,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_classdep *pcd; int cl; + memset(&gci, 0, sizeof(gci)); gci.pm_cputype = md->pmd_cputype; gci.pm_ncpu = pmc_cpu_max(); gci.pm_npmc = md->pmd_npmc; @@ -3131,7 +3132,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO); p = pmcinfo; From owner-svn-src-all@freebsd.org Wed Jan 23 17:40:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D49D314AE015; Wed, 23 Jan 2019 17:40:13 +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 7912D83E7B; Wed, 23 Jan 2019 17:40:13 +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 38C031BF40; Wed, 23 Jan 2019 17:40:13 +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 x0NHeD1C005811; Wed, 23 Jan 2019 17:40:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHeDHC005810; Wed, 23 Jan 2019 17:40:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231740.x0NHeDHC005810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343351 - in stable: 11/sys/fs/nfsserver 12/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable: 11/sys/fs/nfsserver 12/sys/fs/nfsserver X-SVN-Commit-Revision: 343351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7912D83E7B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:40:14 -0000 Author: markj Date: Wed Jan 23 17:40:12 2019 New Revision: 343351 URL: https://svnweb.freebsd.org/changeset/base/343351 Log: MFC r343286: nfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS. admbugs: 765 Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 23 17:36:58 2019 (r343350) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 23 17:40:12 2019 (r343351) @@ -3192,8 +3192,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u error = EPERM; if (!error) { len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size; - dumpclients = (struct nfsd_dumpclients *)malloc(len, - M_TEMP, M_WAITOK); + dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumpclients(dumpclients, dumplist.ndl_size); error = copyout(dumpclients, CAST_USER_ADDR_T(dumplist.ndl_list), len); @@ -3211,8 +3210,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u if (!error) { len = sizeof (struct nfsd_dumplocks) * dumplocklist.ndllck_size; - dumplocks = (struct nfsd_dumplocks *)malloc(len, - M_TEMP, M_WAITOK); + dumplocks = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumplocks(nd.ni_vp, dumplocks, dumplocklist.ndllck_size, p); vput(nd.ni_vp); From owner-svn-src-all@freebsd.org Wed Jan 23 17:40:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D4A14AE017; Wed, 23 Jan 2019 17:40:14 +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 95CF283E7C; Wed, 23 Jan 2019 17:40:13 +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 88EEC1BF41; Wed, 23 Jan 2019 17:40:13 +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 x0NHeDcv005817; Wed, 23 Jan 2019 17:40:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHeDYI005816; Wed, 23 Jan 2019 17:40:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231740.x0NHeDYI005816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343351 - in stable: 11/sys/fs/nfsserver 12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable: 11/sys/fs/nfsserver 12/sys/fs/nfsserver X-SVN-Commit-Revision: 343351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95CF283E7C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:40:14 -0000 Author: markj Date: Wed Jan 23 17:40:12 2019 New Revision: 343351 URL: https://svnweb.freebsd.org/changeset/base/343351 Log: MFC r343286: nfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS. admbugs: 765 Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 23 17:36:58 2019 (r343350) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 23 17:40:12 2019 (r343351) @@ -3615,8 +3615,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u error = EPERM; if (!error) { len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size; - dumpclients = (struct nfsd_dumpclients *)malloc(len, - M_TEMP, M_WAITOK); + dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumpclients(dumpclients, dumplist.ndl_size); error = copyout(dumpclients, CAST_USER_ADDR_T(dumplist.ndl_list), len); @@ -3634,8 +3633,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u if (!error) { len = sizeof (struct nfsd_dumplocks) * dumplocklist.ndllck_size; - dumplocks = (struct nfsd_dumplocks *)malloc(len, - M_TEMP, M_WAITOK); + dumplocks = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumplocks(nd.ni_vp, dumplocks, dumplocklist.ndllck_size, p); vput(nd.ni_vp); From owner-svn-src-all@freebsd.org Wed Jan 23 18:53:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808E714AF876; Wed, 23 Jan 2019 18:53:14 +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 BA87986248; Wed, 23 Jan 2019 18:53:13 +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 A10991CCA2; Wed, 23 Jan 2019 18:53:13 +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 x0NIrDVY047182; Wed, 23 Jan 2019 18:53:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NIrDWK047180; Wed, 23 Jan 2019 18:53:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901231853.x0NIrDWK047180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 23 Jan 2019 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343352 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA87986248 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:53:14 -0000 Author: hselasky Date: Wed Jan 23 18:53:13 2019 New Revision: 343352 URL: https://svnweb.freebsd.org/changeset/base/343352 Log: Add USB quirk. Submitted by: Gary Jennejohn MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 23 17:40:12 2019 (r343351) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 23 18:53:13 2019 (r343352) @@ -278,6 +278,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */ + USB_QUIRK(JMICRON, JMS566, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(JMICRON, JMS567, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 23 17:40:12 2019 (r343351) +++ head/sys/dev/usb/usbdevs Wed Jan 23 18:53:13 2019 (r343352) @@ -2646,6 +2646,7 @@ product JATON EDA 0x5704 Ethernet product JETI SPC1201 0x04b2 FTDI compatible adapter /* JMicron products */ +product JMICRON JMS566 0x3569 USB to SATA 3.0Gb/s bridge product JMICRON JMS567 0x0567 USB to SATA 6.0Gb/s bridge product JMICRON JM20336 0x2336 USB to SATA Bridge product JMICRON JM20337 0x2338 USB to ATA/ATAPI Bridge From owner-svn-src-all@freebsd.org Wed Jan 23 18:57:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F2414AF937; Wed, 23 Jan 2019 18:57:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16522863FC; Wed, 23 Jan 2019 18:57:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0NIvmup080006; Wed, 23 Jan 2019 10:57:48 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0NIvmbS080005; Wed, 23 Jan 2019 10:57:48 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: <201901231734.x0NHY11I004644@repo.freebsd.org> To: Ram Kishore Vegesna Date: Wed, 23 Jan 2019 10:57:48 -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: 16522863FC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.934,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:57:59 -0000 > Author: ram > Date: Wed Jan 23 17:34:01 2019 > New Revision: 343349 > URL: https://svnweb.freebsd.org/changeset/base/343349 > > Log: > Fixed issues reported by coverity scan. The quality of this commit message is rather low, it should of at least included some details about what was wrong, why it was wrong, and how it was fixed. Thanks, Rod > > Approved by: mav > MFC after: 3 weeks > > Modified: > head/sys/dev/ocs_fc/ocs_cam.c > head/sys/dev/ocs_fc/ocs_hw.c > head/sys/dev/ocs_fc/ocs_hw_queues.c > head/sys/dev/ocs_fc/ocs_ioctl.c > head/sys/dev/ocs_fc/ocs_mgmt.c > head/sys/dev/ocs_fc/ocs_node.c > head/sys/dev/ocs_fc/ocs_pci.c > head/sys/dev/ocs_fc/ocs_xport.c > head/sys/dev/ocs_fc/sli4.c > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_tar > struct ocs_softc *ocs = node->ocs; > ocs_fcport *fcp = NULL; > ocs_fc_target_t *tgt = NULL; > - uint32_t tgt_id; > + int32_t tgt_id; > > + if (ocs == NULL) { > + ocs_log_err(ocs,"OCS is NULL \n"); > + return -1; > + } > + > fcp = node->sport->tgt_data; > if (fcp == NULL) { > ocs_log_err(ocs,"FCP is NULL \n"); > - return 0; > + return -1; > } > > tgt_id = ocs_tgt_find(fcp, node); > + if (tgt_id == -1) { > + ocs_log_err(ocs,"target is invalid\n"); > + return -1; > + } > > tgt = &fcp->tgt[tgt_id]; > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb > ocs_io_t *io = NULL; > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > int32_t sgl_count; > + ocs_fcport *fcp; > > - ocs_fcport *fcp = NULL; > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > - if (fcp == NULL) { > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > - return -1; > - } > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > } > case XPT_RESET_BUS: > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) == 0) { > - ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); > - > + rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); > + if (rc) { > + ocs_log_debug(ocs, "Failed to bring port online" > + " : %d\n", rc); > + } > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > } else { > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > static ocs_hw_rtn_e > ocs_hw_link_event_init(ocs_hw_t *hw) > { > - if (hw == NULL) { > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > - return OCS_HW_RTN_ERROR; > - } > + ocs_hw_assert(hw); > > hw->link.status = SLI_LINK_STATUS_MAX; > hw->link.topology = SLI_LINK_TOPO_NONE; > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 > break; > case OCS_HW_MAX_VPORTS: > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > + break; > default: > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > rc = OCS_HW_RTN_ERROR; > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 > break; > case OCS_ESOC: > hw->config.esoc = value; > + break; > case OCS_HW_HIGH_LOGIN_MODE: > rc = sli_set_hlm(&hw->sli, value); > break; > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t *hdr, u > > OCS_STAT(wq->use_count++); > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > + return OCS_HW_RTN_SUCCESS; > } > > ocs_hw_rtn_e > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t *io) > } > > /* fail if we don't have an overflow SGL registered */ > - if (io->ovfl_sgl == NULL) { > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > return OCS_HW_RTN_ERROR; > } > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > + if (!buf) { > + ocs_log_err(hw->os, "no buffer for command\n"); > + return OCS_HW_RTN_NO_MEMORY; > + } > + > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, hw->watchdog_timeout); > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, ocs_hw_cb_cfg_watchdog, NULL); > if (rc) { > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > break; > case SLI_QENTRY_WQ_RELEASE: { > uint32_t wq_id = rid; > - uint32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > + int32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > + > + if (unlikely(index < 0)) { > + ocs_log_err(hw->os, "unknown idx=%#x rid=%#x\n", > + index, rid); > + break; > + } > + > hw_wq_t *wq = hw->hw_wq[index]; > > /* Submit any HW IOs that are on the WQ pending list */ > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > hw->link.status = event->status; > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > + d = hw->domains[i]; > if (d != NULL && > hw->callback.domain != NULL) { > hw->callback.domain(hw->args.domain, OCS_HW_DOMAIN_LOST, d); > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > ocs_domain_t *domain = NULL; > sli4_fip_event_t *event = e; > > + ocs_hw_assert(event); > + ocs_hw_assert(hw); > + > /* Find the associated domain object */ > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > ocs_domain_t *d = NULL; > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > /* Clear VLINK is different from the other FIP events as it passes back > * a VPI instead of a FCF index. Check all attached SLI ports for a > * matching VPI */ > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > + d = hw->domains[i]; > if (d != NULL) { > ocs_sport_t *sport = NULL; > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, > ocs_hw_io_t *io_next = NULL; > uint64_t ticks_current = ocs_get_os_ticks(); > uint32_t sec_elapsed; > + ocs_hw_rtn_e rc; > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t *)mqe; > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, > > /* loop through active WQE list and check for timeouts */ > ocs_lock(&hw->io_lock); > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > - sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > + sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); > > - /* > - * If elapsed time > timeout, abort it. No need to check type since > - * it wouldn't be on this list unless it was a target WQE > - */ > - if (sec_elapsed > io->tgt_wqe_timeout) { > - ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", > - io->indicator, io->reqtag, io->type); > + /* > + * If elapsed time > timeout, abort it. No need to check type since > + * it wouldn't be on this list unless it was a target WQE > + */ > + if (sec_elapsed > io->tgt_wqe_timeout) { > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", > + io->indicator, io->reqtag, io->type); > > - /* remove from active_wqe list so won't try to abort again */ > - ocs_list_remove(&hw->io_timed_wqe, io); > + /* remove from active_wqe list so won't try to abort again */ > + ocs_list_remove(&hw->io_timed_wqe, io); > > - /* save status of "timed out" for when abort completes */ > - io->status_saved = 1; > - io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > - io->saved_ext = 0; > - io->saved_len = 0; > + /* save status of "timed out" for when abort completes */ > + io->status_saved = 1; > + io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > + io->saved_ext = 0; > + io->saved_len = 0; > > - /* now abort outstanding IO */ > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > + /* now abort outstanding IO */ > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > + if (rc) { > + ocs_log_test(hw->os, > + "abort failed xri=%#x tag=%#x rc=%d\n", > + io->indicator, io->reqtag, rc); > } > - /* > - * need to go through entire list since each IO could have a > - * different timeout value > - */ > } > + /* > + * need to go through entire list since each IO could have a > + * different timeout value > + */ > + } > ocs_unlock(&hw->io_lock); > > /* if we're not in the middle of shutting down, schedule next timer */ > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > default_lengths[QTOP_CQ] = len; > break; > } > + > + if (!eq || !next_qt) { > + goto fail; > + } > > /* If this CQ is for MRQ, then delay the creation */ > if (!use_mrq || next_qt->entry != QTOP_RQ) { > cq = hw_new_cq(eq, len); > if (cq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > } > break; > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > hw_queue_teardown(hw); > return OCS_HW_RTN_NO_MEMORY; > } > + > + if (cq == NULL) > + goto fail; > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + qt->ulp); > if (wq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > > /* Place this WQ on the EQ WQ array */ > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > break; > } > > + if (cq == NULL) > + goto fail; > + > mq = hw_new_mq(cq, len); > if (mq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > break; > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > } > > return OCS_HW_RTN_SUCCESS; > +fail: > + hw_queue_teardown(hw); > + return OCS_HW_RTN_NO_MEMORY; > > } > > @@ -737,8 +747,9 @@ error: > for (i = 0; i < num_rq_pairs; i++) { > if (rqs[i] != NULL) { > if (rqs[i]->rq_tracker != NULL) { > - ocs_free(hw->os, rq->rq_tracker, > - sizeof(ocs_hw_sequence_t*) * rq->entry_count); > + ocs_free(hw->os, rqs[i]->rq_tracker, > + sizeof(ocs_hw_sequence_t*) * > + rqs[i]->entry_count); > } > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > } > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > void > hw_del_rq(hw_rq_t *rq) > { > - ocs_hw_t *hw = rq->cq->eq->hw; > > if (rq != NULL) { > + ocs_hw_t *hw = rq->cq->eq->hw; > /* Free RQ tracker */ > if (rq->rq_tracker != NULL) { > ocs_free(hw->os, rq->rq_tracker, sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ > * 6. ioctl code releases the lock > */ > mtx_lock(&ocs->dbg_lock); > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > - __ocs_ioctl_mbox_cb, ocs); > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > + __ocs_ioctl_mbox_cb, ocs)) { > + > + device_printf(ocs->dev, "%s: command- %x failed\n", __func__, > + ((sli4_mbox_command_header_t *)mcmd->payload)->command); > + } > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > mtx_unlock(&ocs->dbg_lock); > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char *value) > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > /* Undefined failure */ > ocs_log_err(ocs, "ocs_sem_p failed\n"); > - rc = -ENXIO; > + return -ENXIO; > } > if (result.status == 0) { > /* Success. */ > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char *value > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > /* Undefined failure */ > ocs_log_err(ocs, "ocs_sem_p failed\n"); > - rc = -ENXIO; > + return -ENXIO; > } > if (result.status == 0) { > /* Success. */ > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > char *wwpn_p = NULL; > char *wwnn_p = NULL; > int32_t rc = -1; > - int wwpn; > - int wwnn; > + int wwpn = 0; > + int wwnn = 0; > int i; > > /* This is a read-modify-write operation, so first we have to read > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > wwnn_p = wwn_p; > } > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > - wwnn = ocs_strcmp(wwnn_p, "NA"); > + if (wwpn_p != NULL) { > + wwpn = ocs_strcmp(wwpn_p, "NA"); > + } > + > + if (wwnn_p != NULL) { > + wwnn = ocs_strcmp(wwnn_p, "NA"); > + } > > /* Parse the new WWPN */ > if ((wwpn_p != NULL) && (wwpn != 0)) { > > Modified: head/sys/dev/ocs_fc/ocs_node.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > - max_xfer_size = max_sge * num_sgl; > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > } else { > max_xfer_size = 65536; > } > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > } > > ocs_cam_detach(ocs); > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > if (bus_dmamap_destroy(ocs->buf_dmat, io->tgt_io.dmap)) { > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > ocs_node_free_pool(ocs); > } > > - if (rq_threads_created) { > - ocs_xport_rq_threads_teardown(xport); > - } > - > return -1; > } > > > Modified: head/sys/dev/ocs_fc/sli4.c > ============================================================================== > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size > } > } > break; > - default: > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", if_type); > - return -1; > - } > + } > > return (sli_config_off + cmd_size); > } > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uin > return -1; > } > > + memset(&dma, 0, sizeof(dma)); > + > /* Align the queue DMA memory */ > for (i = 0; i < num_cqs; i++) { > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, SLI4_CQE_BYTES, > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > } > > if (q->dma.virt != NULL) { > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > + ocs_memset(q->dma.virt, 0, (q->size * (uint64_t)q->length)); > } > > ocs_unlock(&q->lock); > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t num_rq_pair > ocs_dma_t dma; > sli4_res_common_create_queue_set_t *rsp = NULL; > sli4_req_fcoe_rq_create_v2_t *req = NULL; > + > + ocs_memset(&dma, 0, sizeof(dma)); > > for (i = 0; i < (num_rq_pairs * 2); i++) { > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, SLI4_FCOE_RQE_SIZE, > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jan 23 18:58:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC63314AF964; Wed, 23 Jan 2019 18:58:17 +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 5C7928651F; Wed, 23 Jan 2019 18:58:16 +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 22A3E1CCAE; Wed, 23 Jan 2019 18:58:16 +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 x0NIwG4Y047438; Wed, 23 Jan 2019 18:58:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NIwGjf047437; Wed, 23 Jan 2019 18:58:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231858.x0NIwGjf047437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 18:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343353 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C7928651F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:58:18 -0000 Author: markj Date: Wed Jan 23 18:58:15 2019 New Revision: 343353 URL: https://svnweb.freebsd.org/changeset/base/343353 Log: Correct uma_prealloc()'s use of domainset iterators after r339925. The iterator should be reinitialized after every successful slab allocation. A request to advance the iterator is interpreted as an allocation failure, so a sufficiently large preallocation would cause the iterator to believe that all domains were exhausted, resulting in a sleep with the keg lock held. [1] Also, keg_alloc_slab() should pass the unmodified wait flag to the item initialization routine, which may use it to perform allocations from other zones. Reported and tested by: slavah Diagnosed by: kib [1] Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Jan 23 18:53:13 2019 (r343352) +++ head/sys/vm/uma_core.c Wed Jan 23 18:58:15 2019 (r343353) @@ -241,7 +241,7 @@ static void *pcpu_page_alloc(uma_zone_t, vm_size_t, in static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void page_free(void *, vm_size_t, uint8_t); static void pcpu_page_free(void *, vm_size_t, uint8_t); -static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int); +static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); static void bucket_cache_drain(uma_zone_t zone); @@ -1049,20 +1049,22 @@ zone_drain(uma_zone_t zone) * otherwise the keg will be left unlocked. * * Arguments: - * wait Shall we wait? + * flags Wait flags for the item initialization routine + * aflags Wait flags for the slab allocation * * Returns: * The slab that was allocated or NULL if there is no memory and the * caller specified M_NOWAIT. */ static uma_slab_t -keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int wait) +keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags, + int aflags) { uma_alloc allocf; uma_slab_t slab; unsigned long size; uint8_t *mem; - uint8_t flags; + uint8_t sflags; int i; KASSERT(domain >= 0 && domain < vm_ndomains, @@ -1076,7 +1078,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab = NULL; mem = NULL; if (keg->uk_flags & UMA_ZONE_OFFPAGE) { - slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, wait); + slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, aflags); if (slab == NULL) goto out; } @@ -1089,16 +1091,16 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom */ if ((keg->uk_flags & UMA_ZONE_MALLOC) == 0) - wait |= M_ZERO; + aflags |= M_ZERO; else - wait &= ~M_ZERO; + aflags &= ~M_ZERO; if (keg->uk_flags & UMA_ZONE_NODUMP) - wait |= M_NODUMP; + aflags |= M_NODUMP; /* zone is passed for legacy reasons. */ size = keg->uk_ppera * PAGE_SIZE; - mem = allocf(zone, size, domain, &flags, wait); + mem = allocf(zone, size, domain, &sflags, aflags); if (mem == NULL) { if (keg->uk_flags & UMA_ZONE_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); @@ -1118,7 +1120,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab->us_keg = keg; slab->us_data = mem; slab->us_freecount = keg->uk_ipers; - slab->us_flags = flags; + slab->us_flags = sflags; slab->us_domain = domain; BIT_FILL(SLAB_SETSIZE, &slab->us_free); #ifdef INVARIANTS @@ -1128,7 +1130,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom if (keg->uk_init != NULL) { for (i = 0; i < keg->uk_ipers; i++) if (keg->uk_init(slab->us_data + (keg->uk_rsize * i), - keg->uk_size, wait) != 0) + keg->uk_size, flags) != 0) break; if (i != keg->uk_ipers) { keg_free_slab(keg, slab, i); @@ -2698,7 +2700,7 @@ restart: zone->uz_items <= zone->uz_max_items, ("%s: zone %p overflow", __func__, zone)); - slab = keg_alloc_slab(keg, zone, domain, aflags); + slab = keg_alloc_slab(keg, zone, domain, flags, aflags); /* * If we got a slab here it's safe to mark it partially used * and return. We assume that the caller is going to remove @@ -3548,24 +3550,34 @@ uma_prealloc(uma_zone_t zone, int items) uma_domain_t dom; uma_slab_t slab; uma_keg_t keg; - int domain, flags, slabs; + int aflags, domain, slabs; KEG_GET(zone, keg); KEG_LOCK(keg); slabs = items / keg->uk_ipers; if (slabs * keg->uk_ipers < items) slabs++; - flags = M_WAITOK; - vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &flags); while (slabs-- > 0) { - slab = keg_alloc_slab(keg, zone, domain, flags); - if (slab == NULL) - return; - MPASS(slab->us_keg == keg); - dom = &keg->uk_domain[slab->us_domain]; - LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - if (vm_domainset_iter_policy(&di, &domain) != 0) - break; + aflags = M_NOWAIT; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, + &aflags); + for (;;) { + 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); + break; + } + KEG_LOCK(keg); + if (vm_domainset_iter_policy(&di, &domain) != 0) { + KEG_UNLOCK(keg); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + KEG_LOCK(keg); + } + } } KEG_UNLOCK(keg); } From owner-svn-src-all@freebsd.org Wed Jan 23 20:02:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F11814B1601; Wed, 23 Jan 2019 20:02:18 +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 14EC288D8E; Wed, 23 Jan 2019 20:02:18 +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 080911D825; Wed, 23 Jan 2019 20:02:18 +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 x0NK2Hqu082969; Wed, 23 Jan 2019 20:02:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NK2HXQ082968; Wed, 23 Jan 2019 20:02:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232002.x0NK2HXQ082968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 20:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343354 - head/usr.bin/write X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/write X-SVN-Commit-Revision: 343354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14EC288D8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:02:18 -0000 Author: markj Date: Wed Jan 23 20:02:17 2019 New Revision: 343354 URL: https://svnweb.freebsd.org/changeset/base/343354 Log: Remove extraneous setutxent() calls in write(1). We already call setutxent() once during initialization. Furthermore, the subsequent calls occur after the process has entered capability mode, so they fail, and attempts to fetch database entries fail as a result. PR: 235096 Submitted by: fullermd@over-yonder.net MFC after: 3 days Modified: head/usr.bin/write/write.c Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Wed Jan 23 18:58:15 2019 (r343353) +++ head/usr.bin/write/write.c Wed Jan 23 20:02:17 2019 (r343354) @@ -204,7 +204,6 @@ utmp_chk(char *user, char *tty) struct utmpx lu, *u; strncpy(lu.ut_line, tty, sizeof lu.ut_line); - setutxent(); while ((u = getutxline(&lu)) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { @@ -237,7 +236,6 @@ search_utmp(int devfd, char *user, char *tty, char *my bestatime = 0; user_is_me = 0; - setutxent(); while ((u = getutxent()) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { From owner-svn-src-all@freebsd.org Wed Jan 23 20:31:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D59F14B1F01; Wed, 23 Jan 2019 20:31:25 +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 BB85389C84; Wed, 23 Jan 2019 20:31: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 AF0C11DCE3; Wed, 23 Jan 2019 20:31: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 x0NKVOnn094818; Wed, 23 Jan 2019 20:31:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKVOHJ094817; Wed, 23 Jan 2019 20:31:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232031.x0NKVOHJ094817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343355 - stable/12/contrib/netbsd-tests/kernel X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/contrib/netbsd-tests/kernel X-SVN-Commit-Revision: 343355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB85389C84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:31:25 -0000 Author: kib Date: Wed Jan 23 20:31:24 2019 New Revision: 343355 URL: https://svnweb.freebsd.org/changeset/base/343355 Log: MFC r343081: Trim spaces at the end of lines. Modified: stable/12/contrib/netbsd-tests/kernel/t_sysv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- stable/12/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:02:17 2019 (r343354) +++ stable/12/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:31:24 2019 (r343355) @@ -840,9 +840,9 @@ sharer(void) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, msg); - ATF_TP_ADD_TC(tp, sem); - ATF_TP_ADD_TC(tp, shm); + ATF_TP_ADD_TC(tp, msg); + ATF_TP_ADD_TC(tp, sem); + ATF_TP_ADD_TC(tp, shm); return atf_no_error(); } From owner-svn-src-all@freebsd.org Wed Jan 23 20:34:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C6C714B20C0; Wed, 23 Jan 2019 20:34: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 C7EC389F81; Wed, 23 Jan 2019 20:34:23 +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 AF5CB1DD3D; Wed, 23 Jan 2019 20:34:23 +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 x0NKYNfl098996; Wed, 23 Jan 2019 20:34:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKYMOR098991; Wed, 23 Jan 2019 20:34:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232034.x0NKYMOR098991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343356 - in stable/12: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 343356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7EC389F81 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:34:24 -0000 Author: kib Date: Wed Jan 23 20:34:22 2019 New Revision: 343356 URL: https://svnweb.freebsd.org/changeset/base/343356 Log: MFC r343082: Implement shmat(2) flag SHM_REMAP. Modified: stable/12/contrib/netbsd-tests/kernel/t_sysv.c stable/12/lib/libc/sys/shmat.2 stable/12/sys/kern/sysv_shm.c stable/12/sys/sys/shm.h stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- stable/12/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:34:22 2019 (r343356) @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -772,19 +773,27 @@ ATF_TC_BODY(shm, tc) atf_tc_fail("sender: received unexpected signal"); } -ATF_TC_CLEANUP(shm, tc) +static void +shmid_cleanup(const char *name) { - int sender_shmid; + int shmid; /* * Remove the shared memory area if it exists. */ - sender_shmid = read_int("sender_shmid"); - if (sender_shmid != -1) - if (shmctl(sender_shmid, IPC_RMID, NULL) == -1) + shmid = read_int(name); + if (shmid != -1) { + if (shmctl(shmid, IPC_RMID, NULL) == -1) err(1, "shmctl IPC_RMID"); + } } +ATF_TC_CLEANUP(shm, tc) +{ + + shmid_cleanup("sender_shmid"); +} + void print_shmid_ds(struct shmid_ds *sp, mode_t mode) { @@ -837,12 +846,53 @@ sharer(void) exit(0); } +#ifdef SHM_REMAP +ATF_TC_WITH_CLEANUP(shm_remap); +ATF_TC_HEAD(shm_remap, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks SHM_REMAP"); +} + +ATF_TC_BODY(shm_remap, tc) +{ + char *shm_buf; + int shmid_remap; + + pgsize = sysconf(_SC_PAGESIZE); + + shmkey = get_ftok(4160); + ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed"); + + ATF_REQUIRE_MSG((shmid_remap = shmget(shmkey, pgsize, + IPC_CREAT | 0640)) != -1, "shmget: %d", errno); + write_int("shmid_remap", shmid_remap); + + ATF_REQUIRE_MSG((shm_buf = mmap(NULL, pgsize, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0)) != MAP_FAILED, "mmap: %d", errno); + + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, 0) == (void *)-1, + "shmat without MAP_REMAP succeeded"); + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, SHM_REMAP) == shm_buf, + "shmat(SHM_REMAP): %d", errno); +} + +ATF_TC_CLEANUP(shm_remap, tc) +{ + + shmid_cleanup("shmid_remap"); +} +#endif /* SHM_REMAP */ + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, msg); ATF_TP_ADD_TC(tp, sem); ATF_TP_ADD_TC(tp, shm); +#ifdef SHM_REMAP + ATF_TP_ADD_TC(tp, shm_remap); +#endif return atf_no_error(); } Modified: stable/12/lib/libc/sys/shmat.2 ============================================================================== --- stable/12/lib/libc/sys/shmat.2 Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/lib/libc/sys/shmat.2 Wed Jan 23 20:34:22 2019 (r343356) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2018 +.Dd January 14, 2019 .Dt SHMAT 2 .Os .Sh NAME @@ -64,17 +64,38 @@ kernel. .It If .Fa addr -is nonzero and SHM_RND is not specified in +is nonzero and +.Va SHM_RND +is not specified in .Fa flag , the segment is attached the specified address. .It If .Fa addr -is specified and SHM_RND is specified, +is specified and +.Va SHM_RND +is specified, .Fa addr is rounded down to the nearest multiple of SHMLBA. .El .Pp +If the +.Va SHM_REMAP +flag is specified and the passed +.Fa addr +is not +.Dv NULL , +any existing mappings in the virtual addresses range are +cleared before the segment is attached. +If the flag is not specified, +.Fa addr +is not +.Dv NULL , +and the virtual address range contains +some pre-existing mappings, the +.Fn shmat +call fails. +.Pp The .Fn shmdt system call @@ -104,6 +125,14 @@ The .Fa addr argument was not an acceptable address. +.It Bq Er ENOMEM +The specified +.Fa addr +cannot be used for mapping, for instance due to the amount of available +space being smaller than the segment size, +or because pre-existing mappings are in the range and no +.Va SHM_REMAP +flag was provided. .It Bq Er EMFILE Failed to attach the shared memory segment because the per-process .Va kern.ipc.shmseg Modified: stable/12/sys/kern/sysv_shm.c ============================================================================== --- stable/12/sys/kern/sysv_shm.c Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/sys/kern/sysv_shm.c Wed Jan 23 20:34:22 2019 (r343356) @@ -388,7 +388,7 @@ kern_shmat_locked(struct thread *td, int shmid, const vm_offset_t attach_va; vm_prot_t prot; vm_size_t size; - int error, i, rv; + int cow, error, find_space, i, rv; AUDIT_ARG_SVIPC_ID(shmid); AUDIT_ARG_VALUE(shmflg); @@ -427,6 +427,7 @@ kern_shmat_locked(struct thread *td, int shmid, const return (EMFILE); size = round_page(shmseg->u.shm_segsz); prot = VM_PROT_READ; + cow = MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL; if ((shmflg & SHM_RDONLY) == 0) prot |= VM_PROT_WRITE; if (shmaddr != NULL) { @@ -436,6 +437,9 @@ kern_shmat_locked(struct thread *td, int shmid, const attach_va = (vm_offset_t)shmaddr; else return (EINVAL); + if ((shmflg & SHM_REMAP) != 0) + cow |= MAP_REMAP; + find_space = VMFS_NO_SPACE; } else { /* * This is just a hint to vm_map_find() about where to @@ -443,12 +447,12 @@ kern_shmat_locked(struct thread *td, int shmid, const */ attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr + lim_max(td, RLIMIT_DATA)); + find_space = VMFS_OPTIMAL_SPACE; } vm_object_reference(shmseg->object); rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va, - size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE, - prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL); + size, 0, find_space, prot, prot, cow); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg->object); return (ENOMEM); Modified: stable/12/sys/sys/shm.h ============================================================================== --- stable/12/sys/sys/shm.h Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/sys/sys/shm.h Wed Jan 23 20:34:22 2019 (r343356) @@ -52,6 +52,7 @@ #define SHM_RDONLY 010000 /* Attach read-only (else read-write) */ #define SHM_RND 020000 /* Round attach address to SHMLBA */ +#define SHM_REMAP 030000 /* Unmap before mapping */ #define SHMLBA PAGE_SIZE /* Segment low boundary address multiple */ /* "official" access mode definitions; somewhat braindead since you have Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/sys/vm/vm_map.c Wed Jan 23 20:34:22 2019 (r343356) @@ -1565,6 +1565,8 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || object == NULL, ("vm_map_find: non-NULL backing object for stack")); + MPASS((cow & MAP_REMAP) == 0 || (find_space == VMFS_NO_SPACE && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || (object->flags & OBJ_COLORED) == 0)) find_space = VMFS_ANY_SPACE; @@ -1595,6 +1597,14 @@ again: } goto done; } + } else if ((cow & MAP_REMAP) != 0) { + if (*addr < vm_map_min(map) || + *addr + length > vm_map_max(map) || + *addr + length <= length) { + rv = KERN_INVALID_ADDRESS; + goto done; + } + vm_map_delete(map, *addr, *addr + length); } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Wed Jan 23 20:31:24 2019 (r343355) +++ stable/12/sys/vm/vm_map.h Wed Jan 23 20:34:22 2019 (r343356) @@ -342,6 +342,7 @@ long vmspace_resident_count(struct vmspace *vmspace); #define MAP_DISABLE_COREDUMP 0x0100 #define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ #define MAP_VN_WRITECOUNT 0x0400 +#define MAP_REMAP 0x0800 #define MAP_STACK_GROWS_DOWN 0x1000 #define MAP_STACK_GROWS_UP 0x2000 #define MAP_ACC_CHARGED 0x4000 From owner-svn-src-all@freebsd.org Wed Jan 23 20:38:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D2214B220E; Wed, 23 Jan 2019 20:38:02 +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 476048A1BC; Wed, 23 Jan 2019 20:38:02 +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 341811DD3E; Wed, 23 Jan 2019 20:38:02 +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 x0NKc2Cv099203; Wed, 23 Jan 2019 20:38:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKc20G099202; Wed, 23 Jan 2019 20:38:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232038.x0NKc20G099202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343357 - stable/11/contrib/netbsd-tests/kernel X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/contrib/netbsd-tests/kernel X-SVN-Commit-Revision: 343357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 476048A1BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:38:02 -0000 Author: kib Date: Wed Jan 23 20:38:01 2019 New Revision: 343357 URL: https://svnweb.freebsd.org/changeset/base/343357 Log: MFC r343081: Trim spaces at the end of lines. Modified: stable/11/contrib/netbsd-tests/kernel/t_sysv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:34:22 2019 (r343356) +++ stable/11/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 23 20:38:01 2019 (r343357) @@ -842,9 +842,9 @@ sharer(void) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, msg); - ATF_TP_ADD_TC(tp, sem); - ATF_TP_ADD_TC(tp, shm); + ATF_TP_ADD_TC(tp, msg); + ATF_TP_ADD_TC(tp, sem); + ATF_TP_ADD_TC(tp, shm); return atf_no_error(); } From owner-svn-src-all@freebsd.org Wed Jan 23 20:43:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E1A14B2574; Wed, 23 Jan 2019 20:43:43 +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 06E078A776; Wed, 23 Jan 2019 20:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D42E01DEF6; Wed, 23 Jan 2019 20:43:42 +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 x0NKhggx004362; Wed, 23 Jan 2019 20:43:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKhgHl004361; Wed, 23 Jan 2019 20:43:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232043.x0NKhgHl004361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343358 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 343358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06E078A776 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:43:43 -0000 Author: kib Date: Wed Jan 23 20:43:42 2019 New Revision: 343358 URL: https://svnweb.freebsd.org/changeset/base/343358 Log: MFC r343085: Improve iflib busdma(9) KPI use. Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Wed Jan 23 20:38:01 2019 (r343357) +++ stable/12/sys/net/iflib.c Wed Jan 23 20:43:42 2019 (r343358) @@ -282,6 +282,7 @@ typedef struct iflib_sw_rx_desc_array { typedef struct iflib_sw_tx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; @@ -1491,6 +1492,8 @@ iflib_fast_intr_rxtx(void *arg) ctx = rxq->ifr_ctx; + bus_dmamap_sync(rxq->ifr_ifdi->idi_tag, rxq->ifr_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if (!ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) { IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); continue; @@ -1583,6 +1586,7 @@ iflib_txsd_alloc(iflib_txq_t txq) device_t dev = ctx->ifc_dev; bus_size_t tsomaxsize; int err, nsegments, ntsosegments; + bool tso; nsegments = scctx->isc_tx_nsegments; ntsosegments = scctx->isc_tx_tso_segments_max; @@ -1617,8 +1621,8 @@ iflib_txsd_alloc(iflib_txq_t txq) (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } - if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) && - (err = bus_dma_tag_create(bus_get_dma_tag(dev), + tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0; + if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1631,7 +1635,6 @@ iflib_txsd_alloc(iflib_txq_t txq) NULL, /* lockfuncarg */ &txq->ift_tso_desc_tag))) { device_printf(dev,"Unable to allocate TX TSO DMA tag: %d\n", err); - goto fail; } if (!(txq->ift_sds.ifsd_m = @@ -1643,19 +1646,38 @@ iflib_txsd_alloc(iflib_txq_t txq) } /* Create the descriptor buffer dma maps */ - if (!(txq->ift_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + if ((txq->ift_sds.ifsd_map = (bus_dmamap_t *)malloc( + sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); err = ENOMEM; goto fail; } + if (tso && (txq->ift_sds.ifsd_tso_map = (bus_dmamap_t *)malloc( + sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { + device_printf(dev, "Unable to allocate TSO tx_buffer " + "map memory\n"); + err = ENOMEM; + goto fail; + } + for (int i = 0; i < scctx->isc_ntxd[txq->ift_br_offset]; i++) { - err = bus_dmamap_create(txq->ift_desc_tag, 0, &txq->ift_sds.ifsd_map[i]); + err = bus_dmamap_create(txq->ift_desc_tag, 0, + &txq->ift_sds.ifsd_map[i]); if (err != 0) { device_printf(dev, "Unable to create TX DMA map\n"); goto fail; } + if (!tso) + continue; + err = bus_dmamap_create(txq->ift_tso_desc_tag, 0, + &txq->ift_sds.ifsd_tso_map[i]); + if (err != 0) { + device_printf(dev, "Unable to create TSO TX DMA map\n"); + goto fail; + } } return (0); fail: @@ -1673,10 +1695,22 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int if (txq->ift_sds.ifsd_map != NULL) map = txq->ift_sds.ifsd_map[i]; if (map != NULL) { + bus_dmamap_sync(txq->ift_desc_tag, map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txq->ift_desc_tag, map); bus_dmamap_destroy(txq->ift_desc_tag, map); txq->ift_sds.ifsd_map[i] = NULL; } + + map = NULL; + if (txq->ift_sds.ifsd_tso_map != NULL) + map = txq->ift_sds.ifsd_tso_map[i]; + if (map != NULL) { + bus_dmamap_sync(txq->ift_tso_desc_tag, map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, map); + bus_dmamap_destroy(txq->ift_tso_desc_tag, map); + txq->ift_sds.ifsd_tso_map[i] = NULL; + } } static void @@ -1690,6 +1724,10 @@ iflib_txq_destroy(iflib_txq_t txq) free(txq->ift_sds.ifsd_map, M_IFLIB); txq->ift_sds.ifsd_map = NULL; } + if (txq->ift_sds.ifsd_tso_map != NULL) { + free(txq->ift_sds.ifsd_tso_map, M_IFLIB); + txq->ift_sds.ifsd_tso_map = NULL; + } if (txq->ift_sds.ifsd_m != NULL) { free(txq->ift_sds.ifsd_m, M_IFLIB); txq->ift_sds.ifsd_m = NULL; @@ -1715,11 +1753,15 @@ iflib_txsd_free(if_ctx_t ctx, iflib_txq_t txq, int i) if (txq->ift_sds.ifsd_map != NULL) { bus_dmamap_sync(txq->ift_desc_tag, - txq->ift_sds.ifsd_map[i], - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(txq->ift_desc_tag, - txq->ift_sds.ifsd_map[i]); + txq->ift_sds.ifsd_map[i], BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_desc_tag, txq->ift_sds.ifsd_map[i]); } + if (txq->ift_sds.ifsd_tso_map != NULL) { + bus_dmamap_sync(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[i], BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[i]); + } m_free(*mp); DBG_COUNTER_INC(tx_frees); *mp = NULL; @@ -1926,10 +1968,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; MPASS(sd_map != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], - cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); - bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); - + cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, + BUS_DMA_NOWAIT); if (err != 0 || cb_arg.error) { /* * !zone_pack ? @@ -1939,6 +1979,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun break; } + bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], + BUS_DMASYNC_PREREAD); sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; sd_cl[frag_idx] = cl; #if MEMORY_LOGGING @@ -2030,6 +2072,7 @@ static void iflib_fl_bufs_free(iflib_fl_t fl) { iflib_dma_info_t idi = fl->ifl_ifdi; + bus_dmamap_t sd_map; uint32_t i; for (i = 0; i < fl->ifl_size; i++) { @@ -2037,7 +2080,9 @@ iflib_fl_bufs_free(iflib_fl_t fl) caddr_t *sd_cl = &fl->ifl_sds.ifsd_cl[i]; if (*sd_cl != NULL) { - bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; + sd_map = fl->ifl_sds.ifsd_map[i]; + bus_dmamap_sync(fl->ifl_desc_tag, sd_map, + BUS_DMASYNC_POSTREAD); bus_dmamap_unload(fl->ifl_desc_tag, sd_map); if (*sd_cl != NULL) uma_zfree(fl->ifl_zone, *sd_cl); @@ -2140,19 +2185,32 @@ static void iflib_rx_sds_free(iflib_rxq_t rxq) { iflib_fl_t fl; - int i; + int i, j; if (rxq->ifr_fl != NULL) { for (i = 0; i < rxq->ifr_nfl; i++) { fl = &rxq->ifr_fl[i]; if (fl->ifl_desc_tag != NULL) { + if (fl->ifl_sds.ifsd_map != NULL) { + for (j = 0; j < fl->ifl_size; i++) { + if (fl->ifl_sds.ifsd_map[i] == + NULL) + continue; + bus_dmamap_sync( + fl->ifl_desc_tag, + fl->ifl_sds.ifsd_map[i], + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload( + fl->ifl_desc_tag, + fl->ifl_sds.ifsd_map[i]); + } + } bus_dma_tag_destroy(fl->ifl_desc_tag); fl->ifl_desc_tag = NULL; } free(fl->ifl_sds.ifsd_m, M_IFLIB); free(fl->ifl_sds.ifsd_cl, M_IFLIB); free(fl->ifl_sds.ifsd_ba, M_IFLIB); - /* XXX destroy maps first */ free(fl->ifl_sds.ifsd_map, M_IFLIB); fl->ifl_sds.ifsd_m = NULL; fl->ifl_sds.ifsd_cl = NULL; @@ -2430,11 +2488,10 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int map = fl->ifl_sds.ifsd_map[cidx]; di = fl->ifl_ifdi; next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); - bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* not valid assert if bxe really does SGE from non-contiguous elements */ MPASS(fl->ifl_cidx == cidx); + bus_dmamap_sync(fl->ifl_desc_tag, map, BUS_DMASYNC_POSTREAD); if (unload) bus_dmamap_unload(fl->ifl_desc_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); @@ -2442,7 +2499,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int fl->ifl_gen = 0; bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bit_clear(fl->ifl_rx_bitmap, cidx); + bit_clear(fl->ifl_rx_bitmap, cidx); } static struct mbuf * @@ -2519,6 +2576,9 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) m->m_data += 2; #endif memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); + bus_dmamap_sync(rxq->ifr_fl->ifl_desc_tag, + rxq->ifr_fl->ifl_sds.ifsd_map[ri->iri_frags[0].irf_idx], + BUS_DMASYNC_PREREAD); m->m_len = ri->iri_frags[0].irf_len; } else { m = assemble_segments(rxq, ri, &sd); @@ -2587,6 +2647,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if_ctx_t ctx = rxq->ifr_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + iflib_dma_info_t di; int avail, i; qidx_t *cidxp; struct if_rxd_info ri; @@ -2631,6 +2692,9 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) ri.iri_cidx = *cidxp; ri.iri_ifp = ifp; ri.iri_frags = rxq->ifr_frags; + di = rxq->ifr_fl[rxq->ifr_frags[0].irf_flid].ifl_ifdi; + bus_dmamap_sync(di->idi_tag, di->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); err = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); if (err) @@ -3006,16 +3070,17 @@ iflib_remove_mbuf(iflib_txq_t txq) { int ntxd, pidx; struct mbuf *m, **ifsd_m; - bus_dmamap_t *ifsd_map; ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; pidx = txq->ift_pidx & (ntxd - 1); ifsd_m = txq->ift_sds.ifsd_m; - ifsd_map = txq->ift_sds.ifsd_map; m = ifsd_m[pidx]; ifsd_m[pidx] = NULL; - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[pidx]); + bus_dmamap_unload(txq->ift_desc_tag, txq->ift_sds.ifsd_map[pidx]); + if (txq->ift_sds.ifsd_tso_map != NULL) + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[pidx]); #if MEMORY_LOGGING txq->ift_dequeued++; #endif @@ -3131,11 +3196,13 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { desc_tag = txq->ift_tso_desc_tag; max_segs = scctx->isc_tx_tso_segments_max; + map = txq->ift_sds.ifsd_tso_map[pidx]; MPASS(desc_tag != NULL); MPASS(max_segs > 0); } else { desc_tag = txq->ift_desc_tag; max_segs = scctx->isc_tx_nsegments; + map = txq->ift_sds.ifsd_map[pidx]; } if ((sctx->isc_flags & IFLIB_NEED_ETHER_PAD) && __predict_false(m_head->m_pkthdr.len < scctx->isc_min_frame_size)) { @@ -3297,7 +3364,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) { uint32_t qsize, cidx, mask, gen; struct mbuf *m, **ifsd_m; - bus_dmamap_t *ifsd_map; bool do_prefetch; cidx = txq->ift_cidx; @@ -3305,7 +3371,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) qsize = txq->ift_size; mask = qsize-1; ifsd_m = txq->ift_sds.ifsd_m; - ifsd_map = txq->ift_sds.ifsd_map; do_prefetch = (txq->ift_ctx->ifc_flags & IFC_PREFETCH); while (n-- > 0) { @@ -3315,7 +3380,19 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) } if ((m = ifsd_m[cidx]) != NULL) { prefetch(&ifsd_m[(cidx + CACHE_PTR_INCREMENT) & mask]); - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); + if (m->m_pkthdr.csum_flags & CSUM_TSO) { + bus_dmamap_sync(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[cidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[cidx]); + } else { + bus_dmamap_sync(txq->ift_desc_tag, + txq->ift_sds.ifsd_map[cidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_desc_tag, + txq->ift_sds.ifsd_map[cidx]); + } /* XXX we don't support any drivers that batch packets yet */ MPASS(m->m_nextpkt == NULL); m_freem(m); @@ -3400,6 +3477,8 @@ iflib_txq_can_drain(struct ifmp_ring *r) iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); return ((TXQ_AVAIL(txq) > MAX_TX_DESC(ctx) + 2) || ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)); } @@ -3564,6 +3643,8 @@ _task_fn_tx(void *context) if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; if (if_getcapenable(ifp) & IFCAP_NETMAP) { + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); @@ -5817,6 +5898,8 @@ iflib_tx_credits_update(if_ctx_t ctx, iflib_txq_t txq) if (ctx->isc_txd_credits_update == NULL) return (0); + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if ((credits = ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, true)) == 0) return (0); From owner-svn-src-all@freebsd.org Wed Jan 23 20:44:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCE0714B2637; Wed, 23 Jan 2019 20:44:51 +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 743DA8A8E8; Wed, 23 Jan 2019 20:44:51 +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 6825C1DEF8; Wed, 23 Jan 2019 20:44:51 +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 x0NKipbl004482; Wed, 23 Jan 2019 20:44:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKipl3004481; Wed, 23 Jan 2019 20:44:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232044.x0NKipl3004481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343359 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 343359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 743DA8A8E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:44:52 -0000 Author: kib Date: Wed Jan 23 20:44:51 2019 New Revision: 343359 URL: https://svnweb.freebsd.org/changeset/base/343359 Log: MFC r343086: Remove unused prototype. Modified: stable/12/sys/x86/x86/busdma_bounce.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/12/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:43:42 2019 (r343358) +++ stable/12/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:44:51 2019 (r343359) @@ -142,7 +142,6 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); From owner-svn-src-all@freebsd.org Wed Jan 23 20:47:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C37B14B2706; Wed, 23 Jan 2019 20:47: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 191218AA7B; Wed, 23 Jan 2019 20:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 061781DEF9; Wed, 23 Jan 2019 20:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NKlVLv004655; Wed, 23 Jan 2019 20:47:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKlVUA004654; Wed, 23 Jan 2019 20:47:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232047.x0NKlVUA004654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343360 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 343360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 191218AA7B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:47:33 -0000 Author: kib Date: Wed Jan 23 20:47:31 2019 New Revision: 343360 URL: https://svnweb.freebsd.org/changeset/base/343360 Log: MFC r343087: Style(9) fixes for x86/busdma_bounce.c. Modified: stable/12/sys/x86/x86/busdma_bounce.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/12/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:44:51 2019 (r343359) +++ stable/12/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:47:31 2019 (r343360) @@ -137,19 +137,16 @@ static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int commit); + int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_addr_t addr1, - bus_addr_t addr2, bus_size_t size); + vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - pmap_t pmap, void *buf, bus_size_t buflen, - int flags); + pmap_t pmap, void *buf, bus_size_t buflen, int flags); static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_paddr_t buf, bus_size_t buflen, - int flags); + vm_paddr_t buf, bus_size_t buflen, int flags); static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int flags); + int flags); static int bounce_bus_dma_zone_setup(bus_dma_tag_t dmat) @@ -202,15 +199,15 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si newtag->map_count = 0; newtag->segments = NULL; - if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) + if (parent != NULL && (newtag->common.filter != NULL || + (parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0)) newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; - if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && (flags & BUS_DMA_ALLOCNOW) != 0) error = bounce_bus_dma_zone_setup(newtag); else @@ -309,7 +306,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) @@ -448,14 +445,15 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad * * In the meantime warn the user if malloc gets it wrong. */ - if ((dmat->common.maxsize <= PAGE_SIZE) && - (dmat->common.alignment <= dmat->common.maxsize) && + if (dmat->common.maxsize <= PAGE_SIZE && + dmat->common.alignment <= dmat->common.maxsize && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), mflags); } else if (dmat->common.nsegments >= - howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, + PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ @@ -512,7 +510,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_ bus_addr_t curaddr; bus_size_t sgsize; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { /* * Count the number of bounce pages * needed in order to complete this transfer @@ -541,7 +539,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap bus_addr_t paddr; bus_size_t sg_len; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->common.lowaddr, ptoa((vm_paddr_t)Maxmem), @@ -580,7 +578,7 @@ _bus_dmamap_count_ma(bus_dma_tag_t dmat, bus_dmamap_t int page_index; vm_paddr_t paddr; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->common.lowaddr, ptoa((vm_paddr_t)Maxmem), @@ -718,7 +716,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dm while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); @@ -786,7 +784,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_ */ max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); @@ -853,7 +851,7 @@ bounce_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmam paddr = VM_PAGE_TO_PHYS(ma[page_index]) + ma_offs; max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - ma_offs; - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, paddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); @@ -1066,9 +1064,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat) /* Check to see if we already have a suitable zone */ STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->common.alignment <= bz->alignment) && - (dmat->common.lowaddr >= bz->lowaddr) && - (dmat->common.domain == bz->domain)) { + if (dmat->common.alignment <= bz->alignment && + dmat->common.lowaddr >= bz->lowaddr && + dmat->common.domain == bz->domain) { dmat->bounce_zone = bz; return (0); } @@ -1196,7 +1194,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) + bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; From owner-svn-src-all@freebsd.org Wed Jan 23 20:49:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C4B14B279D; Wed, 23 Jan 2019 20:49:15 +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 782678ABE3; Wed, 23 Jan 2019 20:49:15 +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 674D91DEFA; Wed, 23 Jan 2019 20:49:15 +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 x0NKnFuQ004783; Wed, 23 Jan 2019 20:49:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NKnF9G004782; Wed, 23 Jan 2019 20:49:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901232049.x0NKnF9G004782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Jan 2019 20:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343361 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 343361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 782678ABE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:49:16 -0000 Author: kib Date: Wed Jan 23 20:49:14 2019 New Revision: 343361 URL: https://svnweb.freebsd.org/changeset/base/343361 Log: MFC r343086: Remove unused prototype. Modified: stable/11/sys/x86/x86/busdma_bounce.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/11/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:47:31 2019 (r343360) +++ stable/11/sys/x86/x86/busdma_bounce.c Wed Jan 23 20:49:14 2019 (r343361) @@ -138,7 +138,6 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); From owner-svn-src-all@freebsd.org Wed Jan 23 22:00:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B850D14B3CB1; Wed, 23 Jan 2019 22:00:23 +0000 (UTC) (envelope-from ngie@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 3C6398D1D3; Wed, 23 Jan 2019 22:00:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 170731EBD9; Wed, 23 Jan 2019 22:00:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NM0INl041371; Wed, 23 Jan 2019 22:00:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NM0HIq041370; Wed, 23 Jan 2019 22:00:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232200.x0NM0HIq041370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 22:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343362 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C6398D1D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:00:24 -0000 Author: ngie Date: Wed Jan 23 22:00:17 2019 New Revision: 343362 URL: https://svnweb.freebsd.org/changeset/base/343362 Log: Add [initial] functional tests for sendfile(2) as lib/libc/sys/sendfile These testcases exercise a number of functional requirements for sendfile(2). The testcases use IPv4 and IPv6 domain sockets with TCP, and were confirmed functional on UFS and ZFS. UDP address family sockets cannot be used per the sendfile(2) contract, thus using UDP sockets is outside the scope of testing the syscall in positive cases. As seen in `:s_negative_udp_socket_test`, UDP is used to test the sendfile(2) contract to ensure that EINVAL is returned by sendfile(2). The testcases added explicitly avoid testing out `SF_SYNC` due to the complexity of verifying that support. However, this is a good next logical item to verify. The `hdtr_positive*` testcases work to a certain degree (the header testcases pass), but the trailer testcases do not work (it is an expected failure). In particular, the value received by the mock server doesn't match the expected value, and instead looks something like the following (using python array notation): `trailer[:]message[1:]` instead of: `message[:]trailer[:]` This makes me think there's a buffer overrun issue or problem with the offset somewhere in the sendfile(2) system call, but I need to do some other testing first to verify that the code is indeed sane, and my assumptions/code isn't buggy. The `sbytes_negative` testcases that check `sbytes` being set to an invalid value resulting in `EFAULT` fails today as the other change (which checks `copyout(9)`) has not been committed [1]. Thus, it should remain an expected failure (see bug 232210 for more details on this item). Next steps for testing sendfile(2): 1. Fix the header/trailer testcases so that they pass. 2. Setup if_tap interface and test with it, instead of using "localhost", per @asomers's suggestion. 3. Handle short recv(2)'s in `server_cat(..)`. 4. Add `SF_SYNC` support. 5. Add some more negative tests outside the scope of the functional contract. MFC after: 1 month Reviewed by: asomers Approved by: emaste (mentor) PR: 232210 Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D18625 Added: head/lib/libc/tests/sys/sendfile_test.c (contents, props changed) Modified: head/lib/libc/tests/sys/Makefile Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Wed Jan 23 20:49:14 2019 (r343361) +++ head/lib/libc/tests/sys/Makefile Wed Jan 23 22:00:17 2019 (r343362) @@ -8,6 +8,7 @@ PACKAGE= tests ATF_TESTS_C+= brk_test .endif ATF_TESTS_C+= queue_test +ATF_TESTS_C+= sendfile_test # TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, # swapcontext Added: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 22:00:17 2019 (r343362) @@ -0,0 +1,1146 @@ +/*- + * Copyright (c) 2018 Enji Cooper. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +const char DETERMINISTIC_PATTERN[] = + "The past is already gone, the future is not yet here. There's only one moment for you to live.\n"; + +#define SOURCE_FILE "source" +#define DESTINATION_FILE "dest" + +#define PORTRANGE_FIRST "net.inet.ip.portrange.first" +#define PORTRANGE_LAST "net.inet.ip.portrange.last" + +static int portrange_first, portrange_last; + +static int +get_int_via_sysctlbyname(const char *oidname) +{ + size_t oldlen; + int int_value; + + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), + 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); + ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); + + return (int_value); +} + +static int +generate_random_port(int seed) +{ + int random_port; + + printf("Generating a random port with seed=%d\n", seed); + if (portrange_first == 0) { + portrange_first = get_int_via_sysctlbyname(PORTRANGE_FIRST); + printf("Port range lower bound: %d\n", portrange_first); + } + + if (portrange_last == 0) { + portrange_last = get_int_via_sysctlbyname(PORTRANGE_LAST); + printf("Port range upper bound: %d\n", portrange_last); + } + + srand((unsigned)seed); + + random_port = rand() % (portrange_last - portrange_first) + + portrange_first; + + printf("Random port generated: %d\n", random_port); + return (random_port); +} + +static void +resolve_localhost(struct addrinfo **res, int domain, int type, int port) +{ + char *serv; + struct addrinfo hints; + int error; + + ATF_REQUIRE_MSG(domain == AF_INET || domain == AF_INET6, + "unhandled domain: %d", domain); + + ATF_REQUIRE_MSG(asprintf(&serv, "%d", port) >= 0, + "asprintf failed: %s", strerror(errno)); + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = domain; + hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV; + hints.ai_socktype = type; + + error = getaddrinfo("localhost", serv, &hints, res); + ATF_REQUIRE_EQ_MSG(error, 0, + "getaddrinfo failed: %s", gai_strerror(errno)); + free(serv); +} + +static int +make_socket(int domain, int type, int protocol) +{ + int sock; + + sock = socket(domain, type, protocol); + ATF_REQUIRE_MSG(sock != -1, "socket(%d, %d, 0) failed: %s", + domain, type, strerror(errno)); + + return (sock); +} + +static int +setup_client(int domain, int type, int port) +{ + struct addrinfo *res; + char host[NI_MAXHOST+1]; + int error, sock; + + resolve_localhost(&res, domain, type, port); + error = getnameinfo( + (const struct sockaddr*)res->ai_addr, res->ai_addrlen, + host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); + ATF_REQUIRE_EQ_MSG(error, 0, + "getnameinfo failed: %s", gai_strerror(error)); + printf( + "Will try to connect to host='%s', address_family=%d, " + "socket_type=%d\n", + host, res->ai_family, res->ai_socktype); + sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); + error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + ATF_REQUIRE_EQ_MSG(error, 0, "connect failed: %s", strerror(errno)); + return (sock); +} + +/* + * XXX: use linear probing to find a free port and eliminate `port` argument as + * a [const] int (it will need to be a pointer so it can be passed back out of + * the function and can influence which port `setup_client(..)` connects on. + */ +static int +setup_server(int domain, int type, int port) +{ + struct addrinfo *res; + char host[NI_MAXHOST+1]; + int error, sock; + + resolve_localhost(&res, domain, type, port); + sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); + + error = getnameinfo( + (const struct sockaddr*)res->ai_addr, res->ai_addrlen, + host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); + ATF_REQUIRE_EQ_MSG(error, 0, + "getnameinfo failed: %s", gai_strerror(error)); + printf( + "Will try to bind socket to host='%s', address_family=%d, " + "socket_type=%d\n", + host, res->ai_family, res->ai_socktype); + error = bind(sock, res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + ATF_REQUIRE_EQ_MSG(error, 0, "bind failed: %s", strerror(errno)); + error = listen(sock, 1); + ATF_REQUIRE_EQ_MSG(error, 0, "listen failed: %s", strerror(errno)); + + return (sock); +} + +/* + * This function is a helper routine for taking data being sent by `sendfile` via + * `server_sock`, and pushing the received stream out to a file, denoted by + * `dest_filename`. + */ +static void +server_cat(const char *dest_filename, int server_sock, size_t len) +{ + void *buffer; + int recv_sock; + ssize_t received_bytes; + + buffer = calloc(len + 1, sizeof(char)); + if (buffer == NULL) + err(1, "malloc failed"); + + recv_sock = accept(server_sock, NULL, 0); + if (recv_sock == -1) + err(1, "accept failed"); + + /* + * XXX: this assumes the simplest case where all data is received in a + * single recv(2) call. + */ + if (recv(recv_sock, buffer, len, 0) == -1) + err(1, "recv failed"); + + atf_utils_create_file(dest_filename, "%s", buffer); + + /* + * This recv(2) call helps ensure the amount of sent data is exactly + * what was specified by `len`. + */ + received_bytes = recv(recv_sock, buffer, len, 0); + switch (received_bytes) { + case -1: + err(1, "recv failed"); + case 0: + break; + default: + errx(1, "received unexpected data: %s", buffer); + } + + (void)close(recv_sock); + (void)close(server_sock); + free(buffer); +} + +static int +setup_tcp_server(int domain, int port) +{ + + return (setup_server(domain, SOCK_STREAM, port)); +} + +static int +setup_tcp_client(int domain, int port) +{ + + return (setup_client(domain, SOCK_STREAM, port)); +} + +static off_t +file_size_from_fd(int fd) +{ + struct stat st; + + ATF_REQUIRE_EQ_MSG(0, fstat(fd, &st), + "fstat failed: %s", strerror(errno)); + + return (st.st_size); +} + +/* + * NB: `nbytes` == 0 has special connotations given the sendfile(2) API + * contract. In short, "send the whole file" (paraphrased). + */ +static void +verify_source_and_dest(const char* dest_filename, int src_fd, off_t offset, + size_t nbytes) +{ + void *dest_pointer, *src_pointer; + off_t dest_file_size, src_file_size; + size_t length; + int dest_fd; + + atf_utils_cat_file(dest_filename, "dest_file: "); + + dest_fd = open(dest_filename, O_RDONLY); + ATF_REQUIRE_MSG(dest_fd != -1, "open failed"); + + dest_file_size = file_size_from_fd(dest_fd); + src_file_size = file_size_from_fd(src_fd); + + /* + * Per sendfile(2), "send the whole file" (paraphrased). This means + * that we need to grab the file size, as passing in length = 0 with + * mmap(2) will result in a failure with EINVAL (length = 0 is invalid). + */ + length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; + + ATF_REQUIRE_EQ_MSG(dest_file_size, length, + "number of bytes written out to %s (%ju) doesn't match the " + "expected number of bytes (%ju)", dest_filename, dest_file_size, + length); + + ATF_REQUIRE_EQ_MSG(0, lseek(src_fd, offset, SEEK_SET), + "lseek failed: %s", strerror(errno)); + + dest_pointer = mmap(NULL, length, PROT_READ, MAP_PRIVATE, dest_fd, 0); + ATF_REQUIRE_MSG(dest_pointer != MAP_FAILED, "mmap failed: %s", + strerror(errno)); + + printf("Will mmap in the source file from offset=%jd to length=%zu\n", + offset, length); + + src_pointer = mmap(NULL, length, PROT_READ, MAP_PRIVATE, src_fd, offset); + ATF_REQUIRE_MSG(src_pointer != MAP_FAILED, "mmap failed: %s", + strerror(errno)); + + ATF_REQUIRE_EQ_MSG(0, memcmp(src_pointer, dest_pointer, length), + "Contents of source and destination do not match. '%s' != '%s'", + src_pointer, dest_pointer); + + (void)munmap(src_pointer, length); + (void)munmap(dest_pointer, length); + (void)close(dest_fd); +} + +static void +fd_positive_file_test(int domain) +{ + off_t offset; + size_t nbytes, pattern_size; + int client_sock, error, fd, port, server_sock; + pid_t server_pid; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(0, 0)); + ATF_REQUIRE_EQ_MSG(0, error, "sendfile failed: %s", strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)close(fd); +} + +ATF_TC(fd_positive_file_v4); +ATF_TC_HEAD(fd_positive_file_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify regular file as file descriptor support (IPv4)"); +} +ATF_TC_BODY(fd_positive_file_v4, tc) +{ + + fd_positive_file_test(AF_INET); +} + +ATF_TC(fd_positive_file_v6); +ATF_TC_HEAD(fd_positive_file_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify regular file as file descriptor support (IPv6)"); +} +ATF_TC_BODY(fd_positive_file_v6, tc) +{ + + fd_positive_file_test(AF_INET6); +} + +static void +fd_positive_shm_test(int domain) +{ + void *shm_pointer; + off_t offset; + size_t nbytes, pattern_size; + pid_t server_pid; + int client_sock, error, fd, port, server_sock; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + printf("pattern size: %zu\n", pattern_size); + + fd = shm_open(SHM_ANON, O_RDWR|O_CREAT, 0600); + ATF_REQUIRE_MSG(fd != -1, "shm_open failed: %s", strerror(errno)); + ATF_REQUIRE_EQ_MSG(0, ftruncate(fd, pattern_size), + "ftruncate failed: %s", strerror(errno)); + shm_pointer = mmap(NULL, pattern_size, PROT_READ|PROT_WRITE, + MAP_SHARED, fd, 0); + ATF_REQUIRE_MSG(shm_pointer != MAP_FAILED, + "mmap failed: %s", strerror(errno)); + memcpy(shm_pointer, DETERMINISTIC_PATTERN, pattern_size); + ATF_REQUIRE_EQ_MSG(0, + memcmp(shm_pointer, DETERMINISTIC_PATTERN, pattern_size), + "memcmp showed data mismatch: '%s' != '%s'", + DETERMINISTIC_PATTERN, shm_pointer); + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(0, 0)); + ATF_REQUIRE_EQ_MSG(0, error, "sendfile failed: %s", strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)munmap(shm_pointer, sizeof(DETERMINISTIC_PATTERN)); + (void)close(fd); +} + +ATF_TC(fd_positive_shm_v4); +ATF_TC_HEAD(fd_positive_shm_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify shared memory as file descriptor support (IPv4)"); +} +ATF_TC_BODY(fd_positive_shm_v4, tc) +{ + + fd_positive_shm_test(AF_INET); +} + +ATF_TC(fd_positive_shm_v6); +ATF_TC_HEAD(fd_positive_shm_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify shared memory as file descriptor support (IPv6))"); +} +ATF_TC_BODY(fd_positive_shm_v6, tc) +{ + + fd_positive_shm_test(AF_INET6); +} + +static void +fd_negative_bad_fd_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + fd = -1; + + error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EBADF, error == -1); + + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(fd_negative_bad_fd_v4); +ATF_TC_HEAD(fd_negative_bad_fd_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify bad file descriptor returns EBADF (IPv4)"); +} +ATF_TC_BODY(fd_negative_bad_fd_v4, tc) +{ + + fd_negative_bad_fd_test(AF_INET); +} + +ATF_TC(fd_negative_bad_fd_v6); +ATF_TC_HEAD(fd_negative_bad_fd_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify bad file descriptor returns EBADF (IPv6)"); +} +ATF_TC_BODY(fd_negative_bad_fd_v6, tc) +{ + + fd_negative_bad_fd_test(AF_INET6); +} + +static void +flags_test(int domain) +{ + off_t offset; + size_t nbytes, pattern_size; + int client_sock, error, fd, i, port, server_sock; + pid_t server_pid; + int16_t number_pages = 10; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + struct testcase { + int16_t readahead_pages, flags; + } testcases[] = { + /* This is covered in `:fd_positive_file` */ +#if 0 + { + .readahead_pages = 0, + .flags = 0 + }, +#endif + { + .readahead_pages = 0, + .flags = SF_NOCACHE + }, +#ifdef SF_USER_READAHEAD + { + .readahead_pages = 0, + .flags = SF_NOCACHE|SF_USER_READAHEAD + }, + { + .readahead_pages = 0, + .flags = SF_USER_READAHEAD + }, +#endif + { + .readahead_pages = number_pages, + .flags = 0 + }, + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE + }, +#ifdef SF_USER_READAHEAD + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE|SF_USER_READAHEAD + }, +#endif + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE + }, + { + .readahead_pages = number_pages, + .flags = SF_NODISKIO + } + }; + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + for (i = 0; i < nitems(testcases); i++) { + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + port = generate_random_port(i * __LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(testcases[i].readahead_pages, testcases[i].flags)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile testcase #%d failed: %s", + i, strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)close(fd); + } +} + +ATF_TC(flags_v4); +ATF_TC_HEAD(flags_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Verify flags functionality (IPv4)"); +} +ATF_TC_BODY(flags_v4, tc) +{ + + flags_test(AF_INET); +} + +ATF_TC(flags_v6); +ATF_TC_HEAD(flags_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Verify flags functionality (IPv6)"); +} +ATF_TC_BODY(flags_v6, tc) +{ + + flags_test(AF_INET6); +} + +static void +hdtr_positive_test(int domain) +{ + struct iovec headers[1], trailers[1]; + struct testcase { + bool include_headers, include_trailers; + } testcases[] = { + /* This is covered in `:fd_positive_file` */ +#if 0 + { + .include_headers = false, + .include_trailers = false + }, +#endif + { + .include_headers = true, + .include_trailers = false + }, + { + .include_headers = false, + .include_trailers = true + }, + { + .include_headers = true, + .include_trailers = true + } + }; + off_t offset; + size_t nbytes; + int client_sock, error, fd, fd2, i, port, rc, server_sock; + pid_t server_pid; + + headers[0].iov_base = "This is a header"; + headers[0].iov_len = strlen(headers[0].iov_base); + trailers[0].iov_base = "This is a trailer"; + trailers[0].iov_len = strlen(trailers[0].iov_base); + offset = 0; + nbytes = 0; + + atf_tc_expect_fail( + "The header/trailer testcases fail today with a data mismatch; " + "bug # 234809"); + + for (i = 0; i < nitems(testcases); i++) { + struct sf_hdtr hdtr; + char *pattern; + + if (testcases[i].include_headers) { + hdtr.headers = headers; + hdtr.hdr_cnt = nitems(headers); + } else { + hdtr.headers = NULL; + hdtr.hdr_cnt = 0; + } + + if (testcases[i].include_trailers) { + hdtr.trailers = trailers; + hdtr.trl_cnt = nitems(trailers); + } else { + hdtr.trailers = NULL; + hdtr.trl_cnt = 0; + } + + port = generate_random_port(i * __LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + rc = asprintf(&pattern, "%s%s%s", + testcases[i].include_headers ? headers[0].iov_base : "", + DETERMINISTIC_PATTERN, + testcases[i].include_trailers ? trailers[0].iov_base : ""); + ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno)); + + atf_utils_create_file(SOURCE_FILE ".full", "%s", pattern); + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + fd2 = open(SOURCE_FILE ".full", O_RDONLY); + ATF_REQUIRE_MSG(fd2 != -1, "open failed: %s", strerror(errno)); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, + strlen(pattern)); + _exit(0); + } else + (void)close(server_sock); + + error = sendfile(fd, client_sock, offset, nbytes, &hdtr, + NULL, SF_FLAGS(0, 0)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile testcase #%d failed: %s", + i, strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd2, offset, nbytes); + + (void)close(fd); + (void)close(fd2); + free(pattern); + pattern = NULL; + } +} + +ATF_TC(hdtr_positive_v4); +ATF_TC_HEAD(hdtr_positive_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive hdtr functionality (IPv4)"); +} +ATF_TC_BODY(hdtr_positive_v4, tc) +{ + + hdtr_positive_test(AF_INET); +} + +ATF_TC(hdtr_positive_v6); +ATF_TC_HEAD(hdtr_positive_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive hdtr functionality (IPv6)"); +} +ATF_TC_BODY(hdtr_positive_v6, tc) +{ + + hdtr_positive_test(AF_INET); +} + +static void +hdtr_negative_bad_pointers_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + struct sf_hdtr *hdtr1, hdtr2, hdtr3; + + port = generate_random_port(__LINE__ + domain); + + hdtr1 = (struct sf_hdtr*)-1; + + memset(&hdtr2, 0, sizeof(hdtr2)); + hdtr2.hdr_cnt = 1; + hdtr2.headers = (struct iovec*)-1; + + memset(&hdtr3, 0, sizeof(hdtr3)); + hdtr3.trl_cnt = 1; + hdtr3.trailers = (struct iovec*)-1; + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + error = sendfile(fd, client_sock, 0, 0, hdtr1, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + error = sendfile(fd, client_sock, 0, 0, &hdtr2, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + error = sendfile(fd, client_sock, 0, 0, &hdtr3, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(hdtr_negative_bad_pointers_v4); +ATF_TC_HEAD(hdtr_negative_bad_pointers_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that bad pointers for hdtr storage result in EFAULT (IPv4)"); +} +ATF_TC_BODY(hdtr_negative_bad_pointers_v4, tc) +{ + + hdtr_negative_bad_pointers_test(AF_INET); +} + +ATF_TC(hdtr_negative_bad_pointers_v6); +ATF_TC_HEAD(hdtr_negative_bad_pointers_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that bad pointers for hdtr storage result in EFAULT (IPv6)"); +} +ATF_TC_BODY(hdtr_negative_bad_pointers_v6, tc) +{ + + hdtr_negative_bad_pointers_test(AF_INET6); +} + +static void +offset_negative_value_less_than_zero_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, -1, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EINVAL, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(offset_negative_value_less_than_zero_v4); +ATF_TC_HEAD(offset_negative_value_less_than_zero_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that a negative offset results in EINVAL (IPv4)"); +} +ATF_TC_BODY(offset_negative_value_less_than_zero_v4, tc) +{ + + offset_negative_value_less_than_zero_test(AF_INET); +} + +ATF_TC(offset_negative_value_less_than_zero_v6); +ATF_TC_HEAD(offset_negative_value_less_than_zero_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that a negative offset results in EINVAL (IPv6)"); +} +ATF_TC_BODY(offset_negative_value_less_than_zero_v6, tc) +{ + + offset_negative_value_less_than_zero_test(AF_INET6); +} + +static void +sbytes_positive_test(int domain) +{ + size_t pattern_size = strlen(DETERMINISTIC_PATTERN); + off_t sbytes; + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, 0, 0, NULL, &sbytes, SF_FLAGS(0, 0)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile failed: %s", strerror(errno)); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); + + ATF_CHECK_EQ_MSG(pattern_size, sbytes, + "the value returned by sbytes does not match the expected pattern " + "size"); +} + +ATF_TC(sbytes_positive_v4); +ATF_TC_HEAD(sbytes_positive_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive `sbytes` functionality (IPv4)"); +} +ATF_TC_BODY(sbytes_positive_v4, tc) +{ + + sbytes_positive_test(AF_INET); +} + +ATF_TC(sbytes_positive_v6); +ATF_TC_HEAD(sbytes_positive_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive `sbytes` functionality (IPv6)"); +} +ATF_TC_BODY(sbytes_positive_v6, tc) +{ + + sbytes_positive_test(AF_INET6); +} + +static void +sbytes_negative_test(int domain) +{ + off_t *sbytes_p = (off_t*)-1; + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + atf_tc_expect_fail( + "bug 232210: EFAULT assert fails because copyout(9) call is not checked"); + + error = sendfile(fd, client_sock, 0, 0, NULL, sbytes_p, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EFAULT, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(sbytes_negative_v4); +ATF_TC_HEAD(sbytes_negative_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify negative `sbytes` functionality (IPv4)"); +} +ATF_TC_BODY(sbytes_negative_v4, tc) +{ + + sbytes_negative_test(AF_INET); +} + +ATF_TC(sbytes_negative_v6); +ATF_TC_HEAD(sbytes_negative_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify negative `sbytes` functionality (IPv6)"); +} +ATF_TC_BODY(sbytes_negative_v6, tc) +{ + + sbytes_negative_test(AF_INET6); +} + +static void +s_negative_not_connected_socket_test(int domain) +{ + int client_sock, error, fd, port; + + port = generate_random_port(__LINE__ + domain); + client_sock = setup_tcp_server(domain, port); + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(ENOTCONN, error == -1); + + (void)close(fd); + (void)close(client_sock); +} + +ATF_TC(s_negative_not_connected_socket_v4); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 23 22:18:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 870EA14B4255; Wed, 23 Jan 2019 22:18:24 +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 2D7B28DCEE; Wed, 23 Jan 2019 22:18:24 +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 1FEA01EF45; Wed, 23 Jan 2019 22:18:24 +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 x0NMIN7V051614; Wed, 23 Jan 2019 22:18:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NMIN0e051612; Wed, 23 Jan 2019 22:18:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232218.x0NMIN0e051612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 22:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343363 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 343363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D7B28DCEE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:18:24 -0000 Author: markj Date: Wed Jan 23 22:18:23 2019 New Revision: 343363 URL: https://svnweb.freebsd.org/changeset/base/343363 Log: Fix an LLE lookup race. After the afdata read lock was converted to epoch(9), readers could observe a linked LLE and block on the LLE while a thread was unlinking the LLE. The writer would then release the lock and schedule the LLE for deferred free, allowing readers to continue and potentially schedule the LLE timer. By the point the timer fires, the structure is freed, typically resulting in a crash in the callout subsystem. Fix the problem by modifying the lookup path to check for the LLE_LINKED flag upon acquiring the LLE lock. If it's not set, the lookup fails. PR: 234296 Reviewed by: bz Tested by: sbruno, Victor , Mike Andrews MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18906 Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 23 22:00:17 2019 (r343362) +++ head/sys/netinet/in.c Wed Jan 23 22:18:23 2019 (r343363) @@ -1399,6 +1399,17 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co else LLE_RLOCK(lle); + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jan 23 22:00:17 2019 (r343362) +++ head/sys/netinet6/in6.c Wed Jan 23 22:18:23 2019 (r343363) @@ -2342,6 +2342,18 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, LLE_WLOCK(lle); else LLE_RLOCK(lle); + + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } From owner-svn-src-all@freebsd.org Wed Jan 23 22:19:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6FA14B434C; Wed, 23 Jan 2019 22:19:50 +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 330B38DEC3; Wed, 23 Jan 2019 22:19:50 +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 2533B1EF6C; Wed, 23 Jan 2019 22:19:50 +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 x0NMJoCd051730; Wed, 23 Jan 2019 22:19:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NMJnCa051729; Wed, 23 Jan 2019 22:19:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232219.x0NMJnCa051729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 22:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343364 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 343364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 330B38DEC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:19:50 -0000 Author: markj Date: Wed Jan 23 22:19:49 2019 New Revision: 343364 URL: https://svnweb.freebsd.org/changeset/base/343364 Log: Style. Reviewed by: bz MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 23 22:18:23 2019 (r343363) +++ head/sys/netinet/in.c Wed Jan 23 22:19:49 2019 (r343364) @@ -1382,15 +1382,13 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - lle = in_lltable_find_dst(llt, sin->sin_addr); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); + lle = in_lltable_find_dst(llt, sin->sin_addr); if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jan 23 22:18:23 2019 (r343363) +++ head/sys/netinet6/in6.c Wed Jan 23 22:19:49 2019 (r343364) @@ -2325,16 +2325,13 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); - if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); From owner-svn-src-all@freebsd.org Wed Jan 23 23:06:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A20A14B50BA; Wed, 23 Jan 2019 23:06:40 +0000 (UTC) (envelope-from ngie@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 C3E398F6D8; Wed, 23 Jan 2019 23:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B77671F802; Wed, 23 Jan 2019 23:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NN6dHN077570; Wed, 23 Jan 2019 23:06:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NN6dJ0077569; Wed, 23 Jan 2019 23:06:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232306.x0NN6dJ0077569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343365 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3E398F6D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:06:40 -0000 Author: ngie Date: Wed Jan 23 23:06:39 2019 New Revision: 343365 URL: https://svnweb.freebsd.org/changeset/base/343365 Log: Unbreak the gcc build with sendfile_test after r343362 gcc 8.x is more pedantic than clang 7.x with format strings and the tests passed `void*` variables while supplying `%s` (which is technically incorrect). Make the affected `void*` variables use `char*` storage instead to address this issue, as the compiler will upcast the values to `char*`. MFC after: 1 month MFC with: r343362 Approved by: emaste (mentor; implicit) Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D18934 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 22:19:49 2019 (r343364) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:06:39 2019 (r343365) @@ -195,7 +195,7 @@ setup_server(int domain, int type, int port) static void server_cat(const char *dest_filename, int server_sock, size_t len) { - void *buffer; + char *buffer; int recv_sock; ssize_t received_bytes; @@ -268,7 +268,7 @@ static void verify_source_and_dest(const char* dest_filename, int src_fd, off_t offset, size_t nbytes) { - void *dest_pointer, *src_pointer; + char *dest_pointer, *src_pointer; off_t dest_file_size, src_file_size; size_t length; int dest_fd; @@ -384,7 +384,7 @@ ATF_TC_BODY(fd_positive_file_v6, tc) static void fd_positive_shm_test(int domain) { - void *shm_pointer; + char *shm_pointer; off_t offset; size_t nbytes, pattern_size; pid_t server_pid; @@ -687,9 +687,9 @@ hdtr_positive_test(int domain) client_sock = setup_tcp_client(domain, port); rc = asprintf(&pattern, "%s%s%s", - testcases[i].include_headers ? headers[0].iov_base : "", + testcases[i].include_headers ? (char *)headers[0].iov_base : "", DETERMINISTIC_PATTERN, - testcases[i].include_trailers ? trailers[0].iov_base : ""); + testcases[i].include_trailers ? (char *)trailers[0].iov_base : ""); ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno)); atf_utils_create_file(SOURCE_FILE ".full", "%s", pattern); From owner-svn-src-all@freebsd.org Wed Jan 23 23:25:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A98214B5752; Wed, 23 Jan 2019 23:25:43 +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 3985C681E8; Wed, 23 Jan 2019 23:25:43 +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 267481FB88; Wed, 23 Jan 2019 23:25:43 +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 x0NNPhlS087978; Wed, 23 Jan 2019 23:25:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNPgNE087977; Wed, 23 Jan 2019 23:25:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901232325.x0NNPgNE087977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 23 Jan 2019 23:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343366 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 343366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3985C681E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:25:43 -0000 Author: brooks Date: Wed Jan 23 23:25:42 2019 New Revision: 343366 URL: https://svnweb.freebsd.org/changeset/base/343366 Log: Remove documentation for the nonexistant cred_update_thread(9). This was a tangential change submitted as part of D18930. Submitted by: jack@gandi.net Modified: head/share/man/man9/Makefile head/share/man/man9/ucred.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Jan 23 23:06:39 2019 (r343365) +++ head/share/man/man9/Makefile Wed Jan 23 23:25:42 2019 (r343366) @@ -2095,8 +2095,7 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_stop.9 \ timeout.9 callout_when.9 \ timeout.9 untimeout.9 -MLINKS+=ucred.9 cred_update_thread.9 \ - ucred.9 crcopy.9 \ +MLINKS+=ucred.9 crcopy.9 \ ucred.9 crcopysafe.9 \ ucred.9 crdup.9 \ ucred.9 crfree.9 \ Modified: head/share/man/man9/ucred.9 ============================================================================== --- head/share/man/man9/ucred.9 Wed Jan 23 23:06:39 2019 (r343365) +++ head/share/man/man9/ucred.9 Wed Jan 23 23:25:42 2019 (r343366) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2017 +.Dd January 23, 2019 .Dt UCRED 9 .Os .Sh NAME @@ -36,8 +36,7 @@ .Nm crfree , .Nm crcopy , .Nm crdup , -.Nm cru2x , -.Nm cred_update_thread +.Nm cru2x .Nd "functions related to user credentials" .Sh SYNOPSIS .In sys/param.h @@ -58,8 +57,6 @@ .Fn crsetgroups "struct ucred *cr" "int ngrp" "gid_t *groups" .Ft void .Fn cru2x "struct ucred *cr" "struct xucred *xcr" -.Ft void -.Fn cred_update_thread "struct thread *td" .Sh DESCRIPTION The .Nm @@ -147,11 +144,6 @@ the former (e.g., .Va cr_version ) . .Pp -The -.Fn cred_update_thread -function sets the credentials of -.Fa td -to that of its process, freeing its old credential if required. .Sh RETURN VALUES .Fn crget , .Fn crhold , From owner-svn-src-all@freebsd.org Wed Jan 23 23:30:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8265814B58E1; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@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 2ADF5684A0; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E7431FBD0; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NNUuJ3088964; Wed, 23 Jan 2019 23:30:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNUtDI088963; Wed, 23 Jan 2019 23:30:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232330.x0NNUtDI088963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343367 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2ADF5684A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:30:56 -0000 Author: ngie Date: Wed Jan 23 23:30:55 2019 New Revision: 343367 URL: https://svnweb.freebsd.org/changeset/base/343367 Log: Unbreak the build on architectures where size_t isn't synonymous with uintmax_t I should have used `%zu` instead of `%ju` with `size_t` types. MFC after: 1 month MFC with: r343362, r343365 Approved by: emaste (mentor; implicit) Reviewed by: asomers Pointyhat to: ngie Submitted by: asomers Differential Revision: https://reviews.freebsd.org/D18935 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:25:42 2019 (r343366) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:30:55 2019 (r343367) @@ -289,8 +289,8 @@ verify_source_and_dest(const char* dest_filename, int length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; ATF_REQUIRE_EQ_MSG(dest_file_size, length, - "number of bytes written out to %s (%ju) doesn't match the " - "expected number of bytes (%ju)", dest_filename, dest_file_size, + "number of bytes written out to %s (%zu) doesn't match the " + "expected number of bytes (%zu)", dest_filename, dest_file_size, length); ATF_REQUIRE_EQ_MSG(0, lseek(src_fd, offset, SEEK_SET), From owner-svn-src-all@freebsd.org Wed Jan 23 23:34:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2DEB14B5B00; Wed, 23 Jan 2019 23:34:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDCD69C90; Wed, 23 Jan 2019 23:34:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62a.google.com with SMTP id t13so1927383ply.13; Wed, 23 Jan 2019 15:34:14 -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=+PhVpyd8AnSzQI2fm9DLqRURgLFfgtAtoMvxIggaWBo=; b=Ej7U4G7JlzjjxQFhHA1b0LJb8/TBYFs2gm9SeGmfgzDHPV+Pl87uFit4zgbR1u9N29 lAYpcwYpFomEkWynifl5KgHFQx40u2fMqCpRJn2RGA94XFhj5ffefVwHrzVEjvbzhe3j vEMMrYeYMdSvLDFVC+iEMGgI8MnMXDkcwFxrxtpKXHGTM13PTpNNPgGejBd7fAEAf22G G17Gc4waDArisGoqZc2Dyz69IhTgUbUjfHOeiWrTQjh/ZBheR67RysJTYls6R6aYzfTe 3UsqBO1Pq0Q8oHCaFnL0Zju+XkIXb3wXN5z86o2DvyRcE61L5zF/7gCurx0PXRjxknMz zGbA== 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=+PhVpyd8AnSzQI2fm9DLqRURgLFfgtAtoMvxIggaWBo=; b=aqpQV7XOdM7jpaH+2q+Jhph2PuJWw79xg+wbppYW+4x59uvBOKK67MRmv3ojhI6E3l Ze/oZebvAI0XZlNBc+Wftuc80vhJ/msvpOSKDFDfmWYyeDNbEU0YcyfqrQsP4yWGQVb2 ycPft8RkaUsBoRIqttu5ggWcAwT9ah4MIyLgowvVTxdzVdN3obrQkIn/XcLIvMLPc5aR 2Mj1spBzdPIqOflMkkMMXTd6RABKXESFSUHmQ6ooK98HAKTXMHEl/Gr95ndRfn+0p2Kv JJWtd8hLOlhF03d6VGwjOYIS+O7feBuzOtudLfVbm33CnAbR3s5Y+/ZEQN6abURVRms1 tNNg== X-Gm-Message-State: AJcUukfABoFxWkjeKYi6mtsTTXPpnCnKK/+hoH7pdeayaruIpddTXSdF RKAXWpHXBTt+9M82+R0nQcaUAF+s X-Google-Smtp-Source: ALg8bN7eXWJbnfOVx2wDtnUrUTU9Zke+33bZr9S4mYdIkCc+4TycMI13fPhmWc3ZxicwOkSssuSP+w== X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr4263897plo.316.1548286453066; Wed, 23 Jan 2019 15:34:13 -0800 (PST) Received: from [192.168.2.101] (c-24-56-255-165.customer.broadstripe.net. [24.56.255.165]) by smtp.gmail.com with ESMTPSA id v9sm27608948pfg.144.2019.01.23.15.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 15:34:12 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r343367 - head/lib/libc/tests/sys Date: Wed, 23 Jan 2019 15:34:11 -0800 In-Reply-To: <201901232330.x0NNUtDI088963@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Enji Cooper References: <201901232330.x0NNUtDI088963@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 6BDCD69C90 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:34:15 -0000 > On Jan 23, 2019, at 3:30 PM, Enji Cooper wrote: >=20 > Author: ngie > Date: Wed Jan 23 23:30:55 2019 > New Revision: 343367 > URL: https://svnweb.freebsd.org/changeset/base/343367 >=20 > Log: > Unbreak the build on architectures where size_t isn't synonymous with = uintmax_t >=20 > I should have used `%zu` instead of `%ju` with `size_t` types. = https://reviews.freebsd.org/file/data/2cgpmriicvbknz4wmobq/PHID-FILE-boydx= wdwmlcyuxwurofm/bart-simpson-run-make-universe.gif = (caption: Bart = Simpson against chalkboard with 'I will run "make universe=E2=80=9D = before committing to src=E2=80=99 written repeatedly on the chalkboard). -Enji= From owner-svn-src-all@freebsd.org Wed Jan 23 23:48:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D6D14B6084; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@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 80F0C6A6E3; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74E101FF21; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NNmvLN098256; Wed, 23 Jan 2019 23:48:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNmvO5098255; Wed, 23 Jan 2019 23:48:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232348.x0NNmvO5098255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343368 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80F0C6A6E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:48:58 -0000 Author: ngie Date: Wed Jan 23 23:48:57 2019 New Revision: 343368 URL: https://svnweb.freebsd.org/changeset/base/343368 Log: Fix up r343367 I should have only changed the format qualifier with the `size_t` value, `length`, not the other [`off_t`] value, `dest_file_size`. MFC after: 1 month MFC with: r343362, r343365, r343367 Approved by: emaste (mentor; implicit) Reported by: gcc 8.x Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:30:55 2019 (r343367) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:48:57 2019 (r343368) @@ -289,7 +289,7 @@ verify_source_and_dest(const char* dest_filename, int length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; ATF_REQUIRE_EQ_MSG(dest_file_size, length, - "number of bytes written out to %s (%zu) doesn't match the " + "number of bytes written out to %s (%ju) doesn't match the " "expected number of bytes (%zu)", dest_filename, dest_file_size, length); From owner-svn-src-all@freebsd.org Wed Jan 23 23:52:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D91F214B6266; Wed, 23 Jan 2019 23:51:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5265F6AAC1; Wed, 23 Jan 2019 23:51:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x430.google.com with SMTP id b85so2008316pfc.3; Wed, 23 Jan 2019 15:51:59 -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=2hejBC73BbVZejQDbUVB6KS6N8Bnn7jx592PNcQ22hU=; b=RU2WSmWTDd3nfbt5ZwgDw74G6qC0o5tkEjdFTxUxFpLDdII4RaUiRsSLaIYODsZpTX 9uXc6CRamir71TLByI1LT26S0mH2LqMcpABA9d0EguJbjbows7T7Ppgzw7YQOxHD+5EC QuF5yif6fPbhAvI4bGJlK4tghsGUYJrSNjqYmLu7I9VmkZmseiq6ADR8YzPStVcBoTRr We96UrDyamEY/IfVpiHE3L6leEsK/JIEHbFL3fPlDjehGe2ezepaq/ljRcr4Th6HQFcB B7YQUxYB3Vm+KImtcOBYbx9ziEhN7gMlAFNDhhfhV2P8O0KFEz8E4mieTpYPl7x6Lkbc sT2g== 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=2hejBC73BbVZejQDbUVB6KS6N8Bnn7jx592PNcQ22hU=; b=RkadDMBLRupOoEfgIs5I9jfCF73PAbgFRs0KVyP1O5BAz20jTMloP02efkB4xC5vIZ boSR+1pqIn0Rp83gpzAPp2OTknIqF2txMbHVQHc5TgkgMpZ67gj1FlOIbgt+8rbjNyYL NjWETsaYDF453ofExyjUlFe5K22BWNggooJUDu9IIPhbE6kmpKtJZbVeDFB66zY4CzDM A/k7oVspjLI0I7q1RCRxeIVnJ2jGYlDOvQK5duCH6QL/NwQfh4bmQqHpGAT69tTx5aOJ TtEptK2He8UvgLrUpYy6ktCVvTHzGayc+BtpZchT8390ZItPAYArF6Y4cPbxCx20i7vg 70LA== X-Gm-Message-State: AJcUukeceQ5k/grni6I10Hijh49fx4alP3Or+hnaaSITL4emAAA5+5GF NoHGMD/pr7dF5T7GZ1BEhVFE0ne3 X-Google-Smtp-Source: ALg8bN6pNTAKCmeFcGdK0M0j0/db5ByWKZCFreMva9jfDR2ArmOvza4d57BjA3oohUNK0mMPvW3PcA== X-Received: by 2002:a63:955a:: with SMTP id t26mr3875745pgn.449.1548287517831; Wed, 23 Jan 2019 15:51:57 -0800 (PST) Received: from [192.168.2.101] (c-24-56-255-165.customer.broadstripe.net. [24.56.255.165]) by smtp.gmail.com with ESMTPSA id w88sm45512002pfk.11.2019.01.23.15.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 15:51:57 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r343368 - head/lib/libc/tests/sys From: Enji Cooper In-Reply-To: <201901232348.x0NNmvO5098255@repo.freebsd.org> Date: Wed, 23 Jan 2019 15:51:56 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201901232348.x0NNmvO5098255@repo.freebsd.org> To: Enji Cooper X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 5265F6AAC1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:52:00 -0000 > On Jan 23, 2019, at 3:48 PM, Enji Cooper wrote: >=20 > Author: ngie > Date: Wed Jan 23 23:48:57 2019 > New Revision: 343368 > URL: https://svnweb.freebsd.org/changeset/base/343368 >=20 > Log: > Fix up r343367 >=20 > I should have only changed the format qualifier with the `size_t` = value, > `length`, not the other [`off_t`] value, `dest_file_size`. >=20 > MFC after: 1 month > MFC with: r343362, r343365, r343367 > Approved by: emaste (mentor; implicit) > Reported by: gcc 8.x Lessons to learn from this: is, again, always run =E2=80=9Cmake = universe=E2=80=9D beforehand on the releng machines. I swore I did this = before, but I can=E2=80=99t remember (and I didn=E2=80=99t run it before = committing the code). Trying to figure out a reasonable way to use my GitHub fork and = do work with svn =E2=80=94 the workflow is extremely error prone right = now (this is just one symptom of that issue). Thank you for your patience, everyone. It=E2=80=99s been far too = long since I=E2=80=99ve earned pointyhats :/. Cheers, -Enji= From owner-svn-src-all@freebsd.org Thu Jan 24 01:03:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA1514B8059; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@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 51A346DD4A; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 42A8D20CC7; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O132q1041730; Thu, 24 Jan 2019 01:03:02 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O130xi041721; Thu, 24 Jan 2019 01:03:00 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901240103.x0O130xi041721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 24 Jan 2019 01:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343369 - in head/sys/dev: e1000 ixgbe ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 ixgbe ixl X-SVN-Commit-Revision: 343369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51A346DD4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:03:03 -0000 Author: erj Date: Thu Jan 24 01:03:00 2019 New Revision: 343369 URL: https://svnweb.freebsd.org/changeset/base/343369 Log: intel iflib drivers: correct initialization of tx_cidx_processed From Jake: In r341156 ("Fix first-packet completion", 2018-11-28) a hack to work around a delta calculation determining how many descriptors were used was added to ixl_isc_tx_credits_update_dwb. The same fix was also applied to the em and igb drivers in r340310, and to ix in r341156. The hack checked the case where prev and cur were equal, and then added one. This works, because by the time we do the delta check, we already know there is at least one packet available, so the delta should be at least one. However, it's not a complete fix, and as indicated by the comment is really a hack to work around the real bug. The real problem is that the first time that we transmit a packet, tx_cidx_processed will be set to point to the start of the ring. Ultimately, the credits_update function expects it to point to the *last* descriptor that was processed. Since we haven't yet processed any descriptors, pointing it to 0 results in this incorrect calculation. Fix the initialization code to have it point to the end of the ring instead. One way to think about this, is that we are setting the value to be one prior to the first available descriptor. Doing so, corrects the delta calculation in all cases. The original fix only works if the first packet has exactly one descriptor. Otherwise, we will report 1 less than the correct value. As part of this fix, also update the MPASS assertions to match the real expectations. First, ensure that prev is not equal to cur, since this should never happen. Second, remove the assertion about prev==0 || delta != 0. It looks like that originated from when the em driver was converted to iflib. It seems like it was supposed to ensure that delta was non-zero. However, because we originally returned 0 delta for the first calculation, the "prev == 0" was tacked on. Instead, replace this with a check that delta is greater than zero, after the correction necessary when the ring pointers wrap around. This new solution should fix the same bug as r341156 did, but in a more robust way. Submitted by: Jacob Keller Reviewed by: shurd@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18545 Modified: head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/igb_txrx.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/em_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -457,16 +457,11 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, b prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); DPRINTF(iflib_get_dev(adapter->ctx), "%s: cidx_processed=%u cur=%u clear=%d delta=%d\n", __FUNCTION__, prev, cur, clear, delta); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/if_em.c Thu Jan 24 01:03:00 2019 (r343369) @@ -1208,6 +1208,7 @@ static void em_if_init(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); + if_softc_ctx_t scctx = adapter->shared; struct ifnet *ifp = iflib_get_ifp(ctx); struct em_tx_queue *tx_que; int i; @@ -1240,7 +1241,14 @@ em_if_init(if_ctx_t ctx) for (i = 0, tx_que = adapter->tx_queues; i < adapter->tx_num_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; } /* Setup VLAN support, basic and offload if available */ Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/igb_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -332,16 +332,11 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); processed += delta; prev = cur; Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 24 01:03:00 2019 (r343369) @@ -806,7 +806,8 @@ ixgbe_initialize_transmit_units(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) txr->tx_rsq[k] = QIDX_INVALID; Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 24 01:03:00 2019 (r343369) @@ -1228,7 +1228,13 @@ ixv_initialize_transmit_units(if_ctx_t ctx) /* Set Tx Tail register */ txr->tail = IXGBE_VFTDT(j); - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) txr->tx_rsq[k] = QIDX_INVALID; Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/ix_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -296,11 +296,11 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); processed += delta; prev = cur; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixl/ixl_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -515,16 +515,11 @@ ixl_isc_txd_credits_update_dwb(void *arg, uint16_t txq prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); #if 0 device_printf(iflib_get_dev(vsi->ctx), "%s: (q%d) cidx_processed=%u cur=%u clear=%d delta=%d\n", @@ -793,8 +788,15 @@ ixl_init_tx_rsqs(struct ixl_vsi *vsi) for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; + for (j = 0; j < scctx->isc_ntxd[0]; j++) txr->tx_rsq[j] = QIDX_INVALID; } @@ -803,13 +805,14 @@ ixl_init_tx_rsqs(struct ixl_vsi *vsi) void ixl_init_tx_cidx(struct ixl_vsi *vsi) { + if_softc_ctx_t scctx = vsi->shared; struct ixl_tx_queue *tx_que; int i; for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_cidx_processed = 0; + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; } } From owner-svn-src-all@freebsd.org Thu Jan 24 01:03:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D624814B807C; Thu, 24 Jan 2019 01:03:15 +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 7E2D36DE49; Thu, 24 Jan 2019 01:03:15 +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 5054020CC8; Thu, 24 Jan 2019 01:03:13 +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 x0O13DtC041779; Thu, 24 Jan 2019 01:03:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O13DXA041778; Thu, 24 Jan 2019 01:03:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901240103.x0O13DXA041778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 24 Jan 2019 01:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343370 - stable/12/sys/dev/ocs_fc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/ocs_fc X-SVN-Commit-Revision: 343370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E2D36DE49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:03:16 -0000 Author: markj Date: Thu Jan 24 01:03:12 2019 New Revision: 343370 URL: https://svnweb.freebsd.org/changeset/base/343370 Log: MFC r343348: ocs_fc: Ensure that we zero-initialize memory before copying it out. admbugs: 765 Modified: stable/12/sys/dev/ocs_fc/ocs_mgmt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_mgmt.c Thu Jan 24 01:03:00 2019 (r343369) +++ stable/12/sys/dev/ocs_fc/ocs_mgmt.c Thu Jan 24 01:03:12 2019 (r343370) @@ -851,6 +851,7 @@ ocs_mgmt_firmware_write(ocs_t *ocs, char *name, void * if (arg_out_length > sizeof(status_str)) { arg_out_length = sizeof(status_str); } + ocs_memset(status_str, 0, sizeof(status_str)); ocs_snprintf(status_str, arg_out_length, "%d", change_status); if (ocs_copy_to_user(arg_out, status_str, arg_out_length)) { ocs_log_test(ocs, "copy to user failed for change_status\n"); From owner-svn-src-all@freebsd.org Thu Jan 24 01:04:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF98C14B8160; Thu, 24 Jan 2019 01:04:24 +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 3E2C36E040; Thu, 24 Jan 2019 01:04:24 +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 E880120CDF; Thu, 24 Jan 2019 01:04:23 +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 x0O14NmX041866; Thu, 24 Jan 2019 01:04:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O14Ntd041865; Thu, 24 Jan 2019 01:04:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901240104.x0O14Ntd041865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 24 Jan 2019 01:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343371 - stable/11/sys/dev/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/ocs_fc X-SVN-Commit-Revision: 343371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E2C36E040 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:04:25 -0000 Author: markj Date: Thu Jan 24 01:04:23 2019 New Revision: 343371 URL: https://svnweb.freebsd.org/changeset/base/343371 Log: MFC r343348: ocs_fc: Ensure that we zero-initialize memory before copying it out. admbugs: 765 Modified: stable/11/sys/dev/ocs_fc/ocs_mgmt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_mgmt.c Thu Jan 24 01:03:12 2019 (r343370) +++ stable/11/sys/dev/ocs_fc/ocs_mgmt.c Thu Jan 24 01:04:23 2019 (r343371) @@ -851,6 +851,7 @@ ocs_mgmt_firmware_write(ocs_t *ocs, char *name, void * if (arg_out_length > sizeof(status_str)) { arg_out_length = sizeof(status_str); } + ocs_memset(status_str, 0, sizeof(status_str)); ocs_snprintf(status_str, arg_out_length, "%d", change_status); if (ocs_copy_to_user(arg_out, status_str, arg_out_length)) { ocs_log_test(ocs, "copy to user failed for change_status\n"); From owner-svn-src-all@freebsd.org Thu Jan 24 01:08:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7902414B82A9; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@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 1AA476E29B; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0A56020CE5; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O18bEX042078; Thu, 24 Jan 2019 01:08:37 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O18bqL042077; Thu, 24 Jan 2019 01:08:37 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901240108.x0O18bqL042077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 24 Jan 2019 01:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343372 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 343372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AA476E29B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:08:38 -0000 Author: erj Date: Thu Jan 24 01:08:37 2019 New Revision: 343372 URL: https://svnweb.freebsd.org/changeset/base/343372 Log: ixl(4): Fix handling data passed with ioctl from NVM update tool From Krzysztof: Ensure that the entire data buffer passed from the NVM update tool is copied in to kernel space and copied back out to user space using copyin() and copyout(). PR: 234104 Submitted by: Krzysztof Galazka Reported by: Finn MFC after: 5 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18817 Modified: head/sys/dev/ixl/ixl_pf_main.c Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Thu Jan 24 01:04:23 2019 (r343371) +++ head/sys/dev/ixl/ixl_pf_main.c Thu Jan 24 01:08:37 2019 (r343372) @@ -3663,23 +3663,34 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, struct ifdrv struct i40e_nvm_access *nvma; device_t dev = pf->dev; enum i40e_status_code status = 0; - int perrno; + size_t nvma_size, ifd_len, exp_len; + int err, perrno; DEBUGFUNC("ixl_handle_nvmupd_cmd"); /* Sanity checks */ - if (ifd->ifd_len < sizeof(struct i40e_nvm_access) || + nvma_size = sizeof(struct i40e_nvm_access); + ifd_len = ifd->ifd_len; + + if (ifd_len < nvma_size || ifd->ifd_data == NULL) { device_printf(dev, "%s: incorrect ifdrv length or data pointer\n", __func__); device_printf(dev, "%s: ifdrv length: %zu, sizeof(struct i40e_nvm_access): %zu\n", - __func__, ifd->ifd_len, sizeof(struct i40e_nvm_access)); + __func__, ifd_len, nvma_size); device_printf(dev, "%s: data pointer: %p\n", __func__, ifd->ifd_data); return (EINVAL); } - nvma = (struct i40e_nvm_access *)ifd->ifd_data; + nvma = malloc(ifd_len, M_DEVBUF, M_WAITOK); + err = copyin(ifd->ifd_data, nvma, ifd_len); + if (err) { + device_printf(dev, "%s: Cannot get request from user space\n", + __func__); + free(nvma, M_DEVBUF); + return (err); + } if (pf->dbg_mask & IXL_DBG_NVMUPD) ixl_print_nvm_cmd(dev, nvma); @@ -3693,13 +3704,49 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, struct ifdrv } } - if (!(pf->state & IXL_PF_STATE_ADAPTER_RESETTING)) { - // TODO: Might need a different lock here - // IXL_PF_LOCK(pf); - status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); - // IXL_PF_UNLOCK(pf); - } else { - perrno = -EBUSY; + if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) { + free(nvma, M_DEVBUF); + return (-EBUSY); + } + + if (nvma->data_size < 1 || nvma->data_size > 4096) { + device_printf(dev, "%s: invalid request, data size not in supported range\n", + __func__); + free(nvma, M_DEVBUF); + return (EINVAL); + } + + /* + * Older versions of the NVM update tool don't set ifd_len to the size + * of the entire buffer passed to the ioctl. Check the data_size field + * in the contained i40e_nvm_access struct and ensure everything is + * copied in from userspace. + */ + exp_len = nvma_size + nvma->data_size - 1; /* One byte is kept in struct */ + + if (ifd_len < exp_len) { + ifd_len = exp_len; + nvma = realloc(nvma, ifd_len, M_DEVBUF, M_WAITOK); + err = copyin(ifd->ifd_data, nvma, ifd_len); + if (err) { + device_printf(dev, "%s: Cannot get request from user space\n", + __func__); + free(nvma, M_DEVBUF); + return (err); + } + } + + // TODO: Might need a different lock here + // IXL_PF_LOCK(pf); + status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); + // IXL_PF_UNLOCK(pf); + + err = copyout(nvma, ifd->ifd_data, ifd_len); + free(nvma, M_DEVBUF); + if (err) { + device_printf(dev, "%s: Cannot return data to user space\n", + __func__); + return (err); } /* Let the nvmupdate report errors, show them only when debug is enabled */ From owner-svn-src-all@freebsd.org Thu Jan 24 03:41:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BFA14BFE4C; Thu, 24 Jan 2019 03:41:10 +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 4C30975560; Thu, 24 Jan 2019 03:41:10 +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 4071422AAC; Thu, 24 Jan 2019 03:41:10 +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 x0O3fAZn022112; Thu, 24 Jan 2019 03:41:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3f9jX022110; Thu, 24 Jan 2019 03:41:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240341.x0O3f9jX022110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343373 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C30975560 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:41:11 -0000 Author: kevans Date: Thu Jan 24 03:41:09 2019 New Revision: 343373 URL: https://svnweb.freebsd.org/changeset/base/343373 Log: if_iwm - Update firmware rs table, instead of indexing the table in tx cmds. * Rather than providing a non-zero index into the firmware RS table, we should always use index 0 and update the firmware RS table whenever our chosen tx rate for data-frames changes. * Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211 rate control (which is after we tell the tx status to the net80211 rate-control in iwm_mvm_rx_tx_cmd_single()). * Disregard frames transferred with a different tx rate than the currently selected rate for the rate-control calculations. This way we avoid counting management frames (which are sent at a slow, and fixed rate), as well as frames we added to the tx queue just before a new IWM_LQ_CMD update took effect. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (5d6b465e288ac5b52d7115688d4e6516acbbea1c) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 01:08:37 2019 (r343372) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:09 2019 (r343373) @@ -353,7 +353,9 @@ static int iwm_release(struct iwm_softc *, struct iwm_ static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, const uint8_t[IEEE80211_ADDR_LEN]); -static void iwm_setrates(struct iwm_softc *, struct iwm_node *); +static uint8_t iwm_rate_from_ucode_rate(uint32_t); +static int iwm_rate2ridx(struct iwm_softc *, uint8_t); +static void iwm_setrates(struct iwm_softc *, struct iwm_node *, int); static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); @@ -3317,7 +3319,11 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct struct iwm_mvm_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; int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; + int new_rate, cur_rate = vap->iv_bss->ni_txrate; + boolean_t rate_matched; + uint8_t tx_resp_rate; KASSERT(tx_resp->frame_count == 1, ("too many frames")); @@ -3333,6 +3339,17 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct le32toh(tx_resp->initial_rate), (int) le16toh(tx_resp->wireless_media_time)); + tx_resp_rate = iwm_rate_from_ucode_rate(le32toh(tx_resp->initial_rate)); + + /* For rate control, ignore frames sent at different initial rate */ + rate_matched = (tx_resp_rate != 0 && tx_resp_rate == cur_rate); + + if (tx_resp_rate != 0 && cur_rate != 0 && !rate_matched) { + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "tx_resp_rate doesn't match ni_txrate (tx_resp_rate=%u " + "ni_txrate=%d)\n", tx_resp_rate, cur_rate); + } + txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | IEEE80211_RATECTL_STATUS_LONG_RETRY; txs->short_retries = tx_resp->failure_rts; @@ -3356,8 +3373,19 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } else { txs->status = IEEE80211_RATECTL_TX_SUCCESS; } - ieee80211_ratectl_tx_complete(ni, txs); + if (rate_matched) { + ieee80211_ratectl_tx_complete(ni, txs); + + int rix = ieee80211_ratectl_rate(vap->iv_bss, NULL, 0); + new_rate = vap->iv_bss->ni_txrate; + 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); + } + } + return (txs->status != IEEE80211_RATECTL_TX_SUCCESS); } @@ -3482,38 +3510,7 @@ iwm_update_sched(struct iwm_softc *sc, int qid, int id } #endif -/* - * Take an 802.11 (non-n) rate, find the relevant rate - * table entry. return the index into in_ridx[]. - * - * The caller then uses that index back into in_ridx - * to figure out the rate index programmed /into/ - * the firmware for this given node. - */ static int -iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm_node *in, - uint8_t rate) -{ - int i; - uint8_t r; - - for (i = 0; i < nitems(in->in_ridx); i++) { - r = iwm_rates[in->in_ridx[i]].rate; - if (rate == r) - return (i); - } - - IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, - "%s: couldn't find an entry for rate=%d\n", - __func__, - rate); - - /* XXX Return the first */ - /* XXX TODO: have it return the /lowest/ */ - return (0); -} - -static int iwm_tx_rateidx_global_lookup(struct iwm_softc *sc, uint8_t rate) { int i; @@ -3565,22 +3562,15 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: FIXED_RATE (%d)\n", __func__, tp->ucastrate); } else { - int i; - /* for data frames, use RS table */ IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DATA\n", __func__); - /* XXX pass pktlen */ - (void) ieee80211_ratectl_rate(ni, NULL, 0); - i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); - ridx = in->in_ridx[i]; + ridx = iwm_rate2ridx(sc, ni->ni_txrate); + if (ridx == -1) + ridx = 0; /* This is the index into the programmed table */ - tx->initial_rate_index = i; + tx->initial_rate_index = 0; tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE); - - IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, - "%s: start with i=%d, txrate %d\n", - __func__, i, iwm_rates[ridx].rate); } IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, @@ -4165,6 +4155,19 @@ iwm_node_alloc(struct ieee80211vap *vap, const uint8_t M_NOWAIT | M_ZERO); } +static uint8_t +iwm_rate_from_ucode_rate(uint32_t rate_n_flags) +{ + uint8_t plcp = rate_n_flags & 0xff; + int i; + + for (i = 0; i <= IWM_RIDX_MAX; i++) { + if (iwm_rates[i].plcp == plcp) + return iwm_rates[i].rate; + } + return 0; +} + uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) { @@ -4180,15 +4183,36 @@ iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) return 0; } +static int +iwm_rate2ridx(struct iwm_softc *sc, uint8_t rate) +{ + int i; + + for (i = 0; i <= IWM_RIDX_MAX; i++) { + if (iwm_rates[i].rate == rate) + return i; + } + + device_printf(sc->sc_dev, + "%s: WARNING: device rate for %u not found!\n", + __func__, rate); + + return -1; +} + + static void -iwm_setrates(struct iwm_softc *sc, struct iwm_node *in) +iwm_setrates(struct iwm_softc *sc, struct iwm_node *in, int rix) { struct ieee80211_node *ni = &in->in_ni; struct iwm_lq_cmd *lq = &in->in_lq; - int nrates = ni->ni_rates.rs_nrates; + struct ieee80211_rateset *rs = &ni->ni_rates; + int nrates = rs->rs_nrates; int i, ridx, tab = 0; // int txant = 0; + KASSERT(rix >= 0 && rix < nrates, ("invalid rix")); + if (nrates > nitems(lq->rs_table)) { device_printf(sc->sc_dev, "%s: node supports %d rates, driver handles " @@ -4200,45 +4224,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in "%s: node supports 0 rates, odd!\n", __func__); return; } + nrates = imin(rix + 1, nrates); - /* - * XXX .. and most of iwm_node is not initialised explicitly; - * it's all just 0x0 passed to the firmware. - */ - - /* first figure out which rates we should support */ - /* XXX TODO: this isn't 11n aware /at all/ */ - memset(&in->in_ridx, -1, sizeof(in->in_ridx)); IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: nrates=%d\n", __func__, nrates); - /* - * Loop over nrates and populate in_ridx from the highest - * rate to the lowest rate. Remember, in_ridx[] has - * IEEE80211_RATE_MAXSIZE entries! - */ - for (i = 0; i < min(nrates, IEEE80211_RATE_MAXSIZE); i++) { - int rate = ni->ni_rates.rs_rates[(nrates - 1) - i] & IEEE80211_RATE_VAL; - - /* Map 802.11 rate to HW rate index. */ - for (ridx = 0; ridx <= IWM_RIDX_MAX; ridx++) - if (iwm_rates[ridx].rate == rate) - break; - if (ridx > IWM_RIDX_MAX) { - device_printf(sc->sc_dev, - "%s: WARNING: device rate for %d not found!\n", - __func__, rate); - } else { - IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, - "%s: rate: i: %d, rate=%d, ridx=%d\n", - __func__, - i, - rate, - ridx); - in->in_ridx[i] = ridx; - } - } - /* then construct a lq_cmd based on those */ memset(lq, 0, sizeof(*lq)); lq->sta_id = IWM_STATION_ID; @@ -4262,13 +4252,15 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in * Note that we add the rates in the highest rate first * (opposite of ni_rates). */ - /* - * XXX TODO: this should be looping over the min of nrates - * and LQ_MAX_RETRY_NUM. Sigh. - */ for (i = 0; i < nrates; i++) { + int rate = rs->rs_rates[rix - i] & IEEE80211_RATE_VAL; int nextant; + /* Map 802.11 rate to HW rate index. */ + ridx = iwm_rate2ridx(sc, rate); + if (ridx == -1) + continue; + #if 0 if (txant == 0) txant = iwm_mvm_get_valid_tx_ant(sc); @@ -4277,12 +4269,6 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #else nextant = iwm_mvm_get_valid_tx_ant(sc); #endif - /* - * Map the rate id into a rate index into - * our hardware table containing the - * configuration to use for this rate. - */ - ridx = in->in_ridx[i]; tab = iwm_rates[ridx].plcp; tab |= nextant << IWM_RATE_MCS_ANT_POS; if (IWM_RIDX_IS_CCK(ridx)) @@ -4474,7 +4460,8 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_enable_beacon_filter(sc, ivp); iwm_mvm_power_update_mac(sc); iwm_mvm_update_quotas(sc, ivp); - iwm_setrates(sc, in); + 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) { device_printf(sc->sc_dev, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 01:08:37 2019 (r343372) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:41:09 2019 (r343373) @@ -404,8 +404,6 @@ struct iwm_node { int in_assoc; struct iwm_lq_cmd in_lq; - - uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; }; #define IWM_NODE(_ni) ((struct iwm_node *)(_ni)) From owner-svn-src-all@freebsd.org Thu Jan 24 03:45:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0603614C01A2; Thu, 24 Jan 2019 03:45:26 +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 3952975F54; Thu, 24 Jan 2019 03:45:25 +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 2D95622C2E; Thu, 24 Jan 2019 03:45:25 +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 x0O3jPnS025794; Thu, 24 Jan 2019 03:45:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3jOMx025793; Thu, 24 Jan 2019 03:45:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240345.x0O3jOMx025793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343380 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3952975F54 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:45:26 -0000 Author: kevans Date: Thu Jan 24 03:45:24 2019 New Revision: 343380 URL: https://svnweb.freebsd.org/changeset/base/343380 Log: if_iwm - Add firmware API definitions for TX power commands. * While there remove unused IWM_UCODE_TLV_CAPA_LMAC_UPLOAD definition, which isn't defined in iwlwifi. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (fd4f9de8bc72ea961e50829b45b59d0549040b7d) Modified: head/sys/dev/iwm/if_iwm_config.h head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Thu Jan 24 03:44:48 2019 (r343379) +++ head/sys/dev/iwm/if_iwm_config.h Thu Jan 24 03:45:24 2019 (r343380) @@ -80,6 +80,8 @@ enum iwm_device_family { IWM_DEVICE_FAMILY_8000, }; +#define IWM_DEFAULT_MAX_TX_POWER 22 + /* Antenna presence definitions */ #define IWM_ANT_NONE 0x0 #define IWM_ANT_A (1 << 0) Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:48 2019 (r343379) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:45:24 2019 (r343380) @@ -702,8 +702,9 @@ enum iwm_ucode_tlv_api { * @IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared * memory addresses from the firmware. * @IWM_UCODE_TLV_CAPA_LQM_SUPPORT: supports Link Quality Measurement - * @IWM_UCODE_TLV_CAPA_LMAC_UPLOAD: supports upload mode in lmac (1=supported, - * 0=no support) + * @IWM_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger + * command size (command version 4) that supports toggling ACK TX + * power reduction. * * @IWM_NUM_UCODE_TLV_CAPA: number of bits used */ @@ -744,9 +745,9 @@ enum iwm_ucode_tlv_capa { IWM_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT = 75, IWM_UCODE_TLV_CAPA_CTDP_SUPPORT = 76, IWM_UCODE_TLV_CAPA_USNIFFER_UNIFIED = 77, - IWM_UCODE_TLV_CAPA_LMAC_UPLOAD = 79, IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = 80, IWM_UCODE_TLV_CAPA_LQM_SUPPORT = 81, + IWM_UCODE_TLV_CAPA_TX_POWER_ACK = 84, IWM_NUM_UCODE_TLV_CAPA = 128 }; @@ -1916,6 +1917,51 @@ struct iwm_reduce_tx_power_cmd { uint8_t mac_context_id; uint16_t pwr_restriction; } __packed; /* IWM_TX_REDUCED_POWER_API_S_VER_1 */ + +enum iwm_dev_tx_power_cmd_mode { + IWM_TX_POWER_MODE_SET_MAC = 0, + IWM_TX_POWER_MODE_SET_DEVICE = 1, + IWM_TX_POWER_MODE_SET_CHAINS = 2, + IWM_TX_POWER_MODE_SET_ACK = 3, +}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */; + +#define IWM_NUM_CHAIN_LIMITS 2 +#define IWM_NUM_SUB_BANDS 5 + +/** + * struct iwm_dev_tx_power_cmd - TX power reduction command + * @set_mode: see &enum iwl_dev_tx_power_cmd_mode + * @mac_context_id: id of the mac ctx for which we are reducing TX power. + * @pwr_restriction: TX power restriction in 1/8 dBms. + * @dev_24: device TX power restriction in 1/8 dBms + * @dev_52_low: device TX power restriction upper band - low + * @dev_52_high: device TX power restriction upper band - high + * @per_chain_restriction: per chain restrictions + */ +struct iwm_dev_tx_power_cmd_v3 { + uint32_t set_mode; + uint32_t mac_context_id; + uint16_t pwr_restriction; + uint16_t dev_24; + uint16_t dev_52_low; + uint16_t dev_52_high; + uint16_t per_chain_restriction[IWM_NUM_CHAIN_LIMITS][IWM_NUM_SUB_BANDS]; +} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ + +#define IWM_DEV_MAX_TX_POWER 0x7FFF + +/** + * struct iwm_dev_tx_power_cmd - TX power reduction command + * @v3: version 3 of the command, embedded here for easier software handling + * @enable_ack_reduction: enable or disable close range ack TX power + * reduction. + */ +struct iwm_dev_tx_power_cmd { + /* v4 is just an extension of v3 - keep this here */ + struct iwm_dev_tx_power_cmd_v3 v3; + uint8_t enable_ack_reduction; + uint8_t reserved[3]; +} __packed; /* TX_REDUCED_POWER_API_S_VER_4 */ /* * Calibration control struct. From owner-svn-src-all@freebsd.org Thu Jan 24 03:43:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7760214C0014; Thu, 24 Jan 2019 03:43:00 +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 1608475A39; Thu, 24 Jan 2019 03:43:00 +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 0233F22C21; Thu, 24 Jan 2019 03:43:00 +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 x0O3gx1o025482; Thu, 24 Jan 2019 03:42:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3gxRB025481; Thu, 24 Jan 2019 03:42:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240342.x0O3gxRB025481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343376 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1608475A39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:43:00 -0000 Author: kevans Date: Thu Jan 24 03:42:59 2019 New Revision: 343376 URL: https://svnweb.freebsd.org/changeset/base/343376 Log: if_iwm - Check sc->sc_attached flag in suspend/resume callbacks. * There is (almost) nothing to do in suspend/resume if if_iwm has failed during initialization (e.g. because of firmware load failure) and was already uninitialized by iwm_detach_local(). Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (67b5e090efb225654815fed91020db6cfc16bb19) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:23 2019 (r343375) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:59 2019 (r343376) @@ -6301,6 +6301,10 @@ iwm_resume(device_t dev) * PCI Tx retries from interfering with C3 CPU state. */ pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); + + if (!sc->sc_attached) + return 0; + iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc); @@ -6323,6 +6327,9 @@ iwm_suspend(device_t dev) struct iwm_softc *sc = device_get_softc(dev); do_stop = !! (sc->sc_ic.ic_nrunning > 0); + + if (!sc->sc_attached) + return (0); ieee80211_suspend_all(&sc->sc_ic); From owner-svn-src-all@freebsd.org Thu Jan 24 03:42:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC26914BFEC3; Thu, 24 Jan 2019 03:42:24 +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 840BE75932; Thu, 24 Jan 2019 03:42:24 +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 77ED622C12; Thu, 24 Jan 2019 03:42:24 +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 x0O3gOgp025417; Thu, 24 Jan 2019 03:42:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3gOp0025415; Thu, 24 Jan 2019 03:42:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240342.x0O3gOp0025415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343375 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 840BE75932 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:42:25 -0000 Author: kevans Date: Thu Jan 24 03:42:23 2019 New Revision: 343375 URL: https://svnweb.freebsd.org/changeset/base/343375 Log: if_iwm - Move iwm_read_firmware() call into iwm_attach(). * We should load the firmware exactly once before the driver really initializes the hardware the first time, and unload it at detach time. There is no need to retrieve the firmware during execution of iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the firmware data at hand before that. * The existing sc_preinit_hook code fails to deal with the case where if_iwm is loaded by the loader (or is statically linked) and the firmware needs to be loaded from disk. So we can just call iwm_read_firmware() from iwm_attach() directly. * A separate solution will have to be added to properly defer the firmware loading during bootup, until the necessary filesystem is mounted. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (0104ee1f4cb6a2313c00c2526c6ae98d42e5041d) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:44 2019 (r343374) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:23 2019 (r343375) @@ -245,7 +245,7 @@ static int iwm_firmware_store_section(struct iwm_softc const uint8_t *, size_t); static int iwm_set_default_calib(struct iwm_softc *, const void *); static void iwm_fw_info_free(struct iwm_fw_info *); -static int iwm_read_firmware(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_read_firmware(struct iwm_softc *); static int iwm_alloc_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); @@ -536,12 +536,11 @@ iwm_fw_info_free(struct iwm_fw_info *fw) { firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); fw->fw_fp = NULL; - /* don't touch fw->fw_status */ memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); } static int -iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_read_firmware(struct iwm_softc *sc) { struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; @@ -558,24 +557,11 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode int error = 0; size_t len; - if (fw->fw_status == IWM_FW_STATUS_DONE && - ucode_type != IWM_UCODE_INIT) - return 0; - - while (fw->fw_status == IWM_FW_STATUS_INPROGRESS) - msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfwp", 0); - fw->fw_status = IWM_FW_STATUS_INPROGRESS; - - if (fw->fw_fp != NULL) - iwm_fw_info_free(fw); - /* * Load firmware into driver memory. * fw_fp will be set. */ - IWM_UNLOCK(sc); fwp = firmware_get(sc->cfg->fw_name); - IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", @@ -634,9 +620,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_PROBE_MAX_LEN: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: PROBE_MAX_LEN (%d) != sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: PROBE_MAX_LEN (%u) != sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -655,9 +640,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_PAN: if (tlv_len) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_PAN: tlv_len (%d) > 0\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_PAN: tlv_len (%u) > 0\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -666,17 +650,15 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_FLAGS: if (tlv_len < sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) < sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%u) < sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } if (tlv_len % sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) %% sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%u) %% sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -698,17 +680,15 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: iwm_store_cscheme(): returned %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; case IWM_UCODE_TLV_NUM_OF_CPU: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) != sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%u) != sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -733,8 +713,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_REGULAR: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -743,8 +722,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_INIT, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_INIT: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -753,26 +731,23 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_WOWLAN, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_WOWLAN: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; case IWM_UCODE_TLV_DEF_CALIB: if (tlv_len != sizeof(struct iwm_tlv_calib_data)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_DEV_CALIB: tlv_len (%d) < sizeof(iwm_tlv_calib_data) (%d)\n", - __func__, - (int) tlv_len, - (int) sizeof(struct iwm_tlv_calib_data)); + "%s: IWM_UCODE_TLV_DEV_CALIB: tlv_len (%u) < sizeof(iwm_tlv_calib_data) (%zu)\n", + __func__, tlv_len, + sizeof(struct iwm_tlv_calib_data)); error = EINVAL; goto parse_out; } if ((error = iwm_set_default_calib(sc, tlv_data)) != 0) { device_printf(sc->sc_dev, "%s: iwm_set_default_calib() failed: %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -780,9 +755,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode if (tlv_len != sizeof(uint32_t)) { error = EINVAL; device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_PHY_SKU: tlv_len (%d) < sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_PHY_SKU: tlv_len (%u) < sizeof(uint32_t)\n", + __func__, tlv_len); goto parse_out; } sc->sc_fw.phy_config = @@ -907,12 +881,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode out: if (error) { - fw->fw_status = IWM_FW_STATUS_NONE; if (fw->fw_fp != NULL) iwm_fw_info_free(fw); - } else - fw->fw_status = IWM_FW_STATUS_DONE; - wakeup(&sc->sc_fw); + } return error; } @@ -2858,11 +2829,6 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, int error; static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; - if ((error = iwm_read_firmware(sc, ucode_type)) != 0) { - device_printf(sc->sc_dev, "iwm_read_firmware: failed %d\n", - error); - return error; - } fw = &sc->sc_fw.fw_sects[ucode_type]; sc->cur_ucode = ucode_type; sc->ucode_loaded = FALSE; @@ -5849,7 +5815,7 @@ iwm_attach(device_t dev) sc->sc_wantresp = -1; - /* Check device type */ + /* Match device id */ error = iwm_dev_check(dev); if (error != 0) goto fail; @@ -5987,18 +5953,30 @@ iwm_attach(device_t dev) /* Max RSSI */ sc->sc_max_rssi = IWM_MAX_DBM - IWM_MIN_DBM; - sc->sc_preinit_hook.ich_func = iwm_preinit; - sc->sc_preinit_hook.ich_arg = sc; - if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { - device_printf(dev, "config_intrhook_establish failed\n"); - goto fail; - } - #ifdef IWM_DEBUG SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging"); #endif + + error = iwm_read_firmware(sc); + if (error) { + goto fail; + } else if (sc->sc_fw.fw_fp == NULL) { + /* + * XXX Add a solution for properly deferring firmware load + * during bootup. + */ + goto fail; + } else { + sc->sc_preinit_hook.ich_func = iwm_preinit; + sc->sc_preinit_hook.ich_arg = sc; + if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { + device_printf(dev, + "config_intrhook_establish failed\n"); + goto fail; + } + } IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_TRACE, "<-%s\n", __func__); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:41:44 2019 (r343374) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:42:23 2019 (r343375) @@ -139,15 +139,6 @@ struct iwm_tx_radiotap_header { #define IWM_UCODE_SECTION_MAX 16 -/* - * fw_status is used to determine if we've already parsed the firmware file - * - * In addition to the following, status < 0 ==> -error - */ -#define IWM_FW_STATUS_NONE 0 -#define IWM_FW_STATUS_INPROGRESS 1 -#define IWM_FW_STATUS_DONE 2 - /** * enum iwm_ucode_type * @@ -197,7 +188,6 @@ struct iwm_fw_desc { struct iwm_fw_info { const struct firmware *fw_fp; - int fw_status; struct iwm_fw_sects { struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; From owner-svn-src-all@freebsd.org Thu Jan 24 03:43:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0861C14C006C; Thu, 24 Jan 2019 03:43:47 +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 B0EE375B75; Thu, 24 Jan 2019 03:43:46 +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 A381E22C22; Thu, 24 Jan 2019 03:43:46 +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 x0O3hkDI025562; Thu, 24 Jan 2019 03:43:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3hjY1025553; Thu, 24 Jan 2019 03:43:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240343.x0O3hjY1025553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343377 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0EE375B75 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:43:47 -0000 Author: kevans Date: Thu Jan 24 03:43:45 2019 New Revision: 343377 URL: https://svnweb.freebsd.org/changeset/base/343377 Log: iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming. * Rename some structs and struct members for firmware handling. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (4b1006a6e4d0f61d48c67b46e1f791e30837db67) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_fw.c head/sys/dev/iwm/if_iwm_fw.h head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:43:45 2019 (r343377) @@ -305,16 +305,16 @@ static int iwm_pcie_load_section(struct iwm_softc *, u static int iwm_pcie_load_firmware_chunk(struct iwm_softc *, uint32_t, bus_addr_t, uint32_t); static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *, + const struct iwm_fw_img *, int, int *); static int iwm_pcie_load_cpu_sections(struct iwm_softc *, - const struct iwm_fw_sects *, + const struct iwm_fw_img *, int, int *); static int iwm_pcie_load_given_ucode_8000(struct iwm_softc *, - const struct iwm_fw_sects *); + const struct iwm_fw_img *); static int iwm_pcie_load_given_ucode(struct iwm_softc *, - const struct iwm_fw_sects *); -static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_sects *); + const struct iwm_fw_img *); +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 *, @@ -426,7 +426,7 @@ static int iwm_firmware_store_section(struct iwm_softc *sc, enum iwm_ucode_type type, const uint8_t *data, size_t dlen) { - struct iwm_fw_sects *fws; + struct iwm_fw_img *fws; struct iwm_fw_desc *fwone; if (type >= IWM_UCODE_TYPE_MAX) @@ -434,11 +434,11 @@ iwm_firmware_store_section(struct iwm_softc *sc, if (dlen < sizeof(uint32_t)) return EINVAL; - fws = &sc->sc_fw.fw_sects[type]; + fws = &sc->sc_fw.img[type]; if (fws->fw_count >= IWM_UCODE_SECTION_MAX) return EINVAL; - fwone = &fws->fw_sect[fws->fw_count]; + fwone = &fws->sec[fws->fw_count]; /* first 32bit are device load offset */ memcpy(&fwone->offset, data, sizeof(uint32_t)); @@ -536,7 +536,7 @@ iwm_fw_info_free(struct iwm_fw_info *fw) { firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); fw->fw_fp = NULL; - memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); + memset(fw->img, 0, sizeof(fw->img)); } static int @@ -545,7 +545,7 @@ iwm_read_firmware(struct iwm_softc *sc) struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; const struct iwm_ucode_tlv *tlv; - struct iwm_ucode_capabilities *capa = &sc->ucode_capa; + struct iwm_ucode_capabilities *capa = &sc->sc_fw.ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; @@ -694,11 +694,11 @@ iwm_read_firmware(struct iwm_softc *sc) } num_of_cpus = le32_to_cpup((const uint32_t *)tlv_data); if (num_of_cpus == 2) { - fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = + fw->img[IWM_UCODE_REGULAR].is_dual_cpus = TRUE; - fw->fw_sects[IWM_UCODE_INIT].is_dual_cpus = + fw->img[IWM_UCODE_INIT].is_dual_cpus = TRUE; - fw->fw_sects[IWM_UCODE_WOWLAN].is_dual_cpus = + fw->img[IWM_UCODE_WOWLAN].is_dual_cpus = TRUE; } else if ((num_of_cpus > 2) || (num_of_cpus < 1)) { device_printf(sc->sc_dev, @@ -831,10 +831,10 @@ iwm_read_firmware(struct iwm_softc *sc) goto out; } - sc->sc_fw.fw_sects[IWM_UCODE_REGULAR].paging_mem_size = + sc->sc_fw.img[IWM_UCODE_REGULAR].paging_mem_size = paging_mem_size; usniffer_img = IWM_UCODE_REGULAR_USNIFFER; - sc->sc_fw.fw_sects[usniffer_img].paging_mem_size = + sc->sc_fw.img[usniffer_img].paging_mem_size = paging_mem_size; break; @@ -2447,7 +2447,7 @@ iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uin static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) + const struct iwm_fw_img *image, int cpu, int *first_ucode_section) { int shift_param; int i, ret = 0, sec_num = 0x1; @@ -2470,15 +2470,15 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!image->fw_sect[i].data || - image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (!image->sec[i].data || + image->sec[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->sec[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, "Break since Data not valid or Empty section, sec = %d\n", i); break; } - ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + ret = iwm_pcie_load_section(sc, i, &image->sec[i]); if (ret) return ret; @@ -2509,7 +2509,7 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, static int iwm_pcie_load_cpu_sections(struct iwm_softc *sc, - const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) + const struct iwm_fw_img *image, int cpu, int *first_ucode_section) { int shift_param; int i, ret = 0; @@ -2532,16 +2532,16 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!image->fw_sect[i].data || - image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (!image->sec[i].data || + image->sec[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->sec[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, "Break since Data not valid or Empty section, sec = %d\n", i); break; } - ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + ret = iwm_pcie_load_section(sc, i, &image->sec[i]); if (ret) return ret; } @@ -2553,8 +2553,7 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, } static int -iwm_pcie_load_given_ucode(struct iwm_softc *sc, - const struct iwm_fw_sects *image) +iwm_pcie_load_given_ucode(struct iwm_softc *sc, const struct iwm_fw_img *image) { int ret = 0; int first_ucode_section; @@ -2593,7 +2592,7 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, int iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *image) + const struct iwm_fw_img *image) { int ret = 0; int first_ucode_section; @@ -2631,8 +2630,7 @@ iwm_enable_fw_load_int(struct iwm_softc *sc) /* XXX Add proper rfkill support code */ static int -iwm_start_fw(struct iwm_softc *sc, - const struct iwm_fw_sects *fw) +iwm_start_fw(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int ret; @@ -2824,12 +2822,12 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, { struct iwm_notification_wait alive_wait; struct iwm_mvm_alive_data alive_data; - const struct iwm_fw_sects *fw; + 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 }; - fw = &sc->sc_fw.fw_sects[ucode_type]; + fw = &sc->sc_fw.img[ucode_type]; sc->cur_ucode = ucode_type; sc->ucode_loaded = FALSE; @@ -4473,7 +4471,7 @@ static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *sc) { boolean_t nvm_lar = sc->nvm_data->lar_enabled; - boolean_t tlv_lar = fw_has_capa(&sc->ucode_capa, + boolean_t tlv_lar = fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT); if (iwm_lar_disable) @@ -4492,9 +4490,9 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) { - return fw_has_api(&sc->ucode_capa, + return fw_has_api(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - fw_has_capa(&sc->ucode_capa, + fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); } @@ -4515,7 +4513,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int n_channels; uint16_t mcc; #endif - int resp_v2 = fw_has_capa(&sc->ucode_capa, + int resp_v2 = fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); if (!iwm_mvm_is_lar_supported(sc)) { @@ -4674,7 +4672,7 @@ iwm_init_hw(struct iwm_softc *sc) if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) goto error; - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) goto error; } @@ -6208,7 +6206,7 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "%s: Previous scan not completed yet\n", __func__); } - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); Modified: head/sys/dev/iwm/if_iwm_fw.c ============================================================================== --- head/sys/dev/iwm/if_iwm_fw.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_fw.c Thu Jan 24 03:43:45 2019 (r343377) @@ -141,7 +141,7 @@ iwm_free_fw_paging(struct iwm_softc *sc) } static int -iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_img *image) { int sec_idx, idx; uint32_t offset = 0; @@ -158,7 +158,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct * CPU2 paging image (including instruction and data) */ for (sec_idx = 0; sec_idx < IWM_UCODE_SECTION_MAX; sec_idx++) { - if (image->fw_sect[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (image->sec[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { sec_idx++; break; } @@ -168,7 +168,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct * If paging is enabled there should be at least 2 more sections left * (one for CSS and one for Paging data) */ - if (sec_idx >= nitems(image->fw_sect) - 1) { + if (sec_idx >= nitems(image->sec) - 1) { device_printf(sc->sc_dev, "Paging: Missing CSS and/or paging sections\n"); iwm_free_fw_paging(sc); @@ -181,7 +181,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct sec_idx); memcpy(sc->fw_paging_db[0].fw_paging_block.vaddr, - image->fw_sect[sec_idx].data, + image->sec[sec_idx].data, sc->fw_paging_db[0].fw_paging_size); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -198,7 +198,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct */ for (idx = 1; idx < sc->num_of_paging_blk; idx++) { memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, - (const char *)image->fw_sect[sec_idx].data + offset, + (const char *)image->sec[sec_idx].data + offset, sc->fw_paging_db[idx].fw_paging_size); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -212,7 +212,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct /* copy the last paging block */ if (sc->num_of_pages_in_last_blk > 0) { memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, - (const char *)image->fw_sect[sec_idx].data + offset, + (const char *)image->sec[sec_idx].data + offset, IWM_FW_PAGING_SIZE * sc->num_of_pages_in_last_blk); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -224,7 +224,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct } static int -iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_img *image) { int blk_idx = 0; int error, num_of_pages; @@ -298,7 +298,7 @@ iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const st } int -iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int ret; @@ -311,7 +311,7 @@ iwm_save_fw_paging(struct iwm_softc *sc, const struct /* send paging cmd to FW in case CPU2 has paging image */ int -iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int blk_idx; uint32_t dev_phy_addr; Modified: head/sys/dev/iwm/if_iwm_fw.h ============================================================================== --- head/sys/dev/iwm/if_iwm_fw.h Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_fw.h Thu Jan 24 03:43:45 2019 (r343377) @@ -107,7 +107,7 @@ #define IWM_PAGING_TLV_SECURE_MASK 1 extern void iwm_free_fw_paging(struct iwm_softc *); -extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_sects *); -extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_sects *); +extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_img *); +extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_img *); #endif /* __IF_IWM_FW_H__ */ Modified: head/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_phy_db.c Thu Jan 24 03:43:45 2019 (r343377) @@ -390,7 +390,7 @@ static uint8_t ch_id_to_ch_index(uint16_t ch_id) { if (!is_valid_channel(ch_id)) - return 0xff; + return 0xff; if (ch_id <= 14) return ch_id - 1; @@ -509,7 +509,7 @@ iwm_phy_db_send_all_channel_groups(struct iwm_phy_db * int err; struct iwm_phy_db_entry *entry; - /* Send all the channel specific groups to operational fw */ + /* Send all the channel specific groups to operational fw */ for (i = 0; i < max_ch_groups; i++) { entry = iwm_phy_db_get_section(phy_db, type, Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Jan 24 03:43:45 2019 (r343377) @@ -215,7 +215,7 @@ static inline boolean_t iwm_mvm_rrm_scan_needed(struct iwm_softc *sc) { /* require rrm scan whenever the fw supports it */ - return fw_has_capa(&sc->ucode_capa, + return fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT); } @@ -251,7 +251,7 @@ iwm_mvm_rx_lmac_scan_complete_notif(struct iwm_softc * /* If this happens, the firmware has mistakenly sent an LMAC * notification during UMAC scans -- warn and ignore it. */ - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { device_printf(sc->sc_dev, "%s: Mistakenly got LMAC notification during UMAC scan\n", __func__); @@ -307,7 +307,8 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ss->ss_last && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or @@ -350,7 +351,8 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ss->ss_last && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or @@ -495,7 +497,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_SCAN_CONFIG_RATE_36M | IWM_SCAN_CONFIG_RATE_48M | IWM_SCAN_CONFIG_RATE_54M); - cmd_size = sizeof(*scan_config) + sc->ucode_capa.n_scan_channels; + cmd_size = sizeof(*scan_config) + sc->sc_fw.ucode_capa.n_scan_channels; scan_config = malloc(cmd_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (scan_config == NULL) @@ -523,7 +525,8 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -566,7 +569,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) static boolean_t iwm_mvm_scan_use_ebs(struct iwm_softc *sc) { - const struct iwm_ucode_capabilities *capa = &sc->ucode_capa; + const struct iwm_ucode_capabilities *capa = &sc->sc_fw.ucode_capa; /* We can only use EBS if: * 1. the feature is supported; @@ -596,7 +599,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_umac) + (sizeof(struct iwm_scan_channel_cfg_umac) * - sc->ucode_capa.n_scan_channels) + + sc->sc_fw.ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_req_umac_tail); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; @@ -630,7 +633,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) tail = (void *)((char *)&req->data + sizeof(struct iwm_scan_channel_cfg_umac) * - sc->ucode_capa.n_scan_channels); + sc->sc_fw.ucode_capa.n_scan_channels); /* Check if we're doing an active directed scan. */ for (i = 0; i < nssid; i++) { @@ -694,7 +697,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_lmac) + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); + sc->sc_fw.ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -764,7 +767,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) ret = iwm_mvm_fill_probe_req(sc, (struct iwm_scan_probe_req *)(req->data + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->ucode_capa.n_scan_channels))); + sc->sc_fw.ucode_capa.n_scan_channels))); if (ret) { free(req, M_DEVBUF); return ret; @@ -863,7 +866,7 @@ iwm_mvm_scan_stop_wait(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) ret = iwm_mvm_umac_scan_abort(sc); else ret = iwm_mvm_lmac_scan_abort(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:43:45 2019 (r343377) @@ -186,16 +186,21 @@ struct iwm_fw_desc { uint32_t offset; /* offset in the device */ }; +struct iwm_fw_img { + struct iwm_fw_desc sec[IWM_UCODE_SECTION_MAX]; + int fw_count; + int is_dual_cpus; + uint32_t paging_mem_size; +}; + struct iwm_fw_info { const struct firmware *fw_fp; - struct iwm_fw_sects { - struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; - int fw_count; - int is_dual_cpus; - uint32_t paging_mem_size; - } fw_sects[IWM_UCODE_TYPE_MAX]; + /* ucode images */ + struct iwm_fw_img img[IWM_UCODE_TYPE_MAX]; + struct iwm_ucode_capabilities ucode_capa; + uint32_t phy_config; uint8_t valid_tx_ant; uint8_t valid_rx_ant; @@ -470,7 +475,6 @@ struct iwm_softc { int ucode_loaded; char sc_fwver[32]; - struct iwm_ucode_capabilities ucode_capa; char sc_fw_mcc[3]; int sc_intmask; From owner-svn-src-all@freebsd.org Thu Jan 24 03:44:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBB714C013B; Thu, 24 Jan 2019 03:44:50 +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 EADB775E1A; Thu, 24 Jan 2019 03:44:49 +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 DCD7422C2B; Thu, 24 Jan 2019 03:44:49 +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 x0O3in6M025715; Thu, 24 Jan 2019 03:44:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3inie025711; Thu, 24 Jan 2019 03:44:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240344.x0O3inie025711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343379 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EADB775E1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:44:50 -0000 Author: kevans Date: Thu Jan 24 03:44:48 2019 New Revision: 343379 URL: https://svnweb.freebsd.org/changeset/base/343379 Log: if_iwm - Configure the PCIe LTR, fix PCI express capability accesses. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (08a7ad5a5ff65aaaf2df6a609be7a4e1df43efc3) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c 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 Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:44:48 2019 (r343379) @@ -320,6 +320,7 @@ static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_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_rx_addbuf(struct iwm_softc *, int, int); static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); @@ -3000,6 +3001,19 @@ out: return ret; } +static int +iwm_mvm_config_ltr(struct iwm_softc *sc) +{ + struct iwm_ltr_config_cmd cmd = { + .flags = htole32(IWM_LTR_CFG_FLAG_FEATURE_ENABLE), + }; + + if (!sc->sc_ltr_enabled) + return 0; + + return iwm_mvm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); +} + /* * receive side */ @@ -4665,6 +4679,9 @@ iwm_init_hw(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_mvm_tt_tx_backoff(sc, 0); + if (iwm_mvm_config_ltr(sc) != 0) + device_printf(sc->sc_dev, "PCIe LTR configuration failed\n"); + error = iwm_mvm_power_update_device(sc); if (error) goto error; @@ -5292,6 +5309,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_MAC_CONTEXT_CMD: case IWM_REPLY_SF_CFG_CMD: case IWM_POWER_TABLE_CMD: + case IWM_LTR_CONFIG: case IWM_PHY_CONTEXT_CMD: case IWM_BINDING_CONTEXT_CMD: case IWM_TIME_EVENT_CMD: Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jan 24 03:44:48 2019 (r343379) @@ -406,18 +406,39 @@ iwm_prepare_card_hw(struct iwm_softc *sc) void iwm_apm_config(struct iwm_softc *sc) { - uint16_t reg; + uint16_t lctl, cap; + int pcie_ptr; - reg = pci_read_config(sc->sc_dev, PCIER_LINK_CTL, sizeof(reg)); - if (reg & PCIEM_LINK_CTL_ASPMC_L1) { - /* Um the Linux driver prints "Disabling L0S for this one ... */ + /* + * HW bug W/A for instability in PCIe bus L0S->L1 transition. + * Check if BIOS (or OS) enabled L1-ASPM on this device. + * If so (likely), disable L0S, so device moves directly L0->L1; + * costs negligible amount of power savings. + * If not (unlikely), enable L0S, so there is at least some + * power savings, even without L1. + */ + int error; + + error = pci_find_cap(sc->sc_dev, PCIY_EXPRESS, &pcie_ptr); + if (error != 0) + return; + lctl = pci_read_config(sc->sc_dev, pcie_ptr + PCIER_LINK_CTL, + sizeof(lctl)); + if (lctl & PCIEM_LINK_CTL_ASPMC_L1) { IWM_SETBITS(sc, IWM_CSR_GIO_REG, IWM_CSR_GIO_REG_VAL_L0S_ENABLED); } else { - /* ... and "Enabling" here */ IWM_CLRBITS(sc, IWM_CSR_GIO_REG, IWM_CSR_GIO_REG_VAL_L0S_ENABLED); } + + cap = pci_read_config(sc->sc_dev, pcie_ptr + PCIER_DEVICE_CTL2, + sizeof(cap)); + sc->sc_ltr_enabled = (cap & PCIEM_CTL2_LTR_ENABLE) ? 1 : 0; + IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_PWRSAVE, + "L1 %sabled - LTR %sabled\n", + (lctl & PCIEM_LINK_CTL_ASPMC_L1) ? "En" : "Dis", + sc->sc_ltr_enabled ? "En" : "Dis"); } /* Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:48 2019 (r343379) @@ -1790,6 +1790,7 @@ enum { /* Power - legacy power table command */ IWM_POWER_TABLE_CMD = 0x77, IWM_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78, + IWM_LTR_CONFIG = 0xee, /* Thermal Throttling*/ IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, @@ -3521,6 +3522,57 @@ struct iwm_nonqos_seq_query_cmd { */ /* Power Management Commands, Responses, Notifications */ + +/** + * enum iwm_ltr_config_flags - masks for LTR config command flags + * @IWM_LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status + * @IWM_LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow + * memory access + * @IWM_LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR + * reg change + * @IWM_LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from + * D0 to D3 + * @IWM_LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register + * @IWM_LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register + * @IWM_LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD + */ +enum iwm_ltr_config_flags { + IWM_LTR_CFG_FLAG_FEATURE_ENABLE = (1 << 0), + IWM_LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = (1 << 1), + IWM_LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = (1 << 2), + IWM_LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = (1 << 3), + IWM_LTR_CFG_FLAG_SW_SET_SHORT = (1 << 4), + IWM_LTR_CFG_FLAG_SW_SET_LONG = (1 << 5), + IWM_LTR_CFG_FLAG_DENIE_C10_ON_PD = (1 << 6), +}; + +/** + * struct iwm_ltr_config_cmd_v1 - configures the LTR + * @flags: See %enum iwm_ltr_config_flags + */ +struct iwm_ltr_config_cmd_v1 { + uint32_t flags; + uint32_t static_long; + uint32_t static_short; +} __packed; /* LTR_CAPABLE_API_S_VER_1 */ + +#define IWM_LTR_VALID_STATES_NUM 4 + +/** + * struct iwm_ltr_config_cmd - configures the LTR + * @flags: See %enum iwm_ltr_config_flags + * @static_long: + * @static_short: + * @ltr_cfg_values: + * @ltr_short_idle_timeout: + */ +struct iwm_ltr_config_cmd { + uint32_t flags; + uint32_t static_long; + uint32_t static_short; + uint32_t ltr_cfg_values[IWM_LTR_VALID_STATES_NUM]; + uint32_t ltr_short_idle_timeout; +} __packed; /* LTR_CAPABLE_API_S_VER_2 */ /* Radio LP RX Energy Threshold measured in dBm */ #define IWM_POWER_LPRX_RSSI_THRESHOLD 75 Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:44:48 2019 (r343379) @@ -556,6 +556,8 @@ struct iwm_softc { /* Indicate if device power save is allowed */ boolean_t sc_ps_disabled; + + int sc_ltr_enabled; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Jan 24 03:47:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A676614C03B0; Thu, 24 Jan 2019 03:47:06 +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 1BED37636F; Thu, 24 Jan 2019 03:47:06 +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 10B3522C39; Thu, 24 Jan 2019 03:47:06 +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 x0O3l5ie026004; Thu, 24 Jan 2019 03:47:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3l5V6026000; Thu, 24 Jan 2019 03:47:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240347.x0O3l5V6026000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343383 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BED37636F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:47:06 -0000 Author: kevans Date: Thu Jan 24 03:47:04 2019 New Revision: 343383 URL: https://svnweb.freebsd.org/changeset/base/343383 Log: iwm - Improve firmware Time Event handling. * This is a mix of the OpenBSD Git 7fd9664469d1b717a307eebd74aeececbd3c41cc change, and syncing with the Linux iwlwifi code. Taken-From: Linux iwlwifi, and OpenBSD Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (706a3044afd27c3fecfdf57bec1695310e53e228) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_debug.h head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:04 2019 (r343383) @@ -1263,6 +1263,7 @@ iwm_stop_device(struct iwm_softc *sc) iv->is_uploaded = 0; } sc->sc_firmware_state = 0; + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; /* device going down, Stop using ICT table */ sc->sc_flags &= ~IWM_FLAG_USE_ICT; @@ -4050,8 +4051,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s */ /* 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 */); - DELAY(100); + iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); error = 0; out: @@ -4347,6 +4347,15 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_disable_beacon_filter(sc); if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; + } + + if ((vap->iv_state == IEEE80211_S_AUTH || + vap->iv_state == IEEE80211_S_ASSOC || + vap->iv_state == IEEE80211_S_RUN) && + (nstate == IEEE80211_S_INIT || + nstate == IEEE80211_S_SCAN || + nstate == IEEE80211_S_AUTH)) { + iwm_mvm_stop_session_protection(sc, ivp); } if ((vap->iv_state == IEEE80211_S_RUN || Modified: head/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- head/sys/dev/iwm/if_iwm_debug.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_debug.h Thu Jan 24 03:47:04 2019 (r343383) @@ -44,6 +44,7 @@ enum { IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_FW = 0x00200000, /* Firmware management */ IWM_DEBUG_LAR = 0x00400000, /* Location Aware Regulatory */ + IWM_DEBUG_TE = 0x00800000, /* Time Event handling */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:04 2019 (r343383) @@ -155,6 +155,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -166,31 +167,132 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC static int +iwm_mvm_te_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt, + void *data) +{ + struct iwm_time_event_notif *resp; + int resp_len = iwm_rx_packet_payload_len(pkt); + + if (pkt->hdr.code != IWM_TIME_EVENT_NOTIFICATION || + resp_len != sizeof(*resp)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Invalid TIME_EVENT_NOTIFICATION response\n"); + return 1; + } + + resp = (void *)pkt->data; + + /* te_data->uid is already set in the TIME_EVENT_CMD response */ + if (le32toh(resp->unique_id) != sc->sc_time_event_uid) + return false; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_NOTIFICATION response - UID = 0x%x\n", + sc->sc_time_event_uid); + if (!resp->status) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_NOTIFICATION received but not executed\n"); + } + + return 1; +} + +static int +iwm_mvm_time_event_response(struct iwm_softc *sc, struct iwm_rx_packet *pkt, + void *data) +{ + struct iwm_time_event_resp *resp; + int resp_len = iwm_rx_packet_payload_len(pkt); + + if (pkt->hdr.code != IWM_TIME_EVENT_CMD || + resp_len != sizeof(*resp)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Invalid TIME_EVENT_CMD response\n"); + return 1; + } + + resp = (void *)pkt->data; + + /* we should never get a response to another TIME_EVENT_CMD here */ + if (le32toh(resp->id) != IWM_TE_BSS_STA_AGGRESSIVE_ASSOC) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Got TIME_EVENT_CMD response with wrong id: %d\n", + le32toh(resp->id)); + return 0; + } + + sc->sc_time_event_uid = le32toh(resp->unique_id); + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_CMD response - UID = 0x%x\n", sc->sc_time_event_uid); + return 1; +} + + +/* XXX Use the te_data function argument properly, like in iwlwifi's code. */ + +static int iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_vap *ivp, void *te_data, struct iwm_time_event_cmd *te_cmd) { + static const uint16_t time_event_response[] = { IWM_TIME_EVENT_CMD }; + struct iwm_notification_wait wait_time_event; int ret; - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_TE, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, - sizeof(*te_cmd), te_cmd); + /* + * Use a notification wait, which really just processes the + * command response and doesn't wait for anything, in order + * to be able to process the response and get the UID inside + * the RX path. Using CMD_WANT_SKB doesn't work because it + * stores the buffer and then wakes up this thread, by which + * time another notification (that the time event started) + * might already be processed unsuccessfully. + */ + iwm_init_notification_wait(sc->sc_notif_wait, &wait_time_event, + time_event_response, + nitems(time_event_response), + iwm_mvm_time_event_response, /*te_data*/NULL); + + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(*te_cmd), + te_cmd); if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_TE, "%s: Couldn't send IWM_TIME_EVENT_CMD: %d\n", __func__, ret); + iwm_remove_notification(sc->sc_notif_wait, &wait_time_event); + return ret; } + /* No need to wait for anything, so just pass 1 (0 isn't valid) */ + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &wait_time_event, 1); + IWM_LOCK(sc); + /* should never fail */ + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to get response for IWM_TIME_EVENT_CMD: %d\n", + __func__, ret); + } + return ret; } +#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) + void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t duration, uint32_t max_delay) + uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif) { + const uint16_t te_notif_response[] = { IWM_TIME_EVENT_NOTIFICATION }; + struct iwm_notification_wait wait_te_notif; struct iwm_time_event_cmd time_cmd = {}; + /* Do nothing if a time event is already scheduled. */ + if (sc->sc_flags & IWM_FLAG_TE_ACTIVE) + return; + time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); @@ -209,5 +311,58 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); - iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); + if (!wait_for_notif) { + iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); + DELAY(100); + sc->sc_flags |= IWM_FLAG_TE_ACTIVE; + return; + } + + /* + * Create notification_wait for the TIME_EVENT_NOTIFICATION to use + * right after we send the time event + */ + iwm_init_notification_wait(sc->sc_notif_wait, &wait_te_notif, + te_notif_response, nitems(te_notif_response), + iwm_mvm_te_notif, /*te_data*/NULL); + + /* If TE was sent OK - wait for the notification that started */ + if (iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to add TE to protect session\n", __func__); + iwm_remove_notification(sc->sc_notif_wait, &wait_te_notif); + } else { + sc->sc_flags |= IWM_FLAG_TE_ACTIVE; + IWM_UNLOCK(sc); + if (iwm_wait_notification(sc->sc_notif_wait, &wait_te_notif, + TU_TO_HZ(max_delay))) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to protect session until TE\n", + __func__); + } + IWM_LOCK(sc); + } +} + +void +iwm_mvm_stop_session_protection(struct iwm_softc *sc, struct iwm_vap *ivp) +{ + struct iwm_time_event_cmd time_cmd = {}; + + /* Do nothing if the time event has already ended. */ + if ((sc->sc_flags & IWM_FLAG_TE_ACTIVE) == 0) + return; + + time_cmd.id = htole32(sc->sc_time_event_uid); + time_cmd.action = htole32(IWM_FW_CTXT_ACTION_REMOVE); + time_cmd.id_and_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Removing TE 0x%x\n", __func__, le32toh(time_cmd.id)); + if (iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(time_cmd), + &time_cmd) == 0) + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; + + DELAY(100); } Modified: head/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:04 2019 (r343383) @@ -108,6 +108,8 @@ #define __IF_IWM_TIME_EVENT_H__ extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t duration, uint32_t max_delay); + uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif); +extern void iwm_mvm_stop_session_protection(struct iwm_softc *sc, + struct iwm_vap *ivp); #endif /* __IF_IWM_TIME_EVENT_H__ */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:04 2019 (r343383) @@ -434,6 +434,7 @@ struct iwm_softc { #define IWM_FLAG_BUSY (1 << 4) #define IWM_FLAG_SCANNING (1 << 5) #define IWM_FLAG_SCAN_RUNNING (1 << 6) +#define IWM_FLAG_TE_ACTIVE (1 << 7) struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; @@ -562,6 +563,9 @@ struct iwm_softc { /* Track firmware state for STA association. */ int sc_firmware_state; + + /* Unique ID (assigned by the firmware) of the current Time Event. */ + uint32_t sc_time_event_uid; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Jan 24 03:49:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B954C14C06CB; Thu, 24 Jan 2019 03:49:12 +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 6149E769FB; Thu, 24 Jan 2019 03:49:12 +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 5440922C3F; Thu, 24 Jan 2019 03:49:12 +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 x0O3nC51026270; Thu, 24 Jan 2019 03:49:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3nC5i026268; Thu, 24 Jan 2019 03:49:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240349.x0O3nC5i026268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343387 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6149E769FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:49:12 -0000 Author: kevans Date: Thu Jan 24 03:49:11 2019 New Revision: 343387 URL: https://svnweb.freebsd.org/changeset/base/343387 Log: iwm - Fix race during detach, where a callout is left after driver is gone. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (ba3b4ff9a1fc04a349df05d6d3449f4d9b15c4be) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_led.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:50 2019 (r343386) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:49:11 2019 (r343387) @@ -4829,6 +4829,9 @@ iwm_watchdog(void *arg) struct iwm_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; + if (sc->sc_attached == 0) + return; + if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { device_printf(sc->sc_dev, "device timeout\n"); Modified: head/sys/dev/iwm/if_iwm_led.c ============================================================================== --- head/sys/dev/iwm/if_iwm_led.c Thu Jan 24 03:48:50 2019 (r343386) +++ head/sys/dev/iwm/if_iwm_led.c Thu Jan 24 03:49:11 2019 (r343387) @@ -162,6 +162,9 @@ iwm_led_blink_timeout(void *arg) { struct iwm_softc *sc = arg; + if (sc->sc_attached == 0) + return; + if (iwm_mvm_led_is_enabled(sc)) iwm_mvm_led_disable(sc); else From owner-svn-src-all@freebsd.org Thu Jan 24 03:45:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2A714C025E; Thu, 24 Jan 2019 03:45:57 +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 D214B7609C; Thu, 24 Jan 2019 03:45:56 +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 C4C0D22C32; Thu, 24 Jan 2019 03:45:56 +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 x0O3juSv025862; Thu, 24 Jan 2019 03:45:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3ju9i025858; Thu, 24 Jan 2019 03:45:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240345.x0O3ju9i025858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343381 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D214B7609C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:45:57 -0000 Author: kevans Date: Thu Jan 24 03:45:55 2019 New Revision: 343381 URL: https://svnweb.freebsd.org/changeset/base/343381 Log: iwm - Track firmware state better, and improve handling in iwm_newstate(). * This avoids firmware resets in all the cases in iwm_newstate(). Instead iwm_bring_down_firmware() is called, which tears down all the STA connection state, according to the sc->sc_firmware_state value. * Improve the behaviour of the LED blinking a bit, so it only blinks when there really is a wireless scan going on. * Print the newstate arg in debug output of iwm_newstate(), to help in debugging. This is inspired by the firmware state maintaining change in OpenBSD's iwm, by stsp@openbsd.org (OpenBSD Git 0ddb056fb7370664b1d4b84392697cb17d1a414a). Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (8a41b10ac639d0609878696808387a6799d39b57) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_sta.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:55 2019 (r343381) @@ -350,7 +350,6 @@ static int iwm_raw_xmit(struct ieee80211_node *, struc const struct ieee80211_bpf_params *); static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); -static int iwm_release(struct iwm_softc *, struct iwm_node *); static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, const uint8_t[IEEE80211_ADDR_LEN]); @@ -1263,6 +1262,7 @@ iwm_stop_device(struct iwm_softc *sc) iv->phy_ctxt = NULL; iv->is_uploaded = 0; } + sc->sc_firmware_state = 0; /* device going down, Stop using ICT table */ sc->sc_flags &= ~IWM_FLAG_USE_ICT; @@ -3951,8 +3951,11 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s __func__, vap, ni); + IWM_DPRINTF(sc, IWM_DEBUG_STATE, "%s: Current node bssid: %s\n", + __func__, ether_sprintf(ni->ni_bssid)); in->in_assoc = 0; + iv->iv_auth = 1; /* * Firmware bug - it'll crash if the beacon interval is less @@ -4004,6 +4007,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s goto out; } } + sc->sc_firmware_state = 1; if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { @@ -4018,6 +4022,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: binding update cmd\n", __func__); goto out; } + sc->sc_firmware_state = 2; /* * Authentication becomes unreliable when powersaving is left enabled * here. Powersaving will be activated again when association has @@ -4037,6 +4042,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed to add sta\n", __func__); goto out; } + sc->sc_firmware_state = 3; /* * Prevent the FW from wandering off channel during association @@ -4049,81 +4055,12 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s error = 0; out: + if (error != 0) + iv->iv_auth = 0; ieee80211_free_node(ni); return (error); } -static int -iwm_release(struct iwm_softc *sc, struct iwm_node *in) -{ - uint32_t tfd_msk; - - /* - * Ok, so *technically* the proper set of calls for going - * from RUN back to SCAN is: - * - * iwm_mvm_power_mac_disable(sc, in); - * iwm_mvm_mac_ctxt_changed(sc, vap); - * iwm_mvm_rm_sta(sc, in); - * iwm_mvm_update_quotas(sc, NULL); - * iwm_mvm_mac_ctxt_changed(sc, in); - * iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); - * iwm_mvm_mac_ctxt_remove(sc, in); - * - * However, that freezes the device not matter which permutations - * and modifications are attempted. Obviously, this driver is missing - * something since it works in the Linux driver, but figuring out what - * is missing is a little more complicated. Now, since we're going - * back to nothing anyway, we'll just do a complete device reset. - * Up your's, device! - */ - /* - * Just using 0xf for the queues mask is fine as long as we only - * get here from RUN state. - */ - tfd_msk = 0xf; - iwm_xmit_queue_drain(sc); - iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); - /* - * We seem to get away with just synchronously sending the - * IWM_TXPATH_FLUSH command. - */ -// iwm_trans_wait_tx_queue_empty(sc, tfd_msk); - iwm_stop_device(sc); - iwm_init_hw(sc); - if (in) - in->in_assoc = 0; - return 0; - -#if 0 - int error; - - iwm_mvm_power_mac_disable(sc, in); - - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { - device_printf(sc->sc_dev, "mac ctxt change fail 1 %d\n", error); - return error; - } - - if ((error = iwm_mvm_rm_sta(sc, in)) != 0) { - device_printf(sc->sc_dev, "sta remove fail %d\n", error); - return error; - } - error = iwm_mvm_rm_sta(sc, in); - in->in_assoc = 0; - iwm_mvm_update_quotas(sc, NULL); - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { - device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); - return error; - } - iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); - - iwm_mvm_mac_ctxt_remove(sc, in); - - return error; -#endif -} - static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { @@ -4282,7 +4219,98 @@ iwm_media_change(struct ifnet *ifp) return error; } +static void +iwm_bring_down_firmware(struct iwm_softc *sc, struct ieee80211vap *vap) +{ + struct iwm_vap *ivp = IWM_VAP(vap); + int error; + 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); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_sf_update(sc, vap, FALSE); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to update smart FIFO: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_rm_sta_id(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station id: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_update_quotas(sc, NULL); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to update PHY quota: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + /* XXX Might need to specify bssid correctly. */ + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + sc->sc_firmware_state = 2; + } + if (sc->sc_firmware_state > 1) { + error = iwm_mvm_binding_remove_vif(sc, ivp); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove channel ctx: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state > 1) { + sc->sc_firmware_state = 1; + } + ivp->phy_ctxt = NULL; + if (sc->sc_firmware_state > 0) { + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state > 0) { + error = iwm_mvm_power_update_mac(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\n", + __func__); + } + } + sc->sc_firmware_state = 0; +} + static int iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -4293,115 +4321,64 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ int error; IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "switching state %s -> %s\n", + "switching state %s -> %s arg=0x%x\n", ieee80211_state_name[vap->iv_state], - ieee80211_state_name[nstate]); + ieee80211_state_name[nstate], + arg); + IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - if (vap->iv_state == IEEE80211_S_SCAN && nstate != vap->iv_state) + if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && + (nstate == IEEE80211_S_AUTH || + nstate == IEEE80211_S_ASSOC || + nstate == IEEE80211_S_RUN)) { + /* Stop blinking for a scan, when authenticating. */ iwm_led_blink_stop(sc); + } - /* disable beacon filtering if we're hopping out of RUN */ - if (vap->iv_state == IEEE80211_S_RUN && nstate != vap->iv_state) { + if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + iwm_mvm_led_disable(sc); + /* disable beacon filtering if we're hopping out of RUN */ iwm_mvm_disable_beacon_filter(sc); - if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; + } - if (nstate == IEEE80211_S_INIT) { - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - error = ivp->iv_newstate(vap, nstate, arg); - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - iwm_release(sc, NULL); - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - return error; - } - + if ((vap->iv_state == IEEE80211_S_RUN || + vap->iv_state == IEEE80211_S_ASSOC) && + nstate == IEEE80211_S_INIT) { /* - * It's impossible to directly go RUN->SCAN. If we iwm_release() - * above then the card will be completely reinitialized, - * so the driver must do everything necessary to bring the card - * from INIT to SCAN. - * - * Additionally, upon receiving deauth frame from AP, - * OpenBSD 802.11 stack puts the driver in IEEE80211_S_AUTH - * state. This will also fail with this driver, so bring the FSM - * from IEEE80211_S_RUN to IEEE80211_S_SCAN in this case as well. - * - * XXX TODO: fix this for FreeBSD! + * In this case, iv_newstate() wants to send an 80211 frame on + * the network that we are leaving. So we need to call it, + * before tearing down all the firmware state. */ - if (nstate == IEEE80211_S_SCAN || - nstate == IEEE80211_S_AUTH || - nstate == IEEE80211_S_ASSOC) { - IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "Force transition to INIT; MGT=%d\n", arg); - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - /* Always pass arg as -1 since we can't Tx right now. */ - /* - * XXX arg is just ignored anyway when transitioning - * to IEEE80211_S_INIT. - */ - vap->iv_newstate(vap, IEEE80211_S_INIT, -1); - IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "Going INIT->SCAN\n"); - nstate = IEEE80211_S_SCAN; - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - } + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + iwm_bring_down_firmware(sc, vap); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return 0; } switch (nstate) { case IEEE80211_S_INIT: case IEEE80211_S_SCAN: - if (vap->iv_state == IEEE80211_S_AUTH || - vap->iv_state == IEEE80211_S_ASSOC) { - int myerr; - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - myerr = ivp->iv_newstate(vap, nstate, arg); - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - error = iwm_mvm_rm_sta(sc, vap, FALSE); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to remove station: %d\n", - __func__, error); - } - error = iwm_mvm_mac_ctxt_changed(sc, vap); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to change mac context: %d\n", - __func__, error); - } - error = iwm_mvm_binding_remove_vif(sc, ivp); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to remove channel ctx: %d\n", - __func__, error); - } - ivp->phy_ctxt = NULL; - error = iwm_mvm_power_update_mac(sc); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: failed to update power management\n", - __func__); - } - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - return myerr; - } break; case IEEE80211_S_AUTH: + iwm_bring_down_firmware(sc, vap); if ((error = iwm_auth(vap, sc)) != 0) { device_printf(sc->sc_dev, "%s: could not move to auth state: %d\n", __func__, error); + iwm_bring_down_firmware(sc, vap); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return 1; } break; @@ -5566,6 +5543,8 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, " 802.11 state %d\n", (vap == NULL) ? -1 : vap->iv_state); + /* Reset our firmware state tracking. */ + sc->sc_firmware_state = 0; /* Don't stop the device; just do a VAP restart */ IWM_UNLOCK(sc); Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jan 24 03:45:55 2019 (r343381) @@ -309,7 +309,12 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * iwm_mvm_mac_ctxt_changed() when already authenticating or * associating, ni->ni_bssid should always make sense here. */ - IEEE80211_ADDR_COPY(cmd->bssid_addr, ni->ni_bssid); + if (ivp->iv_auth) { + IEEE80211_ADDR_COPY(cmd->bssid_addr, ni->ni_bssid); + } else { + /* XXX Or maybe all zeroes address? */ + IEEE80211_ADDR_COPY(cmd->bssid_addr, ieee80211broadcastaddr); + } #endif /* Modified: head/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- head/sys/dev/iwm/if_iwm_sta.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm_sta.c Thu Jan 24 03:45:55 2019 (r343381) @@ -286,7 +286,7 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v for (ac = 0; ac < WME_NUM_AC; ac++) { tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); } - ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, 0); + ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, IWM_CMD_SYNC); if (ret) return ret; #ifdef notyet /* function not yet implemented */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:45:55 2019 (r343381) @@ -365,6 +365,7 @@ struct iwm_bf_data { struct iwm_vap { struct ieee80211vap iv_vap; int is_uploaded; + int iv_auth; int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); @@ -558,6 +559,9 @@ struct iwm_softc { boolean_t sc_ps_disabled; int sc_ltr_enabled; + + /* Track firmware state for STA association. */ + int sc_firmware_state; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Jan 24 03:49:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4766014C0748; Thu, 24 Jan 2019 03:49:37 +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 E22B876B30; Thu, 24 Jan 2019 03:49:36 +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 D545A22C41; Thu, 24 Jan 2019 03:49:36 +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 x0O3naSN026331; Thu, 24 Jan 2019 03:49:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3naII026328; Thu, 24 Jan 2019 03:49:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240349.x0O3naII026328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343388 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E22B876B30 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:49:37 -0000 Author: kevans Date: Thu Jan 24 03:49:35 2019 New Revision: 343388 URL: https://svnweb.freebsd.org/changeset/base/343388 Log: iwm - Update alive response handling, add v4 and remove old versions. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (3820e2bf3331ced3541d1811a38c5a5136dfab93) Modified: head/sys/dev/iwm/if_iwm.c 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 Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:49:35 2019 (r343388) @@ -2723,75 +2723,48 @@ 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_ver1 *palive1; - struct iwm_mvm_alive_resp_ver2 *palive2; + struct iwm_mvm_alive_resp_v3 *palive3; struct iwm_mvm_alive_resp *palive; + struct iwm_umac_alive *umac; + struct iwm_lmac_alive *lmac1; + struct iwm_lmac_alive *lmac2 = NULL; + uint16_t status; - if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive1)) { - palive1 = (void *)pkt->data; - - sc->support_umac_log = FALSE; - sc->error_event_table = - le32toh(palive1->error_event_table_ptr); - sc->log_event_table = - le32toh(palive1->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive1->scd_base_ptr); - - alive_data->valid = le16toh(palive1->status) == - IWM_ALIVE_STATUS_OK; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive1->status), palive1->ver_type, - palive1->ver_subtype, palive1->flags); - } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive2)) { - palive2 = (void *)pkt->data; - sc->error_event_table = - le32toh(palive2->error_event_table_ptr); - sc->log_event_table = - le32toh(palive2->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive2->scd_base_ptr); - sc->umac_error_event_table = - le32toh(palive2->error_info_addr); - - alive_data->valid = le16toh(palive2->status) == - IWM_ALIVE_STATUS_OK; - if (sc->umac_error_event_table) - sc->support_umac_log = TRUE; - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive2->status), palive2->ver_type, - palive2->ver_subtype, palive2->flags); - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "UMAC version: Major - 0x%x, Minor - 0x%x\n", - palive2->umac_major, palive2->umac_minor); - } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { + if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { palive = (void *)pkt->data; + umac = &palive->umac_data; + lmac1 = &palive->lmac_data[0]; + lmac2 = &palive->lmac_data[1]; + status = le16toh(palive->status); + } else { + palive3 = (void *)pkt->data; + umac = &palive3->umac_data; + lmac1 = &palive3->lmac_data; + status = le16toh(palive3->status); + } - sc->error_event_table = - le32toh(palive->error_event_table_ptr); - sc->log_event_table = - le32toh(palive->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive->scd_base_ptr); - sc->umac_error_event_table = - le32toh(palive->error_info_addr); + sc->error_event_table[0] = le32toh(lmac1->error_event_table_ptr); + if (lmac2) + sc->error_event_table[1] = + le32toh(lmac2->error_event_table_ptr); + sc->log_event_table = le32toh(lmac1->log_event_table_ptr); + sc->umac_error_event_table = le32toh(umac->error_info_addr); + alive_data->scd_base_addr = le32toh(lmac1->scd_base_ptr); + alive_data->valid = status == IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; - alive_data->valid = le16toh(palive->status) == - IWM_ALIVE_STATUS_OK; - if (sc->umac_error_event_table) - sc->support_umac_log = TRUE; + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Alive ucode status 0x%04x revision 0x%01X 0x%01X\n", + status, lmac1->ver_type, lmac1->ver_subtype); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER3 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive->status), palive->ver_type, - palive->ver_subtype, palive->flags); + if (lmac2) + IWM_DPRINTF(sc, IWM_DEBUG_FW, "Alive ucode CDB\n"); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "UMAC version: Major - 0x%x, Minor - 0x%x\n", - le32toh(palive->umac_major), - le32toh(palive->umac_minor)); - } + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + le32toh(umac->umac_major), + le32toh(umac->umac_minor)); return TRUE; } @@ -5052,7 +5025,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->error_event_table; + base = sc->error_event_table[0]; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:35 2019 (r343388) @@ -2144,43 +2144,15 @@ enum { #define IWM_ALIVE_FLG_RFKILL (1 << 0) -struct iwm_mvm_alive_resp_ver1 { - uint16_t status; - uint16_t flags; - uint8_t ucode_minor; - uint8_t ucode_major; - uint16_t id; - uint8_t api_minor; - uint8_t api_major; +struct iwm_lmac_alive { + uint32_t ucode_major; + uint32_t ucode_minor; uint8_t ver_subtype; uint8_t ver_type; uint8_t mac; uint8_t opt; - uint16_t reserved2; uint32_t timestamp; uint32_t error_event_table_ptr; /* SRAM address for error log */ - uint32_t log_event_table_ptr; /* SRAM address for event log */ - uint32_t cpu_register_ptr; - uint32_t dbgm_config_ptr; - uint32_t alive_counter_ptr; - uint32_t scd_base_ptr; /* SRAM address for SCD */ -} __packed; /* IWM_ALIVE_RES_API_S_VER_1 */ - -struct iwm_mvm_alive_resp_ver2 { - uint16_t status; - uint16_t flags; - uint8_t ucode_minor; - uint8_t ucode_major; - uint16_t id; - uint8_t api_minor; - uint8_t api_major; - uint8_t ver_subtype; - uint8_t ver_type; - uint8_t mac; - uint8_t opt; - uint16_t reserved2; - uint32_t timestamp; - uint32_t error_event_table_ptr; /* SRAM address for error log */ uint32_t log_event_table_ptr; /* SRAM address for LMAC event log */ uint32_t cpu_register_ptr; uint32_t dbgm_config_ptr; @@ -2188,36 +2160,28 @@ struct iwm_mvm_alive_resp_ver2 { uint32_t scd_base_ptr; /* SRAM address for SCD */ uint32_t st_fwrd_addr; /* pointer to Store and forward */ uint32_t st_fwrd_size; - uint8_t umac_minor; /* UMAC version: minor */ - uint8_t umac_major; /* UMAC version: major */ - uint16_t umac_id; /* UMAC version: id */ +} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */ + +struct iwm_umac_alive { + uint32_t umac_major; /* UMAC version: major */ + uint32_t umac_minor; /* UMAC version: minor */ uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; -} __packed; /* ALIVE_RES_API_S_VER_2 */ +} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */ -struct iwm_mvm_alive_resp { +struct iwm_mvm_alive_resp_v3 { uint16_t status; uint16_t flags; - uint32_t ucode_minor; - uint32_t ucode_major; - uint8_t ver_subtype; - uint8_t ver_type; - uint8_t mac; - uint8_t opt; - uint32_t timestamp; - uint32_t error_event_table_ptr; /* SRAM address for error log */ - uint32_t log_event_table_ptr; /* SRAM address for LMAC event log */ - uint32_t cpu_register_ptr; - uint32_t dbgm_config_ptr; - uint32_t alive_counter_ptr; - uint32_t scd_base_ptr; /* SRAM address for SCD */ - uint32_t st_fwrd_addr; /* pointer to Store and forward */ - uint32_t st_fwrd_size; - uint32_t umac_minor; /* UMAC version: minor */ - uint32_t umac_major; /* UMAC version: major */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ - uint32_t dbg_print_buff_addr; + struct iwm_lmac_alive lmac_data; + struct iwm_umac_alive umac_data; } __packed; /* ALIVE_RES_API_S_VER_3 */ + +struct iwm_mvm_alive_resp { + uint16_t status; + uint16_t flags; + struct iwm_lmac_alive lmac_data[2]; + struct iwm_umac_alive umac_data; +} __packed; /* ALIVE_RES_API_S_VER_4 */ /* Error response/notification */ enum { Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:49:35 2019 (r343388) @@ -538,7 +538,7 @@ struct iwm_softc { int cmd_hold_nic_awake; /* Firmware status */ - uint32_t error_event_table; + uint32_t error_event_table[2]; uint32_t log_event_table; uint32_t umac_error_event_table; int support_umac_log; From owner-svn-src-all@freebsd.org Thu Jan 24 03:41:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCA414BFE81; Thu, 24 Jan 2019 03:41:45 +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 E5CD7757CE; Thu, 24 Jan 2019 03:41:44 +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 D854622BD9; Thu, 24 Jan 2019 03:41:44 +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 x0O3fi0X022177; Thu, 24 Jan 2019 03:41:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3fiVl022176; Thu, 24 Jan 2019 03:41:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240341.x0O3fiVl022176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343374 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5CD7757CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:41:45 -0000 Author: kevans Date: Thu Jan 24 03:41:44 2019 New Revision: 343374 URL: https://svnweb.freebsd.org/changeset/base/343374 Log: if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw. * Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000 hardware matches the code in Linux iwlwifi. * While there remove DEFAULT_MAX_TX_POWER definition which is unused, and has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (e8560f8dc58df12a7c79a6bb4e6ccb156e001085) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:09 2019 (r343373) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:44 2019 (r343374) @@ -1912,8 +1912,6 @@ enum nvm_sku_bits { #define IWM_NVM_RF_CFG_TX_ANT_MSK_8000(x) ((x >> 24) & 0xF) #define IWM_NVM_RF_CFG_RX_ANT_MSK_8000(x) ((x >> 28) & 0xF) -#define DEFAULT_MAX_TX_POWER 16 - /** * enum iwm_nvm_channel_flags - channel flags in NVM * @IWM_NVM_CHANNEL_VALID: channel is usable for this SKU/geo @@ -5863,18 +5861,17 @@ iwm_attach(device_t dev) * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | - (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); - - if (iwm_prepare_card_hw(sc) != 0) { - device_printf(dev, "could not initialize hardware\n"); - goto fail; - } - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; + + sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | + (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); + + if (iwm_prepare_card_hw(sc) != 0) { + device_printf(dev, "could not initialize hardware\n"); + goto fail; + } /* * In order to recognize C step the driver should read the From owner-svn-src-all@freebsd.org Thu Jan 24 03:44:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED9B14C00D0; Thu, 24 Jan 2019 03:44:21 +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 85BAD75CB2; Thu, 24 Jan 2019 03:44:21 +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 7671F22C28; Thu, 24 Jan 2019 03:44:21 +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 x0O3iLP1025651; Thu, 24 Jan 2019 03:44:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3iLOj025650; Thu, 24 Jan 2019 03:44:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240344.x0O3iLOj025650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343378 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85BAD75CB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:44:22 -0000 Author: kevans Date: Thu Jan 24 03:44:20 2019 New Revision: 343378 URL: https://svnweb.freebsd.org/changeset/base/343378 Log: if_iwm - Update struct iwm_scan_results_notif. Remove old/unused definitions * Remove outdated notifications IWM_SCAN_ABORT_CMD, IWM_SCAN_START_NOTIFICATION and IWM_SCAN_RESULTS_NOTIFICATION. * Remove unused enum iwm_scan_complete_status. * Use the updated FW Api version 3 of struct iwm_scan_results_notif. * No functional change, since struct iwm_scan_results_notif is never accessed in iwm at the moment. Taken-From: Linux iwlwifi commits 1083fd7391e989be52022f0f338e9dadc048b063 and 75118fdb63496e4611ab50380499ddd62b9de69f. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (c947b0b8dc96dabefd63f7b70d53695e36c7b64f) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:43:45 2019 (r343377) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:20 2019 (r343378) @@ -1794,11 +1794,6 @@ enum { /* Thermal Throttling*/ IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, - /* Scanning */ - IWM_SCAN_ABORT_CMD = 0x81, - IWM_SCAN_START_NOTIFICATION = 0x82, - IWM_SCAN_RESULTS_NOTIFICATION = 0x83, - /* NVM */ IWM_NVM_ACCESS_CMD = 0x88, @@ -4952,50 +4947,14 @@ struct iwm_periodic_scan_complete { uint32_t reserved; } __packed; -/* How many statistics are gathered for each channel */ -#define IWM_SCAN_RESULTS_STATISTICS 1 - /** - * enum iwm_scan_complete_status - status codes for scan complete notifications - * @IWM_SCAN_COMP_STATUS_OK: scan completed successfully - * @IWM_SCAN_COMP_STATUS_ABORT: scan was aborted by user - * @IWM_SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed - * @IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready - * @IWM_SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed - * @IWM_SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed - * @IWM_SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command - * @IWM_SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort - * @IWM_SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax - * @IWM_SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful - * (not an error!) - * @IWM_SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver - * asked for - * @IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events -*/ -enum iwm_scan_complete_status { - IWM_SCAN_COMP_STATUS_OK = 0x1, - IWM_SCAN_COMP_STATUS_ABORT = 0x2, - IWM_SCAN_COMP_STATUS_ERR_SLEEP = 0x3, - IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4, - IWM_SCAN_COMP_STATUS_ERR_PROBE = 0x5, - IWM_SCAN_COMP_STATUS_ERR_WAKEUP = 0x6, - IWM_SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7, - IWM_SCAN_COMP_STATUS_ERR_INTERNAL = 0x8, - IWM_SCAN_COMP_STATUS_ERR_COEX = 0x9, - IWM_SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA, - IWM_SCAN_COMP_STATUS_ITERATION_END = 0x0B, - IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C, -}; - -/** - * struct iwm_scan_results_notif - scan results for one channel - * ( IWM_SCAN_RESULTS_NOTIFICATION = 0x83 ) + * struct iwm_scan_results_notif - scan results for one channel - + * SCAN_RESULT_NTF_API_S_VER_3 * @channel: which channel the results are from * @band: 0 for 5.2 GHz, 1 for 2.4 GHz * @probe_status: IWM_SCAN_PROBE_STATUS_*, indicates success of probe request * @num_probe_not_sent: # of request that weren't sent due to not enough time * @duration: duration spent in channel, in usecs - * @statistics: statistics gathered for this channel */ struct iwm_scan_results_notif { uint8_t channel; @@ -5003,8 +4962,7 @@ struct iwm_scan_results_notif { uint8_t probe_status; uint8_t num_probe_not_sent; uint32_t duration; - uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS]; -} __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */ +} __packed; enum iwm_scan_framework_client { IWM_SCAN_CLIENT_SCHED_SCAN = (1 << 0), From owner-svn-src-all@freebsd.org Thu Jan 24 03:48:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD0B514C0694; Thu, 24 Jan 2019 03:48: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 74C32768F7; Thu, 24 Jan 2019 03:48: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 6863822C3E; Thu, 24 Jan 2019 03:48: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 x0O3mp1G026206; Thu, 24 Jan 2019 03:48:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3mpDA026205; Thu, 24 Jan 2019 03:48:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240348.x0O3mpDA026205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343386 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74C32768F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:48:52 -0000 Author: kevans Date: Thu Jan 24 03:48:50 2019 New Revision: 343386 URL: https://svnweb.freebsd.org/changeset/base/343386 Log: if_iwm - Stop iwm_watchdog callout when idle. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (6a8683b0e9d734f23bd9647e117da198c2b9a74e) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:27 2019 (r343385) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:50 2019 (r343386) @@ -3814,6 +3814,8 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m } else { error = iwm_tx(sc, m, ni, 0); } + if (sc->sc_tx_timer == 0) + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); sc->sc_tx_timer = 5; IWM_UNLOCK(sc); @@ -4754,7 +4756,6 @@ iwm_init(struct iwm_softc *sc) * Ok, firmware loaded and we are jogging */ sc->sc_flags |= IWM_FLAG_HW_INITED; - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static int @@ -4800,6 +4801,10 @@ iwm_start(struct iwm_softc *sc) ieee80211_free_node(ni); continue; } + if (sc->sc_tx_timer == 0) { + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, + sc); + } sc->sc_tx_timer = 15; } IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TRACE, "<-%s\n", __func__); @@ -4834,8 +4839,8 @@ iwm_watchdog(void *arg) counter_u64_add(sc->sc_ic.ic_oerrors, 1); return; } + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static void From owner-svn-src-all@freebsd.org Thu Jan 24 03:50:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C74DF14C07F9; Thu, 24 Jan 2019 03:50:04 +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 6C69A76C94; Thu, 24 Jan 2019 03:50:04 +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 5855722C46; Thu, 24 Jan 2019 03:50:04 +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 x0O3o4W0026422; Thu, 24 Jan 2019 03:50:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3o4jg026421; Thu, 24 Jan 2019 03:50:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240350.x0O3o4jg026421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343389 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C69A76C94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:50:05 -0000 Author: kevans Date: Thu Jan 24 03:50:03 2019 New Revision: 343389 URL: https://svnweb.freebsd.org/changeset/base/343389 Log: iwm - Remove unused REPLY_MAX Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (92a727c99d6ec5abf14bb6853e95e3a187a0cd4e) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:35 2019 (r343388) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:03 2019 (r343389) @@ -1866,8 +1866,6 @@ enum { IWM_NET_DETECT_PROFILES_CMD = 0x57, IWM_NET_DETECT_HOTSPOTS_CMD = 0x58, IWM_NET_DETECT_HOTSPOTS_QUERY_CMD = 0x59, - - IWM_REPLY_MAX = 0xff, }; enum iwm_phy_ops_subcmd_ids { From owner-svn-src-all@freebsd.org Thu Jan 24 03:50:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B1214C0864; Thu, 24 Jan 2019 03:50:28 +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 28FD976DA7; Thu, 24 Jan 2019 03:50:28 +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 1B7CF22C47; Thu, 24 Jan 2019 03:50:28 +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 x0O3oRLC026481; Thu, 24 Jan 2019 03:50:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3oReE026480; Thu, 24 Jan 2019 03:50:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240350.x0O3oReE026480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343390 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28FD976DA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:50:28 -0000 Author: kevans Date: Thu Jan 24 03:50:27 2019 New Revision: 343390 URL: https://svnweb.freebsd.org/changeset/base/343390 Log: iwm - Remove unused TX_CMD_NEXT_FRAME_* Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (b0c6116f364a121ab6b9d634ca1997d4167fa747) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:03 2019 (r343389) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:27 2019 (r343390) @@ -4283,30 +4283,7 @@ enum iwm_tx_pm_timeouts { #define IWM_TX_CMD_SEC_WEP_KEY_IDX_MSK 0xc0 #define IWM_TX_CMD_SEC_KEY128 0x08 -/* TODO: how does these values are OK with only 16 bit variable??? */ /* - * TX command next frame info - * - * bits 0:2 - security control (IWM_TX_CMD_SEC_*) - * bit 3 - immediate ACK required - * bit 4 - rate is taken from STA table - * bit 5 - frame belongs to BA stream - * bit 6 - immediate BA response expected - * bit 7 - unused - * bits 8:15 - Station ID - * bits 16:31 - rate - */ -#define IWM_TX_CMD_NEXT_FRAME_ACK_MSK (0x8) -#define IWM_TX_CMD_NEXT_FRAME_STA_RATE_MSK (0x10) -#define IWM_TX_CMD_NEXT_FRAME_BA_MSK (0x20) -#define IWM_TX_CMD_NEXT_FRAME_IMM_BA_RSP_MSK (0x40) -#define IWM_TX_CMD_NEXT_FRAME_FLAGS_MSK (0xf8) -#define IWM_TX_CMD_NEXT_FRAME_STA_ID_MSK (0xff00) -#define IWM_TX_CMD_NEXT_FRAME_STA_ID_POS (8) -#define IWM_TX_CMD_NEXT_FRAME_RATE_MSK (0xffff0000) -#define IWM_TX_CMD_NEXT_FRAME_RATE_POS (16) - -/* * TX command Frame life time in us - to be written in pm_frame_timeout */ #define IWM_TX_CMD_LIFE_TIME_INFINITE 0xFFFFFFFF @@ -4343,7 +4320,7 @@ enum iwm_tx_pm_timeouts { * @initial_rate_index: index into the rate table for initial TX attempt. * Applied if IWM_TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames. * @key: security key - * @next_frame_flags: IWM_TX_CMD_SEC_* and IWM_TX_CMD_NEXT_FRAME_* + * @reserved3: reserved * @life_time: frame life time (usecs??) * @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt + * btkill_cnd + reserved), first 32 bits. "0" disables usage. From owner-svn-src-all@freebsd.org Thu Jan 24 03:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D08914C02EF; Thu, 24 Jan 2019 03:46:36 +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 E64D576201; Thu, 24 Jan 2019 03:46:35 +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 DA67822C34; Thu, 24 Jan 2019 03:46:35 +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 x0O3kZwN025934; Thu, 24 Jan 2019 03:46:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3kZXE025933; Thu, 24 Jan 2019 03:46:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240346.x0O3kZXE025933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343382 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E64D576201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:46:36 -0000 Author: kevans Date: Thu Jan 24 03:46:35 2019 New Revision: 343382 URL: https://svnweb.freebsd.org/changeset/base/343382 Log: iwm - Avoid Tx watchdog timeout, when dropping a connection. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (3e12596fb5c55351517cdd741d72979388a8c75c) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:55 2019 (r343381) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:46:35 2019 (r343382) @@ -4329,6 +4329,10 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ IEEE80211_UNLOCK(ic); IWM_LOCK(sc); + /* Avoid Tx watchdog triggering, when a connectionm is dropped. */ + if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) + sc->sc_tx_timer = 0; + if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && (nstate == IEEE80211_S_AUTH || nstate == IEEE80211_S_ASSOC || From owner-svn-src-all@freebsd.org Thu Jan 24 03:48:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC5B314C063C; Thu, 24 Jan 2019 03:48:27 +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 763A97677A; Thu, 24 Jan 2019 03:48:27 +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 69AC922C3D; Thu, 24 Jan 2019 03:48:27 +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 x0O3mRwm026147; Thu, 24 Jan 2019 03:48:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3mR4O026146; Thu, 24 Jan 2019 03:48:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240348.x0O3mR4O026146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343385 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 763A97677A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:48:27 -0000 Author: kevans Date: Thu Jan 24 03:48:27 2019 New Revision: 343385 URL: https://svnweb.freebsd.org/changeset/base/343385 Log: iwm - Always clear watchdog timer, when bringing down firmware state. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (8abdc2b36a45c4e9c95fc8263ca532ea26633dcb) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:47 2019 (r343384) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:27 2019 (r343385) @@ -4225,6 +4225,9 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i struct iwm_vap *ivp = IWM_VAP(vap); int error; + /* Avoid Tx watchdog triggering, when transfers get dropped here. */ + sc->sc_tx_timer = 0; + ivp->iv_auth = 0; if (sc->sc_firmware_state == 3) { iwm_xmit_queue_drain(sc); @@ -4328,10 +4331,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - - /* Avoid Tx watchdog triggering, when a connectionm is dropped. */ - if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) - sc->sc_tx_timer = 0; if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && (nstate == IEEE80211_S_AUTH || From owner-svn-src-all@freebsd.org Thu Jan 24 03:47:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9264F14C0529; Thu, 24 Jan 2019 03:47:48 +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 3A62E76564; Thu, 24 Jan 2019 03:47:48 +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 2D83822C3B; Thu, 24 Jan 2019 03:47:48 +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 x0O3lmHU026078; Thu, 24 Jan 2019 03:47:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3llKV026073; Thu, 24 Jan 2019 03:47:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240347.x0O3llKV026073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343384 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A62E76564 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:47:48 -0000 Author: kevans Date: Thu Jan 24 03:47:47 2019 New Revision: 343384 URL: https://svnweb.freebsd.org/changeset/base/343384 Log: iwm - Clear Time Event active state, when receiving End Notification. * This hopefully avoids some firmware panics, I was occasionally seeing, when iwm disconnects upon losing signal to an access point at some point. * This is synchronizing the if_iwm_time_event.c file a bit more from the corresponding Linux iwlwifi/mvm/time-event.c. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (e8cb71584a6a72232c13151d60e57f7f229220eb) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:47 2019 (r343384) @@ -5375,15 +5375,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; } - case IWM_TIME_EVENT_NOTIFICATION: { - struct iwm_time_event_notif *notif; - notif = (void *)pkt->data; - - IWM_DPRINTF(sc, IWM_DEBUG_INTR, - "TE notif status = 0x%x action = 0x%x\n", - notif->status, notif->action); + case IWM_TIME_EVENT_NOTIFICATION: + iwm_mvm_rx_time_event_notif(sc, pkt); break; - } /* * Firmware versions 21 and 22 generate some DEBUG_LOG_MSG Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:47 2019 (r343384) @@ -159,13 +159,74 @@ __FBSDID("$FreeBSD$"); #include #include +#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) + +static void +iwm_mvm_te_clear_data(struct iwm_softc *sc) +{ + sc->sc_time_event_uid = 0; + sc->sc_time_event_duration = 0; + sc->sc_time_event_end_ticks = 0; + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; +} + /* - * For the high priority TE use a time event type that has similar priority to - * the FW's action scan priority. + * Handles a FW notification for an event that is known to the driver. + * + * @mvm: the mvm component + * @te_data: the time event data + * @notif: the notification data corresponding the time event data. */ -#define IWM_MVM_ROC_TE_TYPE_NORMAL IWM_TE_P2P_DEVICE_DISCOVERABLE -#define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC +static void +iwm_mvm_te_handle_notif(struct iwm_softc *sc, + struct iwm_time_event_notif *notif) +{ + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Handle time event notif - UID = 0x%x action %d\n", + le32toh(notif->unique_id), + le32toh(notif->action)); + if (!le32toh(notif->status)) { + const char *msg; + + if (notif->action & htole32(IWM_TE_V2_NOTIF_HOST_EVENT_START)) + msg = "Time Event start notification failure"; + else + msg = "Time Event end notification failure"; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, "%s\n", msg); + } + + if (le32toh(notif->action) & IWM_TE_V2_NOTIF_HOST_EVENT_END) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TE ended - current time %d, estimated end %d\n", + ticks, sc->sc_time_event_end_ticks); + + iwm_mvm_te_clear_data(sc); + } else if (le32toh(notif->action) & IWM_TE_V2_NOTIF_HOST_EVENT_START) { + sc->sc_time_event_end_ticks = + ticks + TU_TO_HZ(sc->sc_time_event_duration); + } else { + device_printf(sc->sc_dev, "Got TE with unknown action\n"); + } +} + +/* + * The Rx handler for time event notifications + */ +void +iwm_mvm_rx_time_event_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +{ + struct iwm_time_event_notif *notif = (void *)pkt->data; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Time event notification - UID = 0x%x action %d\n", + le32toh(notif->unique_id), + le32toh(notif->action)); + + iwm_mvm_te_handle_notif(sc, notif); +} + static int iwm_mvm_te_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) @@ -241,6 +302,8 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru IWM_DPRINTF(sc, IWM_DEBUG_TE, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); + sc->sc_time_event_duration = le32toh(te_cmd->duration); + /* * Use a notification wait, which really just processes the * command response and doesn't wait for anything, in order @@ -279,8 +342,6 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru return ret; } -#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) - void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif) @@ -362,7 +423,7 @@ iwm_mvm_stop_session_protection(struct iwm_softc *sc, "%s: Removing TE 0x%x\n", __func__, le32toh(time_cmd.id)); if (iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(time_cmd), &time_cmd) == 0) - sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; + iwm_mvm_te_clear_data(sc); DELAY(100); } Modified: head/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:47 2019 (r343384) @@ -107,6 +107,8 @@ #ifndef __IF_IWM_TIME_EVENT_H__ #define __IF_IWM_TIME_EVENT_H__ +extern void iwm_mvm_rx_time_event_notif(struct iwm_softc *sc, + struct iwm_rx_packet *pkt); extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif); extern void iwm_mvm_stop_session_protection(struct iwm_softc *sc, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:47 2019 (r343384) @@ -566,6 +566,12 @@ struct iwm_softc { /* Unique ID (assigned by the firmware) of the current Time Event. */ uint32_t sc_time_event_uid; + + /* Duration of the Time Event in TU. */ + uint32_t sc_time_event_duration; + + /* Expected end of the Time Event in HZ ticks. */ + int sc_time_event_end_ticks; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Jan 24 06:34:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D580814C4452; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@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 7934F83B3A; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64D3C248DC; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O6YUdZ013809; Thu, 24 Jan 2019 06:34:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O6YUIe013808; Thu, 24 Jan 2019 06:34:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901240634.x0O6YUIe013808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 24 Jan 2019 06:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343391 - head/tools/tools/tinybsd X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/tools/tinybsd X-SVN-Commit-Revision: 343391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7934F83B3A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 06:34:31 -0000 Author: gonzo Date: Thu Jan 24 06:34:29 2019 New Revision: 343391 URL: https://svnweb.freebsd.org/changeset/base/343391 Log: Fix prompt for MFSROOT in tinybsd tinybsd offers two choices when prompting user for MFSROOT: 'YES' and 'NO'. Script logic only handles 'yes'. Change offered values to lower case. PR: 131059 Submitted by: Brock Williams MFC after: 1 week Modified: head/tools/tools/tinybsd/tinybsd Modified: head/tools/tools/tinybsd/tinybsd ============================================================================== --- head/tools/tools/tinybsd/tinybsd Thu Jan 24 03:50:27 2019 (r343390) +++ head/tools/tools/tinybsd/tinybsd Thu Jan 24 06:34:29 2019 (r343391) @@ -206,7 +206,7 @@ loadconfig () { break fi done - MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"` + MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (yes/no)"` IMG=`confirm_action "$IMG" "Image file to generate?"` # example of formatted value (NNN in this case) From owner-svn-src-all@freebsd.org Thu Jan 24 08:15:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B890B14C6188; Thu, 24 Jan 2019 08:15:42 +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 5426A863B6; Thu, 24 Jan 2019 08:15:42 +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 48C78259A3; Thu, 24 Jan 2019 08:15:42 +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 x0O8FgsS065349; Thu, 24 Jan 2019 08:15:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8FgPt065348; Thu, 24 Jan 2019 08:15:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240815.x0O8FgPt065348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343392 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5426A863B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:15:42 -0000 Author: hselasky Date: Thu Jan 24 08:15:41 2019 New Revision: 343392 URL: https://svnweb.freebsd.org/changeset/base/343392 Log: Fix duplicate acquiring of refcount when joining IPv6 multicast groups. This was observed by starting and stopping rpcbind(8) multiple times. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 06:34:29 2019 (r343391) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:15:41 2019 (r343392) @@ -2178,7 +2178,10 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop IN6_MULTI_UNLOCK(); goto out_im6o_free; } - in6m_acquire(inm); + /* + * NOTE: Refcount from in6_joingroup_locked() + * is protecting membership. + */ imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); From owner-svn-src-all@freebsd.org Thu Jan 24 08:18:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EB5A14C6250; Thu, 24 Jan 2019 08:18:03 +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 B7BC386638; Thu, 24 Jan 2019 08:18:02 +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 A4A20259DB; Thu, 24 Jan 2019 08:18:02 +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 x0O8I2Jc065495; Thu, 24 Jan 2019 08:18:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8I2GU065494; Thu, 24 Jan 2019 08:18:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240818.x0O8I2GU065494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343393 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7BC386638 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:18:03 -0000 Author: hselasky Date: Thu Jan 24 08:18:02 2019 New Revision: 343393 URL: https://svnweb.freebsd.org/changeset/base/343393 Log: Add debugging sysctl to disable incoming MLD v2 messages similar to the existing sysctl for MLD v1 messages. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jan 24 08:15:41 2019 (r343392) +++ head/sys/netinet6/mld6.c Thu Jan 24 08:18:02 2019 (r343393) @@ -243,6 +243,10 @@ static int mld_v1enable = 1; SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_RWTUN, &mld_v1enable, 0, "Enable fallback to MLDv1"); +static int mld_v2enable = 1; +SYSCTL_INT(_net_inet6_mld, OID_AUTO, v2enable, CTLFLAG_RWTUN, + &mld_v2enable, 0, "Enable MLDv2"); + static int mld_use_allow = 1; SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RWTUN, &mld_use_allow, 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); @@ -817,7 +821,12 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 char ip6tbuf[INET6_ADDRSTRLEN]; #endif - is_general_query = 0; + if (!mld_v2enable) { + CTR3(KTR_MLD, "ignore v2 query src %s on ifp %p(%s)", + ip6_sprintf(ip6tbuf, &ip6->ip6_src), + ifp, if_name(ifp)); + return (0); + } /* * RFC3810 Section 6.2: MLD queries must originate from @@ -829,6 +838,8 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 ifp, if_name(ifp)); return (0); } + + is_general_query = 0; CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); From owner-svn-src-all@freebsd.org Thu Jan 24 08:25:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F22114C66B9; Thu, 24 Jan 2019 08:25:04 +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 D44B886C56; Thu, 24 Jan 2019 08:25:03 +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 C6E0725B84; Thu, 24 Jan 2019 08:25:03 +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 x0O8P3nO070685; Thu, 24 Jan 2019 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8P3fd070682; Thu, 24 Jan 2019 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240825.x0O8P3fd070682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343394 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D44B886C56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:25:04 -0000 Author: hselasky Date: Thu Jan 24 08:25:02 2019 New Revision: 343394 URL: https://svnweb.freebsd.org/changeset/base/343394 Log: When detaching a network interface drain the workqueue freeing the inm's because the destructor will access the if_ioctl() callback in the ifnet pointer which is about to be freed. This prevents use-after-free. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:25:02 2019 (r343394) @@ -884,6 +884,13 @@ in6_purgemaddrs(struct ifnet *ifp) IN6_MULTI_LIST_UNLOCK(); IN6_MULTI_UNLOCK(); in6m_release_list_deferred(&purgeinms); + + /* + * Make sure all multicast deletions invoking if_ioctl() are + * completed before returning. Else we risk accessing a freed + * ifnet structure pointer. + */ + in6m_release_wait(); } void Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:25:02 2019 (r343394) @@ -585,6 +585,14 @@ in6m_release_list_deferred(struct in6_multi_head *inmh } void +in6m_release_wait(void) +{ + + /* Wait for all jobs to complete. */ + gtaskqueue_drain_all(free_gtask.gt_taskqueue); +} + +void in6m_disconnect(struct in6_multi *inm) { struct ifnet *ifp; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_var.h Thu Jan 24 08:25:02 2019 (r343394) @@ -811,6 +811,7 @@ void in6m_print(const struct in6_multi *); int in6m_record_source(struct in6_multi *, const struct in6_addr *); void in6m_release_deferred(struct in6_multi *); void in6m_release_list_deferred(struct in6_multi_head *); +void in6m_release_wait(void); void ip6_freemoptions(struct ip6_moptions *); int ip6_getmoptions(struct inpcb *, struct sockopt *); int ip6_setmoptions(struct inpcb *, struct sockopt *); From owner-svn-src-all@freebsd.org Thu Jan 24 08:34:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA5814C6B0B; Thu, 24 Jan 2019 08:34:15 +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 B4FC58737F; Thu, 24 Jan 2019 08:34:14 +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 8AD4225D63; Thu, 24 Jan 2019 08:34:14 +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 x0O8YExP075803; Thu, 24 Jan 2019 08:34:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8YD8Q075799; Thu, 24 Jan 2019 08:34:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240834.x0O8YD8Q075799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343395 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4FC58737F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:34:15 -0000 Author: hselasky Date: Thu Jan 24 08:34:13 2019 New Revision: 343395 URL: https://svnweb.freebsd.org/changeset/base/343395 Log: Fix refcounting leaks in IPv6 MLD code leading to loss of IPv6 connectivity. Looking at past changes in this area like r337866, some refcounting bugs have been introduced, one by one. For example like calling in6m_disconnect() and in6m_rele_locked() in mld_v1_process_group_timer() where previously no disconnect nor refcount decrement was done. Calling in6m_disconnect() when it shouldn't causes IPv6 solitation to no longer work, because all the multicast addresses receiving the solitation messages are now deleted from the network interface. This patch reverts some recent changes while improving the MLD refcounting and concurrency model after the MLD code was converted to using EPOCH(9). List changes: - All CK_STAILQ_FOREACH() macros are now properly enclosed into EPOCH(9) sections. This simplifies assertion of locking inside in6m_ifmultiaddr_get_inm(). - Corrected bad use of in6m_disconnect() leading to loss of IPv6 connectivity for MLD v1. - Factored out checks for valid inm structure into in6m_ifmultiaddr_get_inm(). PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c head/sys/netinet6/mld6_var.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:34:13 2019 (r343395) @@ -854,36 +854,15 @@ in6_tmpaddrtimer(void *arg) static void in6_purgemaddrs(struct ifnet *ifp) { - struct in6_multi_head purgeinms; - struct in6_multi *inm; - struct ifmultiaddr *ifma, *next; + struct in6_multi_head inmh; - SLIST_INIT(&purgeinms); + SLIST_INIT(&inmh); IN6_MULTI_LOCK(); IN6_MULTI_LIST_LOCK(); - IF_ADDR_WLOCK(ifp); - /* - * Extract list of in6_multi associated with the detaching ifp - * which the PF_INET6 layer is about to release. - */ - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in6_multi *)ifma->ifma_protospec; - in6m_disconnect(inm); - in6m_rele_locked(&purgeinms, inm); - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } - } - IF_ADDR_WUNLOCK(ifp); - mld_ifdetach(ifp); + mld_ifdetach(ifp, &inmh); IN6_MULTI_LIST_UNLOCK(); IN6_MULTI_UNLOCK(); - in6m_release_list_deferred(&purgeinms); + in6m_release_list_deferred(&inmh); /* * Make sure all multicast deletions invoking if_ioctl() are Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:34:13 2019 (r343395) @@ -190,7 +190,6 @@ static SYSCTL_NODE(_net_inet6_ip6_mcast, OID_AUTO, fil CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip6_mcast_filters, "Per-interface stack-wide source filters"); -int ifma6_restart = 0; #ifdef KTR /* * Inline function which wraps assertions for a valid ifp. @@ -405,6 +404,7 @@ static int in6_getmulti(struct ifnet *ifp, const struct in6_addr *group, struct in6_multi **pinm) { + struct epoch_tracker et; struct sockaddr_in6 gsin6; struct ifmultiaddr *ifma; struct in6_multi *inm; @@ -420,7 +420,10 @@ in6_getmulti(struct ifnet *ifp, const struct in6_addr IN6_MULTI_LOCK_ASSERT(); IN6_MULTI_LIST_LOCK(); IF_ADDR_WLOCK(ifp); + NET_EPOCH_ENTER(et); inm = in6m_lookup_locked(ifp, group); + NET_EPOCH_EXIT(et); + if (inm != NULL) { /* * If we already joined this group, just bump the @@ -593,7 +596,7 @@ in6m_release_wait(void) } void -in6m_disconnect(struct in6_multi *inm) +in6m_disconnect_locked(struct in6_multi_head *inmh, struct in6_multi *inm) { struct ifnet *ifp; struct ifaddr *ifa; @@ -601,10 +604,12 @@ in6m_disconnect(struct in6_multi *inm) struct in6_multi_mship *imm, *imm_tmp; struct ifmultiaddr *ifma, *ll_ifma; - ifp = inm->in6m_ifp; + IN6_MULTI_LIST_LOCK_ASSERT(); + ifp = inm->in6m_ifp; if (ifp == NULL) - return; + return; /* already called */ + inm->in6m_ifp = NULL; IF_ADDR_WLOCK_ASSERT(ifp); ifma = inm->in6m_ifma; @@ -623,7 +628,6 @@ in6m_disconnect(struct in6_multi *inm) MPASS(ll_ifma->ifma_llifma == NULL); MPASS(ll_ifma->ifma_ifp == ifp); if (--ll_ifma->ifma_refcount == 0) { - ifma6_restart = true; if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) { CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); ll_ifma->ifma_flags &= ~IFMA_F_ENQUEUED; @@ -641,28 +645,12 @@ in6m_disconnect(struct in6_multi *inm) if (inm == imm->i6mm_maddr) { LIST_REMOVE(imm, i6mm_chain); free(imm, M_IP6MADDR); + in6m_rele_locked(inmh, inm); } } } } -void -in6m_release_deferred(struct in6_multi *inm) -{ - struct in6_multi_head tmp; - - IN6_MULTI_LIST_LOCK_ASSERT(); - KASSERT(inm->in6m_refcount > 0, ("refcount == %d inm: %p", inm->in6m_refcount, inm)); - if (--inm->in6m_refcount == 0) { - MPASS(inm->in6m_ifp == NULL); - SLIST_INIT(&tmp); - inm->in6m_ifma->ifma_protospec = NULL; - MPASS(inm->in6m_ifma->ifma_llifma == NULL); - SLIST_INSERT_HEAD(&tmp, inm, in6m_nrele); - in6m_release_list_deferred(&tmp); - } -} - static void in6m_release_task(void *arg __unused) { @@ -1262,6 +1250,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct i /*const*/ struct in6_mfilter *imf, struct in6_multi **pinm, const int delay) { + struct in6_multi_head inmh; struct in6_mfilter timf; struct in6_multi *inm; struct ifmultiaddr *ifma; @@ -1321,6 +1310,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct i } out_in6m_release: + SLIST_INIT(&inmh); if (error) { struct epoch_tracker et; @@ -1332,13 +1322,14 @@ out_in6m_release: break; } } - in6m_disconnect(inm); - in6m_release_deferred(inm); + in6m_disconnect_locked(&inmh, inm); + in6m_rele_locked(&inmh, inm); NET_EPOCH_EXIT(et); } else { *pinm = inm; } IN6_MULTI_LIST_UNLOCK(); + in6m_release_list_deferred(&inmh); return (error); } @@ -1372,6 +1363,7 @@ in6_leavegroup(struct in6_multi *inm, /*const*/ struct int in6_leavegroup_locked(struct in6_multi *inm, /*const*/ struct in6_mfilter *imf) { + struct in6_multi_head inmh; struct in6_mfilter timf; struct ifnet *ifp; int error; @@ -1421,13 +1413,15 @@ in6_leavegroup_locked(struct in6_multi *inm, /*const*/ CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm); if (ifp) IF_ADDR_WLOCK(ifp); - if (inm->in6m_refcount == 1 && inm->in6m_ifp != NULL) - in6m_disconnect(inm); - in6m_release_deferred(inm); + + SLIST_INIT(&inmh); + if (inm->in6m_refcount == 1) + in6m_disconnect_locked(&inmh, inm); + in6m_rele_locked(&inmh, inm); if (ifp) IF_ADDR_WUNLOCK(ifp); IN6_MULTI_LIST_UNLOCK(); - + in6m_release_list_deferred(&inmh); return (error); } @@ -1941,6 +1935,7 @@ in6p_lookup_mcast_ifp(const struct inpcb *in6p, static int in6p_join_group(struct inpcb *inp, struct sockopt *sopt) { + struct in6_multi_head inmh; struct group_source_req gsr; sockunion_t *gsa, *ssa; struct ifnet *ifp; @@ -1951,6 +1946,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop size_t idx; int error, is_new; + SLIST_INIT(&inmh); ifp = NULL; imf = NULL; lims = NULL; @@ -2227,7 +2223,7 @@ out_im6o_free: inm = imo->im6o_membership[idx]; if (inm != NULL) { IN6_MULTI_LIST_LOCK(); - in6m_release_deferred(inm); + in6m_rele_locked(&inmh, inm); IN6_MULTI_LIST_UNLOCK(); } imo->im6o_membership[idx] = NULL; @@ -2236,6 +2232,7 @@ out_im6o_free: out_in6p_locked: INP_WUNLOCK(inp); + in6m_release_list_deferred(&inmh); return (error); } @@ -2880,10 +2877,9 @@ sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS) IN6_MULTI_LIST_LOCK(); NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; if (!IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, &mcaddr)) continue; fmode = inm->in6m_st[1].iss_fmode; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_var.h Thu Jan 24 08:34:13 2019 (r343395) @@ -645,6 +645,7 @@ struct in6_multi { /* New fields for MLDv2 follow. */ struct mld_ifsoftc *in6m_mli; /* MLD info */ SLIST_ENTRY(in6_multi) in6m_nrele; /* to-be-released by MLD */ + SLIST_ENTRY(in6_multi) in6m_defer; /* deferred MLDv1 */ struct ip6_msource_tree in6m_srcs; /* tree of sources */ u_long in6m_nsrc; /* # of tree entries */ @@ -670,8 +671,8 @@ struct in6_multi { } in6m_st[2]; /* state at t0, t1 */ }; -void in6m_disconnect(struct in6_multi *inm); -extern int ifma6_restart; +void in6m_disconnect_locked(struct in6_multi_head *inmh, struct in6_multi *inm); + /* * Helper function to derive the filter mode on a source entry * from its internal counters. Predicates are: @@ -713,13 +714,25 @@ extern struct sx in6_multi_sx; #define IN6_MULTI_LOCK_ASSERT() sx_assert(&in6_multi_sx, SA_XLOCKED) #define IN6_MULTI_UNLOCK_ASSERT() sx_assert(&in6_multi_sx, SA_XUNLOCKED) +/* + * Get the in6_multi pointer from a ifmultiaddr. + * Returns NULL if ifmultiaddr is no longer valid. + */ +static __inline struct in6_multi * +in6m_ifmultiaddr_get_inm(struct ifmultiaddr *ifma) +{ + NET_EPOCH_ASSERT(); + + return ((ifma->ifma_addr->sa_family != AF_INET6 || + (ifma->ifma_flags & IFMA_F_ENQUEUED) == 0) ? NULL : + ifma->ifma_protospec); +} + /* * Look up an in6_multi record for an IPv6 multicast address * on the interface ifp. * If no record found, return NULL. - * - * SMPng: The IN6_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held. */ static __inline struct in6_multi * in6m_lookup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr) @@ -727,18 +740,14 @@ in6m_lookup_locked(struct ifnet *ifp, const struct in6 struct ifmultiaddr *ifma; struct in6_multi *inm; - inm = NULL; - CK_STAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { - if (ifma->ifma_addr->sa_family == AF_INET6) { - inm = (struct in6_multi *)ifma->ifma_protospec; - if (inm == NULL) - continue; - if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) - break; - inm = NULL; - } + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) + continue; + if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) + return (inm); } - return (inm); + return (NULL); } /* @@ -809,7 +818,6 @@ void in6m_clear_recorded(struct in6_multi *); void in6m_commit(struct in6_multi *); void in6m_print(const struct in6_multi *); int in6m_record_source(struct in6_multi *, const struct in6_addr *); -void in6m_release_deferred(struct in6_multi *); void in6m_release_list_deferred(struct in6_multi_head *); void in6m_release_wait(void); void ip6_freemoptions(struct ip6_moptions *); Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/mld6.c Thu Jan 24 08:34:13 2019 (r343395) @@ -110,7 +110,7 @@ static void mli_delete_locked(const struct ifnet *); static void mld_dispatch_packet(struct mbuf *); static void mld_dispatch_queue(struct mbufq *, int); static void mld_final_leave(struct in6_multi *, struct mld_ifsoftc *); -static void mld_fasttimo_vnet(void); +static void mld_fasttimo_vnet(struct in6_multi_head *inmh); static int mld_handle_state_change(struct in6_multi *, struct mld_ifsoftc *); static int mld_initial_join(struct in6_multi *, struct mld_ifsoftc *, @@ -537,45 +537,48 @@ out: * XXX This routine is also bitten by unlocked ifma_protospec access. */ void -mld_ifdetach(struct ifnet *ifp) +mld_ifdetach(struct ifnet *ifp, struct in6_multi_head *inmh) { + struct epoch_tracker et; struct mld_ifsoftc *mli; - struct ifmultiaddr *ifma, *next; + struct ifmultiaddr *ifma; struct in6_multi *inm; - struct in6_multi_head inmh; CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, if_name(ifp)); - SLIST_INIT(&inmh); IN6_MULTI_LIST_LOCK_ASSERT(); MLD_LOCK(); mli = MLD_IFINFO(ifp); - if (mli->mli_version == MLD_VERSION_2) { - IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in6_multi *)ifma->ifma_protospec; + IF_ADDR_WLOCK(ifp); + /* + * Extract list of in6_multi associated with the detaching ifp + * which the PF_INET6 layer is about to release. + */ + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) + continue; + in6m_disconnect_locked(inmh, inm); + + if (mli->mli_version == MLD_VERSION_2) { + in6m_clear_recorded(inm); + + /* + * We need to release the final reference held + * for issuing the INCLUDE {}. + */ if (inm->in6m_state == MLD_LEAVING_MEMBER) { - in6m_disconnect(inm); - in6m_rele_locked(&inmh, inm); - ifma->ifma_protospec = NULL; + inm->in6m_state = MLD_NOT_MEMBER; + in6m_rele_locked(inmh, inm); } - in6m_clear_recorded(inm); - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } - IF_ADDR_WUNLOCK(ifp); } - + NET_EPOCH_EXIT(et); + IF_ADDR_WUNLOCK(ifp); MLD_UNLOCK(); - in6m_release_list_deferred(&inmh); } /* @@ -709,10 +712,9 @@ mld_v1_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "process v1 general query on ifp %p(%s)", ifp, if_name(ifp)); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; mld_v1_update_group(inm, timer); } } else { @@ -1324,15 +1326,19 @@ mld_input(struct mbuf *m, int off, int icmp6len) void mld_fasttimo(void) { + struct in6_multi_head inmh; VNET_ITERATOR_DECL(vnet_iter); + SLIST_INIT(&inmh); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - mld_fasttimo_vnet(); + mld_fasttimo_vnet(&inmh); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); + in6m_release_list_deferred(&inmh); } /* @@ -1341,15 +1347,15 @@ mld_fasttimo(void) * VIMAGE: Assume caller has set up our curvnet. */ static void -mld_fasttimo_vnet(void) +mld_fasttimo_vnet(struct in6_multi_head *inmh) { + struct epoch_tracker et; struct mbufq scq; /* State-change packets */ struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifsoftc *mli; - struct ifmultiaddr *ifma, *next; - struct in6_multi *inm, *tinm; - struct in6_multi_head inmh; + struct ifmultiaddr *ifma; + struct in6_multi *inm; int uri_fasthz; uri_fasthz = 0; @@ -1364,7 +1370,6 @@ mld_fasttimo_vnet(void) !V_state_change_timers_running6) return; - SLIST_INIT(&inmh); IN6_MULTI_LIST_LOCK(); MLD_LOCK(); @@ -1410,25 +1415,20 @@ mld_fasttimo_vnet(void) } IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; switch (mli->mli_version) { case MLD_VERSION_1: - mld_v1_process_group_timer(&inmh, inm); + mld_v1_process_group_timer(inmh, inm); break; case MLD_VERSION_2: - mld_v2_process_group_timers(&inmh, &qrq, + mld_v2_process_group_timers(inmh, &qrq, &scq, inm, uri_fasthz); break; } - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } IF_ADDR_WUNLOCK(ifp); @@ -1442,9 +1442,8 @@ mld_fasttimo_vnet(void) * IF_ADDR_LOCK internally as well as * ip6_output() to transmit a packet. */ - SLIST_FOREACH_SAFE(inm, &inmh, in6m_nrele, tinm) { - SLIST_REMOVE_HEAD(&inmh, - in6m_nrele); + while ((inm = SLIST_FIRST(inmh)) != NULL) { + SLIST_REMOVE_HEAD(inmh, in6m_defer); (void)mld_v1_transmit_report(inm, MLD_LISTENER_REPORT); } @@ -1452,14 +1451,9 @@ mld_fasttimo_vnet(void) case MLD_VERSION_2: mld_dispatch_queue(&qrq, 0); mld_dispatch_queue(&scq, 0); - - /* - * Free the in_multi reference(s) for - * this lifecycle. - */ - in6m_release_list_deferred(&inmh); break; } + NET_EPOCH_EXIT(et); } out_locked: @@ -1499,8 +1493,7 @@ mld_v1_process_group_timer(struct in6_multi_head *inmh case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; - in6m_disconnect(inm); - in6m_rele_locked(inmh, inm); + SLIST_INSERT_HEAD(inmh, inm, in6m_defer); } break; case MLD_G_QUERY_PENDING_MEMBER: @@ -1624,7 +1617,7 @@ mld_v2_process_group_timers(struct in6_multi_head *inm if (inm->in6m_state == MLD_LEAVING_MEMBER && inm->in6m_scrv == 0) { inm->in6m_state = MLD_NOT_MEMBER; - in6m_disconnect(inm); + in6m_disconnect_locked(inmh, inm); in6m_rele_locked(inmh, inm); } } @@ -1669,10 +1662,11 @@ mld_set_version(struct mld_ifsoftc *mli, const int ver static void mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) { - struct ifmultiaddr *ifma, *next; + struct epoch_tracker et; + struct in6_multi_head inmh; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in6_multi *inm; - struct in6_multi_head inmh; CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__, mli->mli_ifp, if_name(mli->mli_ifp)); @@ -1695,12 +1689,11 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) ifp = mli->mli_ifp; IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; switch (inm->in6m_state) { case MLD_NOT_MEMBER: case MLD_SILENT_MEMBER: @@ -1715,9 +1708,7 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) * version, we need to release the final * reference held for issuing the INCLUDE {}. */ - in6m_disconnect(inm); in6m_rele_locked(&inmh, inm); - ifma->ifma_protospec = NULL; /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: case MLD_SG_QUERY_PENDING_MEMBER: @@ -1733,11 +1724,8 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) mbufq_drain(&inm->in6m_scq); break; } - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } + NET_EPOCH_EXIT(et); IF_ADDR_WUNLOCK(ifp); in6m_release_list_deferred(&inmh); } @@ -1910,6 +1898,14 @@ mld_change_state(struct in6_multi *inm, const int dela error = 0; /* + * Check if the in6_multi has already been disconnected. + */ + if (inm->in6m_ifp == NULL) { + CTR1(KTR_MLD, "%s: inm is disconnected", __func__); + return (0); + } + + /* * Try to detect if the upper layer just asked us to change state * for an interface which has now gone away. */ @@ -2019,6 +2015,7 @@ mld_initial_join(struct in6_multi *inm, struct mld_ifs if (mli->mli_version == MLD_VERSION_2 && inm->in6m_state == MLD_LEAVING_MEMBER) { inm->in6m_refcount--; + MPASS(inm->in6m_refcount > 0); } inm->in6m_state = MLD_REPORTING_MEMBER; @@ -3023,11 +3020,9 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - - inm = (struct in6_multi *)ifma->ifma_protospec; KASSERT(ifp == inm->in6m_ifp, ("%s: inconsistent ifp", __func__)); Modified: head/sys/netinet6/mld6_var.h ============================================================================== --- head/sys/netinet6/mld6_var.h Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/mld6_var.h Thu Jan 24 08:34:13 2019 (r343395) @@ -160,12 +160,13 @@ struct mld_ifsoftc { #define MLD_IFINFO(ifp) \ (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->mld_ifinfo) +struct in6_multi_head; int mld_change_state(struct in6_multi *, const int); struct mld_ifsoftc * mld_domifattach(struct ifnet *); void mld_domifdetach(struct ifnet *); void mld_fasttimo(void); -void mld_ifdetach(struct ifnet *); +void mld_ifdetach(struct ifnet *, struct in6_multi_head *); int mld_input(struct mbuf *, int, int); void mld_slowtimo(void); From owner-svn-src-all@freebsd.org Thu Jan 24 09:38:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 055CA14A8295; Thu, 24 Jan 2019 09:38:20 +0000 (UTC) (envelope-from mw@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 9A99C89F95; Thu, 24 Jan 2019 09:38:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8E7A626801; Thu, 24 Jan 2019 09:38:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O9cJqV007633; Thu, 24 Jan 2019 09:38:19 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O9cJga007631; Thu, 24 Jan 2019 09:38:19 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201901240938.x0O9cJga007631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 24 Jan 2019 09:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343396 - in stable/12/sys: contrib/ena-com dev/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12/sys: contrib/ena-com dev/ena X-SVN-Commit-Revision: 343396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A99C89F95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 09:38:20 -0000 Author: mw Date: Thu Jan 24 09:38:18 2019 New Revision: 343396 URL: https://svnweb.freebsd.org/changeset/base/343396 Log: MFC r343074: Suppress excessive error prints in ENA TX hotpath Sponsored by: Amazon, Inc. Modified: stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h Modified: stable/12/sys/contrib/ena-com/ena_eth_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 08:34:13 2019 (r343395) +++ stable/12/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 09:38:18 2019 (r343396) @@ -386,7 +386,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, /* num_bufs +1 for potential meta desc */ if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) { - ena_trc_err("Not enough space in the tx queue\n"); + ena_trc_dbg("Not enough space in the tx queue\n"); return ENA_COM_NO_MEM; } Modified: stable/12/sys/dev/ena/ena.c ============================================================================== --- stable/12/sys/dev/ena/ena.c Thu Jan 24 08:34:13 2019 (r343395) +++ stable/12/sys/dev/ena/ena.c Thu Jan 24 09:38:18 2019 (r343396) @@ -2813,7 +2813,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { - device_printf(adapter->pdev, "failed to prepare tx bufs\n"); + ena_trace(ENA_DBG | ENA_TXPTH, "failed to prepare tx bufs\n"); counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; } Modified: stable/12/sys/dev/ena/ena.h ============================================================================== --- stable/12/sys/dev/ena/ena.h Thu Jan 24 08:34:13 2019 (r343395) +++ stable/12/sys/dev/ena/ena.h Thu Jan 24 09:38:18 2019 (r343396) @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 0 #define DRV_MODULE_VER_MINOR 8 -#define DRV_MODULE_VER_SUBMINOR 1 +#define DRV_MODULE_VER_SUBMINOR 2 #define DRV_MODULE_NAME "ena" From owner-svn-src-all@freebsd.org Thu Jan 24 09:53:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4535814A907D; Thu, 24 Jan 2019 09:53:43 +0000 (UTC) (envelope-from mw@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 E39EC8AB6F; Thu, 24 Jan 2019 09:53:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7326426B79; Thu, 24 Jan 2019 09:53:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O9rgod017773; Thu, 24 Jan 2019 09:53:42 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O9rfXR017767; Thu, 24 Jan 2019 09:53:41 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201901240953.x0O9rfXR017767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 24 Jan 2019 09:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343397 - in stable/11/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Group: stable-11 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/11/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Commit-Revision: 343397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E39EC8AB6F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 09:53:43 -0000 Author: mw Date: Thu Jan 24 09:53:41 2019 New Revision: 343397 URL: https://svnweb.freebsd.org/changeset/base/343397 Log: MFC: First part of Amazon ENA driver fixes and improvements r325580 Refactor style of the ENA driver r325579 Fix error handling in the ENA driver and lock drbr_free() call r325578 Destroy admin queue after freeing interrupts in ENA driver r325577 Split function checking for missing TX completion in ENA driver r325576 Check for Rx ring state to prevent from stall in the ENA driver r325574 Add RX OOO completion feature r325512 Change function validate_tx_req_id() to inline in ENA driver r325511 Fix ENA driver error handling in attach and basic style fixes r325239 Rework counting of hardware statistics in ENA driver r325236 Update ena-com HAL to v1.1.4.3 and update driver accordingly Sponsored by: Amazon, Inc. Added: stable/11/sys/contrib/ena-com/ena_defs/ - copied from r325236, head/sys/contrib/ena-com/ena_defs/ Modified: stable/11/sys/contrib/ena-com/ena_com.c stable/11/sys/contrib/ena-com/ena_com.h stable/11/sys/contrib/ena-com/ena_eth_com.c stable/11/sys/contrib/ena-com/ena_eth_com.h stable/11/sys/contrib/ena-com/ena_plat.h stable/11/sys/dev/ena/ena.c stable/11/sys/dev/ena/ena.h stable/11/sys/dev/ena/ena_sysctl.c Modified: stable/11/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/11/sys/contrib/ena-com/ena_com.c Thu Jan 24 09:38:18 2019 (r343396) +++ stable/11/sys/contrib/ena-com/ena_com.c Thu Jan 24 09:53:41 2019 (r343397) @@ -45,6 +45,13 @@ #define ENA_ASYNC_QUEUE_DEPTH 16 #define ENA_ADMIN_QUEUE_DEPTH 32 +#ifdef ENA_EXTENDED_STATS + +#define ENA_HISTOGRAM_ACTIVE_MASK_OFFSET 0xF08 +#define ENA_EXTENDED_STAT_GET_FUNCT(_funct_queue) (_funct_queue & 0xFFFF) +#define ENA_EXTENDED_STAT_GET_QUEUE(_funct_queue) (_funct_queue >> 16) + +#endif /* ENA_EXTENDED_STATS */ #define MIN_ENA_VER (((ENA_COMMON_SPEC_VERSION_MAJOR) << \ ENA_REGS_VERSION_MAJOR_VERSION_SHIFT) \ | (ENA_COMMON_SPEC_VERSION_MINOR)) @@ -65,6 +72,10 @@ #define ENA_MMIO_READ_TIMEOUT 0xFFFFFFFF +#define ENA_COM_BOUNCE_BUFFER_CNTRL_CNT 4 + +#define ENA_REGS_ADMIN_INTR_MASK 1 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -102,7 +113,7 @@ static inline int ena_com_mem_addr_set(struct ena_com_ } ena_addr->mem_addr_low = (u32)addr; - ena_addr->mem_addr_high = (u64)addr >> 32; + ena_addr->mem_addr_high = (u16)((u64)addr >> 32); return 0; } @@ -238,12 +249,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = admin_queue->sq.tail - admin_queue->sq.head; + cnt = ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - ena_trc_dbg("admin queue is FULL (tail %d head %d depth: %d)\n", - admin_queue->sq.tail, - admin_queue->sq.head, - admin_queue->q_depth); + ena_trc_dbg("admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(ENA_COM_NO_SPACE); } @@ -278,6 +286,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd if (unlikely((admin_queue->sq.tail & queue_size_mask) == 0)) admin_queue->sq.phase = !admin_queue->sq.phase; + ENA_DB_SYNC(&admin_queue->sq.mem_handle); ENA_REG_WRITE32(admin_queue->bus, admin_queue->sq.tail, admin_queue->sq.db_addr); @@ -362,21 +371,43 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->desc_addr.phys_addr, io_sq->desc_addr.mem_handle); } - } else { + + if (!io_sq->desc_addr.virt_addr) { + ena_trc_err("memory allocation failed"); + return ENA_COM_NO_MEM; + } + } + + if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + /* Allocate bounce buffers */ + io_sq->bounce_buf_ctrl.buffer_size = ena_dev->llq_info.desc_list_entry_size; + io_sq->bounce_buf_ctrl.buffers_num = ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; + io_sq->bounce_buf_ctrl.next_to_use = 0; + + size = io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; + ENA_MEM_ALLOC_NODE(ena_dev->dmadev, size, - io_sq->desc_addr.virt_addr, + io_sq->bounce_buf_ctrl.base_buffer, ctx->numa_node, dev_node); - if (!io_sq->desc_addr.virt_addr) { - io_sq->desc_addr.virt_addr = - ENA_MEM_ALLOC(ena_dev->dmadev, size); + if (!io_sq->bounce_buf_ctrl.base_buffer) + io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); + + if (!io_sq->bounce_buf_ctrl.base_buffer) { + ena_trc_err("bounce buffer memory allocation failed"); + return ENA_COM_NO_MEM; } - } - if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); - return ENA_COM_NO_MEM; + memcpy(&io_sq->llq_info, &ena_dev->llq_info, sizeof(io_sq->llq_info)); + + /* Initiate the first bounce buffer */ + io_sq->llq_buf_ctrl.curr_bounce_buf = + ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); + memset(io_sq->llq_buf_ctrl.curr_bounce_buf, + 0x0, io_sq->llq_info.desc_list_entry_size); + io_sq->llq_buf_ctrl.descs_left_in_line = + io_sq->llq_info.descs_num_before_header; } io_sq->tail = 0; @@ -507,7 +538,7 @@ static int ena_com_comp_status_to_errno(u8 comp_status case ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE: return ENA_COM_NO_MEM; case ENA_ADMIN_UNSUPPORTED_OPCODE: - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; case ENA_ADMIN_BAD_OPCODE: case ENA_ADMIN_MALFORMED_REQUEST: case ENA_ADMIN_ILLEGAL_PARAMETER: @@ -532,7 +563,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); if (comp_ctx->status != ENA_CMD_SUBMITTED) - break; + break; if (ENA_TIME_EXPIRE(timeout)) { ena_trc_err("Wait for completion (polling) timeout\n"); @@ -567,6 +598,75 @@ err: return ret; } +static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, + struct ena_admin_feature_llq_desc *llq_desc) +{ + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + + memset(llq_info, 0, sizeof(*llq_info)); + + switch (llq_desc->header_location_ctrl) { + case ENA_ADMIN_INLINE_HEADER: + llq_info->inline_header = true; + break; + case ENA_ADMIN_HEADER_RING: + llq_info->inline_header = false; + break; + default: + ena_trc_err("Invalid header location control\n"); + return -EINVAL; + } + + switch (llq_desc->entry_size_ctrl) { + case ENA_ADMIN_LIST_ENTRY_SIZE_128B: + llq_info->desc_list_entry_size = 128; + break; + case ENA_ADMIN_LIST_ENTRY_SIZE_192B: + llq_info->desc_list_entry_size = 192; + break; + case ENA_ADMIN_LIST_ENTRY_SIZE_256B: + llq_info->desc_list_entry_size = 256; + break; + default: + ena_trc_err("Invalid entry_size_ctrl %d\n", + llq_desc->entry_size_ctrl); + return -EINVAL; + } + + if ((llq_info->desc_list_entry_size & 0x7)) { + /* The desc list entry size should be whole multiply of 8 + * This requirement comes from __iowrite64_copy() + */ + ena_trc_err("illegal entry size %d\n", + llq_info->desc_list_entry_size); + return -EINVAL; + } + + if (llq_info->inline_header) { + llq_info->desc_stride_ctrl = llq_desc->descriptors_stride_ctrl; + if ((llq_info->desc_stride_ctrl != ENA_ADMIN_SINGLE_DESC_PER_ENTRY) && + (llq_info->desc_stride_ctrl != ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY)) { + ena_trc_err("Invalid desc_stride_ctrl %d\n", + llq_info->desc_stride_ctrl); + return -EINVAL; + } + } else { + llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; + } + + if (llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY) + llq_info->descs_per_entry = llq_info->desc_list_entry_size / + sizeof(struct ena_eth_io_tx_desc); + else + llq_info->descs_per_entry = 1; + + llq_info->descs_num_before_header = llq_desc->desc_num_before_header_ctrl; + + return 0; +} + + + static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { @@ -614,13 +714,14 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read; volatile struct ena_admin_ena_mmio_req_read_less_resp *read_resp = mmio_read->read_resp; - u32 mmio_read_reg, timeout, ret; + u32 mmio_read_reg, ret, i; unsigned long flags; - int i; + u32 timeout = mmio_read->reg_read_to; ENA_MIGHT_SLEEP(); - timeout = mmio_read->reg_read_to ? : ENA_REG_READ_TIMEOUT; + if (timeout == 0) + timeout = ENA_REG_READ_TIMEOUT; /* If readless is disabled, perform regular read */ if (!mmio_read->readless_supported) @@ -745,17 +846,20 @@ static void ena_com_io_queue_free(struct ena_com_dev * if (io_sq->desc_addr.virt_addr) { size = io_sq->desc_entry_size * io_sq->q_depth; - if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) - ENA_MEM_FREE_COHERENT(ena_dev->dmadev, - size, - io_sq->desc_addr.virt_addr, - io_sq->desc_addr.phys_addr, - io_sq->desc_addr.mem_handle); - else - ENA_MEM_FREE(ena_dev->dmadev, io_sq->desc_addr.virt_addr); + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, + size, + io_sq->desc_addr.virt_addr, + io_sq->desc_addr.phys_addr, + io_sq->desc_addr.mem_handle); io_sq->desc_addr.virt_addr = NULL; } + + if (io_sq->bounce_buf_ctrl.base_buffer) { + size = io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; + ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); + io_sq->bounce_buf_ctrl.base_buffer = NULL; + } } static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, @@ -807,7 +911,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * if (!ena_com_check_supported_feature_id(ena_dev, feature_id)) { ena_trc_dbg("Feature %d isn't supported\n", feature_id); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } memset(&get_cmd, 0x0, sizeof(get_cmd)); @@ -1366,7 +1470,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de ena_trc_warn("Trying to set unsupported aenq events. supported flag: %x asked flag: %x\n", get_resp.u.aenq.supported_groups, groups_flag); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } memset(&cmd, 0x0, sizeof(cmd)); @@ -1480,7 +1584,6 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev if (admin_queue->comp_ctx) ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); - admin_queue->comp_ctx = NULL; size = ADMIN_SQ_SIZE(admin_queue->q_depth); if (sq->entries) @@ -1503,6 +1606,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) { + u32 mask_value = 0; + + if (polling) + mask_value = ENA_REGS_ADMIN_INTR_MASK; + + ENA_REG_WRITE32(ena_dev->bus, mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } @@ -1790,11 +1899,20 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ if (!rc) memcpy(&get_feat_ctx->hw_hints, &get_resp.u.hw_hints, sizeof(get_resp.u.hw_hints)); - else if (rc == ENA_COM_PERMISSION) + else if (rc == ENA_COM_UNSUPPORTED) memset(&get_feat_ctx->hw_hints, 0x0, sizeof(get_feat_ctx->hw_hints)); else return rc; + rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_LLQ); + if (!rc) + memcpy(&get_feat_ctx->llq, &get_resp.u.llq, + sizeof(get_resp.u.llq)); + else if (rc == ENA_COM_UNSUPPORTED) + memset(&get_feat_ctx->llq, 0x0, sizeof(get_feat_ctx->llq)); + else + return rc; + return 0; } @@ -1827,6 +1945,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev struct ena_admin_aenq_common_desc *aenq_common; struct ena_com_aenq *aenq = &dev->aenq; ena_aenq_handler handler_cb; + unsigned long long timestamp; u16 masked_head, processed = 0; u8 phase; @@ -1838,11 +1957,12 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev /* Go over all the events */ while ((aenq_common->flags & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { - ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%jus]\n", + timestamp = (unsigned long long)aenq_common->timestamp_low | + ((unsigned long long)aenq_common->timestamp_high << 32); + ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n", aenq_common->group, aenq_common->syndrom, - (u64)aenq_common->timestamp_low + - ((u64)aenq_common->timestamp_high << 32)); + timestamp); /* Handle specific event*/ handler_cb = ena_com_get_specific_aenq_cb(dev, @@ -1872,8 +1992,30 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev mb(); ENA_REG_WRITE32(dev->bus, (u32)aenq->head, dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); } +#ifdef ENA_EXTENDED_STATS +/* + * Sets the function Idx and Queue Idx to be used for + * get full statistics feature + * + */ +int ena_com_extended_stats_set_func_queue(struct ena_com_dev *ena_dev, + u32 func_queue) +{ -int ena_com_dev_reset(struct ena_com_dev *ena_dev) + /* Function & Queue is acquired from user in the following format : + * Bottom Half word: funct + * Top Half Word: queue + */ + ena_dev->stats_func = ENA_EXTENDED_STAT_GET_FUNCT(func_queue); + ena_dev->stats_queue = ENA_EXTENDED_STAT_GET_QUEUE(func_queue); + + return 0; +} + +#endif /* ENA_EXTENDED_STATS */ + +int ena_com_dev_reset(struct ena_com_dev *ena_dev, + enum ena_regs_reset_reason_types reset_reason) { u32 stat, timeout, cap, reset_val; int rc; @@ -1901,6 +2043,8 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev) /* start reset */ reset_val = ENA_REGS_DEV_CTL_DEV_RESET_MASK; + reset_val |= (reset_reason << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT) & + ENA_REGS_DEV_CTL_RESET_REASON_MASK; ENA_REG_WRITE32(ena_dev->bus, reset_val, ena_dev->reg_bar + ENA_REGS_DEV_CTL_OFF); /* Write again the MMIO read request address */ @@ -1973,7 +2117,52 @@ int ena_com_get_dev_basic_stats(struct ena_com_dev *en return ret; } +#ifdef ENA_EXTENDED_STATS +int ena_com_get_dev_extended_stats(struct ena_com_dev *ena_dev, char *buff, + u32 len) +{ + struct ena_com_stats_ctx ctx; + struct ena_admin_aq_get_stats_cmd *get_cmd = &ctx.get_cmd; + ena_mem_handle_t mem_handle; + void *virt_addr; + dma_addr_t phys_addr; + int ret; + + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, len, + virt_addr, phys_addr, mem_handle); + if (!virt_addr) { + ret = ENA_COM_NO_MEM; + goto done; + } + memset(&ctx, 0x0, sizeof(ctx)); + ret = ena_com_mem_addr_set(ena_dev, + &get_cmd->u.control_buffer.address, + phys_addr); + if (unlikely(ret)) { + ena_trc_err("memory address set failed\n"); + return ret; + } + get_cmd->u.control_buffer.length = len; + + get_cmd->device_id = ena_dev->stats_func; + get_cmd->queue_idx = ena_dev->stats_queue; + + ret = ena_get_dev_stats(ena_dev, &ctx, + ENA_ADMIN_GET_STATS_TYPE_EXTENDED); + if (ret < 0) + goto free_ext_stats_mem; + + ret = snprintf(buff, len, "%s", (char *)virt_addr); + +free_ext_stats_mem: + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, len, virt_addr, phys_addr, + mem_handle); +done: + return ret; +} +#endif + int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu) { struct ena_com_admin_queue *admin_queue; @@ -1983,7 +2172,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, i if (!ena_com_check_supported_feature_id(ena_dev, ENA_ADMIN_MTU)) { ena_trc_dbg("Feature %d isn't supported\n", ENA_ADMIN_MTU); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } memset(&cmd, 0x0, sizeof(cmd)); @@ -2037,7 +2226,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_ ENA_ADMIN_RSS_HASH_FUNCTION)) { ena_trc_dbg("Feature %d isn't supported\n", ENA_ADMIN_RSS_HASH_FUNCTION); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } /* Validate hash function is supported */ @@ -2049,7 +2238,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_ if (get_resp.u.flow_hash_func.supported_func & (1 << rss->hash_func)) { ena_trc_err("Func hash %d isn't supported by device, abort\n", rss->hash_func); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } memset(&cmd, 0x0, sizeof(cmd)); @@ -2108,7 +2297,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena if (!((1 << func) & get_resp.u.flow_hash_func.supported_func)) { ena_trc_err("Flow hash function %d isn't supported\n", func); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } switch (func) { @@ -2201,7 +2390,7 @@ int ena_com_set_hash_ctrl(struct ena_com_dev *ena_dev) ENA_ADMIN_RSS_HASH_INPUT)) { ena_trc_dbg("Feature %d isn't supported\n", ENA_ADMIN_RSS_HASH_INPUT); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } memset(&cmd, 0x0, sizeof(cmd)); @@ -2282,7 +2471,7 @@ int ena_com_set_default_hash_ctrl(struct ena_com_dev * ena_trc_err("hash control doesn't support all the desire configuration. proto %x supported %x selected %x\n", i, hash_ctrl->supported_fields[i].fields, hash_ctrl->selected_fields[i].fields); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } } @@ -2360,7 +2549,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG)) { ena_trc_dbg("Feature %d isn't supported\n", ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG); - return ENA_COM_PERMISSION; + return ENA_COM_UNSUPPORTED; } ret = ena_com_ind_tbl_convert_to_device(ena_dev); @@ -2636,7 +2825,7 @@ int ena_com_init_interrupt_moderation(struct ena_com_d ENA_ADMIN_INTERRUPT_MODERATION); if (rc) { - if (rc == ENA_COM_PERMISSION) { + if (rc == ENA_COM_UNSUPPORTED) { ena_trc_dbg("Feature %d isn't supported\n", ENA_ADMIN_INTERRUPT_MODERATION); rc = 0; @@ -2758,4 +2947,34 @@ void ena_com_get_intr_moderation_entry(struct ena_com_ entry->pkts_per_interval = intr_moder_tbl[level].pkts_per_interval; entry->bytes_per_interval = intr_moder_tbl[level].bytes_per_interval; +} + +int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, + struct ena_admin_feature_llq_desc *llq) +{ + int rc; + int size; + + if (llq->max_llq_num == 0) { + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + return 0; + } + + rc = ena_com_config_llq_info(ena_dev, llq); + if (rc) + return rc; + + /* Validate the descriptor is not too big */ + size = ena_dev->tx_max_header_size; + size += ena_dev->llq_info.descs_num_before_header * + sizeof(struct ena_eth_io_tx_desc); + + if (unlikely(ena_dev->llq_info.desc_list_entry_size < size)) { + ena_trc_err("the size of the LLQ entry is smaller than needed\n"); + return ENA_COM_INVAL; + } + + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_DEV; + + return 0; } Modified: stable/11/sys/contrib/ena-com/ena_com.h ============================================================================== --- stable/11/sys/contrib/ena-com/ena_com.h Thu Jan 24 09:38:18 2019 (r343396) +++ stable/11/sys/contrib/ena-com/ena_com.h Thu Jan 24 09:53:41 2019 (r343397) @@ -133,6 +133,15 @@ struct ena_com_tx_meta { u16 l4_hdr_len; /* In words */ }; +struct ena_com_llq_info { + bool inline_header; + u16 desc_stride_ctrl; + + u16 desc_list_entry_size; + u16 descs_num_before_header; + u16 descs_per_entry; +}; + struct ena_com_io_cq { struct ena_com_io_desc_addr cdesc_addr; void *bus; @@ -171,6 +180,20 @@ struct ena_com_io_cq { } ____cacheline_aligned; +struct ena_com_io_bounce_buffer_control { + u8 *base_buffer; + u16 next_to_use; + u16 buffer_size; + u16 buffers_num; /* Must be a power of 2 */ +}; + +/* This struct is to keep tracking the current location of the next llq entry */ +struct ena_com_llq_pkt_ctrl { + u8 *curr_bounce_buf; + u16 idx; + u16 descs_left_in_line; +}; + struct ena_com_io_sq { struct ena_com_io_desc_addr desc_addr; void *bus; @@ -183,6 +206,9 @@ struct ena_com_io_sq { u32 msix_vector; struct ena_com_tx_meta cached_tx_meta; + struct ena_com_llq_info llq_info; + struct ena_com_llq_pkt_ctrl llq_buf_ctrl; + struct ena_com_io_bounce_buffer_control bounce_buf_ctrl; u16 q_depth; u16 qid; @@ -190,6 +216,7 @@ struct ena_com_io_sq { u16 idx; u16 tail; u16 next_to_comp; + u16 llq_last_copy_tail; u32 tx_max_header_size; u8 phase; u8 desc_entry_size; @@ -321,6 +348,7 @@ struct ena_com_dev { void __iomem *mem_bar; void *dmadev; void *bus; + enum ena_admin_placement_policy_type tx_mem_queue_type; u32 tx_max_header_size; u16 stats_func; /* Selected function for extended statistic dump */ @@ -337,6 +365,8 @@ struct ena_com_dev { u16 intr_delay_resolution; u32 intr_moder_tx_interval; struct ena_intr_moder_entry *intr_moder_tbl; + + struct ena_com_llq_info llq_info; }; struct ena_com_dev_get_features_ctx { @@ -345,6 +375,7 @@ struct ena_com_dev_get_features_ctx { struct ena_admin_feature_aenq_desc aenq; struct ena_admin_feature_offload_desc offload; struct ena_admin_ena_hw_hints hw_hints; + struct ena_admin_feature_llq_desc llq; }; struct ena_com_create_io_ctx { @@ -426,10 +457,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev /* ena_com_dev_reset - Perform device FLR to the device. * @ena_dev: ENA communication layer struct + * @reset_reason: Specify what is the trigger for the reset in case of an error. * * @return - 0 on success, negative value on failure. */ -int ena_com_dev_reset(struct ena_com_dev *ena_dev); +int ena_com_dev_reset(struct ena_com_dev *ena_dev, + enum ena_regs_reset_reason_types reset_reason); /* ena_com_create_io_queue - Create io queue. * @ena_dev: ENA communication layer struct @@ -939,6 +972,15 @@ void ena_com_get_intr_moderation_entry(struct ena_com_ enum ena_intr_moder_level level, struct ena_intr_moder_entry *entry); + +/* ena_com_config_dev_mode - Configure the placement policy of the device. + * @ena_dev: ENA communication layer struct + * @llq: LLQ feature descriptor, retrieve via ena_com_get_dev_attr_feat. + * + */ +int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, + struct ena_admin_feature_llq_desc *llq); + static inline bool ena_com_get_adaptive_moderation_enabled(struct ena_com_dev *ena_dev) { return ena_dev->adaptive_coalescing; @@ -1048,6 +1090,30 @@ static inline void ena_com_update_intr_reg(struct ena_ intr_reg->intr_control |= ENA_ETH_IO_INTR_REG_INTR_UNMASK_MASK; } +static inline u8 *ena_com_get_next_bounce_buffer(struct ena_com_io_bounce_buffer_control *bounce_buf_ctrl) +{ + u16 size, buffers_num; + u8 *buf; + + size = bounce_buf_ctrl->buffer_size; + buffers_num = bounce_buf_ctrl->buffers_num; + + buf = bounce_buf_ctrl->base_buffer + + (bounce_buf_ctrl->next_to_use++ & (buffers_num - 1)) * size; + + prefetch(bounce_buf_ctrl->base_buffer + + (bounce_buf_ctrl->next_to_use & (buffers_num - 1)) * size); + + return buf; +} + +#ifdef ENA_EXTENDED_STATS +int ena_com_get_dev_extended_stats(struct ena_com_dev *ena_dev, char *buff, + u32 len); + +int ena_com_extended_stats_set_func_queue(struct ena_com_dev *ena_dev, + u32 funct_queue); +#endif #if defined(__cplusplus) } #endif /* __cplusplus */ Modified: stable/11/sys/contrib/ena-com/ena_eth_com.c ============================================================================== --- stable/11/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 09:38:18 2019 (r343396) +++ stable/11/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 09:53:41 2019 (r343397) @@ -64,7 +64,7 @@ static inline void ena_com_cq_inc_head(struct ena_com_ io_cq->phase ^= 1; } -static inline void *get_sq_desc(struct ena_com_io_sq *io_sq) +static inline void *get_sq_desc_regular_queue(struct ena_com_io_sq *io_sq) { u16 tail_masked; u32 offset; @@ -76,22 +76,27 @@ static inline void *get_sq_desc(struct ena_com_io_sq * return (void *)((uintptr_t)io_sq->desc_addr.virt_addr + offset); } -static inline void ena_com_copy_curr_sq_desc_to_dev(struct ena_com_io_sq *io_sq) +static inline void ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq, + u8 *bounce_buffer) { - u16 tail_masked = io_sq->tail & (io_sq->q_depth - 1); - u32 offset = tail_masked * io_sq->desc_entry_size; + struct ena_com_llq_info *llq_info = &io_sq->llq_info; - /* In case this queue isn't a LLQ */ - if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) - return; + u16 dst_tail_mask; + u32 dst_offset; - memcpy_toio(io_sq->desc_addr.pbuf_dev_addr + offset, - io_sq->desc_addr.virt_addr + offset, - io_sq->desc_entry_size); -} + dst_tail_mask = io_sq->tail & (io_sq->q_depth - 1); + dst_offset = dst_tail_mask * llq_info->desc_list_entry_size; -static inline void ena_com_sq_update_tail(struct ena_com_io_sq *io_sq) -{ + /* Make sure everything was written into the bounce buffer before + * writing the bounce buffer to the device + */ + wmb(); + + /* The line is completed. Copy it to dev */ + ENA_MEMCPY_TO_DEVICE_64(io_sq->desc_addr.pbuf_dev_addr + dst_offset, + bounce_buffer, + llq_info->desc_list_entry_size); + io_sq->tail++; /* Switch phase bit in case of wrap around */ @@ -99,26 +104,124 @@ static inline void ena_com_sq_update_tail(struct ena_c io_sq->phase ^= 1; } -static inline int ena_com_write_header(struct ena_com_io_sq *io_sq, - u8 *head_src, u16 header_len) +static inline int ena_com_write_header_to_bounce(struct ena_com_io_sq *io_sq, + u8 *header_src, + u16 header_len) { - u16 tail_masked = io_sq->tail & (io_sq->q_depth - 1); - u8 __iomem *dev_head_addr = - io_sq->header_addr + (tail_masked * io_sq->tx_max_header_size); + struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; + struct ena_com_llq_info *llq_info = &io_sq->llq_info; + u8 *bounce_buffer = pkt_ctrl->curr_bounce_buf; + u16 header_offset; if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) return 0; - if (unlikely(!io_sq->header_addr)) { - ena_trc_err("Push buffer header ptr is NULL\n"); - return ENA_COM_INVAL; + header_offset = + llq_info->descs_num_before_header * io_sq->desc_entry_size; + + if (unlikely((header_offset + header_len) > llq_info->desc_list_entry_size)) { + ena_trc_err("trying to write header larger than llq entry can accommodate\n"); + return ENA_COM_FAULT; } - memcpy_toio(dev_head_addr, head_src, header_len); + if (unlikely(!bounce_buffer)) { + ena_trc_err("bounce buffer is NULL\n"); + return ENA_COM_FAULT; + } + memcpy(bounce_buffer + header_offset, header_src, header_len); + return 0; } +static inline void *get_sq_desc_llq(struct ena_com_io_sq *io_sq) +{ + struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; + u8 *bounce_buffer; + void *sq_desc; + + bounce_buffer = pkt_ctrl->curr_bounce_buf; + + if (unlikely(!bounce_buffer)) { + ena_trc_err("bounce buffer is NULL\n"); + return NULL; + } + + sq_desc = bounce_buffer + pkt_ctrl->idx * io_sq->desc_entry_size; + pkt_ctrl->idx++; + pkt_ctrl->descs_left_in_line--; + + return sq_desc; +} + +static inline void ena_com_close_bounce_buffer(struct ena_com_io_sq *io_sq) +{ + struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; + struct ena_com_llq_info *llq_info = &io_sq->llq_info; + + if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) + return; + + /* bounce buffer was used, so write it and get a new one */ + if (pkt_ctrl->idx) { + ena_com_write_bounce_buffer_to_dev(io_sq, + pkt_ctrl->curr_bounce_buf); + pkt_ctrl->curr_bounce_buf = + ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); + memset(io_sq->llq_buf_ctrl.curr_bounce_buf, + 0x0, llq_info->desc_list_entry_size); + } + + pkt_ctrl->idx = 0; + pkt_ctrl->descs_left_in_line = llq_info->descs_num_before_header; +} + +static inline void *get_sq_desc(struct ena_com_io_sq *io_sq) +{ + if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) + return get_sq_desc_llq(io_sq); + + return get_sq_desc_regular_queue(io_sq); +} + +static inline void ena_com_sq_update_llq_tail(struct ena_com_io_sq *io_sq) +{ + struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; + struct ena_com_llq_info *llq_info = &io_sq->llq_info; + + if (!pkt_ctrl->descs_left_in_line) { + ena_com_write_bounce_buffer_to_dev(io_sq, + pkt_ctrl->curr_bounce_buf); + + pkt_ctrl->curr_bounce_buf = + ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); + memset(io_sq->llq_buf_ctrl.curr_bounce_buf, + 0x0, llq_info->desc_list_entry_size); + + pkt_ctrl->idx = 0; + if (llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY) + pkt_ctrl->descs_left_in_line = 1; + else + pkt_ctrl->descs_left_in_line = + llq_info->desc_list_entry_size / io_sq->desc_entry_size; + } +} + +static inline void ena_com_sq_update_tail(struct ena_com_io_sq *io_sq) +{ + + if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + ena_com_sq_update_llq_tail(io_sq); + return; + } + + io_sq->tail++; + + /* Switch phase bit in case of wrap around */ + if (unlikely((io_sq->tail & (io_sq->q_depth - 1)) == 0)) + io_sq->phase ^= 1; +} + static inline struct ena_eth_io_rx_cdesc_base * ena_com_rx_cdesc_idx_to_ptr(struct ena_com_io_cq *io_cq, u16 idx) { @@ -228,7 +331,6 @@ static inline void ena_com_create_and_store_tx_meta_de memcpy(&io_sq->cached_tx_meta, ena_meta, sizeof(struct ena_com_tx_meta)); - ena_com_copy_curr_sq_desc_to_dev(io_sq); ena_com_sq_update_tail(io_sq); } @@ -271,10 +373,11 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, { struct ena_eth_io_tx_desc *desc = NULL; struct ena_com_buf *ena_bufs = ena_tx_ctx->ena_bufs; - void *push_header = ena_tx_ctx->push_header; + void *buffer_to_push = ena_tx_ctx->push_header; u16 header_len = ena_tx_ctx->header_len; u16 num_bufs = ena_tx_ctx->num_bufs; - int total_desc, i, rc; + u16 start_tail = io_sq->tail; + int i, rc; bool have_meta; u64 addr_hi; @@ -282,7 +385,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, "wrong Q type"); /* num_bufs +1 for potential meta desc */ - if (ena_com_sq_empty_space(io_sq) < (num_bufs + 1)) { + if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) { ena_trc_err("Not enough space in the tx queue\n"); return ENA_COM_NO_MEM; } @@ -293,8 +396,10 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, return ENA_COM_INVAL; } - /* start with pushing the header (if needed) */ - rc = ena_com_write_header(io_sq, push_header, header_len); + if (unlikely((io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) && !buffer_to_push)) + return ENA_COM_INVAL; + + rc = ena_com_write_header_to_bounce(io_sq, buffer_to_push, header_len); if (unlikely(rc)) return rc; @@ -305,11 +410,14 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, /* If the caller doesn't want send packets */ if (unlikely(!num_bufs && !header_len)) { - *nb_hw_desc = have_meta ? 0 : 1; + ena_com_close_bounce_buffer(io_sq); + *nb_hw_desc = io_sq->tail - start_tail; return 0; } desc = get_sq_desc(io_sq); + if (unlikely(!desc)) + return ENA_COM_FAULT; memset(desc, 0x0, sizeof(struct ena_eth_io_tx_desc)); /* Set first desc when we don't have meta descriptor */ @@ -361,10 +469,12 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, for (i = 0; i < num_bufs; i++) { /* The first desc share the same desc as the header */ if (likely(i != 0)) { - ena_com_copy_curr_sq_desc_to_dev(io_sq); ena_com_sq_update_tail(io_sq); desc = get_sq_desc(io_sq); + if (unlikely(!desc)) + return ENA_COM_FAULT; + memset(desc, 0x0, sizeof(struct ena_eth_io_tx_desc)); desc->len_ctrl |= (io_sq->phase << @@ -387,14 +497,11 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, /* set the last desc indicator */ desc->len_ctrl |= ENA_ETH_IO_TX_DESC_LAST_MASK; - ena_com_copy_curr_sq_desc_to_dev(io_sq); - ena_com_sq_update_tail(io_sq); - total_desc = ENA_MAX16(num_bufs, 1); - total_desc += have_meta ? 1 : 0; + ena_com_close_bounce_buffer(io_sq); - *nb_hw_desc = total_desc; + *nb_hw_desc = io_sq->tail - start_tail; return 0; } @@ -456,10 +563,13 @@ int ena_com_add_single_rx_desc(struct ena_com_io_sq *i ENA_WARN(io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX, "wrong Q type"); - if (unlikely(ena_com_sq_empty_space(io_sq) == 0)) + if (unlikely(!ena_com_sq_have_enough_space(io_sq, 1))) return ENA_COM_NO_SPACE; desc = get_sq_desc(io_sq); + if (unlikely(!desc)) + return ENA_COM_FAULT; + memset(desc, 0x0, sizeof(struct ena_eth_io_rx_desc)); desc->length = ena_buf->len; @@ -500,6 +610,11 @@ int ena_com_tx_comp_req_id_get(struct ena_com_io_cq *i cdesc_phase = READ_ONCE(cdesc->flags) & ENA_ETH_IO_TX_CDESC_PHASE_MASK; if (cdesc_phase != expected_phase) return ENA_COM_TRY_AGAIN; + + if (unlikely(cdesc->req_id >= io_cq->q_depth)) { + ena_trc_err("Invalid req id %d\n", cdesc->req_id); + return ENA_COM_INVAL; + } ena_com_cq_inc_head(io_cq); Modified: stable/11/sys/contrib/ena-com/ena_eth_com.h ============================================================================== --- stable/11/sys/contrib/ena-com/ena_eth_com.h Thu Jan 24 09:38:18 2019 (r343396) +++ stable/11/sys/contrib/ena-com/ena_eth_com.h Thu Jan 24 09:53:41 2019 (r343397) @@ -98,7 +98,7 @@ static inline void ena_com_unmask_intr(struct ena_com_ ENA_REG_WRITE32(io_cq->bus, intr_reg->intr_control, io_cq->unmask_reg); } -static inline int ena_com_sq_empty_space(struct ena_com_io_sq *io_sq) +static inline int ena_com_free_desc(struct ena_com_io_sq *io_sq) { u16 tail, next_to_comp, cnt; @@ -107,6 +107,25 @@ static inline int ena_com_sq_empty_space(struct ena_co cnt = tail - next_to_comp; return io_sq->q_depth - 1 - cnt; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 24 11:31:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D4914AC321; Thu, 24 Jan 2019 11:31:58 +0000 (UTC) (envelope-from mw@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 33F218E299; Thu, 24 Jan 2019 11:31:58 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 275D227BE9; Thu, 24 Jan 2019 11:31:58 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OBVwBY067873; Thu, 24 Jan 2019 11:31:58 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OBVvt5067870; Thu, 24 Jan 2019 11:31:57 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201901241131.x0OBVvt5067870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 24 Jan 2019 11:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343398 - in stable/11/sys: contrib/ena-com dev/ena X-SVN-Group: stable-11 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/11/sys: contrib/ena-com dev/ena X-SVN-Commit-Revision: 343398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33F218E299 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 11:31:59 -0000 Author: mw Date: Thu Jan 24 11:31:57 2019 New Revision: 343398 URL: https://svnweb.freebsd.org/changeset/base/343398 Log: MFC: Second part of Amazon ENA driver fixes and improvements Now, the driver functionality is aligned with the latest version in HEAD. r343074 Suppress excessive error prints in ENA TX hotpath r336099 Add PNP info to PCI attachment of ena driver r333456 Do not pass header length to the ENA controller r333453 Apply fixes in ena-com r333450 Upgrade ENA version to v0.8.1 r325593 Fix setting AENQ group in ENA driver r325592 Allow usage of more RX descriptors than 1 in ENA driver r325591 Read max MTU from the ENA device r325590 Fix calculating io queues number in ENA driver r325589 Rework printouts and logging level in ENA driver r325587 Fix comparing L3 type with L4 enum on RX hash in ENA driver r325586 Fix compilation warnings when building ENA driver with gcc compiler r325585 Fix checking if the DF flag was set in ENA driver r325584 Cleanup of the ENA driver header file r325583 Allow partial MSI-x allocation in ENA driver r325582 Remove deprecated and unused counters in ENA driver r325581 Cover ENA driver code with branch predictioning statements Sponsored by: Amazon, Inc. Modified: stable/11/sys/contrib/ena-com/ena_eth_com.c stable/11/sys/contrib/ena-com/ena_plat.h stable/11/sys/dev/ena/ena.c stable/11/sys/dev/ena/ena.h stable/11/sys/dev/ena/ena_sysctl.c Modified: stable/11/sys/contrib/ena-com/ena_eth_com.c ============================================================================== --- stable/11/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 09:53:41 2019 (r343397) +++ stable/11/sys/contrib/ena-com/ena_eth_com.c Thu Jan 24 11:31:57 2019 (r343398) @@ -386,7 +386,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, /* num_bufs +1 for potential meta desc */ if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) { - ena_trc_err("Not enough space in the tx queue\n"); + ena_trc_dbg("Not enough space in the tx queue\n"); return ENA_COM_NO_MEM; } Modified: stable/11/sys/contrib/ena-com/ena_plat.h ============================================================================== --- stable/11/sys/contrib/ena-com/ena_plat.h Thu Jan 24 09:53:41 2019 (r343397) +++ stable/11/sys/contrib/ena-com/ena_plat.h Thu Jan 24 11:31:57 2019 (r343398) @@ -104,14 +104,11 @@ extern struct ena_bus_space ebs; #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ -#ifndef ENA_DEBUG_LEVEL -#define ENA_DEBUG_LEVEL (ENA_ALERT | ENA_WARNING) -#endif +extern int ena_log_level; -#ifdef ENA_TRACE #define ena_trace_raw(level, fmt, args...) \ do { \ - if (((level) & ENA_DEBUG_LEVEL) != (level)) \ + if (((level) & ena_log_level) != (level)) \ break; \ printf(fmt, ##args); \ } while (0) @@ -120,10 +117,6 @@ extern struct ena_bus_space ebs; ena_trace_raw(level, "%s() [TID:%d]: " \ fmt " \n", __func__, curthread->td_tid, ##args) -#else /* ENA_TRACE */ -#define ena_trace_raw(...) -#define ena_trace(...) -#endif /* ENA_TRACE */ #define ena_trc_dbg(format, arg...) ena_trace(ENA_DBG, format, ##arg) #define ena_trc_info(format, arg...) ena_trace(ENA_INFO, format, ##arg) @@ -172,7 +165,7 @@ static inline long PTR_ERR(const void *ptr) #define GENMASK(h, l) (((1U << ((h) - (l) + 1)) - 1) << (l)) #define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (64 - 1 - (h)))) -#define BIT(x) (1 << (x)) +#define BIT(x) (1UL << (x)) #define ENA_ABORT() BUG() #define BUG() panic("ENA BUG") @@ -251,7 +244,12 @@ static inline long PTR_ERR(const void *ptr) timeout_us * hz / 1000 / 1000 ); \ mtx_unlock(&((waitqueue).mtx)); \ } while (0) -#define ENA_WAIT_EVENT_SIGNAL(waitqueue) cv_broadcast(&((waitqueue).wq)) +#define ENA_WAIT_EVENT_SIGNAL(waitqueue) \ + do { \ + mtx_lock(&((waitqueue).mtx)); \ + cv_broadcast(&((waitqueue).wq)); \ + mtx_unlock(&((waitqueue).mtx)); \ + } while (0) #define dma_addr_t bus_addr_t #define u8 uint8_t Modified: stable/11/sys/dev/ena/ena.c ============================================================================== --- stable/11/sys/dev/ena/ena.c Thu Jan 24 09:53:41 2019 (r343397) +++ stable/11/sys/dev/ena/ena.c Thu Jan 24 11:31:57 2019 (r343398) @@ -193,6 +193,13 @@ static int ena_buf_ring_size = 4096; SYSCTL_INT(_hw_ena, OID_AUTO, buf_ring_size, CTLFLAG_RWTUN, &ena_buf_ring_size, 0, "Size of the bufring"); +/* + * Logging level for changing verbosity of the output + */ +int ena_log_level = ENA_ALERT | ENA_WARNING; +SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, + &ena_log_level, 0, "Logging level indicating verbosity of the logs"); + static ena_vendor_info_t ena_vendor_info_array[] = { { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0}, { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_LLQ_PF, 0}, @@ -227,7 +234,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, maxsize = ((size - 1) / PAGE_SIZE + 1) * PAGE_SIZE; dma_space_addr = ENA_DMA_BIT_MASK(adapter->dma_width); - if (dma_space_addr == 0) + if (unlikely(dma_space_addr == 0)) dma_space_addr = BUS_SPACE_MAXADDR; error = bus_dma_tag_create(bus_get_dma_tag(dmadev), /* parent */ @@ -242,26 +249,24 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, NULL, /* lockfunc */ NULL, /* lockarg */ &dma->tag); - if (error != 0) { - device_printf(dmadev, "%s: bus_dma_tag_create failed: %d\n", - __func__, error); + if (unlikely(error != 0)) { + ena_trace(ENA_ALERT, "bus_dma_tag_create failed: %d\n", error); goto fail_tag; } error = bus_dmamem_alloc(dma->tag, (void**) &dma->vaddr, BUS_DMA_COHERENT | BUS_DMA_ZERO, &dma->map); - if (error != 0) { - device_printf(dmadev, "%s: bus_dmamem_alloc(%ju) failed: %d\n", - __func__, (uintmax_t)size, error); + if (unlikely(error != 0)) { + ena_trace(ENA_ALERT, "bus_dmamem_alloc(%ju) failed: %d\n", + (uintmax_t)size, error); goto fail_map_create; } dma->paddr = 0; error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, ena_dmamap_callback, &dma->paddr, mapflags); - if ((error != 0) || (dma->paddr == 0)) { - device_printf(dmadev, "%s: bus_dmamap_load failed: %d\n", - __func__, error); + if (unlikely((error != 0) || (dma->paddr == 0))) { + ena_trace(ENA_ALERT, ": bus_dmamap_load failed: %d\n", error); goto fail_map_load; } @@ -287,7 +292,7 @@ ena_allocate_pci_resources(struct ena_adapter* adapter adapter->memory = NULL; adapter->registers = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (adapter->registers == NULL) { + if (unlikely(adapter->registers == NULL)) { device_printf(pdev, "Unable to allocate bus resource: " "registers\n"); return (ENXIO); @@ -346,39 +351,25 @@ static int ena_change_mtu(if_t ifp, int new_mtu) { struct ena_adapter *adapter = if_getsoftc(ifp); - struct ena_com_dev_get_features_ctx get_feat_ctx; - int rc, old_mtu, max_frame; + int rc; - rc = ena_com_get_dev_attr_feat(adapter->ena_dev, &get_feat_ctx); - if (rc != 0) { - device_printf(adapter->pdev, - "Cannot get attribute for ena device\n"); - return (ENXIO); - } - - /* Save old MTU in case of fail */ - old_mtu = if_getmtu(ifp); - - /* Change MTU and calculate max frame */ - if_setmtu(ifp, new_mtu); - max_frame = ETHER_MAX_FRAME(ifp, ETHERTYPE_VLAN, 1); - - if ((new_mtu < ENA_MIN_FRAME_LEN) || - (new_mtu > get_feat_ctx.dev_attr.max_mtu) || - (max_frame > ENA_MAX_FRAME_LEN)) { + if ((new_mtu > adapter->max_mtu) || (new_mtu < ENA_MIN_MTU)) { device_printf(adapter->pdev, "Invalid MTU setting. " - "new_mtu: %d\n", new_mtu); - goto error; + "new_mtu: %d max mtu: %d min mtu: %d\n", + new_mtu, adapter->max_mtu, ENA_MIN_MTU); + return (EINVAL); } rc = ena_com_set_dev_mtu(adapter->ena_dev, new_mtu); - if (rc != 0) - goto error; + if (likely(rc == 0)) { + ena_trace(ENA_DBG, "set MTU to %d\n", new_mtu); + if_setmtu(ifp, new_mtu); + } else { + device_printf(adapter->pdev, "Failed to set MTU to %d\n", + new_mtu); + } - return (0); -error: - if_setmtu(ifp, old_mtu); - return (EINVAL); + return (rc); } static inline void @@ -453,7 +444,6 @@ ena_init_io_rings(struct ena_adapter *adapter) /* RX specific ring state */ rxr->ring_size = adapter->rx_ring_size; - rxr->rx_small_copy_len = adapter->small_copy_len; rxr->smoothed_interval = ena_com_get_nonadaptive_moderation_interval_rx(ena_dev); @@ -531,9 +521,6 @@ ena_setup_tx_dma_tag(struct ena_adapter *adapter) NULL, /* lockfuncarg */ &adapter->tx_buf_tag); - if (ret != 0) - device_printf(adapter->pdev, "Unable to create Tx DMA tag\n"); - return (ret); } @@ -544,7 +531,7 @@ ena_free_tx_dma_tag(struct ena_adapter *adapter) ret = bus_dma_tag_destroy(adapter->tx_buf_tag); - if (ret == 0) + if (likely(ret == 0)) adapter->tx_buf_tag = NULL; return (ret); @@ -562,16 +549,13 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) BUS_SPACE_MAXADDR, /* highaddr of excl window */ NULL, NULL, /* filter, filterarg */ MJUM16BYTES, /* maxsize */ - 1, /* nsegments */ + adapter->max_rx_sgl_size, /* nsegments */ MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ &adapter->rx_buf_tag); - if (ret != 0) - device_printf(adapter->pdev, "Unable to create Rx DMA tag\n"); - return (ret); } @@ -582,7 +566,7 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) ret = bus_dma_tag_destroy(adapter->rx_buf_tag); - if (ret == 0) + if (likely(ret == 0)) adapter->rx_buf_tag = NULL; return (ret); @@ -608,12 +592,12 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (tx_ring->tx_buffer_info == NULL) + if (unlikely(tx_ring->tx_buffer_info == NULL)) return (ENOMEM); size = sizeof(uint16_t) * tx_ring->ring_size; tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (tx_ring->free_tx_ids == NULL) + if (unlikely(tx_ring->free_tx_ids == NULL)) goto err_buf_info_free; /* Req id stack for TX OOO completions */ @@ -636,9 +620,9 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in for (i = 0; i < tx_ring->ring_size; i++) { err = bus_dmamap_create(adapter->tx_buf_tag, 0, &tx_ring->tx_buffer_info[i].map); - if (err != 0) { - device_printf(adapter->pdev, - "Unable to create Tx DMA map for buffer %d\n", i); + if (unlikely(err != 0)) { + ena_trace(ENA_ALERT, + "Unable to create Tx DMA map for buffer %d\n", i); goto err_buf_info_unmap; } } @@ -647,8 +631,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in TASK_INIT(&tx_ring->enqueue_task, 0, ena_deferred_mq_start, tx_ring); tx_ring->enqueue_tq = taskqueue_create_fast("ena_tx_enque", M_NOWAIT, taskqueue_thread_enqueue, &tx_ring->enqueue_tq); - if (tx_ring->enqueue_tq == NULL) { - device_printf(adapter->pdev, + if (unlikely(tx_ring->enqueue_tq == NULL)) { + ena_trace(ENA_ALERT, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; goto err_buf_info_unmap; @@ -828,7 +812,7 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un err = bus_dmamap_create(adapter->rx_buf_tag, 0, &(rx_ring->rx_buffer_info[i].map)); if (err != 0) { - device_printf(adapter->pdev, + ena_trace(ENA_ALERT, "Unable to create Rx DMA map for buffer %d\n", i); goto err_buf_info_unmap; } @@ -875,7 +859,6 @@ err_buf_info_unmap: rx_ring->free_rx_ids = NULL; free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; - ena_trace(ENA_ALERT, "RX resource allocation fail"); return (ENOMEM); } @@ -891,8 +874,6 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns { struct ena_ring *rx_ring = &adapter->rx_ring[qid]; - ena_trace(ENA_INFO, "%s qid %d\n", __func__, qid); - while (taskqueue_cancel(rx_ring->cmpl_tq, &rx_ring->cmpl_task, NULL) != 0) taskqueue_drain(rx_ring->cmpl_tq, &rx_ring->cmpl_task); @@ -969,20 +950,28 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, struct ena_com_buf *ena_buf; bus_dma_segment_t segs[1]; int nsegs, error; + int mlen; /* if previous allocated frag is not used */ - if (rx_info->mbuf != NULL) + if (unlikely(rx_info->mbuf != NULL)) return (0); /* Get mbuf using UMA allocator */ rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); - if (rx_info->mbuf == NULL) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - return (ENOMEM); + if (unlikely(rx_info->mbuf == NULL)) { + counter_u64_add(rx_ring->rx_stats.mjum_alloc_fail, 1); + rx_info->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (unlikely(rx_info->mbuf == NULL)) { + counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); + return (ENOMEM); + } + mlen = MCLBYTES; + } else { + mlen = MJUM16BYTES; } /* Set mbuf length*/ - rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = MJUM16BYTES; + rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = mlen; /* Map packets for DMA */ ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, @@ -990,8 +979,8 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, adapter->rx_buf_tag,rx_info->mbuf, rx_info->mbuf->m_len); error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if ((error != 0) || (nsegs != 1)) { - device_printf(adapter->pdev, "failed to map mbuf, error: %d, " + if (unlikely((error != 0) || (nsegs != 1))) { + ena_trace(ENA_WARNING, "failed to map mbuf, error: %d, " "nsegs: %d\n", error, nsegs); counter_u64_add(rx_ring->rx_stats.dma_mapping_err, 1); goto exit; @@ -1002,7 +991,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, ena_buf = &rx_info->ena_buf; ena_buf->paddr = segs[0].ds_addr; - ena_buf->len = MJUM16BYTES; + ena_buf->len = mlen; ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, "ALLOC RX BUF: mbuf %p, rx_info %p, len %d, paddr %#jx\n", @@ -1021,8 +1010,10 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e struct ena_rx_buffer *rx_info) { - if (rx_info->mbuf == NULL) + if (rx_info->mbuf == NULL) { + ena_trace(ENA_WARNING, "Trying to free unallocated buffer\n"); return; + } bus_dmamap_unload(adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); @@ -1062,15 +1053,16 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t rx_info = &rx_ring->rx_buffer_info[req_id]; rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); - if (rc < 0) { - device_printf(adapter->pdev, - "failed to alloc buffer for rx queue\n"); + if (unlikely(rc != 0)) { + ena_trace(ENA_WARNING, + "failed to alloc buffer for rx queue %d\n", + rx_ring->qid); break; } rc = ena_com_add_single_rx_desc(rx_ring->ena_com_io_sq, &rx_info->ena_buf, req_id); if (unlikely(rc != 0)) { - device_printf(adapter->pdev, + ena_trace(ENA_WARNING, "failed to add buffer for rx queue %d\n", rx_ring->qid); break; @@ -1079,14 +1071,14 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t rx_ring->ring_size); } - if (i < num) { + if (unlikely(i < num)) { counter_u64_add(rx_ring->rx_stats.refil_partial, 1); - device_printf(adapter->pdev, - "refilled rx queue %d with %d pages only\n", - rx_ring->qid, i); + ena_trace(ENA_WARNING, + "refilled rx qid %d with only %d mbufs (from %d)\n", + rx_ring->qid, i, num); } - if (i != 0) { + if (likely(i != 0)) { wmb(); ena_com_write_sq_doorbell(rx_ring->ena_com_io_sq); } @@ -1125,9 +1117,8 @@ ena_refill_all_rx_bufs(struct ena_adapter *adapter) rc = ena_refill_rx_bufs(rx_ring, bufs_num); if (unlikely(rc != bufs_num)) - device_printf(adapter->pdev, - "refilling Queue %d failed. allocated %d buffers" - " from: %d\n", i, rc, bufs_num); + ena_trace(ENA_WARNING, "refilling Queue %d failed. " + "Allocated %d buffers from: %d\n", i, rc, bufs_num); } } @@ -1148,6 +1139,7 @@ ena_free_all_rx_bufs(struct ena_adapter *adapter) static void ena_free_tx_bufs(struct ena_adapter *adapter, unsigned int qid) { + bool print_once = true; struct ena_ring *tx_ring = &adapter->tx_ring[qid]; ENA_RING_MTX_LOCK(tx_ring); @@ -1157,8 +1149,16 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned if (tx_info->mbuf == NULL) continue; - ena_trace(ENA_DBG | ENA_TXPTH | ENA_RSC, - "free uncompleted Tx mbufs qid[%d] idx: 0x%x", qid, i); + if (print_once) { + device_printf(adapter->pdev, + "free uncompleted tx mbuf qid %d idx 0x%x", + qid, i); + print_once = false; + } else { + ena_trace(ENA_DBG, + "free uncompleted tx mbuf qid %d idx 0x%x", + qid, i); + } bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); m_free(tx_info->mbuf); @@ -1209,6 +1209,7 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) static inline int validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) { + struct ena_adapter *adapter = tx_ring->adapter; struct ena_tx_buffer *tx_info = NULL; if (likely(req_id < tx_ring->ring_size)) { @@ -1217,6 +1218,12 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t return (0); } + if (tx_info->mbuf == NULL) + device_printf(adapter->pdev, + "tx_info doesn't have valid mbuf\n"); + else + device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); + counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); return (EFAULT); @@ -1270,7 +1277,7 @@ ena_create_io_queues(struct ena_adapter *adapter) ctx.msix_vector = msix_vector; ctx.qid = ena_qid; rc = ena_com_create_io_queue(ena_dev, &ctx); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Failed to create io RX queue[%d] rc: %d\n", i, rc); goto err_rx; @@ -1280,7 +1287,7 @@ ena_create_io_queues(struct ena_adapter *adapter) rc = ena_com_get_io_handlers(ena_dev, ena_qid, &ring->ena_com_io_sq, &ring->ena_com_io_cq); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Failed to get RX queue handlers. RX queue num" " %d rc: %d\n", i, rc); @@ -1337,11 +1344,11 @@ ena_tx_cleanup(struct ena_ring *tx_ring) struct mbuf *mbuf; rc = ena_com_tx_comp_req_id_get(io_cq, &req_id); - if (rc != 0) + if (unlikely(rc != 0)) break; rc = validate_tx_req_id(tx_ring, req_id); - if (rc != 0) + if (unlikely(rc != 0)) break; tx_info = &tx_ring->tx_buffer_info[req_id]; @@ -1351,11 +1358,14 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_info->mbuf = NULL; bintime_clear(&tx_info->timestamp); - if (tx_info->num_of_bufs != 0) { + if (likely(tx_info->num_of_bufs != 0)) { /* Map is no longer required */ bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); } + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed", + tx_ring->qid, mbuf); + m_freem(mbuf); total_done += tx_info->tx_descs; @@ -1364,7 +1374,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean, tx_ring->ring_size); - if (--commit == 0) { + if (unlikely(--commit == 0)) { commit = TX_COMMIT; /* update ring state every TX_COMMIT descriptor */ tx_ring->next_to_clean = next_to_clean; @@ -1374,12 +1384,15 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ena_com_update_dev_comp_head(io_cq); total_done = 0; } - } while (--budget); + } while (likely(--budget)); work_done = TX_BUDGET - budget; + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d", + tx_ring->qid, work_done); + /* If there is still something to commit update ring state */ - if (commit != TX_COMMIT) { + if (likely(commit != TX_COMMIT)) { tx_ring->next_to_clean = next_to_clean; ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); @@ -1397,11 +1410,11 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ { struct ena_adapter *adapter = rx_ring->adapter; - if (adapter->rss_support) { + if (likely(adapter->rss_support)) { mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; if (ena_rx_ctx->frag && - (ena_rx_ctx->l3_proto != ENA_ETH_IO_L4_PROTO_UNKNOWN)) { + (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); return; } @@ -1522,11 +1535,15 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r return (NULL); } - if (m_append(mbuf, len, rx_info->mbuf->m_data) == 0) { + if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", mbuf); } + + ena_trace(ENA_DBG | ENA_RXPTH, + "rx mbuf updated. len %d", mbuf->m_pkthdr.len); + /* Free already appended mbuf, it won't be useful anymore */ bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); @@ -1550,11 +1567,12 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c { /* if IP and error */ - if ((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - ena_rx_ctx->l3_csum_err) { + if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && + ena_rx_ctx->l3_csum_err)) { /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); + ena_trace(ENA_DBG, "RX IPv4 header checksum error"); return; } @@ -1565,6 +1583,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* TCP/UDP checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); + ena_trace(ENA_DBG, "RX L4 checksum error"); } else { mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; @@ -1583,7 +1602,7 @@ ena_deferred_rx_cleanup(void *arg, int pending) * If deferred task was executed, perform cleanup of all awaiting * descs (or until given budget is depleted to avoid infinite loop). */ - while (budget--) { + while (likely(budget--)) { if (ena_rx_cleanup(rx_ring) == 0) break; } @@ -1620,6 +1639,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; next_to_clean = rx_ring->next_to_clean; + ena_trace(ENA_DBG, "rx: qid %d", qid); + do { ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; @@ -1632,6 +1653,11 @@ ena_rx_cleanup(struct ena_ring *rx_ring) if (unlikely(ena_rx_ctx.descs == 0)) break; + ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " + "descs #: %d l3 proto %d l4 proto %d hash: %x", + rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, + ena_rx_ctx.l4_proto, ena_rx_ctx.hash); + /* Receive mbuf from the ring */ mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, &ena_rx_ctx, &next_to_clean); @@ -1648,8 +1674,6 @@ ena_rx_cleanup(struct ena_ring *rx_ring) } break; } - ena_trace(ENA_DBG | ENA_RXPTH, "Rx: %d bytes", - mbuf->m_pkthdr.len); if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { @@ -1695,7 +1719,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) rx_ring->next_to_clean = next_to_clean; refill_required = ena_com_free_desc(io_sq); - refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DEVIDER; + refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER; if (refill_required > refill_threshold) { ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); @@ -1748,7 +1772,7 @@ ena_handle_msix(void *arg) int qid, ena_qid; int txc, rxc, i; - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; ena_trace(ENA_DBG, "MSI-X TX/RX routine"); @@ -1765,7 +1789,7 @@ ena_handle_msix(void *arg) * being executed and rx ring is being cleaned up in * another thread. */ - if (ENA_RING_MTX_TRYLOCK(rx_ring) != 0) { + if (likely(ENA_RING_MTX_TRYLOCK(rx_ring) != 0)) { rxc = ena_rx_cleanup(rx_ring); ENA_RING_MTX_UNLOCK(rx_ring); } else { @@ -1777,7 +1801,7 @@ ena_handle_msix(void *arg) txc = ena_tx_cleanup(tx_ring); ENA_RING_MTX_UNLOCK(tx_ring); - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) @@ -1796,7 +1820,8 @@ static int ena_enable_msix(struct ena_adapter *adapter) { device_t dev = adapter->pdev; - int i, msix_vecs, rc = 0; + int msix_vecs, msix_req; + int i, rc = 0; /* Reserved the max msix vectors we might need */ msix_vecs = ENA_MAX_MSIX_VEC(adapter->num_queues); @@ -1804,8 +1829,7 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries = malloc(msix_vecs * sizeof(struct msix_entry), M_DEVBUF, M_WAITOK | M_ZERO); - device_printf(dev, "Allocated msix_entries, vectors (cnt: %d)\n", - msix_vecs); + ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d", msix_vecs); for (i = 0; i < msix_vecs; i++) { adapter->msix_entries[i].entry = i; @@ -1813,8 +1837,9 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries[i].vector = i + 1; } + msix_req = msix_vecs; rc = pci_alloc_msix(dev, &msix_vecs); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(dev, "Failed to enable MSIX, vectors %d rc %d\n", msix_vecs, rc); @@ -1822,6 +1847,12 @@ ena_enable_msix(struct ena_adapter *adapter) goto err_msix_free; } + if (msix_vecs != msix_req) { + device_printf(dev, "Enable only %d MSI-x (out of %d), reduce " + "the number of queues\n", msix_vecs, msix_req); + adapter->num_queues = msix_vecs - ENA_ADMIN_MSIX_VEC; + } + adapter->msix_vecs = msix_vecs; adapter->msix_enabled = true; @@ -1856,7 +1887,6 @@ ena_setup_io_intr(struct ena_adapter *adapter) { static int last_bind_cpu = -1; int irq_idx; - ena_trace(ENA_DBG, "enter"); for (int i = 0; i < adapter->num_queues; i++) { irq_idx = ENA_IO_IRQ_IDX(i); @@ -1877,7 +1907,7 @@ ena_setup_io_intr(struct ena_adapter *adapter) * We still want to bind rings to the corresponding cpu * using something similar to the RSS round-robin technique. */ - if (last_bind_cpu < 0) + if (unlikely(last_bind_cpu < 0)) last_bind_cpu = CPU_FIRST(); adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = last_bind_cpu; @@ -1899,7 +1929,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) irq->res = bus_alloc_resource_any(adapter->pdev, SYS_RES_IRQ, &irq->vector, flags); - if (irq->res == NULL) { + if (unlikely(irq->res == NULL)) { device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); return (ENXIO); @@ -1907,7 +1937,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "could not activate " "irq vector: %d\n", irq->vector); goto err_res_free; @@ -1916,7 +1946,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) rc = bus_setup_intr(adapter->pdev, irq->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, ena_intr_msix_mgmnt, irq->data, &irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -1927,11 +1957,11 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) return (rc); err_res_free: - device_printf(adapter->pdev, "releasing resource for irq %d\n", + ena_trace(ENA_INFO | ENA_ADMQ, "releasing resource for irq %d\n", irq->vector); rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->res = NULL; @@ -1946,8 +1976,9 @@ ena_request_io_irq(struct ena_adapter *adapter) unsigned long flags = 0; int rc = 0, i, rcc; - if (adapter->msix_enabled == 0) { - device_printf(adapter->pdev, "failed to request irq\n"); + if (unlikely(adapter->msix_enabled == 0)) { + device_printf(adapter->pdev, + "failed to request I/O IRQ: MSI-X is not enabled\n"); return (EINVAL); } else { flags = RF_ACTIVE | RF_SHAREABLE; @@ -1956,12 +1987,12 @@ ena_request_io_irq(struct ena_adapter *adapter) for (i = ENA_IO_IRQ_FIRST_IDX; i < adapter->msix_vecs; i++) { irq = &adapter->irq_tbl[i]; - if (irq->requested) + if (unlikely(irq->requested)) continue; irq->res = bus_alloc_resource_any(adapter->pdev, SYS_RES_IRQ, &irq->vector, flags); - if (irq->res == NULL) { + if (unlikely(irq->res == NULL)) { device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); goto err; @@ -1970,7 +2001,7 @@ ena_request_io_irq(struct ena_adapter *adapter) rc = bus_setup_intr(adapter->pdev, irq->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, irq->handler, irq->data, &irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -1979,10 +2010,10 @@ ena_request_io_irq(struct ena_adapter *adapter) irq->requested = true; #ifdef RSS - device_printf(adapter->pdev, "queue %d - RSS bucket %d\n", + ena_trace(ENA_INFO, "queue %d - RSS bucket %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); #else - device_printf(adapter->pdev, "queue %d - cpu %d\n", + ena_trace(ENA_INFO, "queue %d - cpu %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); #endif } @@ -1999,7 +2030,7 @@ err: free both intr and resources */ if (irq->requested) rcc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "could not release" " irq: %d, error: %d\n", irq->vector, rcc); @@ -2012,7 +2043,7 @@ err: rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); } - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->requested = false; @@ -2033,7 +2064,7 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) ena_trace(ENA_INFO | ENA_ADMQ, "tear down irq: %d\n", irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); irq->requested = 0; @@ -2045,7 +2076,7 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); } @@ -2064,7 +2095,7 @@ ena_free_io_irq(struct ena_adapter *adapter) irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); } @@ -2077,7 +2108,7 @@ ena_free_io_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "dev has no parent" " while releasing res for irq: %d\n", irq->vector); @@ -2153,14 +2184,14 @@ ena_up_complete(struct ena_adapter *adapter) { int rc; - if (adapter->rss_support) { + if (likely(adapter->rss_support)) { rc = ena_rss_configure(adapter); if (rc != 0) return (rc); } rc = ena_change_mtu(adapter->ifp, adapter->ifp->if_mtu); - if (rc != 0) + if (unlikely(rc != 0)) return (rc); ena_refill_all_rx_bufs(adapter); @@ -2175,12 +2206,12 @@ ena_up(struct ena_adapter *adapter) { int rc = 0; - if (device_is_attached(adapter->pdev) == 0) { + if (unlikely(device_is_attached(adapter->pdev) == 0)) { device_printf(adapter->pdev, "device is not attached!\n"); return (ENXIO); } - if (!adapter->running == false) { + if (unlikely(!adapter->running)) { device_printf(adapter->pdev, "device is not running!\n"); return (ENXIO); } @@ -2191,38 +2222,38 @@ ena_up(struct ena_adapter *adapter) /* setup interrupts for IO queues */ ena_setup_io_intr(adapter); rc = ena_request_io_irq(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_req_irq"); goto err_req_irq; } /* allocate transmit descriptors */ rc = ena_setup_all_tx_resources(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_setup_tx"); goto err_setup_tx; } /* allocate receive descriptors */ rc = ena_setup_all_rx_resources(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_setup_rx"); goto err_setup_rx; } /* create IO queues for Rx & Tx */ rc = ena_create_io_queues(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "create IO queues failed"); goto err_io_que; } - if (adapter->link_status) + if (unlikely(adapter->link_status)) if_link_state_change(adapter->ifp, LINK_STATE_UP); rc = ena_up_complete(adapter); - if (rc != 0) + if (unlikely(rc != 0)) goto err_up_complete; counter_u64_add(adapter->dev_stats.interface_up, 1); @@ -2292,21 +2323,21 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) struct ena_adapter *adapter = if_getsoftc(ifp); ena_trace(ENA_DBG, "enter"); - ENA_DEV_LOCK; + mtx_lock(&adapter->global_mtx); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; if (!adapter->link_status) { - ENA_DEV_UNLOCK; - ena_trace(ENA_WARNING, "link_status = false"); + mtx_unlock(&adapter->global_mtx); + ena_trace(ENA_INFO, "link_status = false"); return; } ifmr->ifm_status |= IFM_ACTIVE; ifmr->ifm_active |= IFM_10G_T | IFM_FDX; - ENA_DEV_UNLOCK; + mtx_unlock(&adapter->global_mtx); } static void @@ -2491,11 +2522,9 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada if_t ifp; int caps = 0; - ena_trace(ENA_DBG, "enter"); - ifp = adapter->ifp = if_gethandle(IFT_ETHER); - if (ifp == NULL) { - device_printf(pdev, "can not allocate ifnet structure\n"); + if (unlikely(ifp == NULL)) { + ena_trace(ENA_ALERT, "can not allocate ifnet structure\n"); return (ENXIO); } if_initname(ifp, device_get_name(pdev), device_get_unit(pdev)); @@ -2563,7 +2592,7 @@ ena_down(struct ena_adapter *adapter) if (adapter->trigger_reset) { rc = ena_com_dev_reset(adapter->ena_dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 24 11:59:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2FBB14AD2E2; Thu, 24 Jan 2019 11:59:47 +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 8A99F8F0D1; Thu, 24 Jan 2019 11:59:47 +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 80B4C280D3; Thu, 24 Jan 2019 11:59:47 +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 x0OBxlEk080192; Thu, 24 Jan 2019 11:59:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OBxk05080188; Thu, 24 Jan 2019 11:59:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901241159.x0OBxk05080188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 11:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343399 - in head: bin/sh share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: bin/sh share/skel X-SVN-Commit-Revision: 343399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A99F8F0D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 11:59:48 -0000 Author: trasz Date: Thu Jan 24 11:59:46 2019 New Revision: 343399 URL: https://svnweb.freebsd.org/changeset/base/343399 Log: Make sh(1) support \u in PS1. This removes one fork/exec on interactive shell startup. Reviewed by: 0mp (man page), jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18790 Modified: head/bin/sh/parser.c head/bin/sh/sh.1 head/share/skel/dot.shrc Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Jan 24 11:31:57 2019 (r343398) +++ head/bin/sh/parser.c Thu Jan 24 11:59:46 2019 (r343399) @@ -40,6 +40,8 @@ static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -130,6 +132,7 @@ static void synexpect(int) __dead2; static void synerror(const char *) __dead2; static void setprompt(int); static int pgetc_linecont(void); +static void getusername(char *, size_t); static void * @@ -1969,6 +1972,53 @@ pgetc_linecont(void) return (c); } + +static struct passwd * +getpwlogin(void) +{ + const char *login; + + login = getlogin(); + if (login == NULL) + return (NULL); + + return (getpwnam(login)); +} + + +static void +getusername(char *name, size_t namelen) +{ + static char cached_name[MAXLOGNAME]; + struct passwd *pw; + uid_t euid; + + if (cached_name[0] == '\0') { + euid = geteuid(); + + /* + * Handle the case when there is more than one + * login with the same UID, or when the login + * returned by getlogin(2) does no longer match + * the current UID. + */ + pw = getpwlogin(); + if (pw == NULL || pw->pw_uid != euid) + pw = getpwuid(euid); + + if (pw != NULL) { + strlcpy(cached_name, pw->pw_name, + sizeof(cached_name)); + } else { + snprintf(cached_name, sizeof(cached_name), + "%u", euid); + } + } + + strlcpy(name, cached_name, namelen); +} + + /* * called by editline -- any expansions to the prompt * should be added here. @@ -2024,6 +2074,17 @@ getprompt(void *unused __unused) while ((ps[i] != '\0') && (ps[i] != trim)) i++; --i; + break; + + /* + * User name. + */ + case 'u': + ps[i] = '\0'; + getusername(&ps[i], PROMPTLEN - i); + /* Skip to end of username. */ + while (ps[i + 1] != '\0') + i++; break; /* Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Thu Jan 24 11:31:57 2019 (r343398) +++ head/bin/sh/sh.1 Thu Jan 24 11:59:46 2019 (r343399) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd December 8, 2018 +.Dd January 24, 2019 .Dt SH 1 .Os .Sh NAME @@ -1402,6 +1402,8 @@ which are replaced by the given information: This system's fully-qualified hostname (FQDN). .It Li \eh This system's hostname. +.It Li \eu +User name. .It Li \eW The final component of the current working directory. .It Li \ew Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Thu Jan 24 11:31:57 2019 (r343398) +++ head/share/skel/dot.shrc Thu Jan 24 11:59:46 2019 (r343399) @@ -33,7 +33,7 @@ alias g='egrep -i' # set prompt: ``username@hostname:directory $ '' -PS1="`whoami`@\h:\w \\$ " +PS1="\u@\h:\w \\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-all@freebsd.org Thu Jan 24 12:52:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0323E14AF293 for ; Thu, 24 Jan 2019 12:52:45 +0000 (UTC) (envelope-from tmiller@pipeline4data.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74EDD6A5CF for ; Thu, 24 Jan 2019 12:52:43 +0000 (UTC) (envelope-from tmiller@pipeline4data.com) Received: by mail-pf1-x441.google.com with SMTP id i12so2935158pfo.7 for ; Thu, 24 Jan 2019 04:52:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=IkjT8RCzCXK0GxuCBxaj9HEmlxH1Y5AnGVyBDoae2T8=; b=NOM6KxgGjfccWFptqKgrxxZ2lF75anpJgPD6N3oqH+jPyqV7b+15i/nDgHWxKIQT4R XwKLr1esaqqJrvllTD3dxqXL7HA8JbHFl1tT09tRDY1stOwVU2O0ZCqydB/xHOFsNQX8 kh/2uxxO5n5IsF7cJ9djofyYzWG/bFFtqL1gtTjHmDQWzJmTRKGXHgAEvlLvzTCMsyiP QPbjkJoX4gh2qDPCaDhpG8qPpWm1vRaDSAFco+fbA3qbDKRE/VqUvP+/uvmoikZu2bH+ MqILxRV2kDdT1Ie9N//Jz3H5etG76umbhzOT0Fs1XKo2Voj97tsiiCbuz1ERgM/AUZ7v 5/1g== X-Gm-Message-State: AJcUukcUV883YaHU4y0AAizyA/Gi79NpGhX830EedtiWCzRjubfWocpP w7/JKeKyXj6WRkOXDCAXRWuEqo8SpwrM+g== X-Google-Smtp-Source: ALg8bN4OHS7SiUg2ghu5dROJZhaUpMX4ma8LellopEBZxV8gMCYuskisRR8igsefeSb0TvnP8fZ5Bg== X-Received: by 2002:a62:9657:: with SMTP id c84mr6523779pfe.77.1548334362273; Thu, 24 Jan 2019 04:52:42 -0800 (PST) Received: from CPBS2PC ([1.22.103.252]) by smtp.gmail.com with ESMTPSA id q199sm39810405pfc.97.2019.01.24.04.52.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Jan 2019 04:52:41 -0800 (PST) From: "Tom Miller" To: Subject: IT and Cyber Security Professionals Database Date: Thu, 24 Jan 2019 18:21:56 +0530 Message-ID: <05a201d4b3e3$c0afecd0$420fc670$@pipeline4data.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdSz45OnvB2asMD9RTiuLsJKYbRH6w== Content-Language: en-us X-Antivirus: Avast (VPS 190124-0, 01/24/2019), Outbound message X-Antivirus-Status: Clean X-Rspamd-Queue-Id: 74EDD6A5CF X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.64 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[pipeline4data-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx2.googlemail.com,aspmx.l.google.com,alt2.aspmx.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[pipeline4data.com,quarantine]; NEURAL_HAM_SHORT(-0.59)[-0.586,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.07)[ip: (4.11), ipnet: 2607:f8b0::/32(-2.48), asn: 15169(-1.91), country: US(-0.08)]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[252.103.22.1.zen.spamhaus.org : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.976,0]; R_DKIM_ALLOW(-0.20)[pipeline4data-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; HTML_SHORT_LINK_IMG_2(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.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] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 12:52:45 -0000 Hi, Hope this email finds you well. Would you be interested in a list of professionals of IT and Cyber Security Professionals? For your business development and other marketing activities. Title includes: President/CEO/ Managing Directors, Vice President/Executive Director, Police Chiefs, Security Administrators, CIO Directors, Engineers, System Integrators, Technical Specialists, Network Administrators, Fire/Rescue Officers, Security Agencies, Law-Enforcement Directors, Head Of Security, Security Analysts, Safety Directors, Security Consultants, Sales And Marketing Staff Of Security Product And Service Providers, Emergency Management Departments, Lawyers, Advocates, Sales& Marketing Directors, Fleet Managers And Other As Per Your Requirement. The list comes with complete contact information like Contact name, Email address, Title, Company name, Phone number, Mailing address, etc. I'd be happy to send over few sample records on your request, and set up a time to discuss further. If there is someone else in your organization that I need to speak with, I'd be grateful if you would forward this email to the appropriate contact and help me with the introduction. Have a great day! Tom Miller Sr. Marketing Analyst If you don't wish to receive emails from us reply back with "Unsubscribe". --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From owner-svn-src-all@freebsd.org Thu Jan 24 14:33:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CC2B14B1932; Thu, 24 Jan 2019 14:33:16 +0000 (UTC) (envelope-from mw@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 10FD56D86B; Thu, 24 Jan 2019 14:33:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 07B8729C37; Thu, 24 Jan 2019 14:33:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OEXFYq063035; Thu, 24 Jan 2019 14:33:15 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OEXF9v063034; Thu, 24 Jan 2019 14:33:15 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201901241433.x0OEXF9v063034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 24 Jan 2019 14:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343400 - stable/11/sys/dev/ena X-SVN-Group: stable-11 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/11/sys/dev/ena X-SVN-Commit-Revision: 343400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10FD56D86B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 14:33:16 -0000 Author: mw Date: Thu Jan 24 14:33:15 2019 New Revision: 343400 URL: https://svnweb.freebsd.org/changeset/base/343400 Log: MFC: r336114: Remove stray space from PNP string. Sponsored by: Amazon, Inc. Modified: stable/11/sys/dev/ena/ena.c Modified: stable/11/sys/dev/ena/ena.c ============================================================================== --- stable/11/sys/dev/ena/ena.c Thu Jan 24 11:59:46 2019 (r343399) +++ stable/11/sys/dev/ena/ena.c Thu Jan 24 14:33:15 2019 (r343400) @@ -3947,7 +3947,7 @@ static driver_t ena_driver = { devclass_t ena_devclass; DRIVER_MODULE(ena, pci, ena_driver, ena_devclass, 0, 0); -MODULE_PNP_INFO("U16:vendor; U16:device", pci, ena, ena_vendor_info_array, +MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena_vendor_info_array, sizeof(ena_vendor_info_array[0]), nitems(ena_vendor_info_array) - 1); MODULE_DEPEND(ena, pci, 1, 1, 1); MODULE_DEPEND(ena, ether, 1, 1, 1); From owner-svn-src-all@freebsd.org Thu Jan 24 14:33:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21CC514B1963; Thu, 24 Jan 2019 14:33:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6D466D972; Thu, 24 Jan 2019 14:33:27 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id d11so5221522itf.2; Thu, 24 Jan 2019 06:33:27 -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=46AvUTJwSJkenr5EemY+5/UiOJzqJZgqYYPh9EtIc0s=; b=A3eC1BKd20lVMhfgkuwVEfpfQKlSnwMogJLo1a832g+fykHgiMejXsZZBl5n37diR4 U+ij7q87Jzc4/gAiVQN/Bn8f5bF7YjC3Pekzuv3gtyipoqn2jeVbtQbgKgQl/6QveNOp hrMVmtNJJF5k70D1ZUKlfPmvo9JNHzAGXMK/ZCTW6RBtfZsFAgFNxYM938Z/F+zDb09t we7fsBkhDSH5PeOsqSYsW/PUussd3XBaYj7NkB243mByNI9tGdt+4kztP8WLrvuEM63x viGK1Hqr9k2HH3ms/rSfHAI+Zgq7zfUNXBDT1dwJglEE/SSU7n2IiDcKIwaVcgbdyz7/ 1D+g== X-Gm-Message-State: AJcUukcqOyrnHHRYoO5OCXOuYmZtrpfUmsFc/iqcPPHiFX3XKoyZvoye Az/Wh1TTRKfB2atXluS6ba4Xtaeuq/YswoFkh2A9GA== X-Google-Smtp-Source: ALg8bN4hLeZZWz7XBDgP+tJiZ1uFVg10IYKSZ0WkItsTU2HICYmeN6z1TUfen8P7vsP2Fr3etpartLD1uVZEGL1wVqs= X-Received: by 2002:a05:660c:84e:: with SMTP id f14mr1459902itl.33.1548340400497; Thu, 24 Jan 2019 06:33:20 -0800 (PST) MIME-Version: 1.0 References: <201901151535.x0FFZE94018787@repo.freebsd.org> <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Thu, 24 Jan 2019 09:33:06 -0500 Message-ID: Subject: Re: svn commit: r343043 - head/crypto/openssh To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D6D466D972 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.169 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.00)[ip: (-9.28), ipnet: 209.85.128.0/17(-3.72), asn: 15169(-1.91), country: US(-0.08)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.80)[-0.796,0]; RCVD_IN_DNSWL_NONE(0.00)[169.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@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]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 14:33:29 -0000 > > Log: > > scp: disallow empty or current directory > > > Can this be MFCed to 12, 11 and 10? r343096,r343097,r343098 for stable/12, stable/11, stable/10. It will get merged to release branches with the next batch of SA/ENs. From owner-svn-src-all@freebsd.org Thu Jan 24 16:40:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08BB314B4E1C; Thu, 24 Jan 2019 16:40:15 +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 A35A071BAB; Thu, 24 Jan 2019 16:40:14 +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 974E02B117; Thu, 24 Jan 2019 16:40:14 +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 x0OGeEH4025557; Thu, 24 Jan 2019 16:40:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGeEjL025556; Thu, 24 Jan 2019 16:40:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241640.x0OGeEjL025556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343401 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A35A071BAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:40:15 -0000 Author: tuexen Date: Thu Jan 24 16:40:14 2019 New Revision: 343401 URL: https://svnweb.freebsd.org/changeset/base/343401 Log: Update a comment to reflect the current reality. SYN-cache entries live for abaut 12 seconds, not 45, when default setting are used. MFC after: 1 week Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 14:33:15 2019 (r343400) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:40:14 2019 (r343401) @@ -154,7 +154,12 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. - * 3 retransmits corresponds to a timeout of 3 * (1 + 2 + 4 + 8) == 45 seconds, + * 3 retransmits corresponds to a timeout with default values of + * TCPTV_RTOBASE * ( 1 + + * tcp_syn_backoff[1] + + * tcp_syn_backoff[2] + + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-all@freebsd.org Thu Jan 24 16:43:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CEBB14B515C; Thu, 24 Jan 2019 16:43:14 +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 C5AA87212A; Thu, 24 Jan 2019 16:43:13 +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 B85602B2B8; Thu, 24 Jan 2019 16:43:13 +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 x0OGhDZ4030424; Thu, 24 Jan 2019 16:43:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGhDI9030423; Thu, 24 Jan 2019 16:43:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241643.x0OGhDI9030423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343402 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5AA87212A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:43:14 -0000 Author: tuexen Date: Thu Jan 24 16:43:13 2019 New Revision: 343402 URL: https://svnweb.freebsd.org/changeset/base/343402 Log: Kill a trailing whitespace character... MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 16:40:14 2019 (r343401) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:43:13 2019 (r343402) @@ -156,7 +156,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + + * tcp_syn_backoff[1] + * tcp_syn_backoff[2] + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, From owner-svn-src-all@freebsd.org Thu Jan 24 16:47:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E0E14B531D; Thu, 24 Jan 2019 16:47:19 +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 688F472415; Thu, 24 Jan 2019 16:47:19 +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 5BE962B2BF; Thu, 24 Jan 2019 16:47:19 +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 x0OGlJPM030790; Thu, 24 Jan 2019 16:47:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGlJUY030789; Thu, 24 Jan 2019 16:47:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241647.x0OGlJUY030789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343403 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 688F472415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:47:19 -0000 Author: tuexen Date: Thu Jan 24 16:47:18 2019 New Revision: 343403 URL: https://svnweb.freebsd.org/changeset/base/343403 Log: Get the arithmetic right... MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 16:43:13 2019 (r343402) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:47:18 2019 (r343403) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_syn_backoff[1] + * tcp_syn_backoff[2] + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-all@freebsd.org Thu Jan 24 17:02:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F60314B60EA; Thu, 24 Jan 2019 17:02:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8F1732AD; Thu, 24 Jan 2019 17:02:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OH2G9v084160; Thu, 24 Jan 2019 09:02:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OH2GdN084159; Thu, 24 Jan 2019 09:02:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343391 - head/tools/tools/tinybsd In-Reply-To: <201901240634.x0O6YUIe013808@repo.freebsd.org> To: Oleksandr Tymoshenko Date: Thu, 24 Jan 2019 09:02:16 -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: 0A8F1732AD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:02:21 -0000 > Author: gonzo > Date: Thu Jan 24 06:34:29 2019 > New Revision: 343391 > URL: https://svnweb.freebsd.org/changeset/base/343391 > > Log: > Fix prompt for MFSROOT in tinybsd > > tinybsd offers two choices when prompting user for MFSROOT: 'YES' > and 'NO'. Script logic only handles 'yes'. Change offered values > to lower case. Why not fix this so that [Yy][Ee][Ss] is accepted? > PR: 131059 > Submitted by: Brock Williams > MFC after: 1 week > > Modified: > head/tools/tools/tinybsd/tinybsd > > Modified: head/tools/tools/tinybsd/tinybsd > ============================================================================== > --- head/tools/tools/tinybsd/tinybsd Thu Jan 24 03:50:27 2019 (r343390) > +++ head/tools/tools/tinybsd/tinybsd Thu Jan 24 06:34:29 2019 (r343391) > @@ -206,7 +206,7 @@ loadconfig () { > break > fi > done > - MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"` > + MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (yes/no)"` > IMG=`confirm_action "$IMG" "Image file to generate?"` > > # example of formatted value (NNN in this case) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jan 24 17:31:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0BE114B6C72; Thu, 24 Jan 2019 17:31:04 +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 63B837458C; Thu, 24 Jan 2019 17:31:04 +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 58EA82B9D9; Thu, 24 Jan 2019 17:31:04 +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 x0OHV4iR051992; Thu, 24 Jan 2019 17:31:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OHV4Pu051991; Thu, 24 Jan 2019 17:31:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901241731.x0OHV4Pu051991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 24 Jan 2019 17:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343404 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 343404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63B837458C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:31:04 -0000 Author: np Date: Thu Jan 24 17:31:03 2019 New Revision: 343404 URL: https://svnweb.freebsd.org/changeset/base/343404 Log: MFC r342603: cxgbe(4): Attach to two T540 variants. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Thu Jan 24 16:47:18 2019 (r343403) +++ stable/12/sys/dev/cxgbe/t4_main.c Thu Jan 24 17:31:03 2019 (r343404) @@ -666,6 +666,10 @@ struct { {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ + + /* Custom */ + {0x5483, "Custom T540-CR"}, + {0x5484, "Custom T540-BT"}, }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ From owner-svn-src-all@freebsd.org Thu Jan 24 17:31:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21ED814B6C76; Thu, 24 Jan 2019 17:31:05 +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 B9DC87458F; Thu, 24 Jan 2019 17:31:04 +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 AE8E22B9DA; Thu, 24 Jan 2019 17:31:04 +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 x0OHV4xE051998; Thu, 24 Jan 2019 17:31:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OHV4S2051997; Thu, 24 Jan 2019 17:31:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901241731.x0OHV4S2051997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 24 Jan 2019 17:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343404 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 343404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9DC87458F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:31:05 -0000 Author: np Date: Thu Jan 24 17:31:03 2019 New Revision: 343404 URL: https://svnweb.freebsd.org/changeset/base/343404 Log: MFC r342603: cxgbe(4): Attach to two T540 variants. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Thu Jan 24 16:47:18 2019 (r343403) +++ stable/11/sys/dev/cxgbe/t4_main.c Thu Jan 24 17:31:03 2019 (r343404) @@ -677,6 +677,10 @@ struct { {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ + + /* Custom */ + {0x5483, "Custom T540-CR"}, + {0x5484, "Custom T540-BT"}, }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ From owner-svn-src-all@freebsd.org Thu Jan 24 17:55:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF6ED14B78B5; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@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 555EC75C0F; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4652F2BED6; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OHtYC6068269; Thu, 24 Jan 2019 17:55:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OHtYYL068268; Thu, 24 Jan 2019 17:55:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901241755.x0OHtYYL068268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 24 Jan 2019 17:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343405 - in stable: 11/usr.bin/units 12/usr.bin/units X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/usr.bin/units 12/usr.bin/units X-SVN-Commit-Revision: 343405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 555EC75C0F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:55:34 -0000 Author: gjb Date: Thu Jan 24 17:55:33 2019 New Revision: 343405 URL: https://svnweb.freebsd.org/changeset/base/343405 Log: MFC r343259: Correct a typo: was -> way. Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/units/units.1 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.bin/units/units.1 Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.bin/units/units.1 ============================================================================== --- stable/11/usr.bin/units/units.1 Thu Jan 24 17:31:03 2019 (r343404) +++ stable/11/usr.bin/units/units.1 Thu Jan 24 17:55:33 2019 (r343405) @@ -158,7 +158,7 @@ by careless unit definitions. Comments in the unit definition file begin with a '#' or '/' character at the beginning of a line. .Pp -Prefixes are defined in the same was as standard units, but with +Prefixes are defined in the same way as standard units, but with a trailing dash at the end of the prefix name. If a unit is not found even after removing trailing 's' or 'es', then it will be checked From owner-svn-src-all@freebsd.org Thu Jan 24 17:55:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2C1314B78BA; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@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 98E6A75C10; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8DF442BED7; Thu, 24 Jan 2019 17:55:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OHtYtU068275; Thu, 24 Jan 2019 17:55:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OHtYuN068274; Thu, 24 Jan 2019 17:55:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901241755.x0OHtYuN068274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 24 Jan 2019 17:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343405 - in stable: 11/usr.bin/units 12/usr.bin/units X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/usr.bin/units 12/usr.bin/units X-SVN-Commit-Revision: 343405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98E6A75C10 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:55:35 -0000 Author: gjb Date: Thu Jan 24 17:55:33 2019 New Revision: 343405 URL: https://svnweb.freebsd.org/changeset/base/343405 Log: MFC r343259: Correct a typo: was -> way. Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/units/units.1 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/units/units.1 Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/units/units.1 ============================================================================== --- stable/12/usr.bin/units/units.1 Thu Jan 24 17:31:03 2019 (r343404) +++ stable/12/usr.bin/units/units.1 Thu Jan 24 17:55:33 2019 (r343405) @@ -158,7 +158,7 @@ by careless unit definitions. Comments in the unit definition file begin with a '#' or '/' character at the beginning of a line. .Pp -Prefixes are defined in the same was as standard units, but with +Prefixes are defined in the same way as standard units, but with a trailing dash at the end of the prefix name. If a unit is not found even after removing trailing 's' or 'es', then it will be checked From owner-svn-src-all@freebsd.org Thu Jan 24 18:13:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB0C414B8C2F; Thu, 24 Jan 2019 18:13:23 +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 7A9E376F9F; Thu, 24 Jan 2019 18:13:23 +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 707FB2C272; Thu, 24 Jan 2019 18:13:23 +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 x0OIDNkw079068; Thu, 24 Jan 2019 18:13:23 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIDNUN079067; Thu, 24 Jan 2019 18:13:23 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201901241813.x0OIDNUN079067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Thu, 24 Jan 2019 18:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343406 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 343406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A9E376F9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:13:24 -0000 Author: bcr (doc committer) Date: Thu Jan 24 18:13:23 2019 New Revision: 343406 URL: https://svnweb.freebsd.org/changeset/base/343406 Log: Add ZFS usage tips to freebsd-tips. Add a bunch of examples on how to use ZFS features like: - listing available space, - setting and displaying a userquota, - displaying pool I/O statistics and pool history, - displaying the compression ratio for a dataset, - various list options (sorting, removing headers), - performing a dry-run of a snapshot delete, - removing a range of snapshots, - setting a custom property, - preventing removal of a snapshot with ZFS holds, - permission sets for zfs send/receive. Additionally, clarify the existing examples a bit when it comes to displaying space by mentioning UFS explicitly. Other examples include displaying I/O in top(1), querying sysctl(8) for active CPUs and available RAM. Mention systat(1) and its options, too. While here, reformat the example to upload a dmesg(8) a bit to wrap properly. Thanks to Allan Jude for his help with some of the ZFS examples. Reviewed by: dru,allanjude Approved by: allanjude (earlier version) MFC after: 3 days Relnotes: yes (ZFS examples in freebsd-tips) Differential Revision: https://reviews.freebsd.org/D18541 Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Thu Jan 24 17:55:33 2019 (r343405) +++ head/usr.bin/fortune/datfiles/freebsd-tips Thu Jan 24 18:13:23 2019 (r343406) @@ -270,12 +270,12 @@ To see how long it takes a command to run, type the wo command name. -- Dru % -To see how much disk space is left on your partitions, use +To see how much disk space is left on your UFS partitions, use df -h -- Dru % -To see the 10 largest files on a directory or partition, use +To see the 10 largest files on a directory or UFS partition, use du -h /partition_or_directory_name | sort -rh | head -- Dru @@ -554,9 +554,241 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % -You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. -Use the curl package to upload it in one command: +You can upload the dmesg of your system to help developers get an overview of commonly +used hardware and peripherals for FreeBSD. Use the curl package to upload it like this: curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ $(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ --data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% +Want to know how much memory (in bytes) your machine has available? Let +sysctl(8) tell you with the following command: + +sysctl hw.physmem + +The number of active CPUs is displayed using this command: + +sysctl hw.ncpu + + -- Benedict Reuschling +% +When using ZFS as the file system the "df" command will display confusing +values. Use the built-in "zfs list" command to get an overview of space usage: + +zfs list -o space + + -- Benedict Reuschling +% +To learn more about what your system is doing, take a look at systat(1). For +example, to get an overview of I/O happening in the system, run: + +systat -iostat + +Other values are icmp, icmp6, ifstat, ip, ip6, netstat, pigs, sctp, swap, tcp, +vmstat, or zarc. You can switch between displays using : and exit +back to your shell by typing + +:quit + + -- Benedict Reuschling +% +To set a quota of 10 GB for the user named foo on a ZFS dataset, run the +following command: + +# zfs set userquota@foo=10G pool/home/foo + +The zfs userspace command can display the quota and current space usage: + +# zfs userspace pool/home/foo + +To unset a quota, assign "none" as the value. + -- Benedict Reuschling +% +ZFS can display I/O statistics for a given pool using the iostat subcommand. +By default, it will display one line of current activity. To display stats +every 5 seconds run the following command (cancel with CTRL+C): + +zpool iostat 5 + +To view individual disk activities, specify the -v parameter: + +zpool iostat -v + +Of course, both can be combined. For more options, see zpool(8). + -- Benedict Reuschling +% +FreeBSD's top(1) utility displays CPU statistics by default. +To display I/O activity for each process instead, run top like this: + +top -m io + + -- Benedict Reuschling +% +ZFS keeps a history of commands run against a specific pool using the +history subcommand to zpool: + +zpool history + +More details are available using the -i and -l parameters. Note that ZFS +will not keep the complete pool history forever and will remove older +events in favor of never ones. + -- Benedict Reuschling +% +To display the compression ratio for the ZFS dataset /var/log on the pool +mypool, run the following command: + +zfs get refcompressratio mypool/var/log + +The refcompressratio will only display the compression ratio for that specific +dataset, not the descendant datasets. To include the child datasets, the +command looks like this: + +zfs get compressratio mypool/var + + -- Benedict Reuschling +% +You can limit the depth of the displayed datasets in the "zfs list" output +using the -d parameter. To display only the first level of datasets below +mypool/usr and not the ones deeper than those, run this command: + +zfs list -d 1 mypool/usr + + -- Benedict Reuschling +% +The "zfs list" command can be filtered in multiple ways. To display just +the dataset name, use the -o parameter: + +zfs list -o name mypool/usr + +More columns and their order can be defined by separating them with commas: + +zfs list -o mountpoint,name,avail + + -- Benedict Reuschling +% +The output of "zfs list" can be sorted by a specific column using -s. To +sort the datasets by the "used" column in ascending order, run this command: + +zfs list -s used + +To sort in descending order instead, use -S: + +zfs list -S used + + -- Benedict Reuschling +% +To make the "zfs list" output more script-friendly, you can suppress the +output of the headers for each column by passing the -H parameter: + +zfs list -H + +Another helpful option for script writers is -p, which displays the numbers +in non-rounded, exact values: + +zfs list -p + + -- Benedict Reuschling +% +Before deleting a dataset or snapshot, perform a dry run using the -n +parameter. This is to make sure you really want to delete just that +dataset/snapshot and not any dependent ones. ZFS will display the resulting +action when -n is combined with the -v option without actually performing +it: + +zfs destroy -rvn mypool@mysnap + +Once you are sure this is exactly what you intend to do, remove the -n +parameter to execute the destroy operation. + -- Benedict Reuschling +% +You can delete a range of ZFS snapshots (a-z) in multiple ways. +The following will delete d and all earlier snapshots: + +zfs destroy mypool/data@%d + +To delete d and all later snapshots: + +zfs destroy mypool/data@d% + +To delete all dataset snapshots: + +zfs destroy mypool/data@% + +Make sure to let ZFS perform a dry run (-n option) first and display (-v) what +it would do to confirm that the delete operation is removing exactly what you +intended. + -- Benedict Reuschling +% +To set a custom ZFS property on the mypool pool, you need to provide it +using the "key1:key2=value" syntax, where the colon (:) is used as the +separator and identifier from the built-in ZFS properties: + +# zfs set warranty:expires=2038-01-19 mypool + +The custom property is applied to all datasets and can be queried like any +built-in properties using zfs get: + +zfs get warranty:expires mypool + +To reset the value of a custom property, use the inherit subcommand: + +# zfs inherit warranty:expires mypool + +Removing a custom property from a pool is done using the -r flag to the +"zfs inherit" command: + +# zfs inherit -r warranty:expires mypool + + -- Benedict Reuschling +% +To delete a range of ZFS snapshots, use the % (percent) character after the +full path to the first snapshot that should be included. For example, to +simulate deleting snapshots a through (including) d, use this command: + +# zfs destroy -rvn mypool/tmp@a%d + +Once you are sure that this is what you want, remove the -n option: + +# zfs destroy -rv mypool/tmp@a%d + + -- Benedict Reuschling +% +You can prevent the removal of a ZFS snapshot by using the hold subcommand. +For example, to prevent the snapshot called milestone from deletion, run the +following command: + +# zfs hold milestone_hold mypool/projects@my_milestone + +The "zfs holds" command will list all current snapshots that are protected +this way (-r for a recursive list): + +# zfs holds -r mypool + +The TIMESTAMP column in the output of the above command is from when the +hold was created, not the snapshot it holds. The "zfs destroy" command will +echo a "dataset is busy" message on the console when it encounters a hold. +Use "zfs release" to release the hold on the snapshot: + +# zfs release milestone_hold mypool/projects@my_milestone + + -- Benedict Reuschling +% +A user "sender" needs the following permissions set to send a ZFS dataset: + +# zfs allow -u sender send,snapshot txpool + +On the receiving side, the user "receiver" requires these permissions: + +# zfs allow -u receiver compression,mountpoint,mount,create,receive rxpool + + -- Benedict Reuschling +% +Don't let your zpool fill up completely by creating a dataset with +reservation. + +# zfs create -o refreservation=<5% of total pool space> /reserved + +You can always shrink the reserve if you need the space, but your pool will +always have space left this way. + + -- Benedict Reuschling % From owner-svn-src-all@freebsd.org Thu Jan 24 18:26:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AF814B9323; Thu, 24 Jan 2019 18:26:31 +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 1C9EE7787C; Thu, 24 Jan 2019 18:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10F9E2C434; Thu, 24 Jan 2019 18:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIQUJk084198; Thu, 24 Jan 2019 18:26:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIQUUk084197; Thu, 24 Jan 2019 18:26:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241826.x0OIQUUk084197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343407 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C9EE7787C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:26:31 -0000 Author: emaste Date: Thu Jan 24 18:26:30 2019 New Revision: 343407 URL: https://svnweb.freebsd.org/changeset/base/343407 Log: freebsd-update: open $PAGER only if necessary PR: 194547, 208497 Submitted by: Gerald Aryeetey Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:13:23 2019 (r343406) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:26:30 2019 (r343407) @@ -1949,13 +1949,11 @@ fetch_create_manifest () { # Report to the user if any updates were avoided due to local changes if [ -s modifiedfiles ]; then - echo - echo -n "The following files are affected by updates, " - echo "but no changes have" - echo -n "been downloaded because the files have been " - echo "modified locally:" - cat modifiedfiles - fi | $PAGER + cat - modifiedfiles <<- EOF | ${PAGER} + The folling files are affected by updates but no changes have + been downloaded because the files have been modified locally: + EOF + fi rm modifiedfiles # If no files will be updated, tell the user and exit @@ -1981,30 +1979,29 @@ fetch_create_manifest () { # Report removed files, if any if [ -s files.removed ]; then - echo - echo -n "The following files will be removed " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - cat files.removed - fi | $PAGER + cat - files.removed <<- EOF | ${PAGER} + The following files will be removed as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.removed # Report added files, if any if [ -s files.added ]; then - echo - echo -n "The following files will be added " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - cat files.added - fi | $PAGER + cat - files.added <<- EOF | ${PAGER} + The following files will be added as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.added # Report updated files, if any if [ -s files.updated ]; then - echo - echo -n "The following files will be updated " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - - cat files.updated - fi | $PAGER + cat - files.updated <<- EOF | ${PAGER} + The following files will be updated as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.updated # Create a directory for the install manifest. From owner-svn-src-all@freebsd.org Thu Jan 24 18:39:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D31714B97CC; Thu, 24 Jan 2019 18:39:46 +0000 (UTC) (envelope-from se@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 D6A1377FC4; Thu, 24 Jan 2019 18:39:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CA7262C5EC; Thu, 24 Jan 2019 18:39:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIdjjt089422; Thu, 24 Jan 2019 18:39:45 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIdjIH089421; Thu, 24 Jan 2019 18:39:45 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901241839.x0OIdjIH089421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 24 Jan 2019 18:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343408 - head/usr.bin/whereis X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/whereis X-SVN-Commit-Revision: 343408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6A1377FC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:39:46 -0000 Author: se Date: Thu Jan 24 18:39:45 2019 New Revision: 343408 URL: https://svnweb.freebsd.org/changeset/base/343408 Log: Silence Clang Scan warnings regarding the use of strcp(). While these warnings are false positives, the use of strdup() instead of malloc() and strcpy() simplifies and clarifies the code. While checking the remaining uses of strcpy and strcat I noticed an assignment of a strlen() to a variable "s", whose value needs to be preserved for use in later output routines (where it is used to allocate a buffer). I do not think that the value of "s" will come out lower than its correct value and thus there is no risk of a buffer overflow, in the general case, but a specially crafter argument might lead to an overflow. The bogus assignment to "s" is removed since this value was only used a single time in the following malloc() call, which has been removed. MFC after: 2 weeks Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Thu Jan 24 18:26:30 2019 (r343407) +++ head/usr.bin/whereis/whereis.c Thu Jan 24 18:39:45 2019 (r343408) @@ -285,9 +285,9 @@ defaults(void) bindirs[nele] = NULL; if ((cp = getenv("PATH")) != NULL) { /* don't destroy the original environment... */ - if ((b = malloc(strlen(cp) + 1)) == NULL) + b = strdup(cp); + if (b == NULL) abort(); - strcpy(b, cp); decolonify(b, &bindirs, &nele); } } @@ -301,18 +301,18 @@ defaults(void) err(EX_OSERR, "error processing manpath results"); if ((b = strchr(buf, '\n')) != NULL) *b = '\0'; - if ((b = malloc(strlen(buf) + 1)) == NULL) + b = strdup(buf); + if (b == NULL) abort(); - strcpy(b, buf); nele = 0; decolonify(b, &mandirs, &nele); } /* -s defaults to precompiled list, plus subdirs of /usr/ports */ if (!sourcedirs) { - if ((b = malloc(strlen(sourcepath) + 1)) == NULL) + b = strdup(sourcepath); + if (b == NULL) abort(); - strcpy(b, sourcepath); nele = 0; decolonify(b, &sourcedirs, &nele); @@ -523,11 +523,9 @@ main(int argc, char **argv) * man -w found plain source * page, use it. */ - s = strlen(buf); - cp2 = malloc(s + 1); + cp2 = strdup(buf); if (cp2 == NULL) abort(); - strcpy(cp2, buf); } if (man == NULL) { From owner-svn-src-all@freebsd.org Thu Jan 24 18:41:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6117614B9A2E; Thu, 24 Jan 2019 18:41:01 +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 0925D8027D; Thu, 24 Jan 2019 18:41:01 +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 F292B2C612; Thu, 24 Jan 2019 18:41:00 +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 x0OIf0tm090352; Thu, 24 Jan 2019 18:41:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIf07Y090351; Thu, 24 Jan 2019 18:41:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241841.x0OIf07Y090351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343409 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0925D8027D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:41:01 -0000 Author: emaste Date: Thu Jan 24 18:41:00 2019 New Revision: 343409 URL: https://svnweb.freebsd.org/changeset/base/343409 Log: freebsd-update: Stop installing empty component sets Submitted by: Gerald Aryeetey Reported by: rgrimes Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18927 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:39:45 2019 (r343408) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) @@ -2195,7 +2195,7 @@ upgrade_guess_components () { sort -k 2,2 -t ' ' > compfreq.present join -t ' ' -1 2 -2 2 compfreq.present compfreq.total | while read S P T; do - if [ ${P} -gt `expr ${T} / 2` ]; then + if [ ${T} -ne 0 -a ${P} -gt `expr ${T} / 2` ]; then echo ${S} fi done > comp.present From owner-svn-src-all@freebsd.org Thu Jan 24 18:44:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DDD14B9D06; Thu, 24 Jan 2019 18:44:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87982807FE; Thu, 24 Jan 2019 18:44:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id m19so5621751ioh.3; Thu, 24 Jan 2019 10:44:02 -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; bh=6JjcNvvA2V9li2u3lFmLWwb26S5TFmK6w/Awre9A3eg=; b=XVRBjznhktwA/ZGmV8ycPwJByN7JHu5UxLbzy6ZqRVMaBguctp1m3KcreqHPUmqM/2 u3pvzjK5W3Abo0NNdGONmpa9cK7l1oXCKqUin9967SXWReVu3VVkzFoH/AWlkRL44D0C yWtOSy6ufiPwYbgBMe91Q5qDulWD7sL9OFkiP5AKQE0g51vT729Pw16uzU+Q7DooFrFx s0e2H4l5aDL97i78fUFfwilhmE7VB+zG2sudSbYSn7i5DKD08y3AvSbx9OWibIOBzR6r TnU8oJrPXfhV1EsJZLRg1kSinpZDtjHAo5sqvFW1BTAQq4WUzVpW/FYzPPVcvGt/PaM8 PVWg== X-Gm-Message-State: AHQUAuam6uzhEiX3omULhyD1iTOATxqKqBgexqR1usNn8VtWP92G8DKi 8zIQvO8dzLSEbaFbLJJ835ifz3+YOghhWvKbgOi5mw== X-Google-Smtp-Source: ALg8bN7IRK9GqDDny0ZMsCddclpR8DXC5L41zipHm4phf5Yd+fePLN2Xbuh5KHw1YdD0E+dcy9e4ieBdyob794lGUxk= X-Received: by 2002:a5d:88ce:: with SMTP id i14mr5228351iol.66.1548355435576; Thu, 24 Jan 2019 10:43:55 -0800 (PST) MIME-Version: 1.0 References: <201901241841.x0OIf07Y090351@repo.freebsd.org> In-Reply-To: <201901241841.x0OIf07Y090351@repo.freebsd.org> From: Ed Maste Date: Thu, 24 Jan 2019 13:43:42 -0500 Message-ID: Subject: Re: svn commit: r343409 - head/usr.sbin/freebsd-update To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 87982807FE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:44:03 -0000 On Thu, 24 Jan 2019 at 13:41, Ed Maste wrote: > > Author: emaste > Date: Thu Jan 24 18:41:00 2019 > New Revision: 343409 > URL: https://svnweb.freebsd.org/changeset/base/343409 > > Log: > freebsd-update: Stop installing empty component sets > ... > Reviewed by: delphij Oops, error in the commit message; delphij did not review this one of the set of freebsd-update patches. From owner-svn-src-all@freebsd.org Thu Jan 24 18:48:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A014B14B9F05; Thu, 24 Jan 2019 18:48:16 +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 4364080A2B; Thu, 24 Jan 2019 18:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3137D2C7B2; Thu, 24 Jan 2019 18:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OImGOm094607; Thu, 24 Jan 2019 18:48:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OImG3N094606; Thu, 24 Jan 2019 18:48:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241848.x0OImG3N094606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343410 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4364080A2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:48:16 -0000 Author: emaste Date: Thu Jan 24 18:48:15 2019 New Revision: 343410 URL: https://svnweb.freebsd.org/changeset/base/343410 Log: freebsd-update: fix style from r343271 change PR: 234771 Submitted by: Gerald Aryeetey MFC with: r343271 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:48:15 2019 (r343410) @@ -670,20 +670,20 @@ fetchupgrade_check_params () { # Disallow upgrade from a version that is not a release case ${RELNUM} in - *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) - ;; - *) - echo -n "`basename $0`: " - cat <<- EOF - Cannot upgrade from a version that is not a release - (including alpha, beta and release candidates) - using `basename $0`. Instead, FreeBSD can be directly - upgraded by source or upgraded to a RELEASE/RELENG version - prior to running `basename $0`. - Currently running: ${RELNUM} - EOF - exit 1 - ;; + *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) + ;; + *) + echo -n "`basename $0`: " + cat <<- EOF + Cannot upgrade from a version that is not a release + (including alpha, beta and release candidates) + using `basename $0`. Instead, FreeBSD can be directly + upgraded by source or upgraded to a RELEASE/RELENG version + prior to running `basename $0`. + Currently running: ${RELNUM} + EOF + exit 1 + ;; esac # Figure out what directory contains the running kernel From owner-svn-src-all@freebsd.org Thu Jan 24 18:51:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F5814BA051; Thu, 24 Jan 2019 18:51:16 +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 DD67E80DEA; Thu, 24 Jan 2019 18:51:15 +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 C8F5F2C7EA; Thu, 24 Jan 2019 18:51:15 +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 x0OIpFRq096330; Thu, 24 Jan 2019 18:51:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIpFGs096329; Thu, 24 Jan 2019 18:51:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241851.x0OIpFGs096329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343411 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD67E80DEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:51:16 -0000 Author: emaste Date: Thu Jan 24 18:51:15 2019 New Revision: 343411 URL: https://svnweb.freebsd.org/changeset/base/343411 Log: freebsd-update: Clarify unsupported upgrade message PR: 204115 Submitted by: Gerald Aryeetey Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18916 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:48:15 2019 (r343410) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:51:15 2019 (r343411) @@ -1022,7 +1022,16 @@ fetch_pick_server () { # Have we run out of mirrors? if [ `wc -l < serverlist` -eq 0 ]; then - echo "No mirrors remaining, giving up." + cat <<- EOF + No mirrors remaining, giving up. + + This may be because upgrading from this platform (${ARCH}) + or release (${RELNUM}) is unsupported by `basename $0`. Only + platforms with Tier 1 support can be upgraded by `basename $0`. + See https://www.freebsd.org/platforms/index.html for more info. + + If unsupported, FreeBSD must be upgraded by source. + EOF return 1 fi From owner-svn-src-all@freebsd.org Thu Jan 24 19:41:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA5714BBE0C; Thu, 24 Jan 2019 19:41:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51DB083306; Thu, 24 Jan 2019 19:41:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OJeuup084583; Thu, 24 Jan 2019 11:40:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OJetvf084582; Thu, 24 Jan 2019 11:40:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901241940.x0OJetvf084582@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343043 - head/crypto/openssh In-Reply-To: To: Ed Maste Date: Thu, 24 Jan 2019 11:40:55 -0800 (PST) CC: "Rodney W. Grimes" , src-committers , 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: 51DB083306 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 19:41:07 -0000 [ Charset UTF-8 unsupported, converting... ] > > > Log: > > > scp: disallow empty or current directory > > > > > Can this be MFCed to 12, 11 and 10? > > r343096,r343097,r343098 for stable/12, stable/11, stable/10. It will > get merged to release branches with the next batch of SA/ENs. Thank you! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jan 24 20:08:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5915914BC95C; Thu, 24 Jan 2019 20:08:48 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB2648475A; Thu, 24 Jan 2019 20:08:47 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1gmlIk-000P68-E3; Thu, 24 Jan 2019 12:08:39 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id x0OK8bMg096479; Thu, 24 Jan 2019 12:08:37 -0800 (PST) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Thu, 24 Jan 2019 12:08:37 -0800 From: Oleksandr Tymoshenko To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343391 - head/tools/tools/tinybsd Message-ID: <20190124200837.GA96390@bluezbox.com> References: <201901240634.x0O6YUIe013808@repo.freebsd.org> <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Rodney W. Grimes (freebsd@pdx.rh.CN85.dnsmgr.net) wrote: > > Author: gonzo > > Date: Thu Jan 24 06:34:29 2019 > > New Revision: 343391 > > URL: https://svnweb.freebsd.org/changeset/base/343391 > > > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: EB2648475A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:08:48 -0000 Rodney W. Grimes (freebsd@pdx.rh.CN85.dnsmgr.net) wrote: > > Author: gonzo > > Date: Thu Jan 24 06:34:29 2019 > > New Revision: 343391 > > URL: https://svnweb.freebsd.org/changeset/base/343391 > > > > Log: > > Fix prompt for MFSROOT in tinybsd > > > > tinybsd offers two choices when prompting user for MFSROOT: 'YES' > > and 'NO'. Script logic only handles 'yes'. Change offered values > > to lower case. > > Why not fix this so that [Yy][Ee][Ss] is accepted? I thought about it but actual end-to-end verification of such fix would require going through whole build (and learning how tinybsd script works). It's a bit more effort than I would like to spend on the tool I don't work with and with the number of users I don't know of. The committed patch was readily available, easily verifiable and a step forward, a tiny one but nevertheless. If anybody wants to implement proper fix - feel free to reopen PR and take over it. -- gonzo From owner-svn-src-all@freebsd.org Thu Jan 24 20:35:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A2214BDA43; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@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 2C0E385CF9; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FF2B2DAA9; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OKZx6N052620; Thu, 24 Jan 2019 20:35:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OKZwxX052619; Thu, 24 Jan 2019 20:35:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901242035.x0OKZwxX052619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 24 Jan 2019 20:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343412 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C0E385CF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:35:59 -0000 Author: ngie Date: Thu Jan 24 20:35:58 2019 New Revision: 343412 URL: https://svnweb.freebsd.org/changeset/base/343412 Log: Fix a typo/wordsmith a description modified in r343407 r343407 accidentally introduced a typo (folling -> following). While reading the change out loud, I realized that the original sentence was wordy. almost sounding like a run-on sentence. Improve the flow by splitting up the two thoughts into two distinct sentence fragments. PR: 194547, 208497 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 month MFC with: r343407 Differential Revision: https://reviews.freebsd.org/D18947 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:51:15 2019 (r343411) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 20:35:58 2019 (r343412) @@ -1959,8 +1959,9 @@ fetch_create_manifest () { # Report to the user if any updates were avoided due to local changes if [ -s modifiedfiles ]; then cat - modifiedfiles <<- EOF | ${PAGER} - The folling files are affected by updates but no changes have - been downloaded because the files have been modified locally: + The following files are affected by updates. No changes have + been downloaded, however, because the files have been modified + locally: EOF fi rm modifiedfiles From owner-svn-src-all@freebsd.org Thu Jan 24 20:38:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560BA14BDBEB; Thu, 24 Jan 2019 20:38:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A4385F8B; Thu, 24 Jan 2019 20:38:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OKcgoq084811; Thu, 24 Jan 2019 12:38:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OKcgLH084810; Thu, 24 Jan 2019 12:38:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901242038.x0OKcgLH084810@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343409 - head/usr.sbin/freebsd-update In-Reply-To: <201901241841.x0OIf07Y090351@repo.freebsd.org> To: Ed Maste Date: Thu, 24 Jan 2019 12:38:42 -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: C5A4385F8B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:38:45 -0000 > Author: emaste > Date: Thu Jan 24 18:41:00 2019 > New Revision: 343409 > URL: https://svnweb.freebsd.org/changeset/base/343409 > > Log: > freebsd-update: Stop installing empty component sets Thank you! > Submitted by: Gerald Aryeetey > Reported by: rgrimes > Reviewed by: delphij > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18927 > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:39:45 2019 (r343408) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) > @@ -2195,7 +2195,7 @@ upgrade_guess_components () { > sort -k 2,2 -t ' ' > compfreq.present > join -t ' ' -1 2 -2 2 compfreq.present compfreq.total | > while read S P T; do > - if [ ${P} -gt `expr ${T} / 2` ]; then > + if [ ${T} -ne 0 -a ${P} -gt `expr ${T} / 2` ]; then > echo ${S} > fi > done > comp.present > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jan 24 22:09:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EADA014C0723; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@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 8D08989952; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 797482EA63; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OM9Qop000206; Thu, 24 Jan 2019 22:09:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OM9QDV000205; Thu, 24 Jan 2019 22:09:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901242209.x0OM9QDV000205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 24 Jan 2019 22:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343413 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D08989952 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 22:09:27 -0000 Author: vmaffione Date: Thu Jan 24 22:09:26 2019 New Revision: 343413 URL: https://svnweb.freebsd.org/changeset/base/343413 Log: netmap: fix crash with monitors and VALE ports Crash report described here: https://github.com/luigirizzo/netmap/issues/583 Fixed by providing dummy sync callback in case it is missing. Modified: head/sys/dev/netmap/netmap_monitor.c Modified: head/sys/dev/netmap/netmap_monitor.c ============================================================================== --- head/sys/dev/netmap/netmap_monitor.c Thu Jan 24 20:35:58 2019 (r343412) +++ head/sys/dev/netmap/netmap_monitor.c Thu Jan 24 22:09:26 2019 (r343413) @@ -259,11 +259,20 @@ static int netmap_monitor_parent_txsync(struct netmap_ static int netmap_monitor_parent_rxsync(struct netmap_kring *, int); static int netmap_monitor_parent_notify(struct netmap_kring *, int); +static int +nm_monitor_dummycb(struct netmap_kring *kring, int flags) +{ + (void)kring; + (void)flags; + return 0; +} + static void nm_monitor_intercept_callbacks(struct netmap_kring *kring) { ND("intercept callbacks on %s", kring->name); - kring->mon_sync = kring->nm_sync; + kring->mon_sync = kring->nm_sync != NULL ? + kring->nm_sync : nm_monitor_dummycb; kring->mon_notify = kring->nm_notify; if (kring->tx == NR_TX) { kring->nm_sync = netmap_monitor_parent_txsync; From owner-svn-src-all@freebsd.org Thu Jan 24 22:25:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA09F14C0E6B; Thu, 24 Jan 2019 22:25:52 +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 824458A4A2; Thu, 24 Jan 2019 22:25:52 +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 719832EDEC; Thu, 24 Jan 2019 22:25:52 +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 x0OMPq4G010470; Thu, 24 Jan 2019 22:25:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OMPqeh010469; Thu, 24 Jan 2019 22:25:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901242225.x0OMPqeh010469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 22:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343414 - stable/12/usr.sbin/freebsd-update X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 824458A4A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 22:25:53 -0000 Author: emaste Date: Thu Jan 24 22:25:52 2019 New Revision: 343414 URL: https://svnweb.freebsd.org/changeset/base/343414 Log: MFC r339960 (cem): freebsd-update: add a progress report for the "fetching files..." After patching step is done. PR: 232857 Submitted by: mat Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/12/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 22:09:26 2019 (r343413) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 22:25:52 2019 (r343414) @@ -1888,7 +1888,7 @@ fetch_files () { echo ${NDEBUG} "files... " lam -s "${FETCHDIR}/f/" - -s ".gz" < filelist | xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ - 2>${QUIETREDIR} + 2>${STATSREDIR} | fetch_progress while read Y; do if ! [ -f ${Y}.gz ]; then From owner-svn-src-all@freebsd.org Thu Jan 24 22:34:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3151F14C13AA; Thu, 24 Jan 2019 22:34:31 +0000 (UTC) (envelope-from jilles@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 CBC928AC5F; Thu, 24 Jan 2019 22:34:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF1B2EFB3; Thu, 24 Jan 2019 22:34:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OMYUrt015706; Thu, 24 Jan 2019 22:34:30 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OMYUEh015705; Thu, 24 Jan 2019 22:34:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901242234.x0OMYUEh015705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 24 Jan 2019 22:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343415 - stable/12/lib/libedit X-SVN-Group: stable-12 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/12/lib/libedit X-SVN-Commit-Revision: 343415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBC928AC5F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 22:34:31 -0000 Author: jilles Date: Thu Jan 24 22:34:30 2019 New Revision: 343415 URL: https://svnweb.freebsd.org/changeset/base/343415 Log: MFC r343105: libedit: Avoid out of bounds read in 'bind' command This is CVS revision 1.31 from NetBSD lib/libedit/chartype.c: Make sure that argv is NULL terminated since functions like tty_stty rely on it to be so (Gerry Swinslow) This broke when the wide-character support was enabled in libedit. The conversion from multibyte to wide-character did not supply the apparently expected terminating NULL in the new argv array. PR: 233343 Modified: stable/12/lib/libedit/chartype.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libedit/chartype.c ============================================================================== --- stable/12/lib/libedit/chartype.c Thu Jan 24 22:25:52 2019 (r343414) +++ stable/12/lib/libedit/chartype.c Thu Jan 24 22:34:30 2019 (r343415) @@ -157,7 +157,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) return NULL; - wargv = el_malloc((size_t)argc * sizeof(*wargv)); + wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv)); for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { /* don't pass null pointers to mbstowcs */ @@ -175,6 +175,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer bufspace -= (size_t)bytes; p += bytes; } + wargv[i] = NULL; return wargv; } From owner-svn-src-all@freebsd.org Thu Jan 24 23:34:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8116614C2D65; Thu, 24 Jan 2019 23:34:52 +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 27F3A8CEBF; Thu, 24 Jan 2019 23:34:52 +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 1E44A2FA3B; Thu, 24 Jan 2019 23:34:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ONYpWk047051; Thu, 24 Jan 2019 23:34:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ONYpNU047048; Thu, 24 Jan 2019 23:34:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901242334.x0ONYpNU047048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 23:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343416 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27F3A8CEBF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 23:34:52 -0000 Author: trasz Date: Thu Jan 24 23:34:51 2019 New Revision: 343416 URL: https://svnweb.freebsd.org/changeset/base/343416 Log: Install .shrc for root, and set PS1 for the toor account. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18872 Added: head/bin/sh/dot.shrc - copied unchanged from r343399, head/share/skel/dot.shrc Modified: head/bin/sh/Makefile head/bin/sh/dot.profile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) @@ -3,9 +3,12 @@ .include -CONFS= dot.profile profile -CONFSDIR_dot.profile= /root -CONFSNAME_dot.profile= .profile +CONFGROUPS= ETC ROOT +ETC= profile +ROOT= dot.shrc dot.profile +ROOTDIR= /root +ROOTNAME_dot.shrc= .shrc +ROOTNAME_dot.profile= .profile PACKAGE=runtime PROG= sh INSTALLFLAGS= -S Modified: head/bin/sh/dot.profile ============================================================================== --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) @@ -9,6 +9,9 @@ export TERM PAGER=less export PAGER +# set ENV to a file invoked each time sh is started for interactive use. +ENV=$HOME/.shrc; export ENV + # Query terminal size; useful for serial lines. if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi Copied: head/bin/sh/dot.shrc (from r343399, head/share/skel/dot.shrc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, copy of r343399, head/share/skel/dot.shrc) @@ -0,0 +1,39 @@ +# $FreeBSD$ +# +# .shrc - bourne shell startup file +# +# This file will be used if the shell is invoked for interactive use and +# the environment variable ENV is set to this file. +# +# see also sh(1), environ(7). +# + + +# file permissions: rwxr-xr-x +# +# umask 022 + +# Uncomment this to enable the builtin vi(1) command line editor in sh(1), +# e.g. ESC to go into visual mode. +# set -o vi + + +# some useful aliases +alias h='fc -l' +alias j=jobs +alias m="$PAGER" +alias ll='ls -laFo' +alias l='ls -l' +alias g='egrep -i' + +# # be paranoid +# alias cp='cp -ip' +# alias mv='mv -i' +# alias rm='rm -i' + + +# set prompt: ``username@hostname:directory $ '' +PS1="\u@\h:\w \\$ " + +# search path for cd(1) +# CDPATH=:$HOME From owner-svn-src-all@freebsd.org Thu Jan 24 23:55:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD71914C356E; Thu, 24 Jan 2019 23:55:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6608DA45; Thu, 24 Jan 2019 23:55:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0ONt46H085461; Thu, 24 Jan 2019 15:55:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0ONt4Xl085460; Thu, 24 Jan 2019 15:55:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901242334.x0ONYpNU047048@repo.freebsd.org> To: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 15:55:04 -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: EF6608DA45 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 23:55:09 -0000 > Author: trasz > Date: Thu Jan 24 23:34:51 2019 > New Revision: 343416 > URL: https://svnweb.freebsd.org/changeset/base/343416 > > Log: > Install .shrc for root, and set PS1 for the toor account. And a dozen other aliases :-( Please do not contaiminate the prestine environment with personal preferences. In the start of the project we did a great deal of work to remove and eliminate these types of things, only the few csh aliases where retained. This is really the domain of a systems administrator to decide and making work for them to clean this out is not going to make them happy. The commands in an ENV file well be executed by every single shell that is started, not just an interactive shell, unless I am mis reading the man page: If the environment variable ENV is set on entry to a shell, or is set in the .profile of a login shell, the shell then subjects its value to parameter expansion and arithmetic expansion and reads commands from the named file. > Reviewed by: jilles > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18872 > > Added: > head/bin/sh/dot.shrc > - copied unchanged from r343399, head/share/skel/dot.shrc > Modified: > head/bin/sh/Makefile > head/bin/sh/dot.profile > > Modified: head/bin/sh/Makefile > ============================================================================== > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > @@ -3,9 +3,12 @@ > > .include > > -CONFS= dot.profile profile > -CONFSDIR_dot.profile= /root > -CONFSNAME_dot.profile= .profile > +CONFGROUPS= ETC ROOT > +ETC= profile > +ROOT= dot.shrc dot.profile > +ROOTDIR= /root > +ROOTNAME_dot.shrc= .shrc > +ROOTNAME_dot.profile= .profile > PACKAGE=runtime > PROG= sh > INSTALLFLAGS= -S > > Modified: head/bin/sh/dot.profile > ============================================================================== > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > @@ -9,6 +9,9 @@ export TERM > PAGER=less > export PAGER > > +# set ENV to a file invoked each time sh is started for interactive use. > +ENV=$HOME/.shrc; export ENV > + > # Query terminal size; useful for serial lines. > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > Copied: head/bin/sh/dot.shrc (from r343399, head/share/skel/dot.shrc) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, copy of r343399, head/share/skel/dot.shrc) > @@ -0,0 +1,39 @@ > +# $FreeBSD$ > +# > +# .shrc - bourne shell startup file > +# > +# This file will be used if the shell is invoked for interactive use and > +# the environment variable ENV is set to this file. > +# > +# see also sh(1), environ(7). > +# > + > + > +# file permissions: rwxr-xr-x > +# > +# umask 022 > + > +# Uncomment this to enable the builtin vi(1) command line editor in sh(1), > +# e.g. ESC to go into visual mode. > +# set -o vi > + > + > +# some useful aliases > +alias h='fc -l' > +alias j=jobs > +alias m="$PAGER" > +alias ll='ls -laFo' > +alias l='ls -l' > +alias g='egrep -i' > + > +# # be paranoid > +# alias cp='cp -ip' > +# alias mv='mv -i' > +# alias rm='rm -i' > + > + > +# set prompt: ``username@hostname:directory $ '' > +PS1="\u@\h:\w \\$ " > + > +# search path for cd(1) > +# CDPATH=:$HOME > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 00:15:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA8D714C4310 for ; Fri, 25 Jan 2019 00:15:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48F148E95D for ; Fri, 25 Jan 2019 00:15:58 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548374385; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=lMAIftxlO1GWPkcwks9LiHKeZX1srWGjPzdAXFtiJVbOa+RYLNVd9r3nUlB/aDSQU7VaL1BMyfMeK 853+TySVEC+/mHwo825S9y1h4XQje8YBjbDGr1jn6JinmV2MUdZD6ZbZKV7Lu9Y+tBdNGV86t/ZQUJ ffqzwHn+wPKcWjxcf5+VWVqQAJ6tNAOBZt0U3vTZOpQUeJbERSke9MsyMTg71TA2QpgD17HqxCoYdY RJofseU1RyWocM4qY+wY0EgNCUlDv8HQes4EpnrEMBGW+fHgmgC/3Cxr1HmEGQK0mBjSuAuJa8Y8Zq WOwJr5hOBzfAbZczG2mYJ87pr9ZuvrA== 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=VBFwOtucCkSCwRaGe8DxOZwVSejGaKoaMeVpX2Dq3m4=; b=EfVDbKcC0ihqeLUvT8+/jgJ0A+Ns5VoHbHqpEnLU11AAN7dnPQH+CAkCGnfyLk9EUE5RTjiXCYoI4 DTskXGLx+7Vd0rormBX2KrySC/nx/hrrqlX+pLacG80m5V8EUzcx6dl7IQmQJN57KTuErBW3m73ca4 mUYLiDXa6oCHh+yxiuEGNwKX1IyEMrUtSslIgwc44i91V2gARkm93dEVE9bg9qyT5GV01B2plKf7br vxe9KDdu4tyFvuJvSt5oSncbi5RPc+TWMTyn23hFX54WAEdwzSgnC7f7V3lbaRtbkupx5PCTQvv9tQ 08wDLw/jNncLqB2+vDkmaXJ1sn9ezPw== ARC-Authentication-Results: i=1; outbound3.eu.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=VBFwOtucCkSCwRaGe8DxOZwVSejGaKoaMeVpX2Dq3m4=; b=C3MhRy057dkba0dUJa8gRUR5ubjzmte8k0N3OnRuvIVmQFQyQjII+JStmpqZfs05M6ff2u91c5IRm qoWFolo8oPAcZs1otwKOTwARUf+CJy4uQ3Fufn2e0IGs7UWPq5yeEuKMnvyZfu1Tvb4CkkQAj+CLGk u+jNDnZC/UWGNifzuQ7l+Bhz73+VFcg0/WYpsEkx8enI2pdi5YLZb/zDpLhbn9l7D36tpoN+l6/o3j 2PCGJqD+f8fZHSKet6c/lbBcMrAqu7no2akvgVVG5aTk688BagvREMaMHRvyXPI+Tj1kmskALhFfXd huMa5wPZx8jsGrGKEWbuuLmIlGNvYxA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1cced4f4-2034-11e9-8a28-a1efd8da9a94 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.eu.mailhop.org (Halon) with ESMTPSA id 1cced4f4-2034-11e9-8a28-a1efd8da9a94; Thu, 24 Jan 2019 23:59:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0ONxeHX002783; Thu, 24 Jan 2019 16:59:40 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> Subject: Re: svn commit: r343416 - head/bin/sh From: Ian Lepore To: rgrimes@freebsd.org, Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Jan 2019 16:59:40 -0700 In-Reply-To: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> 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: 48F148E95D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 00:15:59 -0000 On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > Author: trasz > > Date: Thu Jan 24 23:34:51 2019 > > New Revision: 343416 > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > Log: > > Install .shrc for root, and set PS1 for the toor account. > > And a dozen other aliases :-( > Please do not contaiminate the prestine environment with > personal preferences. In the start of the project we > did a great deal of work to remove and eliminate these > types of things, only the few csh aliases where retained. > > This is really the domain of a systems administrator to > decide and making work for them to clean this out is > not going to make them happy. > > The commands in an ENV file well be executed by > every single shell that is started, not just an > interactive shell, unless I am mis reading the > man page: > If the environment variable ENV is set on > entry to a shell, or is set in the .profile of a login shell, the > shell > then subjects its value to parameter expansion and arithmetic > expansion > and reads commands from the named file. > I agree with all of tat. If the local sysadmin wants to make /bin/sh friendly as an interactive shell, maybe we could provide some .sample files to make that easy, but we SHOULD NOT put all this junk in by default. -- Ian > > Reviewed by: jilles > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D18872 > > > > Added: > > head/bin/sh/dot.shrc > > - copied unchanged from r343399, head/share/skel/dot.shrc > > Modified: > > head/bin/sh/Makefile > > head/bin/sh/dot.profile > > > > Modified: head/bin/sh/Makefile > > =================================================================== > > =========== > > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > > @@ -3,9 +3,12 @@ > > > > .include > > > > -CONFS= dot.profile profile > > -CONFSDIR_dot.profile= /root > > -CONFSNAME_dot.profile= .profile > > +CONFGROUPS= ETC ROOT > > +ETC= profile > > +ROOT= dot.shrc dot.profile > > +ROOTDIR= /root > > +ROOTNAME_dot.shrc= .shrc > > +ROOTNAME_dot.profile= .profile > > PACKAGE=runtime > > PROG= sh > > INSTALLFLAGS= -S > > > > Modified: head/bin/sh/dot.profile > > =================================================================== > > =========== > > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > > @@ -9,6 +9,9 @@ export TERM > > PAGER=less > > export PAGER > > > > +# set ENV to a file invoked each time sh is started for > > interactive use. > > +ENV=$HOME/.shrc; export ENV > > + > > # Query terminal size; useful for serial lines. > > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > > > > Copied: head/bin/sh/dot.shrc (from r343399, > > head/share/skel/dot.shrc) > > =================================================================== > > =========== > > --- /dev/null 00:00:00 1970 (empty, because file is > > newly added) > > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, > > copy of r343399, head/share/skel/dot.shrc) > > @@ -0,0 +1,39 @@ > > +# $FreeBSD$ > > +# > > +# .shrc - bourne shell startup file > > +# > > +# This file will be used if the shell is invoked for interactive > > use and > > +# the environment variable ENV is set to this file. > > +# > > +# see also sh(1), environ(7). > > +# > > + > > + > > +# file permissions: rwxr-xr-x > > +# > > +# umask 022 > > + > > +# Uncomment this to enable the builtin vi(1) command line editor > > in sh(1), > > +# e.g. ESC to go into visual mode. > > +# set -o vi > > + > > + > > +# some useful aliases > > +alias h='fc -l' > > +alias j=jobs > > +alias m="$PAGER" > > +alias ll='ls -laFo' > > +alias l='ls -l' > > +alias g='egrep -i' > > + > > +# # be paranoid > > +# alias cp='cp -ip' > > +# alias mv='mv -i' > > +# alias rm='rm -i' > > + > > + > > +# set prompt: ``username@hostname:directory $ '' > > +PS1="\u@\h:\w \\$ " > > + > > +# search path for cd(1) > > +# CDPATH=:$HOME > > > > > > From owner-svn-src-all@freebsd.org Fri Jan 25 00:23:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DAB14C46E2; Fri, 25 Jan 2019 00:23:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E958EF61; Fri, 25 Jan 2019 00:23:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0P0Nr60085676; Thu, 24 Jan 2019 16:23:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0P0NrC0085675; Thu, 24 Jan 2019 16:23:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> To: Ian Lepore Date: Thu, 24 Jan 2019 16:23:53 -0800 (PST) CC: rgrimes@freebsd.org, Edward Tomasz Napierala , 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: 97E958EF61 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 00:23:56 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > > Author: trasz > > > Date: Thu Jan 24 23:34:51 2019 > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. > > > > This is really the domain of a systems administrator to > > decide and making work for them to clean this out is > > not going to make them happy. > > > > The commands in an ENV file well be executed by > > every single shell that is started, not just an > > interactive shell, unless I am mis reading the > > man page: > > If the environment variable ENV is set on > > entry to a shell, or is set in the .profile of a login shell, the > > shell > > then subjects its value to parameter expansion and arithmetic > > expansion > > and reads commands from the named file. The man page needs fixed here too, it does infact later state that THIS version of sh does not always run ENV, only for interactive shells. Which is a good thing, but there is still this un needed contaimination with aliases. You also just caused me to have to revive my .profile diff cause the addition of the ENV falls in the context range of my local mods. I am sure this effects others. Please do consider that these files have been very very rarely touched over decades of time. > > > > I agree with all of tat. If the local sysadmin wants to make /bin/sh > friendly as an interactive shell, maybe we could provide some .sample > files to make that easy, but we SHOULD NOT put all this junk in by > default. > > -- Ian > > > > Reviewed by: jilles > > > MFC after: 2 weeks > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D18872 > > > > > > Added: > > > head/bin/sh/dot.shrc > > > - copied unchanged from r343399, head/share/skel/dot.shrc > > > Modified: > > > head/bin/sh/Makefile > > > head/bin/sh/dot.profile > > > > > > Modified: head/bin/sh/Makefile > > > =================================================================== > > > =========== > > > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > > > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > > > @@ -3,9 +3,12 @@ > > > > > > .include > > > > > > -CONFS= dot.profile profile > > > -CONFSDIR_dot.profile= /root > > > -CONFSNAME_dot.profile= .profile > > > +CONFGROUPS= ETC ROOT > > > +ETC= profile > > > +ROOT= dot.shrc dot.profile > > > +ROOTDIR= /root > > > +ROOTNAME_dot.shrc= .shrc > > > +ROOTNAME_dot.profile= .profile > > > PACKAGE=runtime > > > PROG= sh > > > INSTALLFLAGS= -S > > > > > > Modified: head/bin/sh/dot.profile > > > =================================================================== > > > =========== > > > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > > > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > > > @@ -9,6 +9,9 @@ export TERM > > > PAGER=less > > > export PAGER > > > > > > +# set ENV to a file invoked each time sh is started for > > > interactive use. > > > +ENV=$HOME/.shrc; export ENV > > > + > > > # Query terminal size; useful for serial lines. > > > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > > > > > > > Copied: head/bin/sh/dot.shrc (from r343399, > > > head/share/skel/dot.shrc) > > > =================================================================== > > > =========== > > > --- /dev/null 00:00:00 1970 (empty, because file is > > > newly added) > > > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, > > > copy of r343399, head/share/skel/dot.shrc) > > > @@ -0,0 +1,39 @@ > > > +# $FreeBSD$ > > > +# > > > +# .shrc - bourne shell startup file > > > +# > > > +# This file will be used if the shell is invoked for interactive > > > use and > > > +# the environment variable ENV is set to this file. > > > +# > > > +# see also sh(1), environ(7). > > > +# > > > + > > > + > > > +# file permissions: rwxr-xr-x > > > +# > > > +# umask 022 > > > + > > > +# Uncomment this to enable the builtin vi(1) command line editor > > > in sh(1), > > > +# e.g. ESC to go into visual mode. > > > +# set -o vi > > > + > > > + > > > +# some useful aliases > > > +alias h='fc -l' > > > +alias j=jobs > > > +alias m="$PAGER" > > > +alias ll='ls -laFo' > > > +alias l='ls -l' > > > +alias g='egrep -i' > > > + > > > +# # be paranoid > > > +# alias cp='cp -ip' > > > +# alias mv='mv -i' > > > +# alias rm='rm -i' > > > + > > > + > > > +# set prompt: ``username@hostname:directory $ '' > > > +PS1="\u@\h:\w \\$ " > > > + > > > +# search path for cd(1) > > > +# CDPATH=:$HOME > > > > > > > > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 01:05:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82E014C5986; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@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 7DF119057B; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70573A27; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0P15KrM093248; Fri, 25 Jan 2019 01:05:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0P15IQ8093240; Fri, 25 Jan 2019 01:05:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901250105.x0P15IQ8093240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 25 Jan 2019 01:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343417 - in head/sys: dev/rtwn/pci dev/rtwn/usb net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/rtwn/pci dev/rtwn/usb net80211 X-SVN-Commit-Revision: 343417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DF119057B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:05:21 -0000 Author: avos Date: Fri Jan 25 01:05:18 2019 New Revision: 343417 URL: https://svnweb.freebsd.org/changeset/base/343417 Log: net80211: reuse TICKS_2_MSEC / MSEC_2_TICKS macros from sys/time.h Replace in-place implementation with system-wide one; since it guarantees non-zero result drop all less-than-one checks from drivers and net80211. MFC after: 2 weeks Modified: head/sys/dev/rtwn/pci/rtwn_pci_reg.c head/sys/dev/rtwn/usb/rtwn_usb_reg.c head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_rssadapt.c head/sys/net80211/ieee80211_scan.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_reg.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_reg.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/dev/rtwn/pci/rtwn_pci_reg.c Fri Jan 25 01:05:18 2019 (r343417) @@ -118,6 +118,6 @@ rtwn_pci_delay(struct rtwn_softc *sc, int usec) DELAY(usec); else { (void) mtx_sleep(sc, &sc->sc_mtx, 0, "rtwn_pci", - MAX(msecs_to_ticks(usec / 1000), 1)); + msecs_to_ticks(usec / 1000)); } } Modified: head/sys/dev/rtwn/usb/rtwn_usb_reg.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_reg.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/dev/rtwn/usb/rtwn_usb_reg.c Fri Jan 25 01:05:18 2019 (r343417) @@ -172,8 +172,6 @@ rtwn_usb_delay(struct rtwn_softc *sc, int usec) /* 1ms delay as default is too big. */ if (usec < 1000) DELAY(usec); - else { - usb_pause_mtx(&sc->sc_mtx, - MAX(msecs_to_ticks(usec / 1000), 1)); - } + else + usb_pause_mtx(&sc->sc_mtx, msecs_to_ticks(usec / 1000)); } Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_amrr.c Fri Jan 25 01:05:18 2019 (r343417) @@ -102,15 +102,13 @@ static void amrr_setinterval(const struct ieee80211vap *vap, int msecs) { struct ieee80211_amrr *amrr = vap->iv_rs; - int t; if (!amrr) return; if (msecs < 100) msecs = 100; - t = msecs_to_ticks(msecs); - amrr->amrr_interval = (t < 1) ? 1 : t; + amrr->amrr_interval = msecs_to_ticks(msecs); } static void Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_freebsd.c Fri Jan 25 01:05:18 2019 (r343417) @@ -136,13 +136,12 @@ int ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS) { int msecs = ticks_to_msecs(*(int *)arg1); - int error, t; + int error; error = sysctl_handle_int(oidp, &msecs, 0, req); if (error || !req->newptr) return error; - t = msecs_to_ticks(msecs); - *(int *)arg1 = (t < 1) ? 1 : t; + *(int *)arg1 = msecs_to_ticks(msecs); return 0; } @@ -347,9 +346,6 @@ ieee80211_com_vdetach(struct ieee80211vap *vap) int sleep_time; sleep_time = msecs_to_ticks(250); - if (sleep_time == 0) - sleep_time = 1; - atomic_set_32(&vap->iv_com_state, IEEE80211_COM_DETACHED); while (MS(atomic_load_32(&vap->iv_com_state), IEEE80211_COM_REF) != 0) pause("comref", sleep_time); Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_freebsd.h Fri Jan 25 01:05:18 2019 (r343417) @@ -38,6 +38,7 @@ #include #include #include +#include /* * Common state locking definitions. @@ -249,9 +250,8 @@ void ieee80211_vap_destroy(struct ieee80211vap *); (((_ifp)->if_flags & IFF_UP) && \ ((_ifp)->if_drv_flags & IFF_DRV_RUNNING)) -/* XXX TODO: cap these at 1, as hz may not be 1000 */ -#define msecs_to_ticks(ms) (((ms)*hz)/1000) -#define ticks_to_msecs(t) (1000*(t) / hz) +#define msecs_to_ticks(ms) MSEC_2_TICKS(ms) +#define ticks_to_msecs(t) TICKS_2_MSEC(t) #define ticks_to_secs(t) ((t) / hz) #define ieee80211_time_after(a,b) ((long)(b) - (long)(a) < 0) Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_ioctl.c Fri Jan 25 01:05:18 2019 (r343417) @@ -2515,20 +2515,12 @@ ieee80211_scanreq(struct ieee80211vap *vap, struct iee sr->sr_duration > IEEE80211_IOC_SCAN_DURATION_MAX) return EINVAL; sr->sr_duration = msecs_to_ticks(sr->sr_duration); - if (sr->sr_duration < 1) - sr->sr_duration = 1; } /* convert min/max channel dwell */ - if (sr->sr_mindwell != 0) { + if (sr->sr_mindwell != 0) sr->sr_mindwell = msecs_to_ticks(sr->sr_mindwell); - if (sr->sr_mindwell < 1) - sr->sr_mindwell = 1; - } - if (sr->sr_maxdwell != 0) { + if (sr->sr_maxdwell != 0) sr->sr_maxdwell = msecs_to_ticks(sr->sr_maxdwell); - if (sr->sr_maxdwell < 1) - sr->sr_maxdwell = 1; - } /* NB: silently reduce ssid count to what is supported */ if (sr->sr_nssid > IEEE80211_SCAN_MAX_SSID) sr->sr_nssid = IEEE80211_SCAN_MAX_SSID; Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_rssadapt.c Fri Jan 25 01:05:18 2019 (r343417) @@ -117,15 +117,13 @@ static void rssadapt_setinterval(const struct ieee80211vap *vap, int msecs) { struct ieee80211_rssadapt *rs = vap->iv_rs; - int t; if (!rs) return; if (msecs < 100) msecs = 100; - t = msecs_to_ticks(msecs); - rs->interval = (t < 1) ? 1 : t; + rs->interval = msecs_to_ticks(msecs); } static void Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_scan.c Fri Jan 25 01:05:18 2019 (r343417) @@ -294,7 +294,7 @@ ieee80211_scan_dump(struct ieee80211_scan_state *ss) if_printf(vap->iv_ifp, "scan set "); ieee80211_scan_dump_channels(ss); - printf(" dwell min %lums max %lums\n", + printf(" dwell min %ums max %ums\n", ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell)); } #endif /* IEEE80211_DEBUG */ From owner-svn-src-all@freebsd.org Fri Jan 25 01:06:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4351C14C5A08; Fri, 25 Jan 2019 01:06:07 +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 DD656906BE; Fri, 25 Jan 2019 01:06:06 +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 CFC57A28; Fri, 25 Jan 2019 01:06:06 +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 x0P166NR093322; Fri, 25 Jan 2019 01:06:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0P1668p093321; Fri, 25 Jan 2019 01:06:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901250106.x0P1668p093321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Jan 2019 01:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343418 - 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: 343418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD656906BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:06:07 -0000 Author: kp Date: Fri Jan 25 01:06:06 2019 New Revision: 343418 URL: https://svnweb.freebsd.org/changeset/base/343418 Log: pf: Fix use-after-free of counters When cleaning up a vnet we free the counters in V_pf_default_rule and V_pf_status from shutdown_pf(), but we can still use them later, for example through pf_purge_expired_src_nodes(). Free them as the very last operation, as they rely on nothing else themselves. PR: 235097 MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Jan 25 01:05:18 2019 (r343417) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Jan 25 01:06:06 2019 (r343418) @@ -3989,20 +3989,6 @@ shutdown_pf(void) /* status does not use malloced mem so no need to cleanup */ /* fingerprints and interfaces have their own cleanup code */ - - /* Free counters last as we updated them during shutdown. */ - counter_u64_free(V_pf_default_rule.states_cur); - counter_u64_free(V_pf_default_rule.states_tot); - counter_u64_free(V_pf_default_rule.src_nodes); - - for (int i = 0; i < PFRES_MAX; i++) - counter_u64_free(V_pf_status.counters[i]); - for (int i = 0; i < LCNT_MAX; i++) - counter_u64_free(V_pf_status.lcounters[i]); - for (int i = 0; i < FCNT_MAX; i++) - counter_u64_free(V_pf_status.fcounters[i]); - for (int i = 0; i < SCNT_MAX; i++) - counter_u64_free(V_pf_status.scounters[i]); } while(0); return (error); @@ -4232,6 +4218,20 @@ pf_unload_vnet(void) pf_cleanup(); if (IS_DEFAULT_VNET(curvnet)) pf_mtag_cleanup(); + + /* Free counters last as we updated them during shutdown. */ + counter_u64_free(V_pf_default_rule.states_cur); + counter_u64_free(V_pf_default_rule.states_tot); + counter_u64_free(V_pf_default_rule.src_nodes); + + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_free(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_free(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_free(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_free(V_pf_status.scounters[i]); } static void From owner-svn-src-all@freebsd.org Fri Jan 25 01:36:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5317F14C6819; Fri, 25 Jan 2019 01:36:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 8580091872; Fri, 25 Jan 2019 01:36:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id mqPkgbMn5nBo4mqPlgxmcJ; Thu, 24 Jan 2019 18:36:15 -0700 X-Authority-Analysis: v=2.3 cv=J8fUEzvS c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=FR35MORUfq6qWSmt_NgA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [IPv6:2605:8d80:401:1152:25e8:5ff:bcad:3987] (unknown [72.143.221.163]) by spqr.komquats.com (Postfix) with ESMTPSA id 3FA8F97B; Thu, 24 Jan 2019 17:36:46 -0800 (PST) Date: Thu, 24 Jan 2019 17:35:42 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343416 - head/bin/sh To: Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> X-CMAE-Envelope: MS4wfFQhp2tOoNHUnX+JpjCjhCo3gHhpwGw/229CyEQNlG3PFKUGk6IzSK8oopHpx2XNbR5L0mEm3uJSq/lLqJqCmqz+xwCq9YhmVZ1+ENR0oklanMadO5ot W2T2sQAgaZwZpNSrR6Bdqz3+o5ECCEl3vkUBo4kE5/++p/mK/JsnyJBR/0K40jciAXYN3YeBoLqjME4xGKqejN0GZ5S/ecdmI64VGfrbxmlcSqlZDtY0FlEy +7CNABbqc/mA8FBIFR4z+YHrUnpAxEedgYOUHaoPmZckv2rCRbD/Xg/x34VzXhcYZ/RxrHvGfGWRjcrCHspZGyHoTsA5hPQBJPWlCfDHgUSZpOVObJGJu2tL WTeP7Afr X-Rspamd-Queue-Id: 8580091872 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:36:18 -0000 On January 24, 2019 3:59:40 PM PST, Ian Lepore wrote: >On Thu, 2019-01-24 at 15:55 -0800, Rodney W=2E Grimes wrote: >> > Author: trasz >> > Date: Thu Jan 24 23:34:51 2019 >> > New Revision: 343416 >> > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343416 >> >=20 >> > Log: >> > Install =2Eshrc for root, and set PS1 for the toor account=2E >>=20 >> And a dozen other aliases :-( >> Please do not contaiminate the prestine environment with >> personal preferences=2E In the start of the project we >> did a great deal of work to remove and eliminate these >> types of things, only the few csh aliases where retained=2E >>=20 >> This is really the domain of a systems administrator to >> decide and making work for them to clean this out is >> not going to make them happy=2E >>=20 >> The commands in an ENV file well be executed by >> every single shell that is started, not just an >> interactive shell, unless I am mis reading the >> man page: >> If the environment variable ENV is set on >> entry to a shell, or is set in the =2Eprofile of a login shell, the >> shell >> then subjects its value to parameter expansion and arithmetic >> expansion >> and reads commands from the named file=2E >> =20 > >I agree with all of tat=2E If the local sysadmin wants to make /bin/sh >friendly as an interactive shell, maybe we could provide some =2Esample >files to make that easy, but we SHOULD NOT put all this junk in by >default=2E > >-- Ian > >> > Reviewed by: jilles >> > MFC after: 2 weeks >> > Sponsored by: DARPA, AFRL >> > Differential Revision: https://reviews=2Efreebsd=2Eorg/D18872 >> >=20 >> > Added: >> > head/bin/sh/dot=2Eshrc >> > - copied unchanged from r343399, head/share/skel/dot=2Eshrc >> > Modified: >> > head/bin/sh/Makefile >> > head/bin/sh/dot=2Eprofile >> >=20 >> > Modified: head/bin/sh/Makefile >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) >> > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) >> > @@ -3,9 +3,12 @@ >> > =20 >> > =2Einclude >> > =20 >> > -CONFS=3D dot=2Eprofile profile >> > -CONFSDIR_dot=2Eprofile=3D /root >> > -CONFSNAME_dot=2Eprofile=3D =2Eprofile >> > +CONFGROUPS=3D ETC ROOT >> > +ETC=3D profile >> > +ROOT=3D dot=2Eshrc dot=2Eprofile >> > +ROOTDIR=3D /root >> > +ROOTNAME_dot=2Eshrc=3D =2Eshrc >> > +ROOTNAME_dot=2Eprofile=3D =2Eprofile >> > PACKAGE=3Druntime >> > PROG=3D sh >> > INSTALLFLAGS=3D -S >> >=20 >> > Modified: head/bin/sh/dot=2Eprofile >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- head/bin/sh/dot=2Eprofile Thu Jan 24 22:34:30 2019 (r343415) >> > +++ head/bin/sh/dot=2Eprofile Thu Jan 24 23:34:51 2019 (r343416) >> > @@ -9,6 +9,9 @@ export TERM >> > PAGER=3Dless >> > export PAGER >> > =20 >> > +# set ENV to a file invoked each time sh is started for >> > interactive use=2E >> > +ENV=3D$HOME/=2Eshrc; export ENV >> > + >> > # Query terminal size; useful for serial lines=2E >> > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi >> > =20 >> >=20 >> > Copied: head/bin/sh/dot=2Eshrc (from r343399, >> > head/share/skel/dot=2Eshrc) >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- /dev/null 00:00:00 1970 (empty, because file is >> > newly added) >> > +++ head/bin/sh/dot=2Eshrc Thu Jan 24 23:34:51 2019 (r343416, >> > copy of r343399, head/share/skel/dot=2Eshrc) >> > @@ -0,0 +1,39 @@ >> > +# $FreeBSD$ >> > +# >> > +# =2Eshrc - bourne shell startup file=20 >> > +# >> > +# This file will be used if the shell is invoked for interactive >> > use and >> > +# the environment variable ENV is set to this file=2E >> > +# >> > +# see also sh(1), environ(7)=2E >> > +# >> > + >> > + >> > +# file permissions: rwxr-xr-x >> > +# >> > +# umask 022 >> > + >> > +# Uncomment this to enable the builtin vi(1) command line editor >> > in sh(1), >> > +# e=2Eg=2E ESC to go into visual mode=2E >> > +# set -o vi >> > + >> > + >> > +# some useful aliases >> > +alias h=3D'fc -l' >> > +alias j=3Djobs >> > +alias m=3D"$PAGER" >> > +alias ll=3D'ls -laFo' >> > +alias l=3D'ls -l' >> > +alias g=3D'egrep -i' >> > +=20 >> > +# # be paranoid >> > +# alias cp=3D'cp -ip' >> > +# alias mv=3D'mv -i' >> > +# alias rm=3D'rm -i' >> > + >> > + >> > +# set prompt: ``username@hostname:directory $ ''=20 >> > +PS1=3D"\u@\h:\w \\$ " >> > + >> > +# search path for cd(1) >> > +# CDPATH=3D:$HOME >> >=20 >> >=20 >>=20 >>=20 Agreed re samples though a comment in the default should point the user to= samples=2E Samples could also include some nifty tricks too, some of which= are in fortune or Power Tools=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-all@freebsd.org Fri Jan 25 01:44:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8DD14C6BFD; Fri, 25 Jan 2019 01:44:30 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 F414391E2F; Fri, 25 Jan 2019 01:44:29 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=55102 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gmqX4-000NgJ-AC; Thu, 24 Jan 2019 17:43:46 -0800 From: Devin Teske Message-Id: <0D1FAD4B-5E35-4CCE-AA30-E94E3534F890@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343416 - head/bin/sh Date: Thu, 24 Jan 2019 17:44:15 -0800 In-Reply-To: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> Cc: Devin Teske , Ian Lepore , Edward Tomasz Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: rgrimes@freebsd.org References: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: F414391E2F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:44:30 -0000 > On Jan 24, 2019, at 4:23 PM, Rodney W. Grimes = wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] >> On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: >>>> Author: trasz >>>> Date: Thu Jan 24 23:34:51 2019 >>>> New Revision: 343416 >>>> URL: https://svnweb.freebsd.org/changeset/base/343416 >>>>=20 >>>> Log: >>>> Install .shrc for root, and set PS1 for the toor account. >>>=20 >>> And a dozen other aliases :-( >>> Please do not contaiminate the prestine environment with >>> personal preferences. In the start of the project we >>> did a great deal of work to remove and eliminate these >>> types of things, only the few csh aliases where retained. >>>=20 >>> This is really the domain of a systems administrator to >>> decide and making work for them to clean this out is >>> not going to make them happy. >>>=20 >>> The commands in an ENV file well be executed by >>> every single shell that is started, not just an >>> interactive shell, unless I am mis reading the >>> man page: >>> If the environment variable ENV is set on >>> entry to a shell, or is set in the .profile of a login shell, the >>> shell >>> then subjects its value to parameter expansion and arithmetic >>> expansion >>> and reads commands from the named file. >=20 > The man page needs fixed here too, it does infact later state > that THIS version of sh does not always run ENV, only for > interactive shells. Which is a good thing, but there is > still this un needed contaimination with aliases. >=20 > You also just caused me to have to revive my .profile diff > cause the addition of the ENV falls in the context range > of my local mods. I am sure this effects others. Please > do consider that these files have been very very rarely > touched over decades of time. >=20 +1 Will be watching for the revert of this. --=20 Devin From owner-svn-src-all@freebsd.org Fri Jan 25 01:45:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D741D14C6CA5; Fri, 25 Jan 2019 01:45:55 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 693B291FB7; Fri, 25 Jan 2019 01:45:55 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=55128 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gmqYN-000NjF-Ox; Thu, 24 Jan 2019 17:45:07 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343416 - head/bin/sh Date: Thu, 24 Jan 2019 17:45:52 -0800 In-Reply-To: <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> Cc: Devin Teske , Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Cy Schubert References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 693B291FB7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:45:56 -0000 > On Jan 24, 2019, at 5:35 PM, Cy Schubert = wrote: >=20 > Agreed re samples though a comment in the default should point the = user to samples. Samples could also include some nifty tricks too, some = of which are in fortune or Power Tools. What is this "Power Tools" you speak of (honest question) --=20 Devin= From owner-svn-src-all@freebsd.org Fri Jan 25 02:27:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E8F14C7C1D; Fri, 25 Jan 2019 02:27:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 3BF7193317; Fri, 25 Jan 2019 02:27:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id mrAXgjKxI8uQmmrAYgn4yb; Thu, 24 Jan 2019 19:24:35 -0700 X-Authority-Analysis: v=2.3 cv=XKpOtjpE c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=8oJCibGMUmJDAxpDk1YA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id ABF74ABC; Thu, 24 Jan 2019 18:25:07 -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 x0P2OWKb003712; Thu, 24 Jan 2019 18:24:32 -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 x0P2OW9r003709; Thu, 24 Jan 2019 18:24:32 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901250224.x0P2OW9r003709@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: Devin Teske cc: Cy Schubert , Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: Message from Devin Teske of "Thu, 24 Jan 2019 17:45:52 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 24 Jan 2019 18:24:32 -0800 X-CMAE-Envelope: MS4wfJYCvl7v//ZEBYCnjGItIh+gd95VWbu8BoQNnEncxRAffkjiUe9UOBPAVqDkcGU2Gkr0WmY1b/6+lku5NjNcvuybqSxd8umj3XS/YdNXDWFkEPj4e0Gx bq5914uWDFQI3INq6OgsRkCfQTT2tqF3i/OCWwvFVGqfKlCfNyY/AsXCgctsIT+FczXPBNCjCpBCUqKNNa0ifv7pdZ8ciib01dV/V7RgETHrn054TAnA8Qwi qoOR6a9lS4lrByebAUL1AJRENn9UslFJGrJ9B4d20F2ikWW4Eqmf1huJKDGxAS8oEULbdooAwpJxhUJUh8QIBLs7b2SSz3C+9C/RQTkEsJFIaj8w2scVPltV DLUogmxX7LuWRVJZqtMgLk/8BBi6Xw== X-Rspamd-Queue-Id: 3BF7193317 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.65 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.03)[ip: (-5.77), ipnet: 64.59.128.0/20(-2.43), asn: 6327(-1.88), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 02:27:29 -0000 In message , Devin Teske writ es: > > > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=us-ascii > > > > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = > wrote: > >=20 > > Agreed re samples though a comment in the default should point the = > user to samples. Samples could also include some nifty tricks too, some = > of which are in fortune or Power Tools. > > What is this "Power Tools" you speak of (honest question) UNIX Power Tools. It's an O'Reilly book that should have been entitled Common Sense UNIX. -- 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-all@freebsd.org Fri Jan 25 02:34:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D6D14C7EAD; Fri, 25 Jan 2019 02:34:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 496AE93882; Fri, 25 Jan 2019 02:34:25 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0P2YMHT086179; Thu, 24 Jan 2019 18:34:22 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0P2YMCc086178; Thu, 24 Jan 2019 18:34:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901250224.x0P2OW9r003709@slippy.cwsent.com> To: Cy Schubert Date: Thu, 24 Jan 2019 18:34:22 -0800 (PST) CC: Devin Teske , Ian Lepore , rgrimes@FreeBSD.org, Edward Tomasz Napierala , 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: 496AE93882 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 02:34:27 -0000 > In message , Devin > Teske writ > es: > > > > > > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D > > Content-Transfer-Encoding: quoted-printable > > Content-Type: text/plain; > > charset=us-ascii > > > > > > > > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = > > wrote: > > >=20 > > > Agreed re samples though a comment in the default should point the = > > user to samples. Samples could also include some nifty tricks too, some = > > of which are in fortune or Power Tools. > > > > What is this "Power Tools" you speak of (honest question) > > UNIX Power Tools. It's an O'Reilly book that should have been entitled > Common Sense UNIX. If I can find my copy you can have it Devin. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 03:33:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A53214A5912; Fri, 25 Jan 2019 03:33:06 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (unknown [IPv6:2001:470:1f0f:3ad::53:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D89395812; Fri, 25 Jan 2019 03:33:04 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=92ZTWX2cz5wTXiEVgQR2FSDtCvSQ5TPHabVdDYKfheI=; b=ngJBpdw1QL1Yw96RcfXV9IzyiN 75Sfljya7AG7tzshVXk1HbgX4O+aayxRjtR3/+Lg7RxG2d8eSEOU1wuaZKO2rI4qbNtEnbU4hieNU kDcj22s/9RAiHwZ5gZc3kKP14N/BuBFyynPsan04Tkq0Lw4Zxn5qhJdDdcwQ8ap2VA00=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:bb:dcff:fe50:d900]:52578 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gmsEo-000G28-WA; Thu, 24 Jan 2019 21:33:03 -0600 Received: from 2600:1700:210:b18f:3179:a92e:363e:1ae by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Thu, 24 Jan 2019 21:33:02 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 24 Jan 2019 21:33:02 -0600 From: Larry Rosenman To: rgrimes@freebsd.org Cc: Cy Schubert , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske , Edward Tomasz Napierala , owner-svn-src-all@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> References: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> Message-ID: X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.3.8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 03:33:06 -0000 On 01/24/2019 8:34 pm, Rodney W. Grimes wrote: >> In message , Devin >> Teske writ >> es: >> > >> > >> > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D >> > Content-Transfer-Encoding: quoted-printable >> > Content-Type: text/plain; >> > charset=us-ascii >> > >> > >> > >> > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = >> > wrote: >> > >=20 >> > > Agreed re samples though a comment in the default should point the = >> > user to samples. Samples could also include some nifty tricks too, some = >> > of which are in fortune or Power Tools. >> > >> > What is this "Power Tools" you speak of (honest question) >> >> UNIX Power Tools. It's an O'Reilly book that should have been entitled >> Common Sense UNIX. > > If I can find my copy you can have it Devin. If you can't find yours, Rod, I can send mine. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106 From owner-svn-src-all@freebsd.org Fri Jan 25 06:34:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACA214A974E; Fri, 25 Jan 2019 06:34:46 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD5096BA4A; Fri, 25 Jan 2019 06:34:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8F81FB7DF; Fri, 25 Jan 2019 06:34:45 +0000 (UTC) Date: Fri, 25 Jan 2019 06:34:45 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: rgrimes@freebsd.org, Edward Tomasz Napierala , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125063445.GA6058@FreeBSD.org> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: AD5096BA4A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 06:34:46 -0000 On Thu, Jan 24, 2019 at 04:59:40PM -0700, Ian Lepore wrote: > On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. I fully concur, please back this out trasz@. > I agree with all of tat. If the local sysadmin wants to make /bin/sh > friendly as an interactive shell, maybe we could provide some .sample > files to make that easy No matter what sample files we provide, there are far better and complete examples can be found all over the Internet. If anyone wants to customize their shell, there are plenty of good sources for this information, let's not spam the filesystem with another one. ./danfe From owner-svn-src-all@freebsd.org Fri Jan 25 08:55:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A0614AD725; Fri, 25 Jan 2019 08:55:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 854A170741; Fri, 25 Jan 2019 08:55:20 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x32e.google.com with SMTP id d15so5942669wmb.3; Fri, 25 Jan 2019 00:55: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:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hSm4D1dy7upM0Ie1zBdF3XUhruPao6tM9F5xeS6A1m0=; b=P76pTk5uPcVawgYhDeJjfifPMOy+HbuFHeQCblXPzw/Ta5u8RuaAQHEbbD1mCHnr3g b+4F+ZcjSFC1fpLGdmiDiTq88hTt4Cm1SixV7IPAd9172pdlUhDayi7VNXq9ZqrJ4RJv YNCtTcPV6MhJpWsAJBngkZpk5QfNe3+niTRatrOHCwAyPvNjo8YKbtolFQdlX80amuOg QCNJU/K5pFWU6NXjlQ/ggaX6w7jFqurfBUxHNXog2MjD6thvct2p2i7lHgfVwZ3TkBt7 SR67mzX5QvCApWi4rCy5FFc03kOFrlLQC+vB2p3CFSLnj+rJBWndN4DidjW/uuOe53f6 0wMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=hSm4D1dy7upM0Ie1zBdF3XUhruPao6tM9F5xeS6A1m0=; b=g5Wc/kkfqZs44kElU33BHZVJ0HSs3jqvxV3fyTlmYRk6ntOfROKwa9W7zyuAd84QdG 3HTCvPU6FYYlu9BJhUV8ACm6DiAoiNN/baI6d9vnG3SIB3cutTiFmQg1VZxpyT+RY1rV +V5l8Ra27W7Ojq/2ARz3Uqny6iFcz+j9XBry2ARAXqta0yFpWx8p11R/ZEcY2KeZ0Ffj Tm8psuYgGU8X2/mLP9JiIL1opuKjHUNM30+dq/DbhCDVTWgiwxy9JeXMIP3fko0ghUGz nu6NmZzpO/7SSf17n7XWNggoa7eaLs6AuI6tnjfHAnjldRHK5kMbfsl8LEoWj+PQDupG Z9Lw== X-Gm-Message-State: AJcUukeHsXl7v/AT4VXcJzNmbEv7aY5qRsUAVwq+esojw2H1ujpPY3Hw PM0xAkpNUvOwN9HzxWZFSvUaFte/ X-Google-Smtp-Source: ALg8bN6cDyKlnXzk+wZ9X+csmkBK5dgrmEV/FE+AHvp1QHCJMw7+KQMakOLae8cp7DoOhlKymM0Ipw== X-Received: by 2002:a7b:c08f:: with SMTP id r15mr6078023wmh.118.1548406518777; Fri, 25 Jan 2019 00:55:18 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id m4sm40314763wml.2.2019.01.25.00.55.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 00:55:17 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Jan 2019 22:45:54 +0000 From: Edward Tomasz Napierala To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190124224554.GA23558@v2> Mail-Followup-To: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901242334.x0ONYpNU047048@repo.freebsd.org> <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 854A170741 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 08:55:21 -0000 On 0124T1555, Rodney W. Grimes wrote: > > Author: trasz > > Date: Thu Jan 24 23:34:51 2019 > > New Revision: 343416 > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > Log: > > Install .shrc for root, and set PS1 for the toor account. > > And a dozen other aliases :-( Six, and they are exactly the same as for ordinary users. But yeah, I can see the point of not defining any aliases by default for the root user. Would the change be acceptable if the aliases were commented out? This would be still quite close to the situation for csh. > Please do not contaiminate the prestine environment with > personal preferences. In the start of the project we > did a great deal of work to remove and eliminate these > types of things, only the few csh aliases where retained. Indeed, and those are pretty much the same aliases. > This is really the domain of a systems administrator to > decide and making work for them to clean this out is > not going to make them happy. Problem is, we're in a strage situation where we ship with root shell which is just broken - basic shell syntax doesn't work - and the out-of-box alternative provides you with a VMS prompt. Not the best first impression to make, I'd say. [..] From owner-svn-src-all@freebsd.org Fri Jan 25 10:58:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F1614B0B90; Fri, 25 Jan 2019 10:58:35 +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 6A45B751A8; Fri, 25 Jan 2019 10:58:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DED471A6; Fri, 25 Jan 2019 10:58:35 +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 x0PAwZQ3000473; Fri, 25 Jan 2019 10:58:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PAwZUi000471; Fri, 25 Jan 2019 10:58:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251058.x0PAwZUi000471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 10:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343419 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 343419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A45B751A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 10:58:35 -0000 Author: kib Date: Fri Jan 25 10:58:34 2019 New Revision: 343419 URL: https://svnweb.freebsd.org/changeset/base/343419 Log: MFC r343302: Remove unused *_sysinit_flags() declarations. Modified: stable/12/sys/sys/rmlock.h stable/12/sys/sys/rwlock.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/rmlock.h ============================================================================== --- stable/12/sys/sys/rmlock.h Fri Jan 25 01:06:06 2019 (r343418) +++ stable/12/sys/sys/rmlock.h Fri Jan 25 10:58:34 2019 (r343419) @@ -54,7 +54,6 @@ void rm_init_flags(struct rmlock *rm, const char *name void rm_destroy(struct rmlock *rm); int rm_wowned(const struct rmlock *rm); void rm_sysinit(void *arg); -void rm_sysinit_flags(void *arg); void _rm_wlock_debug(struct rmlock *rm, const char *file, int line); void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line); Modified: stable/12/sys/sys/rwlock.h ============================================================================== --- stable/12/sys/sys/rwlock.h Fri Jan 25 01:06:06 2019 (r343418) +++ stable/12/sys/sys/rwlock.h Fri Jan 25 10:58:34 2019 (r343419) @@ -130,7 +130,6 @@ void _rw_init_flags(volatile uintptr_t *c, const char *name, int opts); void _rw_destroy(volatile uintptr_t *c); void rw_sysinit(void *arg); -void rw_sysinit_flags(void *arg); int _rw_wowned(const volatile uintptr_t *c); void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); int __rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); From owner-svn-src-all@freebsd.org Fri Jan 25 11:01:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF2FA14B0C5F; Fri, 25 Jan 2019 11:01:12 +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 914967539D; Fri, 25 Jan 2019 11:01:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 813D771E4; Fri, 25 Jan 2019 11:01:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PB1CuC001651; Fri, 25 Jan 2019 11:01:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PB1C9o001649; Fri, 25 Jan 2019 11:01:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251101.x0PB1C9o001649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343420 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 343420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 914967539D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:01:13 -0000 Author: kib Date: Fri Jan 25 11:01:11 2019 New Revision: 343420 URL: https://svnweb.freebsd.org/changeset/base/343420 Log: MFC r343302: Remove unused *_sysinit_flags() declarations. Modified: stable/11/sys/sys/rmlock.h stable/11/sys/sys/rwlock.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/rmlock.h ============================================================================== --- stable/11/sys/sys/rmlock.h Fri Jan 25 10:58:34 2019 (r343419) +++ stable/11/sys/sys/rmlock.h Fri Jan 25 11:01:11 2019 (r343420) @@ -52,7 +52,6 @@ void rm_init_flags(struct rmlock *rm, const char *name void rm_destroy(struct rmlock *rm); int rm_wowned(const struct rmlock *rm); void rm_sysinit(void *arg); -void rm_sysinit_flags(void *arg); void _rm_wlock_debug(struct rmlock *rm, const char *file, int line); void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line); Modified: stable/11/sys/sys/rwlock.h ============================================================================== --- stable/11/sys/sys/rwlock.h Fri Jan 25 10:58:34 2019 (r343419) +++ stable/11/sys/sys/rwlock.h Fri Jan 25 11:01:11 2019 (r343420) @@ -128,7 +128,6 @@ void _rw_init_flags(volatile uintptr_t *c, const char *name, int opts); void _rw_destroy(volatile uintptr_t *c); void rw_sysinit(void *arg); -void rw_sysinit_flags(void *arg); int _rw_wowned(const volatile uintptr_t *c); void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); int __rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); From owner-svn-src-all@freebsd.org Fri Jan 25 11:05:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E11414B0EF2; Fri, 25 Jan 2019 11:05: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 CA33C75823; Fri, 25 Jan 2019 11:05:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54E37351; Fri, 25 Jan 2019 11:05:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PB5WkG005846; Fri, 25 Jan 2019 11:05:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PB5WaS005845; Fri, 25 Jan 2019 11:05:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251105.x0PB5WaS005845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343421 - stable/12/sys/dev/nvdimm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/nvdimm X-SVN-Commit-Revision: 343421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA33C75823 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:05:33 -0000 Author: kib Date: Fri Jan 25 11:05:32 2019 New Revision: 343421 URL: https://svnweb.freebsd.org/changeset/base/343421 Log: MFC r339461: nvdimm(4): Fix GCC 6.4.0 build Modified: stable/12/sys/dev/nvdimm/nvdimm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvdimm/nvdimm.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm.c Fri Jan 25 11:01:11 2019 (r343420) +++ stable/12/sys/dev/nvdimm/nvdimm.c Fri Jan 25 11:05:32 2019 (r343421) @@ -222,7 +222,7 @@ nvdimm_count_devs(ACPI_HANDLE handle __unused, void *a status = AcpiGetName(handle, ACPI_FULL_PATHNAME, &name); if (ACPI_FAILURE(status)) return_ACPI_STATUS(status); - printf("nvdimm: enumerated %s\n", name.Pointer); + printf("nvdimm: enumerated %s\n", (char *)name.Pointer); AcpiOsFree(name.Pointer); } From owner-svn-src-all@freebsd.org Fri Jan 25 11:11:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA77814B1132; Fri, 25 Jan 2019 11:11:29 +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 9106075BAD; Fri, 25 Jan 2019 11:11:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B0B873A3; Fri, 25 Jan 2019 11:11:29 +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 x0PBBTrP009320; Fri, 25 Jan 2019 11:11:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PBBTvq009318; Fri, 25 Jan 2019 11:11:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251111.x0PBBTvq009318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343422 - stable/12/sys/dev/nvdimm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/nvdimm X-SVN-Commit-Revision: 343422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9106075BAD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:11:30 -0000 Author: kib Date: Fri Jan 25 11:11:28 2019 New Revision: 343422 URL: https://svnweb.freebsd.org/changeset/base/343422 Log: MFC r343143: nvdimm: add a driver for the NVDIMM root device Modified: stable/12/sys/dev/nvdimm/nvdimm.c stable/12/sys/dev/nvdimm/nvdimm_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvdimm/nvdimm.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm.c Fri Jan 25 11:05:32 2019 (r343421) +++ stable/12/sys/dev/nvdimm/nvdimm.c Fri Jan 25 11:11:28 2019 (r343422) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -51,28 +52,27 @@ __FBSDID("$FreeBSD$"); ACPI_MODULE_NAME("NVDIMM") static devclass_t nvdimm_devclass; -static device_t *nvdimm_devs; -static int nvdimm_devcnt; +static devclass_t nvdimm_root_devclass; MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); struct nvdimm_dev * nvdimm_find_by_handle(nfit_handle_t nv_handle) { - device_t dev; - struct nvdimm_dev *res, *nv; - int i; + struct nvdimm_dev *res; + device_t *dimms; + int i, error, num_dimms; res = NULL; - for (i = 0; i < nvdimm_devcnt; i++) { - dev = nvdimm_devs[i]; - if (dev == NULL) - continue; - nv = device_get_softc(dev); - if (nv->nv_handle == nv_handle) { - res = nv; + error = devclass_get_devices(nvdimm_devclass, &dimms, &num_dimms); + if (error != 0) + return (NULL); + for (i = 0; i < num_dimms; i++) { + if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) { + res = device_get_softc(dimms[i]); break; } } + free(dimms, M_TEMP); return (res); } @@ -89,8 +89,8 @@ nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg) return (0); MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0); - nv->nv_flush_addr = malloc(nfitflshaddr->HintCount * sizeof(uint64_t *), - M_NVDIMM, M_WAITOK); + nv->nv_flush_addr = mallocarray(nfitflshaddr->HintCount, + sizeof(uint64_t *), M_NVDIMM, M_WAITOK); for (i = 0; i < nfitflshaddr->HintCount; i++) nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i]; nv->nv_flush_addr_cnt = nfitflshaddr->HintCount; @@ -169,206 +169,166 @@ nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum Acpi return (error); } -static ACPI_STATUS -nvdimm_walk_dev(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +static int +nvdimm_probe(device_t dev) { - ACPI_STATUS status; - struct nvdimm_ns_walk_ctx *wctx; - wctx = ctx; - status = wctx->func(handle, wctx->arg); - return_ACPI_STATUS(status); + return (BUS_PROBE_NOWILDCARD); } -static ACPI_STATUS -nvdimm_walk_root(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +static int +nvdimm_attach(device_t dev) { + struct nvdimm_dev *nv; + ACPI_TABLE_NFIT *nfitbl; + ACPI_HANDLE handle; ACPI_STATUS status; - if (!acpi_MatchHid(handle, "ACPI0012")) - return_ACPI_STATUS(AE_OK); - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 100, - nvdimm_walk_dev, NULL, ctx, NULL); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - return_ACPI_STATUS(AE_CTRL_TERMINATE); + nv = device_get_softc(dev); + handle = nvdimm_root_get_acpi_handle(dev); + if (handle == NULL) + return (EINVAL); + nv->nv_dev = dev; + nv->nv_handle = nvdimm_root_get_device_handle(dev); + + status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); + if (ACPI_FAILURE(status)) { + if (bootverbose) + device_printf(dev, "cannot get NFIT\n"); + return (ENXIO); + } + nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, + nvdimm_parse_flush_addr, nv); + AcpiPutTable(&nfitbl->Header); + return (0); } -static ACPI_STATUS -nvdimm_foreach_acpi(ACPI_STATUS (*func)(ACPI_HANDLE, void *), void *arg) +static int +nvdimm_detach(device_t dev) { - struct nvdimm_ns_walk_ctx wctx; - ACPI_STATUS status; + struct nvdimm_dev *nv; - wctx.func = func; - wctx.arg = arg; - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 100, - nvdimm_walk_root, NULL, &wctx, NULL); - return_ACPI_STATUS(status); + nv = device_get_softc(dev); + free(nv->nv_flush_addr, M_NVDIMM); + return (0); } -static ACPI_STATUS -nvdimm_count_devs(ACPI_HANDLE handle __unused, void *arg) +static int +nvdimm_suspend(device_t dev) { - int *cnt; - cnt = arg; - (*cnt)++; + return (0); +} - ACPI_BUFFER name; - ACPI_STATUS status; - if (bootverbose) { - name.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiGetName(handle, ACPI_FULL_PATHNAME, &name); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - printf("nvdimm: enumerated %s\n", (char *)name.Pointer); - AcpiOsFree(name.Pointer); - } +static int +nvdimm_resume(device_t dev) +{ - return_ACPI_STATUS(AE_OK); + return (0); } -struct nvdimm_create_dev_arg { - device_t acpi0; - int *cnt; -}; - static ACPI_STATUS -nvdimm_create_dev(ACPI_HANDLE handle, void *arg) +nvdimm_root_create_dev(ACPI_HANDLE handle, UINT32 nesting_level, void *context, + void **return_value) { - struct nvdimm_create_dev_arg *narg; - device_t child; - int idx; + ACPI_STATUS status; + ACPI_DEVICE_INFO *device_info; + device_t parent, child; + uintptr_t *ivars; - narg = arg; - idx = *(narg->cnt); - child = device_find_child(narg->acpi0, "nvdimm", idx); - if (child == NULL) - child = BUS_ADD_CHILD(narg->acpi0, 1, "nvdimm", idx); + parent = context; + child = BUS_ADD_CHILD(parent, 100, "nvdimm", -1); if (child == NULL) { - if (bootverbose) - device_printf(narg->acpi0, - "failed to create nvdimm%d\n", idx); + device_printf(parent, "failed to create nvdimm\n"); return_ACPI_STATUS(AE_ERROR); } - acpi_set_handle(child, handle); - KASSERT(nvdimm_devs[idx] == NULL, ("nvdimm_devs[%d] not NULL", idx)); - nvdimm_devs[idx] = child; - - (*(narg->cnt))++; - return_ACPI_STATUS(AE_OK); -} - -static bool -nvdimm_init(void) -{ - ACPI_STATUS status; - - if (nvdimm_devcnt != 0) - return (true); - if (acpi_disabled("nvdimm")) - return (false); - status = nvdimm_foreach_acpi(nvdimm_count_devs, &nvdimm_devcnt); + status = AcpiGetObjectInfo(handle, &device_info); if (ACPI_FAILURE(status)) { - if (bootverbose) - printf("nvdimm_init: count failed\n"); - return (false); + device_printf(parent, "failed to get nvdimm device info\n"); + return_ACPI_STATUS(AE_ERROR); } - nvdimm_devs = malloc(nvdimm_devcnt * sizeof(device_t), M_NVDIMM, - M_WAITOK | M_ZERO); - return (true); + ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX - 1, sizeof(uintptr_t), + M_NVDIMM, M_ZERO | M_WAITOK); + device_set_ivars(child, ivars); + nvdimm_root_set_acpi_handle(child, handle); + nvdimm_root_set_device_handle(child, device_info->Address); + return_ACPI_STATUS(AE_OK); } -static void -nvdimm_identify(driver_t *driver, device_t parent) -{ - struct nvdimm_create_dev_arg narg; - ACPI_STATUS status; - int i; +static char *nvdimm_root_id[] = {"ACPI0012", NULL}; - if (!nvdimm_init()) - return; - narg.acpi0 = parent; - narg.cnt = &i; - i = 0; - status = nvdimm_foreach_acpi(nvdimm_create_dev, &narg); - if (ACPI_FAILURE(status) && bootverbose) - printf("nvdimm_identify: create failed\n"); -} - static int -nvdimm_probe(device_t dev) +nvdimm_root_probe(device_t dev) { - return (BUS_PROBE_NOWILDCARD); + if (acpi_disabled("nvdimm")) + return (ENXIO); + if (ACPI_ID_PROBE(device_get_parent(dev), dev, nvdimm_root_id) + != NULL) { + device_set_desc(dev, "ACPI NVDIMM root device"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -nvdimm_attach(device_t dev) +nvdimm_root_attach(device_t dev) { - struct nvdimm_dev *nv; - ACPI_TABLE_NFIT *nfitbl; ACPI_HANDLE handle; ACPI_STATUS status; - int i; + int error; - nv = device_get_softc(dev); handle = acpi_get_handle(dev); - if (handle == NULL) - return (EINVAL); - nv->nv_dev = dev; - for (i = 0; i < nvdimm_devcnt; i++) { - if (nvdimm_devs[i] == dev) { - nv->nv_devs_idx = i; - break; - } - } - MPASS(i < nvdimm_devcnt); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &nv->nv_handle))) { - device_printf(dev, "cannot get handle\n"); - return (ENXIO); - } - - status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); - if (ACPI_FAILURE(status)) { - if (bootverbose) - device_printf(dev, "cannot get NFIT\n"); - return (ENXIO); - } - nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, - nvdimm_parse_flush_addr, nv); - AcpiPutTable(&nfitbl->Header); - return (0); + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1, + nvdimm_root_create_dev, NULL, dev, NULL); + if (ACPI_FAILURE(status)) + device_printf(dev, "failed adding children\n"); + error = bus_generic_attach(dev); + return (error); } static int -nvdimm_detach(device_t dev) +nvdimm_root_detach(device_t dev) { - struct nvdimm_dev *nv; + device_t *children; + int i, error, num_children; - nv = device_get_softc(dev); - nvdimm_devs[nv->nv_devs_idx] = NULL; - free(nv->nv_flush_addr, M_NVDIMM); - return (0); + error = bus_generic_detach(dev); + if (error != 0) + return (error); + error = device_get_children(dev, &children, &num_children); + if (error != 0) + return (error); + for (i = 0; i < num_children; i++) + free(device_get_ivars(children[i]), M_NVDIMM); + free(children, M_TEMP); + error = device_delete_children(dev); + return (error); } static int -nvdimm_suspend(device_t dev) +nvdimm_root_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result) { + if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) + return (ENOENT); + *result = ((uintptr_t *)device_get_ivars(child))[index]; return (0); } static int -nvdimm_resume(device_t dev) +nvdimm_root_write_ivar(device_t dev, device_t child, int index, + uintptr_t value) { + if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) + return (ENOENT); + ((uintptr_t *)device_get_ivars(child))[index] = value; return (0); } static device_method_t nvdimm_methods[] = { - DEVMETHOD(device_identify, nvdimm_identify), DEVMETHOD(device_probe, nvdimm_probe), DEVMETHOD(device_attach, nvdimm_attach), DEVMETHOD(device_detach, nvdimm_detach), @@ -383,41 +343,22 @@ static driver_t nvdimm_driver = { sizeof(struct nvdimm_dev), }; -static void -nvdimm_fini(void) -{ +static device_method_t nvdimm_root_methods[] = { + DEVMETHOD(device_probe, nvdimm_root_probe), + DEVMETHOD(device_attach, nvdimm_root_attach), + DEVMETHOD(device_detach, nvdimm_root_detach), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), + DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), + DEVMETHOD_END +}; - free(nvdimm_devs, M_NVDIMM); - nvdimm_devs = NULL; - nvdimm_devcnt = 0; -} +static driver_t nvdimm_root_driver = { + "nvdimm_root", + nvdimm_root_methods, +}; -static int -nvdimm_modev(struct module *mod, int what, void *arg) -{ - int error; - - switch (what) { - case MOD_LOAD: - error = 0; - break; - - case MOD_UNLOAD: - nvdimm_fini(); - error = 0; - break; - - case MOD_QUIESCE: - error = 0; - break; - - default: - error = EOPNOTSUPP; - break; - } - - return (error); -} - -DRIVER_MODULE(nvdimm, acpi, nvdimm_driver, nvdimm_devclass, nvdimm_modev, NULL); +DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, NULL, + NULL); +DRIVER_MODULE(nvdimm, nvdimm_root, nvdimm_driver, nvdimm_devclass, NULL, NULL); MODULE_DEPEND(nvdimm, acpi, 1, 1, 1); Modified: stable/12/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm_var.h Fri Jan 25 11:05:32 2019 (r343421) +++ stable/12/sys/dev/nvdimm/nvdimm_var.h Fri Jan 25 11:11:28 2019 (r343422) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -34,12 +35,20 @@ typedef uint32_t nfit_handle_t; +enum nvdimm_root_ivar { + NVDIMM_ROOT_IVAR_ACPI_HANDLE, + NVDIMM_ROOT_IVAR_DEVICE_HANDLE, + NVDIMM_ROOT_IVAR_MAX, +}; +__BUS_ACCESSOR(nvdimm_root, acpi_handle, NVDIMM_ROOT, ACPI_HANDLE, ACPI_HANDLE) +__BUS_ACCESSOR(nvdimm_root, device_handle, NVDIMM_ROOT, DEVICE_HANDLE, + nfit_handle_t) + struct nvdimm_dev { device_t nv_dev; nfit_handle_t nv_handle; uint64_t **nv_flush_addr; int nv_flush_addr_cnt; - int nv_devs_idx; }; enum SPA_mapping_type { @@ -72,11 +81,6 @@ struct SPA_mapping { struct vm_object *spa_obj; bool spa_g_proc_run; bool spa_g_proc_exiting; -}; - -struct nvdimm_ns_walk_ctx { - ACPI_STATUS (*func)(ACPI_HANDLE, void *); - void *arg; }; extern struct SPA_mapping *spa_mappings; From owner-svn-src-all@freebsd.org Fri Jan 25 11:12:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32FD14B11C2; Fri, 25 Jan 2019 11:12:23 +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 8B9C775DDF; Fri, 25 Jan 2019 11:12:23 +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 7D94574FA; Fri, 25 Jan 2019 11:12:23 +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 x0PBCNIY011092; Fri, 25 Jan 2019 11:12:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PBCNCC011090; Fri, 25 Jan 2019 11:12:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251112.x0PBCNCC011090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343423 - stable/12/sys/dev/nvdimm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/nvdimm X-SVN-Commit-Revision: 343423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B9C775DDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:12:24 -0000 Author: kib Date: Fri Jan 25 11:12:22 2019 New Revision: 343423 URL: https://svnweb.freebsd.org/changeset/base/343423 Log: MFC r343144: nvdimm: initialize SPA uuids statically. Modified: stable/12/sys/dev/nvdimm/nvdimm_spa.c stable/12/sys/dev/nvdimm/nvdimm_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm_spa.c Fri Jan 25 11:11:28 2019 (r343422) +++ stable/12/sys/dev/nvdimm/nvdimm_spa.c Fri Jan 25 11:12:22 2019 (r343423) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -64,6 +65,23 @@ __FBSDID("$FreeBSD$"); #include #include +#define UUID_INITIALIZER_VOLATILE_MEMORY \ + {0x7305944f,0xfdda,0x44e3,0xb1,0x6c,{0x3f,0x22,0xd2,0x52,0xe5,0xd0}} +#define UUID_INITIALIZER_PERSISTENT_MEMORY \ + {0x66f0d379,0xb4f3,0x4074,0xac,0x43,{0x0d,0x33,0x18,0xb7,0x8c,0xdb}} +#define UUID_INITIALIZER_CONTROL_REGION \ + {0x92f701f6,0x13b4,0x405d,0x91,0x0b,{0x29,0x93,0x67,0xe8,0x23,0x4c}} +#define UUID_INITIALIZER_DATA_REGION \ + {0x91af0530,0x5d86,0x470e,0xa6,0xb0,{0x0a,0x2d,0xb9,0x40,0x82,0x49}} +#define UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK \ + {0x77ab535a,0x45fc,0x624b,0x55,0x60,{0xf7,0xb2,0x81,0xd1,0xf9,0x6e}} +#define UUID_INITIALIZER_VOLATILE_VIRTUAL_CD \ + {0x3d5abd30,0x4175,0x87ce,0x6d,0x64,{0xd2,0xad,0xe5,0x23,0xc4,0xbb}} +#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK \ + {0x5cea02c9,0x4d07,0x69d3,0x26,0x9f,{0x44,0x96,0xfb,0xe0,0x96,0xf9}} +#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD \ + {0x08018188,0x42cd,0xbb48,0x10,0x0f,{0x53,0x87,0xd5,0x3d,0xed,0x3d}} + struct SPA_mapping *spa_mappings; int spa_mappings_cnt; @@ -79,52 +97,64 @@ nvdimm_spa_count(void *nfitsubtbl __unused, void *arg) static struct nvdimm_SPA_uuid_list_elm { const char *u_name; - const char *u_id_str; struct uuid u_id; const bool u_usr_acc; } nvdimm_SPA_uuid_list[] = { [SPA_TYPE_VOLATILE_MEMORY] = { .u_name = "VOLA MEM ", - .u_id_str = UUID_VOLATILE_MEMORY, + .u_id = UUID_INITIALIZER_VOLATILE_MEMORY, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_MEMORY] = { .u_name = "PERS MEM", - .u_id_str = UUID_PERSISTENT_MEMORY, + .u_id = UUID_INITIALIZER_PERSISTENT_MEMORY, .u_usr_acc = true, }, [SPA_TYPE_CONTROL_REGION] = { .u_name = "CTRL RG ", - .u_id_str = UUID_CONTROL_REGION, + .u_id = UUID_INITIALIZER_CONTROL_REGION, .u_usr_acc = false, }, [SPA_TYPE_DATA_REGION] = { .u_name = "DATA RG ", - .u_id_str = UUID_DATA_REGION, + .u_id = UUID_INITIALIZER_DATA_REGION, .u_usr_acc = true, }, [SPA_TYPE_VOLATILE_VIRTUAL_DISK] = { .u_name = "VIRT DSK", - .u_id_str = UUID_VOLATILE_VIRTUAL_DISK, + .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK, .u_usr_acc = true, }, [SPA_TYPE_VOLATILE_VIRTUAL_CD] = { .u_name = "VIRT CD ", - .u_id_str = UUID_VOLATILE_VIRTUAL_CD, + .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_CD, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_VIRTUAL_DISK] = { .u_name = "PV DSK ", - .u_id_str = UUID_PERSISTENT_VIRTUAL_DISK, + .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_VIRTUAL_CD] = { .u_name = "PV CD ", - .u_id_str = UUID_PERSISTENT_VIRTUAL_CD, + .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD, .u_usr_acc = true, }, }; +enum SPA_mapping_type +nvdimm_spa_type_from_uuid(struct uuid *uuid) +{ + int j; + + for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { + if (uuidcmp(uuid, &nvdimm_SPA_uuid_list[j].u_id) != 0) + continue; + return (j); + } + return (SPA_TYPE_UNKNOWN); +} + static vm_memattr_t nvdimm_spa_memattr(struct SPA_mapping *spa) { @@ -538,48 +568,30 @@ nvdimm_spa_parse(void *nfitsubtbl, void *arg) { ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; struct SPA_mapping *spa; - int error, *i, j; + enum SPA_mapping_type spa_type; + int error, *i; i = arg; - spa = &spa_mappings[*i]; + spa = &spa_mappings[(*i)++]; nfitaddr = nfitsubtbl; - - for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { - /* XXXKIB: is ACPI UUID representation compatible ? */ - if (uuidcmp((struct uuid *)&nfitaddr->RangeGuid, - &nvdimm_SPA_uuid_list[j].u_id) != 0) - continue; - error = nvdimm_spa_init_one(spa, nfitaddr, j); - if (error != 0) - nvdimm_spa_fini_one(spa); - break; - } - if (j == nitems(nvdimm_SPA_uuid_list) && bootverbose) { + spa_type = nvdimm_spa_type_from_uuid( + (struct uuid *)&nfitaddr->RangeGuid); + if (spa_type == SPA_TYPE_UNKNOWN) { printf("Unknown SPA UUID %d ", nfitaddr->RangeIndex); printf_uuid((struct uuid *)&nfitaddr->RangeGuid); printf("\n"); + return (0); } - (*i)++; + error = nvdimm_spa_init_one(spa, nfitaddr, spa_type); + if (error != 0) + nvdimm_spa_fini_one(spa); return (0); } static int nvdimm_spa_init1(ACPI_TABLE_NFIT *nfitbl) { - struct nvdimm_SPA_uuid_list_elm *sle; int error, i; - - for (i = 0; i < nitems(nvdimm_SPA_uuid_list); i++) { - sle = &nvdimm_SPA_uuid_list[i]; - error = parse_uuid(sle->u_id_str, &sle->u_id); - if (error != 0) { - if (bootverbose) - printf("nvdimm_identify: error %d parsing " - "known SPA UUID %d %s\n", error, i, - sle->u_id_str); - return (error); - } - } error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, nvdimm_spa_count, &spa_mappings_cnt); Modified: stable/12/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm_var.h Fri Jan 25 11:11:28 2019 (r343422) +++ stable/12/sys/dev/nvdimm/nvdimm_var.h Fri Jan 25 11:12:22 2019 (r343423) @@ -60,6 +60,7 @@ enum SPA_mapping_type { SPA_TYPE_VOLATILE_VIRTUAL_CD = 5, SPA_TYPE_PERSISTENT_VIRTUAL_DISK= 6, SPA_TYPE_PERSISTENT_VIRTUAL_CD = 7, + SPA_TYPE_UNKNOWN = 127, }; struct SPA_mapping { @@ -88,6 +89,7 @@ extern int spa_mappings_cnt; MALLOC_DECLARE(M_NVDIMM); +enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *); struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t nv_handle); int nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, int (*cb)(void *, void *), void *arg); From owner-svn-src-all@freebsd.org Fri Jan 25 11:14:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0816814B133A; Fri, 25 Jan 2019 11:14:22 +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 A2CD376019; Fri, 25 Jan 2019 11:14:21 +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 77D90750C; Fri, 25 Jan 2019 11:14:21 +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 x0PBELhJ011233; Fri, 25 Jan 2019 11:14:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PBEKxO011230; Fri, 25 Jan 2019 11:14:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251114.x0PBEKxO011230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343424 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 343424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2CD376019 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:14:22 -0000 Author: kib Date: Fri Jan 25 11:14:20 2019 New Revision: 343424 URL: https://svnweb.freebsd.org/changeset/base/343424 Log: MFC r343145: MI VM: Make it possible to set size of superpage at boot instead of compile time. Modified: stable/12/sys/vm/vm_phys.c stable/12/sys/vm/vm_phys.h stable/12/sys/vm/vm_reserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_phys.c ============================================================================== --- stable/12/sys/vm/vm_phys.c Fri Jan 25 11:12:22 2019 (r343423) +++ stable/12/sys/vm/vm_phys.c Fri Jan 25 11:14:20 2019 (r343424) @@ -106,7 +106,8 @@ static struct rwlock_padalign vm_phys_fictitious_reg_l MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages"); static struct vm_freelist __aligned(CACHE_LINE_SIZE) - vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER]; + vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL] + [VM_NFREEORDER_MAX]; static int __read_mostly vm_nfreelists; Modified: stable/12/sys/vm/vm_phys.h ============================================================================== --- stable/12/sys/vm/vm_phys.h Fri Jan 25 11:12:22 2019 (r343423) +++ stable/12/sys/vm/vm_phys.h Fri Jan 25 11:14:20 2019 (r343424) @@ -42,6 +42,10 @@ #ifdef _KERNEL +#ifndef VM_NFREEORDER_MAX +#define VM_NFREEORDER_MAX VM_NFREEORDER +#endif + /* Domains must be dense (non-sparse) and zero-based. */ struct mem_affinity { vm_paddr_t start; @@ -63,7 +67,7 @@ struct vm_phys_seg { vm_paddr_t end; vm_page_t first_page; int domain; - struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER]; + struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; }; extern struct vm_phys_seg vm_phys_segs[]; Modified: stable/12/sys/vm/vm_reserv.c ============================================================================== --- stable/12/sys/vm/vm_reserv.c Fri Jan 25 11:12:22 2019 (r343423) +++ stable/12/sys/vm/vm_reserv.c Fri Jan 25 11:14:20 2019 (r343424) @@ -77,10 +77,15 @@ __FBSDID("$FreeBSD$"); #if VM_NRESERVLEVEL > 0 +#ifndef VM_LEVEL_0_ORDER_MAX +#define VM_LEVEL_0_ORDER_MAX VM_LEVEL_0_ORDER +#endif + /* * The number of small pages that are contained in a level 0 reservation */ #define VM_LEVEL_0_NPAGES (1 << VM_LEVEL_0_ORDER) +#define VM_LEVEL_0_NPAGES_MAX (1 << VM_LEVEL_0_ORDER_MAX) /* * The number of bits by which a physical address is shifted to obtain the @@ -114,6 +119,7 @@ typedef u_long popmap_t; * The number of population map entries in a reservation */ #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) +#define NPOPMAP_MAX howmany(VM_LEVEL_0_NPAGES_MAX, NBPOPMAP) /* * Number of elapsed ticks before we update the LRU queue position. Used @@ -191,7 +197,7 @@ struct vm_reserv { uint16_t popcnt; /* (r) # of pages in use */ int lasttick; /* (r) last pop update tick. */ char inpartpopq; /* (d) */ - popmap_t popmap[NPOPMAP]; /* (r) bit vector, used pages */ + popmap_t popmap[NPOPMAP_MAX]; /* (r) bit vector, used pages */ }; #define vm_reserv_lockptr(rv) (&(rv)->lock) From owner-svn-src-all@freebsd.org Fri Jan 25 11:24:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B85214B1710; Fri, 25 Jan 2019 11:24:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 417DC7659A; Fri, 25 Jan 2019 11:24:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PBOdI8088151; Fri, 25 Jan 2019 03:24:39 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PBOd7i088150; Fri, 25 Jan 2019 03:24:39 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <20190124224554.GA23558@v2> To: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 03:24:39 -0800 (PST) CC: rgrimes@freebsd.org, 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: 417DC7659A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.950,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:24:45 -0000 > On 0124T1555, Rodney W. Grimes wrote: > > > Author: trasz > > > Date: Thu Jan 24 23:34:51 2019 > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Six, and they are exactly the same as for ordinary users. Your right, I drifted to hyperbolie on that, but 1 is too many in this case. > But yeah, I can see the point of not defining any aliases > by default for the root user. Would the change be acceptable > if the aliases were commented out? This would be still quite > close to the situation for csh. There is also the issue that we are now going to open 1 more file every time an interactive /bin/sh is spawned, and that file is full of comments, to me thats a waste of cycles for probably 95% of the systems out there. People that want a Borne shell type interactive shell invariable choose bash, ksh or some other shell, not our /bin/sh which is lean mean and a fast machine because the base system uses it so much. > > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. > > Indeed, and those are pretty much the same aliases. But those alias have never been there for sh, the few we did keep was for historerical history, they had been in roots .cshrc for a decade and people got upset when we tried to remove them, thus we settled on just the few people stated as being the most wanted and used. I am sure there are a few of us around that would actually like to see the ones left go away and view them as contamination to what should be the domain of a site administrator or personal taste. Just as some of us would really rather have cd home return the proper error rather than doing some magic when there is not a ./home to cd into. And having ls .. ; cd ..; ls give 2 different outputs is just.. well something that should confuse the heck out of a new user, yet seems completely fine to have in the system. Note the above becomes a fatal mistake when the second ls is a rm with wild cards. Howerver I do understand the need to assist the new person or less informed that do not pack an emacs size environment with them that there are nifty things they can do to make life easier. Perhaps making more extensive comments in the skel files, or even adding pointers in them to a set of /usr/share/example/ files? Perhaps pointers in roots .files to the skel files as "for a better example of what can be done in this file see foo". > > > This is really the domain of a systems administrator to > > decide and making work for them to clean this out is > > not going to make them happy. > > Problem is, we're in a strage situation where we ship with > root shell which is just broken - basic shell syntax doesn't > work - and the out-of-box alternative provides you with > a VMS prompt. Not the best first impression to make, I'd say. Huh? Now I think you have gone off the other end, would you please explain how some alias in .shrc fix anything broken with /bin/sh or roots use of it? Can you expand on exactly what syntax this commit fixes please? And FYI, the $ prompt from a unix /bin/sh predates VMS by a decade or so, so VMS copied unix on that one. And historically interactive prompts have been 1 character since.. well.. interactive prompts appeared. . . .r pip/l I miss my OS/8 ".". :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 11:26:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1C114B17C5; Fri, 25 Jan 2019 11:26:06 +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 58E3876727; Fri, 25 Jan 2019 11:26:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4198176B0; Fri, 25 Jan 2019 11:26:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PBQ65w016277; Fri, 25 Jan 2019 11:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PBQ6Xm016276; Fri, 25 Jan 2019 11:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251126.x0PBQ6Xm016276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343425 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 343425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58E3876727 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:26:07 -0000 Author: kib Date: Fri Jan 25 11:26:05 2019 New Revision: 343425 URL: https://svnweb.freebsd.org/changeset/base/343425 Log: MFC r328433: EMFILE errno documented. Modified: stable/11/lib/libc/sys/shmat.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/shmat.2 ============================================================================== --- stable/11/lib/libc/sys/shmat.2 Fri Jan 25 11:14:20 2019 (r343424) +++ stable/11/lib/libc/sys/shmat.2 Fri Jan 25 11:26:05 2019 (r343425) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 2, 1995 +.Dd January 25, 2018 .Dt SHMAT 2 .Os .Sh NAME @@ -104,6 +104,11 @@ The .Fa addr argument was not an acceptable address. +.It Bq Er EMFILE +Failed to attach the shared memory segment because the per-process +.Va kern.ipc.shmseg +.Xr sysctl 3 +limit was reached. .El .Pp The From owner-svn-src-all@freebsd.org Fri Jan 25 11:46:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5249214B241C; Fri, 25 Jan 2019 11:46:09 +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 E84307759B; Fri, 25 Jan 2019 11:46:08 +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 DC09779F7; Fri, 25 Jan 2019 11:46:08 +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 x0PBk8ON026933; Fri, 25 Jan 2019 11:46:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PBk7wl026926; Fri, 25 Jan 2019 11:46:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901251146.x0PBk7wl026926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Jan 2019 11:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343426 - in stable/11: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 343426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E84307759B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:46:09 -0000 Author: kib Date: Fri Jan 25 11:46:07 2019 New Revision: 343426 URL: https://svnweb.freebsd.org/changeset/base/343426 Log: MFC r343082: Implement shmat(2) flag SHM_REMAP. Modified: stable/11/contrib/netbsd-tests/kernel/t_sysv.c stable/11/lib/libc/sys/shmat.2 stable/11/sys/kern/sysv_shm.c stable/11/sys/sys/shm.h stable/11/sys/vm/vm_map.c stable/11/sys/vm/vm_map.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/t_sysv.c Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/contrib/netbsd-tests/kernel/t_sysv.c Fri Jan 25 11:46:07 2019 (r343426) @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -774,19 +775,27 @@ ATF_TC_BODY(shm, tc) atf_tc_fail("sender: received unexpected signal"); } -ATF_TC_CLEANUP(shm, tc) +static void +shmid_cleanup(const char *name) { - int sender_shmid; + int shmid; /* * Remove the shared memory area if it exists. */ - sender_shmid = read_int("sender_shmid"); - if (sender_shmid != -1) - if (shmctl(sender_shmid, IPC_RMID, NULL) == -1) + shmid = read_int(name); + if (shmid != -1) { + if (shmctl(shmid, IPC_RMID, NULL) == -1) err(1, "shmctl IPC_RMID"); + } } +ATF_TC_CLEANUP(shm, tc) +{ + + shmid_cleanup("sender_shmid"); +} + void print_shmid_ds(struct shmid_ds *sp, mode_t mode) { @@ -839,12 +848,53 @@ sharer(void) exit(0); } +#ifdef SHM_REMAP +ATF_TC_WITH_CLEANUP(shm_remap); +ATF_TC_HEAD(shm_remap, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks SHM_REMAP"); +} + +ATF_TC_BODY(shm_remap, tc) +{ + char *shm_buf; + int shmid_remap; + + pgsize = sysconf(_SC_PAGESIZE); + + shmkey = get_ftok(4160); + ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed"); + + ATF_REQUIRE_MSG((shmid_remap = shmget(shmkey, pgsize, + IPC_CREAT | 0640)) != -1, "shmget: %d", errno); + write_int("shmid_remap", shmid_remap); + + ATF_REQUIRE_MSG((shm_buf = mmap(NULL, pgsize, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0)) != MAP_FAILED, "mmap: %d", errno); + + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, 0) == (void *)-1, + "shmat without MAP_REMAP succeeded"); + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, SHM_REMAP) == shm_buf, + "shmat(SHM_REMAP): %d", errno); +} + +ATF_TC_CLEANUP(shm_remap, tc) +{ + + shmid_cleanup("shmid_remap"); +} +#endif /* SHM_REMAP */ + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, msg); ATF_TP_ADD_TC(tp, sem); ATF_TP_ADD_TC(tp, shm); +#ifdef SHM_REMAP + ATF_TP_ADD_TC(tp, shm_remap); +#endif return atf_no_error(); } Modified: stable/11/lib/libc/sys/shmat.2 ============================================================================== --- stable/11/lib/libc/sys/shmat.2 Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/lib/libc/sys/shmat.2 Fri Jan 25 11:46:07 2019 (r343426) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2018 +.Dd January 14, 2019 .Dt SHMAT 2 .Os .Sh NAME @@ -64,17 +64,38 @@ kernel. .It If .Fa addr -is nonzero and SHM_RND is not specified in +is nonzero and +.Va SHM_RND +is not specified in .Fa flag , the segment is attached the specified address. .It If .Fa addr -is specified and SHM_RND is specified, +is specified and +.Va SHM_RND +is specified, .Fa addr is rounded down to the nearest multiple of SHMLBA. .El .Pp +If the +.Va SHM_REMAP +flag is specified and the passed +.Fa addr +is not +.Dv NULL , +any existing mappings in the virtual addresses range are +cleared before the segment is attached. +If the flag is not specified, +.Fa addr +is not +.Dv NULL , +and the virtual address range contains +some pre-existing mappings, the +.Fn shmat +call fails. +.Pp The .Fn shmdt system call @@ -104,6 +125,14 @@ The .Fa addr argument was not an acceptable address. +.It Bq Er ENOMEM +The specified +.Fa addr +cannot be used for mapping, for instance due to the amount of available +space being smaller than the segment size, +or because pre-existing mappings are in the range and no +.Va SHM_REMAP +flag was provided. .It Bq Er EMFILE Failed to attach the shared memory segment because the per-process .Va kern.ipc.shmseg Modified: stable/11/sys/kern/sysv_shm.c ============================================================================== --- stable/11/sys/kern/sysv_shm.c Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/sys/kern/sysv_shm.c Fri Jan 25 11:46:07 2019 (r343426) @@ -379,7 +379,7 @@ kern_shmat_locked(struct thread *td, int shmid, const vm_offset_t attach_va; vm_prot_t prot; vm_size_t size; - int error, i, rv; + int cow, error, find_space, i, rv; SYSVSHM_ASSERT_LOCKED(); rpr = shm_find_prison(td->td_ucred); @@ -415,6 +415,7 @@ kern_shmat_locked(struct thread *td, int shmid, const return (EMFILE); size = round_page(shmseg->u.shm_segsz); prot = VM_PROT_READ; + cow = MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL; if ((shmflg & SHM_RDONLY) == 0) prot |= VM_PROT_WRITE; if (shmaddr != NULL) { @@ -424,6 +425,9 @@ kern_shmat_locked(struct thread *td, int shmid, const attach_va = (vm_offset_t)shmaddr; else return (EINVAL); + if ((shmflg & SHM_REMAP) != 0) + cow |= MAP_REMAP; + find_space = VMFS_NO_SPACE; } else { /* * This is just a hint to vm_map_find() about where to @@ -431,12 +435,12 @@ kern_shmat_locked(struct thread *td, int shmid, const */ attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr + lim_max(td, RLIMIT_DATA)); + find_space = VMFS_OPTIMAL_SPACE; } vm_object_reference(shmseg->object); rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va, - size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE, - prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL); + size, 0, find_space, prot, prot, cow); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg->object); return (ENOMEM); Modified: stable/11/sys/sys/shm.h ============================================================================== --- stable/11/sys/sys/shm.h Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/sys/sys/shm.h Fri Jan 25 11:46:07 2019 (r343426) @@ -47,6 +47,7 @@ #define SHM_RDONLY 010000 /* Attach read-only (else read-write) */ #define SHM_RND 020000 /* Round attach address to SHMLBA */ +#define SHM_REMAP 030000 /* Unmap before mapping */ #define SHMLBA PAGE_SIZE /* Segment low boundary address multiple */ /* "official" access mode definitions; somewhat braindead since you have Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/sys/vm/vm_map.c Fri Jan 25 11:46:07 2019 (r343426) @@ -1492,6 +1492,8 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || object == NULL, ("vm_map_find: non-NULL backing object for stack")); + MPASS((cow & MAP_REMAP) == 0 || (find_space == VMFS_NO_SPACE && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || (object->flags & OBJ_COLORED) == 0)) find_space = VMFS_ANY_SPACE; @@ -1532,6 +1534,14 @@ again: } start = *addr; + } else if ((cow & MAP_REMAP) != 0) { + if (start < vm_map_min(map) || + start + length > vm_map_max(map) || + start + length <= length) { + result = KERN_INVALID_ADDRESS; + break; + } + vm_map_delete(map, start, start + length); } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { result = vm_map_stack_locked(map, start, length, Modified: stable/11/sys/vm/vm_map.h ============================================================================== --- stable/11/sys/vm/vm_map.h Fri Jan 25 11:26:05 2019 (r343425) +++ stable/11/sys/vm/vm_map.h Fri Jan 25 11:46:07 2019 (r343426) @@ -342,6 +342,7 @@ long vmspace_resident_count(struct vmspace *vmspace); #define MAP_DISABLE_COREDUMP 0x0100 #define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ #define MAP_VN_WRITECOUNT 0x0400 +#define MAP_REMAP 0x0800 #define MAP_STACK_GROWS_DOWN 0x1000 #define MAP_STACK_GROWS_UP 0x2000 #define MAP_ACC_CHARGED 0x4000 From owner-svn-src-all@freebsd.org Fri Jan 25 12:41:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C186714B4977; Fri, 25 Jan 2019 12:41:22 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2AC08186B; Fri, 25 Jan 2019 12:41:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id i6so7552050oia.6; Fri, 25 Jan 2019 04:41:21 -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:content-transfer-encoding; bh=QOGB2izpsZbU07zr/Gvc3tYA1fYdpaUtfdFmFx5oxlo=; b=FgFxw+LtH/T0xN1Zu+daRPxwb8jxcMbttSZsSEOKCvoGwiiJLnA8vI3yloqRZVY9ai 9Ylc2CWYbzfh2sdjgsyEOy6RXZCuodsqmpsKUh8m7X0Tp4H6BaKFfZllcvCnUtSiDz2r 8WSiWqR1L7ahQl3jgHYNELmpI9aqZjvSQ+mcmjng+JXmnQ3E/BOS+HgvTdunrsYPLFc/ GNDfIX8oJpS5qXhYRQ20jRnMknEcXw/XF6YRGPRqNNfZ0re/HCWxTYvD4UglWZkLp4jP WBI+2yGfUd++5jOb7cGuUTCMCnHvAbpA9RCjSdWLD6Z6o0GAyGmToG3tEQ6k7pYY0/Sn w37Q== X-Gm-Message-State: AJcUukdlrj5tbzGpmZMBNkgW0CZLkpvAadMrlrIu7MSgamSnBlp+2T2U zM8Tk56RSdjbb6OJ63aUKeZpQdcpAH7HHv3/PlBGoPNO X-Google-Smtp-Source: ALg8bN6DNxCv6icTAKzkfv2p17t+p8vyUnHE/OqhyCtaoPDOcXXQ22anP743Ettd/WAcLzEzSPj9Nobm/DWIOoIPT/Q= X-Received: by 2002:aca:e884:: with SMTP id f126mr1270075oih.181.1548420074877; Fri, 25 Jan 2019 04:41:14 -0800 (PST) MIME-Version: 1.0 References: <20190124224554.GA23558@v2> <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Fri, 25 Jan 2019 12:41:03 +0000 Message-ID: Subject: Re: svn commit: r343416 - head/bin/sh To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: F2AC08186B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 12:41:23 -0000 pt., 25 sty 2019 o 11:24 Rodney W. Grimes napisa=C5=82(a): > > > On 0124T1555, Rodney W. Grimes wrote: > > > > Author: trasz > > > > Date: Thu Jan 24 23:34:51 2019 > > > > New Revision: 343416 > > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > > > Log: > > > > Install .shrc for root, and set PS1 for the toor account. > > > > > > And a dozen other aliases :-( > > > > Six, and they are exactly the same as for ordinary users. > > Your right, I drifted to hyperbolie on that, > but 1 is too many in this case. Okay, I don't have a problem with removing the default aliases. (And from all the aliases that are actually there in the default shrc, the only one I actually do like and use is "ll"). > > But yeah, I can see the point of not defining any aliases > > by default for the root user. Would the change be acceptable > > if the aliases were commented out? This would be still quite > > close to the situation for csh. > > There is also the issue that we are now going to open 1 > more file every time an interactive /bin/sh is spawned, > and that file is full of comments, to me thats a waste > of cycles for probably 95% of the systems out there. True, but I don't think that's even measurable, at least for interactive shells (as opposed to shells used to run scripts, for which the commit changes nothing). > People that want a Borne shell type interactive shell > invariable choose bash, ksh or some other shell, not > our /bin/sh which is lean mean and a fast machine > because the base system uses it so much. That's true. But we discourage using shells from ports/packages as root shell. The easiest thing for a new user to do if they want a Bourne-compatible shell for root is to just use chsh(1). And here's what happens: you get greeted with an alien-looking (new folks usually come from Linux or OSX background) '$' prompt. Which is not a problem, of course, just define PS1, and perhaps some aliases, in a newly created /root/.shrc. Except... that doesn't work, despite the fact that it works just fine for accounts other than root, and that's also how you would fix it with bash. And then you end up having to read the sh(1) manual page to discover the ENV. > > > Please do not contaiminate the prestine environment with > > > personal preferences. In the start of the project we > > > did a great deal of work to remove and eliminate these > > > types of things, only the few csh aliases where retained. > > > > Indeed, and those are pretty much the same aliases. > > But those alias have never been there for sh, the few > we did keep was for historerical history, they had been > in roots .cshrc for a decade and people got upset when > we tried to remove them, thus we settled on just the > few people stated as being the most wanted and used. They are there in share/skel/dot.shrc, just not for root. But again - I agree regarding the aliases. > I am sure there are a few of us around that would actually > like to see the ones left go away and view them as contamination > to what should be the domain of a site administrator or > personal taste. > > Just as some of us would really rather have > cd home > return the proper error rather than doing some > magic when there is not a ./home to cd into. > And having ls .. ; cd ..; ls give 2 different outputs > is just.. well something that should confuse the > heck out of a new user, yet seems completely fine > to have in the system. Note the above becomes > a fatal mistake when the second ls is a rm > with wild cards. That's a historical mistake we can't really fix, I'm afraid, unless we want to break compatibility with other systems. > Howerver I do understand the need to assist the new person > or less informed that do not pack an emacs size environment > with them that there are nifty things they can do > to make life easier. Perhaps making more extensive > comments in the skel files, or even adding pointers in them > to a set of /usr/share/example/ files? Perhaps pointers > in roots .files to the skel files as "for a better example > of what can be done in this file see foo". I'd expect pretty much every user new to FreeBSD to already know about what they can do with shell files. And there's plenty of advice for that too, including the sources mentioned by Cy. There are two things, however: first, they don't neccessarily know about things specific to FreeBSD sh(1), such as requiring the ENV to be set to actually read the ~/.shrc. And second, it's just nice to new users to make stuff just a tiny bit more familiar looking. This includes installing the file they can edit (/root/.shrc), and setting the prompt to something that resembles other systems. That's exactly what we do for csh(1). > > > This is really the domain of a systems administrator to > > > decide and making work for them to clean this out is > > > not going to make them happy. > > > > Problem is, we're in a strage situation where we ship with > > root shell which is just broken - basic shell syntax doesn't > > work - and the out-of-box alternative provides you with > > a VMS prompt. Not the best first impression to make, I'd say. > > Huh? Now I think you have gone off the other end, > would you please explain how some alias in .shrc fix anything > broken with /bin/sh or roots use of it? > > Can you expand on exactly what syntax this commit fixes please? The way this commit fixes syntax problems of the default root shell (which is csh(1)) is that you can easily change the root shell and end up with something that looks just like before, but this time accepting the Bourne syntax. That's how it works for non-root users; this commit makes the same apply to root. > And FYI, the $ prompt from a unix /bin/sh predates VMS > by a decade or so, so VMS copied unix on that one. And > historically interactive prompts have been 1 character > since.. well.. interactive prompts appeared. > > . > . > .r pip/l > I miss my OS/8 ".". :-) Well, back them it could actually make a lot of sense; with a hardcopy terminal the "." prompt is just easier to ears :-) From owner-svn-src-all@freebsd.org Fri Jan 25 12:58:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0059C14B4F9D for ; Fri, 25 Jan 2019 12:58:51 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D71C8250D for ; Fri, 25 Jan 2019 12:58:49 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: by mail-lj1-x231.google.com with SMTP id u89-v6so8337019lje.1 for ; Fri, 25 Jan 2019 04:58:48 -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=J5vvXaU+VF6Ikajo6H09m/1hX+miWyWTjYfzCL1TMT4=; b=YJpAR8nSMCdW+KIQ0fOTUz+ho20zcXLHxfB5gW15lbaY1sSCB/YQ+AVdesjijsff9L 7jLHicWkgW1VcBVkUG3e/Ke2xkn+ZAYal+V4egT0xNHHB9NcI6oV1aWB4PPbyTqU09cX Lt4uP8FGCTQ84Sww0S5UJCUzBayiJa8CfjSrJB2kZqxyS8423+ZM1ZDMYrR8yBILlR0b fhgd1fmgBFn9oGnYX/bwcNxoYFjstiqTTKEIkOZf8vIibGsUzbmPc2j1Qne1FD32cv4R DSqPCXtf52b801FficnyhQq18BcbIhHl8yXWwO4LkFLJBNnBoYQft5ey598x2QvWsZZE fGyg== X-Gm-Message-State: AJcUukd8nWDXoQb7v7jSLjGvXPeE354t5MOjq8RK2PGo51PCCH8tG6ZU /zHgjteo1ZG7jkIEau/7yDh8mVOkuW7xVTgobqLShQ== X-Google-Smtp-Source: ALg8bN53TZSciOWO6nlqLHGOYEQykSkUq8eJC4u6RWbQzDdvAIvQUk7e4jcLJp3zqNkZrBCxn+P9Ks3xeczwfGqF9vw= X-Received: by 2002:a2e:80d3:: with SMTP id r19-v6mr9760744ljg.151.1548421127148; Fri, 25 Jan 2019 04:58:47 -0800 (PST) MIME-Version: 1.0 References: <201901231734.x0NHY11I004644@repo.freebsd.org> <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> From: Ram Kishore Vegesna Date: Fri, 25 Jan 2019 18:28:35 +0530 Message-ID: Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc To: "Rodney W. Grimes" Cc: Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 0D71C8250D X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.59 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[broadcom.com:s=google]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_LOW(-1.00)[broadcom.com.dwl.dnswl.org : 127.0.9.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[broadcom.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[broadcom.com,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[1.3.2.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]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.70)[ip: (-9.26), ipnet: 2a00:1450::/32(-2.23), asn: 15169(-1.92), country: US(-0.08)]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,alt3.aspmx.l.google.com,alt2.aspmx.l.google.com,alt4.aspmx.l.google.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 12:58:51 -0000 Hi Rodney, I fixed many coverity tool warnings as part of this commit. Adding all the warnings and fix details seemed over kill. I will use a better commit message when I do MFC commit of this revision. Thanks, Ram On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: ram > > Date: Wed Jan 23 17:34:01 2019 > > New Revision: 343349 > > URL: https://svnweb.freebsd.org/changeset/base/343349 > > > > Log: > > Fixed issues reported by coverity scan. > > The quality of this commit message is rather low, > it should of at least included some details about > what was wrong, why it was wrong, and how it was > fixed. > > Thanks, > Rod > > > > Approved by: mav > > MFC after: 3 weeks > > > > Modified: > > head/sys/dev/ocs_fc/ocs_cam.c > > head/sys/dev/ocs_fc/ocs_hw.c > > head/sys/dev/ocs_fc/ocs_hw_queues.c > > head/sys/dev/ocs_fc/ocs_ioctl.c > > head/sys/dev/ocs_fc/ocs_mgmt.c > > head/sys/dev/ocs_fc/ocs_node.c > > head/sys/dev/ocs_fc/ocs_pci.c > > head/sys/dev/ocs_fc/ocs_xport.c > > head/sys/dev/ocs_fc/sli4.c > > > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, > ocs_scsi_del_tar > > struct ocs_softc *ocs = node->ocs; > > ocs_fcport *fcp = NULL; > > ocs_fc_target_t *tgt = NULL; > > - uint32_t tgt_id; > > + int32_t tgt_id; > > > > + if (ocs == NULL) { > > + ocs_log_err(ocs,"OCS is NULL \n"); > > + return -1; > > + } > > + > > fcp = node->sport->tgt_data; > > if (fcp == NULL) { > > ocs_log_err(ocs,"FCP is NULL \n"); > > - return 0; > > + return -1; > > } > > > > tgt_id = ocs_tgt_find(fcp, node); > > + if (tgt_id == -1) { > > + ocs_log_err(ocs,"target is invalid\n"); > > + return -1; > > + } > > > > tgt = &fcp->tgt[tgt_id]; > > > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb > *ccb > > ocs_io_t *io = NULL; > > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > > int32_t sgl_count; > > + ocs_fcport *fcp; > > > > - ocs_fcport *fcp = NULL; > > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > > - if (fcp == NULL) { > > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > > - return -1; > > - } > > > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > > } > > case XPT_RESET_BUS: > > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) > == 0) { > > - ocs_xport_control(ocs->xport, > OCS_XPORT_PORT_ONLINE); > > - > > + rc = ocs_xport_control(ocs->xport, > OCS_XPORT_PORT_ONLINE); > > + if (rc) { > > + ocs_log_debug(ocs, "Failed to bring port > online" > > + " : %d\n", > rc); > > + } > > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > > } else { > > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > > static ocs_hw_rtn_e > > ocs_hw_link_event_init(ocs_hw_t *hw) > > { > > - if (hw == NULL) { > > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > > - return OCS_HW_RTN_ERROR; > > - } > > + ocs_hw_assert(hw); > > > > hw->link.status = SLI_LINK_STATUS_MAX; > > hw->link.topology = SLI_LINK_TOPO_NONE; > > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, > uint3 > > break; > > case OCS_HW_MAX_VPORTS: > > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > > + break; > > default: > > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > > rc = OCS_HW_RTN_ERROR; > > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, > uint3 > > break; > > case OCS_ESOC: > > hw->config.esoc = value; > > + break; > > case OCS_HW_HIGH_LOGIN_MODE: > > rc = sli_set_hlm(&hw->sli, value); > > break; > > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t > *hdr, u > > > > OCS_STAT(wq->use_count++); > > > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > > + return OCS_HW_RTN_SUCCESS; > > } > > > > ocs_hw_rtn_e > > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t > *io) > > } > > > > /* fail if we don't have an overflow SGL registered */ > > - if (io->ovfl_sgl == NULL) { > > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > > return OCS_HW_RTN_ERROR; > > } > > > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > > > + if (!buf) { > > + ocs_log_err(hw->os, "no buffer for command\n"); > > + return OCS_HW_RTN_NO_MEMORY; > > + } > > + > > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, > hw->watchdog_timeout); > > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, > ocs_hw_cb_cfg_watchdog, NULL); > > if (rc) { > > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > > break; > > case SLI_QENTRY_WQ_RELEASE: { > > uint32_t wq_id = rid; > > - uint32_t index = > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > + int32_t index = > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > + > > + if (unlikely(index < 0)) { > > + ocs_log_err(hw->os, "unknown idx=%#x > rid=%#x\n", > > + index, rid); > > + break; > > + } > > + > > hw_wq_t *wq = hw->hw_wq[index]; > > > > /* Submit any HW IOs that are on the WQ pending > list */ > > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > > > hw->link.status = event->status; > > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > + d = hw->domains[i]; > > if (d != NULL && > > hw->callback.domain != NULL) { > > hw->callback.domain(hw->args.domain, > OCS_HW_DOMAIN_LOST, d); > > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > > ocs_domain_t *domain = NULL; > > sli4_fip_event_t *event = e; > > > > + ocs_hw_assert(event); > > + ocs_hw_assert(hw); > > + > > /* Find the associated domain object */ > > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > > ocs_domain_t *d = NULL; > > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > > /* Clear VLINK is different from the other FIP events as > it passes back > > * a VPI instead of a FCF index. Check all attached SLI > ports for a > > * matching VPI */ > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > + d = hw->domains[i]; > > if (d != NULL) { > > ocs_sport_t *sport = NULL; > > > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > status, > > ocs_hw_io_t *io_next = NULL; > > uint64_t ticks_current = ocs_get_os_ticks(); > > uint32_t sec_elapsed; > > + ocs_hw_rtn_e rc; > > > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t > *)mqe; > > > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > status, > > > > /* loop through active WQE list and check for timeouts */ > > ocs_lock(&hw->io_lock); > > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > - sec_elapsed = ((ticks_current - io->submit_ticks) > / ocs_get_os_tick_freq()); > > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > + sec_elapsed = ((ticks_current - io->submit_ticks) / > ocs_get_os_tick_freq()); > > > > - /* > > - * If elapsed time > timeout, abort it. No need to > check type since > > - * it wouldn't be on this list unless it was a > target WQE > > - */ > > - if (sec_elapsed > io->tgt_wqe_timeout) { > > - ocs_log_test(hw->os, "IO timeout xri=0x%x > tag=0x%x type=%d\n", > > - io->indicator, io->reqtag, > io->type); > > + /* > > + * If elapsed time > timeout, abort it. No need to check > type since > > + * it wouldn't be on this list unless it was a target WQE > > + */ > > + if (sec_elapsed > io->tgt_wqe_timeout) { > > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x > type=%d\n", > > + io->indicator, io->reqtag, io->type); > > > > - /* remove from active_wqe list so won't > try to abort again */ > > - ocs_list_remove(&hw->io_timed_wqe, io); > > + /* remove from active_wqe list so won't try to > abort again */ > > + ocs_list_remove(&hw->io_timed_wqe, io); > > > > - /* save status of "timed out" for when > abort completes */ > > - io->status_saved = 1; > > - io->saved_status = > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > - io->saved_ext = 0; > > - io->saved_len = 0; > > + /* save status of "timed out" for when abort > completes */ > > + io->status_saved = 1; > > + io->saved_status = > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > + io->saved_ext = 0; > > + io->saved_len = 0; > > > > - /* now abort outstanding IO */ > > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > + /* now abort outstanding IO */ > > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > + if (rc) { > > + ocs_log_test(hw->os, > > + "abort failed xri=%#x tag=%#x > rc=%d\n", > > + io->indicator, io->reqtag, rc); > > } > > - /* > > - * need to go through entire list since each IO > could have a > > - * different timeout value > > - */ > > } > > + /* > > + * need to go through entire list since each IO could have > a > > + * different timeout value > > + */ > > + } > > ocs_unlock(&hw->io_lock); > > > > /* if we're not in the middle of shutting down, schedule next > timer */ > > > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > default_lengths[QTOP_CQ] = len; > > break; > > } > > + > > + if (!eq || !next_qt) { > > + goto fail; > > + } > > > > /* If this CQ is for MRQ, then delay the creation > */ > > if (!use_mrq || next_qt->entry != QTOP_RQ) { > > cq = hw_new_cq(eq, len); > > if (cq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > } > > break; > > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > hw_queue_teardown(hw); > > return OCS_HW_RTN_NO_MEMORY; > > } > > + > > + if (cq == NULL) > > + goto fail; > > > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + > qt->ulp); > > if (wq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > > > /* Place this WQ on the EQ WQ array */ > > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > break; > > } > > > > + if (cq == NULL) > > + goto fail; > > + > > mq = hw_new_mq(cq, len); > > if (mq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > break; > > > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > > } > > > > return OCS_HW_RTN_SUCCESS; > > +fail: > > + hw_queue_teardown(hw); > > + return OCS_HW_RTN_NO_MEMORY; > > > > } > > > > @@ -737,8 +747,9 @@ error: > > for (i = 0; i < num_rq_pairs; i++) { > > if (rqs[i] != NULL) { > > if (rqs[i]->rq_tracker != NULL) { > > - ocs_free(hw->os, rq->rq_tracker, > > - sizeof(ocs_hw_sequence_t*) * > rq->entry_count); > > + ocs_free(hw->os, rqs[i]->rq_tracker, > > + sizeof(ocs_hw_sequence_t*) * > > + rqs[i]->entry_count); > > } > > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > > } > > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > > void > > hw_del_rq(hw_rq_t *rq) > > { > > - ocs_hw_t *hw = rq->cq->eq->hw; > > > > if (rq != NULL) { > > + ocs_hw_t *hw = rq->cq->eq->hw; > > /* Free RQ tracker */ > > if (rq->rq_tracker != NULL) { > > ocs_free(hw->os, rq->rq_tracker, > sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, > ocs_ioctl_elxu_mbox_ > > * 6. ioctl code releases the lock > > */ > > mtx_lock(&ocs->dbg_lock); > > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > - __ocs_ioctl_mbox_cb, ocs); > > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > + __ocs_ioctl_mbox_cb, ocs)) { > > + > > + device_printf(ocs->dev, "%s: command- %x failed\n", > __func__, > > + ((sli4_mbox_command_header_t > *)mcmd->payload)->command); > > + } > > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > mtx_unlock(&ocs->dbg_lock); > > > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t > *)mcmd->payload)->command > > > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char > *value) > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > /* Undefined failure */ > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > - rc = -ENXIO; > > + return -ENXIO; > > } > > if (result.status == 0) { > > /* Success. */ > > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char > *value > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > /* Undefined failure */ > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > - rc = -ENXIO; > > + return -ENXIO; > > } > > if (result.status == 0) { > > /* Success. */ > > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > char *wwpn_p = NULL; > > char *wwnn_p = NULL; > > int32_t rc = -1; > > - int wwpn; > > - int wwnn; > > + int wwpn = 0; > > + int wwnn = 0; > > int i; > > > > /* This is a read-modify-write operation, so first we have to read > > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > wwnn_p = wwn_p; > > } > > > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > > - wwnn = ocs_strcmp(wwnn_p, "NA"); > > + if (wwpn_p != NULL) { > > + wwpn = ocs_strcmp(wwpn_p, "NA"); > > + } > > + > > + if (wwnn_p != NULL) { > > + wwnn = ocs_strcmp(wwnn_p, "NA"); > > + } > > > > /* Parse the new WWPN */ > > if ((wwpn_p != NULL) && (wwpn != 0)) { > > > > Modified: head/sys/dev/ocs_fc/ocs_node.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > > - max_xfer_size = max_sge * num_sgl; > > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > > } else { > > max_xfer_size = 65536; > > } > > > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > > } > > > > ocs_cam_detach(ocs); > > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > > if (bus_dmamap_destroy(ocs->buf_dmat, > io->tgt_io.dmap)) { > > > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > > ocs_node_free_pool(ocs); > > } > > > > - if (rq_threads_created) { > > - ocs_xport_rq_threads_teardown(xport); > > - } > > - > > return -1; > > } > > > > > > Modified: head/sys/dev/ocs_fc/sli4.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, > size > > } > > } > > break; > > - default: > > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", > if_type); > > - return -1; > > - } > > + } > > > > return (sli_config_off + cmd_size); > > } > > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], > uin > > return -1; > > } > > > > + memset(&dma, 0, sizeof(dma)); > > + > > /* Align the queue DMA memory */ > > for (i = 0; i < num_cqs; i++) { > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, > SLI4_CQE_BYTES, > > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > > } > > > > if (q->dma.virt != NULL) { > > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > > + ocs_memset(q->dma.virt, 0, (q->size * > (uint64_t)q->length)); > > } > > > > ocs_unlock(&q->lock); > > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t > num_rq_pair > > ocs_dma_t dma; > > sli4_res_common_create_queue_set_t *rsp = NULL; > > sli4_req_fcoe_rq_create_v2_t *req = NULL; > > + > > + ocs_memset(&dma, 0, sizeof(dma)); > > > > for (i = 0; i < (num_rq_pairs * 2); i++) { > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, > SLI4_FCOE_RQE_SIZE, > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Fri Jan 25 13:39:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9633414B5F3B; Fri, 25 Jan 2019 13:39:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0CA483BE1; Fri, 25 Jan 2019 13:39:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PDd5gG088602; Fri, 25 Jan 2019 05:39:05 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PDd5sG088601; Fri, 25 Jan 2019 05:39:05 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: To: Edward Napierala Date: Fri, 25 Jan 2019 05:39:05 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , 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: B0CA483BE1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:39:10 -0000 > pt., 25 sty 2019 o 11:24 Rodney W. Grimes > napisa?(a): > > > > > On 0124T1555, Rodney W. Grimes wrote: > > > > > Author: trasz > > > > > Date: Thu Jan 24 23:34:51 2019 > > > > > New Revision: 343416 > > > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > > > > > Log: > > > > > Install .shrc for root, and set PS1 for the toor account. > > > > > > > > And a dozen other aliases :-( > > > > > > Six, and they are exactly the same as for ordinary users. > > > > Your right, I drifted to hyperbolie on that, > > but 1 is too many in this case. > > Okay, I don't have a problem with removing the default aliases. > (And from all the aliases that are actually there in the default shrc, > the only one I actually do like and use is "ll"). > > > > But yeah, I can see the point of not defining any aliases > > > by default for the root user. Would the change be acceptable > > > if the aliases were commented out? This would be still quite > > > close to the situation for csh. > > > > There is also the issue that we are now going to open 1 > > more file every time an interactive /bin/sh is spawned, > > and that file is full of comments, to me thats a waste > > of cycles for probably 95% of the systems out there. > > True, but I don't think that's even measurable, at least for > interactive shells (as opposed to shells used to run scripts, > for which the commit changes nothing). > > > People that want a Borne shell type interactive shell > > invariable choose bash, ksh or some other shell, not > > our /bin/sh which is lean mean and a fast machine > > because the base system uses it so much. > > That's true. But we discourage using shells from ports/packages > as root shell. I am not so sure on that, it use to be more so because /bin/sh was statically linked and needed no lib's to run, well that is gone out the window. There is also the issue that other shells are installed into /usr/local/bin, which may or may not be mounted (less likely now that zfs and be's are all the rage.) Most of the reasons to discourage a pkg root shell are now gone. > The easiest thing for a new user to do if they want > a Bourne-compatible shell for root is to just use chsh(1). And > here's what happens: you get greeted with an alien-looking > (new folks usually come from Linux or OSX background) '$' If that is alien looking then they need some education on how the tool they are using works and how to use it. > prompt. Which is not a problem, of course, just define PS1, > and perhaps some aliases, in a newly created /root/.shrc. > Except... that doesn't work, despite the fact that it works just > fine for accounts other than root, and that's also how you would > fix it with bash. And then you end up having to read the sh(1) > manual page to discover the ENV. Or read the .profile of there user account and actually understand some of these details. IMHO this is about user education and rather than dumb the system down we should try to raise the level of knowledge. > > > > > Please do not contaiminate the prestine environment with > > > > personal preferences. In the start of the project we > > > > did a great deal of work to remove and eliminate these > > > > types of things, only the few csh aliases where retained. > > > > > > Indeed, and those are pretty much the same aliases. > > > > But those alias have never been there for sh, the few > > we did keep was for historerical history, they had been > > in roots .cshrc for a decade and people got upset when > > we tried to remove them, thus we settled on just the > > few people stated as being the most wanted and used. > > They are there in share/skel/dot.shrc, just not for root. > But again - I agree regarding the aliases. > > > I am sure there are a few of us around that would actually > > like to see the ones left go away and view them as contamination > > to what should be the domain of a site administrator or > > personal taste. > > > > Just as some of us would really rather have > > cd home > > return the proper error rather than doing some > > magic when there is not a ./home to cd into. > > And having ls .. ; cd ..; ls give 2 different outputs > > is just.. well something that should confuse the > > heck out of a new user, yet seems completely fine > > to have in the system. Note the above becomes > > a fatal mistake when the second ls is a rm > > with wild cards. > > That's a historical mistake we can't really fix, I'm afraid, > unless we want to break compatibility with other systems. I seriously doubt that are a lot of people depending on cd home to do what it does, most would be lazy like me and type cd ~. > > > Howerver I do understand the need to assist the new person > > or less informed that do not pack an emacs size environment > > with them that there are nifty things they can do > > to make life easier. Perhaps making more extensive > > comments in the skel files, or even adding pointers in them > > to a set of /usr/share/example/ files? Perhaps pointers > > in roots .files to the skel files as "for a better example > > of what can be done in this file see foo". > > I'd expect pretty much every user new to FreeBSD to already > know about what they can do with shell files. And there's > plenty of advice for that too, including the sources mentioned > by Cy. > > There are two things, however: first, they don't neccessarily > know about things specific to FreeBSD sh(1), such as requiring > the ENV to be set to actually read the ~/.shrc. Is that only the freebsd shell, I thought most shells need special stuff done to get them to do much more than processes .profile. > > And second, it's just nice to new users to make stuff just a tiny > bit more familiar looking. This includes installing the file they can > edit (/root/.shrc), and setting the prompt to something that > resembles other systems. That's exactly what we do for csh(1). I am ok installing .shrc, I am ok putting a commented ENV in /root/.profile to say uncomment this if you want .shrc to be read for interactive shells. Document document document, but changing the existing very long standing behavior in the name of "just nice to new users" at the cost of agitating many of the current users is no good. As to prompts, well, those are very personalized things and vary more than the colors of bike sheds, best left to the site or personal admin. > > > > This is really the domain of a systems administrator to > > > > decide and making work for them to clean this out is > > > > not going to make them happy. > > > > > > Problem is, we're in a strage situation where we ship with > > > root shell which is just broken - basic shell syntax doesn't > > > work - and the out-of-box alternative provides you with > > > a VMS prompt. Not the best first impression to make, I'd say. > > > > Huh? Now I think you have gone off the other end, > > would you please explain how some alias in .shrc fix anything > > broken with /bin/sh or roots use of it? > > > > Can you expand on exactly what syntax this commit fixes please? > > The way this commit fixes syntax problems of the default root > shell (which is csh(1)) is that you can easily change the root shell > and end up with something that looks just like before, but this > time accepting the Bourne syntax. That's how it works for non-root > users; this commit makes the same apply to root. That is not a syntax problem. That is a difference of the fact that roots environment is pretty sanitary and a users is not, and for good reason on the former. > > > And FYI, the $ prompt from a unix /bin/sh predates VMS > > by a decade or so, so VMS copied unix on that one. And > > historically interactive prompts have been 1 character > > since.. well.. interactive prompts appeared. > > > > . > > . > > .r pip/l > > I miss my OS/8 ".". :-) > > Well, back them it could actually make a lot of sense; with > a hardcopy terminal the "." prompt is just easier to ears :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 13:44:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 978FB14B6238; Fri, 25 Jan 2019 13:44:22 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0886840AB; Fri, 25 Jan 2019 13:44:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PDiHvi088638; Fri, 25 Jan 2019 05:44:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PDiGZP088635; Fri, 25 Jan 2019 05:44:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: To: Ram Kishore Vegesna Date: Fri, 25 Jan 2019 05:44:16 -0800 (PST) CC: "Rodney W. Grimes" , Ram Kishore Vegesna , src-committers , 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: B0886840AB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:44:23 -0000 > Hi Rodney, > > I fixed many coverity tool warnings as part of this commit. Adding all the > warnings and fix details seemed over kill. It seems like overkill when your commiting, but if you have have to go digging through commit history trying to find something it helps a great deal to have good information present there. You do not need to include the output from coverty, but some amount of detail is very helpful. Seeing returns 0 changed into return -1 just seems a strange thing to need to do to fix a static analysis issue. > > I will use a better commit message when I do MFC commit of this revision. Those commits should usually just duplicate the ^head message with a 1 liner at the top that is a MFC: rXXXXXX one line summary of original commit. Original commit message here > Thanks, > Ram > > > > On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: ram > > > Date: Wed Jan 23 17:34:01 2019 > > > New Revision: 343349 > > > URL: https://svnweb.freebsd.org/changeset/base/343349 > > > > > > Log: > > > Fixed issues reported by coverity scan. > > > > The quality of this commit message is rather low, > > it should of at least included some details about > > what was wrong, why it was wrong, and how it was > > fixed. > > > > Thanks, > > Rod > > > > > > Approved by: mav > > > MFC after: 3 weeks > > > > > > Modified: > > > head/sys/dev/ocs_fc/ocs_cam.c > > > head/sys/dev/ocs_fc/ocs_hw.c > > > head/sys/dev/ocs_fc/ocs_hw_queues.c > > > head/sys/dev/ocs_fc/ocs_ioctl.c > > > head/sys/dev/ocs_fc/ocs_mgmt.c > > > head/sys/dev/ocs_fc/ocs_node.c > > > head/sys/dev/ocs_fc/ocs_pci.c > > > head/sys/dev/ocs_fc/ocs_xport.c > > > head/sys/dev/ocs_fc/sli4.c > > > > > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, > > ocs_scsi_del_tar > > > struct ocs_softc *ocs = node->ocs; > > > ocs_fcport *fcp = NULL; > > > ocs_fc_target_t *tgt = NULL; > > > - uint32_t tgt_id; > > > + int32_t tgt_id; > > > > > > + if (ocs == NULL) { > > > + ocs_log_err(ocs,"OCS is NULL \n"); > > > + return -1; > > > + } > > > + > > > fcp = node->sport->tgt_data; > > > if (fcp == NULL) { > > > ocs_log_err(ocs,"FCP is NULL \n"); > > > - return 0; > > > + return -1; > > > } > > > > > > tgt_id = ocs_tgt_find(fcp, node); > > > + if (tgt_id == -1) { > > > + ocs_log_err(ocs,"target is invalid\n"); > > > + return -1; > > > + } > > > > > > tgt = &fcp->tgt[tgt_id]; > > > > > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb > > *ccb > > > ocs_io_t *io = NULL; > > > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > > > int32_t sgl_count; > > > + ocs_fcport *fcp; > > > > > > - ocs_fcport *fcp = NULL; > > > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > > > - if (fcp == NULL) { > > > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > > > - return -1; > > > - } > > > > > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > > > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > > > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > > > } > > > case XPT_RESET_BUS: > > > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) > > == 0) { > > > - ocs_xport_control(ocs->xport, > > OCS_XPORT_PORT_ONLINE); > > > - > > > + rc = ocs_xport_control(ocs->xport, > > OCS_XPORT_PORT_ONLINE); > > > + if (rc) { > > > + ocs_log_debug(ocs, "Failed to bring port > > online" > > > + " : %d\n", > > rc); > > > + } > > > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > > > } else { > > > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > > > > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > > > static ocs_hw_rtn_e > > > ocs_hw_link_event_init(ocs_hw_t *hw) > > > { > > > - if (hw == NULL) { > > > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > > > - return OCS_HW_RTN_ERROR; > > > - } > > > + ocs_hw_assert(hw); > > > > > > hw->link.status = SLI_LINK_STATUS_MAX; > > > hw->link.topology = SLI_LINK_TOPO_NONE; > > > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, > > uint3 > > > break; > > > case OCS_HW_MAX_VPORTS: > > > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > > > + break; > > > default: > > > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > > > rc = OCS_HW_RTN_ERROR; > > > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, > > uint3 > > > break; > > > case OCS_ESOC: > > > hw->config.esoc = value; > > > + break; > > > case OCS_HW_HIGH_LOGIN_MODE: > > > rc = sli_set_hlm(&hw->sli, value); > > > break; > > > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t > > *hdr, u > > > > > > OCS_STAT(wq->use_count++); > > > > > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > > > + return OCS_HW_RTN_SUCCESS; > > > } > > > > > > ocs_hw_rtn_e > > > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t > > *io) > > > } > > > > > > /* fail if we don't have an overflow SGL registered */ > > > - if (io->ovfl_sgl == NULL) { > > > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > > > return OCS_HW_RTN_ERROR; > > > } > > > > > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > > > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > > > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > > > > > + if (!buf) { > > > + ocs_log_err(hw->os, "no buffer for command\n"); > > > + return OCS_HW_RTN_NO_MEMORY; > > > + } > > > + > > > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, > > hw->watchdog_timeout); > > > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, > > ocs_hw_cb_cfg_watchdog, NULL); > > > if (rc) { > > > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > > > break; > > > case SLI_QENTRY_WQ_RELEASE: { > > > uint32_t wq_id = rid; > > > - uint32_t index = > > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > > + int32_t index = > > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > > + > > > + if (unlikely(index < 0)) { > > > + ocs_log_err(hw->os, "unknown idx=%#x > > rid=%#x\n", > > > + index, rid); > > > + break; > > > + } > > > + > > > hw_wq_t *wq = hw->hw_wq[index]; > > > > > > /* Submit any HW IOs that are on the WQ pending > > list */ > > > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > > > > > hw->link.status = event->status; > > > > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > > + d = hw->domains[i]; > > > if (d != NULL && > > > hw->callback.domain != NULL) { > > > hw->callback.domain(hw->args.domain, > > OCS_HW_DOMAIN_LOST, d); > > > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > > > ocs_domain_t *domain = NULL; > > > sli4_fip_event_t *event = e; > > > > > > + ocs_hw_assert(event); > > > + ocs_hw_assert(hw); > > > + > > > /* Find the associated domain object */ > > > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > > > ocs_domain_t *d = NULL; > > > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > > > /* Clear VLINK is different from the other FIP events as > > it passes back > > > * a VPI instead of a FCF index. Check all attached SLI > > ports for a > > > * matching VPI */ > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > > + d = hw->domains[i]; > > > if (d != NULL) { > > > ocs_sport_t *sport = NULL; > > > > > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > > status, > > > ocs_hw_io_t *io_next = NULL; > > > uint64_t ticks_current = ocs_get_os_ticks(); > > > uint32_t sec_elapsed; > > > + ocs_hw_rtn_e rc; > > > > > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t > > *)mqe; > > > > > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > > status, > > > > > > /* loop through active WQE list and check for timeouts */ > > > ocs_lock(&hw->io_lock); > > > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > > - sec_elapsed = ((ticks_current - io->submit_ticks) > > / ocs_get_os_tick_freq()); > > > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > > + sec_elapsed = ((ticks_current - io->submit_ticks) / > > ocs_get_os_tick_freq()); > > > > > > - /* > > > - * If elapsed time > timeout, abort it. No need to > > check type since > > > - * it wouldn't be on this list unless it was a > > target WQE > > > - */ > > > - if (sec_elapsed > io->tgt_wqe_timeout) { > > > - ocs_log_test(hw->os, "IO timeout xri=0x%x > > tag=0x%x type=%d\n", > > > - io->indicator, io->reqtag, > > io->type); > > > + /* > > > + * If elapsed time > timeout, abort it. No need to check > > type since > > > + * it wouldn't be on this list unless it was a target WQE > > > + */ > > > + if (sec_elapsed > io->tgt_wqe_timeout) { > > > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x > > type=%d\n", > > > + io->indicator, io->reqtag, io->type); > > > > > > - /* remove from active_wqe list so won't > > try to abort again */ > > > - ocs_list_remove(&hw->io_timed_wqe, io); > > > + /* remove from active_wqe list so won't try to > > abort again */ > > > + ocs_list_remove(&hw->io_timed_wqe, io); > > > > > > - /* save status of "timed out" for when > > abort completes */ > > > - io->status_saved = 1; > > > - io->saved_status = > > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > > - io->saved_ext = 0; > > > - io->saved_len = 0; > > > + /* save status of "timed out" for when abort > > completes */ > > > + io->status_saved = 1; > > > + io->saved_status = > > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > > + io->saved_ext = 0; > > > + io->saved_len = 0; > > > > > > - /* now abort outstanding IO */ > > > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > > + /* now abort outstanding IO */ > > > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > > + if (rc) { > > > + ocs_log_test(hw->os, > > > + "abort failed xri=%#x tag=%#x > > rc=%d\n", > > > + io->indicator, io->reqtag, rc); > > > } > > > - /* > > > - * need to go through entire list since each IO > > could have a > > > - * different timeout value > > > - */ > > > } > > > + /* > > > + * need to go through entire list since each IO could have > > a > > > + * different timeout value > > > + */ > > > + } > > > ocs_unlock(&hw->io_lock); > > > > > > /* if we're not in the middle of shutting down, schedule next > > timer */ > > > > > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > default_lengths[QTOP_CQ] = len; > > > break; > > > } > > > + > > > + if (!eq || !next_qt) { > > > + goto fail; > > > + } > > > > > > /* If this CQ is for MRQ, then delay the creation > > */ > > > if (!use_mrq || next_qt->entry != QTOP_RQ) { > > > cq = hw_new_cq(eq, len); > > > if (cq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > } > > > break; > > > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > hw_queue_teardown(hw); > > > return OCS_HW_RTN_NO_MEMORY; > > > } > > > + > > > + if (cq == NULL) > > > + goto fail; > > > > > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + > > qt->ulp); > > > if (wq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > > > > /* Place this WQ on the EQ WQ array */ > > > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > break; > > > } > > > > > > + if (cq == NULL) > > > + goto fail; > > > + > > > mq = hw_new_mq(cq, len); > > > if (mq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > break; > > > > > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > > > } > > > > > > return OCS_HW_RTN_SUCCESS; > > > +fail: > > > + hw_queue_teardown(hw); > > > + return OCS_HW_RTN_NO_MEMORY; > > > > > > } > > > > > > @@ -737,8 +747,9 @@ error: > > > for (i = 0; i < num_rq_pairs; i++) { > > > if (rqs[i] != NULL) { > > > if (rqs[i]->rq_tracker != NULL) { > > > - ocs_free(hw->os, rq->rq_tracker, > > > - sizeof(ocs_hw_sequence_t*) * > > rq->entry_count); > > > + ocs_free(hw->os, rqs[i]->rq_tracker, > > > + sizeof(ocs_hw_sequence_t*) * > > > + rqs[i]->entry_count); > > > } > > > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > > > } > > > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > > > void > > > hw_del_rq(hw_rq_t *rq) > > > { > > > - ocs_hw_t *hw = rq->cq->eq->hw; > > > > > > if (rq != NULL) { > > > + ocs_hw_t *hw = rq->cq->eq->hw; > > > /* Free RQ tracker */ > > > if (rq->rq_tracker != NULL) { > > > ocs_free(hw->os, rq->rq_tracker, > > sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > > > > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, > > ocs_ioctl_elxu_mbox_ > > > * 6. ioctl code releases the lock > > > */ > > > mtx_lock(&ocs->dbg_lock); > > > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > > - __ocs_ioctl_mbox_cb, ocs); > > > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > > + __ocs_ioctl_mbox_cb, ocs)) { > > > + > > > + device_printf(ocs->dev, "%s: command- %x failed\n", > > __func__, > > > + ((sli4_mbox_command_header_t > > *)mcmd->payload)->command); > > > + } > > > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > > mtx_unlock(&ocs->dbg_lock); > > > > > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t > > *)mcmd->payload)->command > > > > > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char > > *value) > > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > > /* Undefined failure */ > > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > > - rc = -ENXIO; > > > + return -ENXIO; > > > } > > > if (result.status == 0) { > > > /* Success. */ > > > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char > > *value > > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > > /* Undefined failure */ > > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > > - rc = -ENXIO; > > > + return -ENXIO; > > > } > > > if (result.status == 0) { > > > /* Success. */ > > > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > > char *wwpn_p = NULL; > > > char *wwnn_p = NULL; > > > int32_t rc = -1; > > > - int wwpn; > > > - int wwnn; > > > + int wwpn = 0; > > > + int wwnn = 0; > > > int i; > > > > > > /* This is a read-modify-write operation, so first we have to read > > > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > > wwnn_p = wwn_p; > > > } > > > > > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > > > - wwnn = ocs_strcmp(wwnn_p, "NA"); > > > + if (wwpn_p != NULL) { > > > + wwpn = ocs_strcmp(wwpn_p, "NA"); > > > + } > > > + > > > + if (wwnn_p != NULL) { > > > + wwnn = ocs_strcmp(wwnn_p, "NA"); > > > + } > > > > > > /* Parse the new WWPN */ > > > if ((wwpn_p != NULL) && (wwpn != 0)) { > > > > > > Modified: head/sys/dev/ocs_fc/ocs_node.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > > > > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > > > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > > > - max_xfer_size = max_sge * num_sgl; > > > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > > > } else { > > > max_xfer_size = 65536; > > > } > > > > > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > > > } > > > > > > ocs_cam_detach(ocs); > > > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > > > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > > > > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > > > if (bus_dmamap_destroy(ocs->buf_dmat, > > io->tgt_io.dmap)) { > > > > > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > > > ocs_node_free_pool(ocs); > > > } > > > > > > - if (rq_threads_created) { > > > - ocs_xport_rq_threads_teardown(xport); > > > - } > > > - > > > return -1; > > > } > > > > > > > > > Modified: head/sys/dev/ocs_fc/sli4.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, > > size > > > } > > > } > > > break; > > > - default: > > > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", > > if_type); > > > - return -1; > > > - } > > > + } > > > > > > return (sli_config_off + cmd_size); > > > } > > > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], > > uin > > > return -1; > > > } > > > > > > + memset(&dma, 0, sizeof(dma)); > > > + > > > /* Align the queue DMA memory */ > > > for (i = 0; i < num_cqs; i++) { > > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, > > SLI4_CQE_BYTES, > > > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > > > } > > > > > > if (q->dma.virt != NULL) { > > > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > > > + ocs_memset(q->dma.virt, 0, (q->size * > > (uint64_t)q->length)); > > > } > > > > > > ocs_unlock(&q->lock); > > > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t > > num_rq_pair > > > ocs_dma_t dma; > > > sli4_res_common_create_queue_set_t *rsp = NULL; > > > sli4_req_fcoe_rq_create_v2_t *req = NULL; > > > + > > > + ocs_memset(&dma, 0, sizeof(dma)); > > > > > > for (i = 0; i < (num_rq_pairs * 2); i++) { > > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, > > SLI4_FCOE_RQE_SIZE, > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 13:48:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EFCC14B636E; Fri, 25 Jan 2019 13:48:47 +0000 (UTC) (envelope-from avos@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 03ABA84327; Fri, 25 Jan 2019 13:48:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E77748ECF; Fri, 25 Jan 2019 13:48:46 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PDmkoI088944; Fri, 25 Jan 2019 13:48:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PDmfkG088912; Fri, 25 Jan 2019 13:48:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901251348.x0PDmfkG088912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 25 Jan 2019 13:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343427 - in head: share/man/man4 sys/amd64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/ath_hal_ar5416 sys/powerpc/conf sys/sparc64/conf tools/tools/ath/ath_ee_9300_print tool... X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/ath_hal_ar5416 sys/powerpc/conf sys/sparc64/conf tools/tools/ath/ath_ee_9300_print tools/tools/ath/athaggrstats ... X-SVN-Commit-Revision: 343427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03ABA84327 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:48:47 -0000 Author: avos Date: Fri Jan 25 13:48:40 2019 New Revision: 343427 URL: https://svnweb.freebsd.org/changeset/base/343427 Log: Garbage collect AH_SUPPORT_AR5416 config option. It does nothing since r318857. Modified: head/share/man/man4/ath.4 head/share/man/man4/ath_hal.4 head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ERL head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/std.AR_MIPS_BASE head/sys/modules/ath_hal_ar5416/Makefile head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/sparc64/conf/GENERIC head/tools/tools/ath/ath_ee_9300_print/Makefile head/tools/tools/ath/athaggrstats/Makefile head/tools/tools/ath/athdecode/Makefile head/tools/tools/ath/athkey/Makefile head/tools/tools/ath/athpoke/Makefile head/tools/tools/ath/athprom/Makefile head/tools/tools/ath/athradar/Makefile head/tools/tools/ath/athratestats/Makefile head/tools/tools/ath/athregs/Makefile head/tools/tools/ath/athspectral/Makefile head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athsurvey/Makefile head/tools/tools/nanobsd/pcengines/ALIX_DSK Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Fri Jan 25 11:46:07 2019 (r343426) +++ head/share/man/man4/ath.4 Fri Jan 25 13:48:40 2019 (r343427) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 14, 2014 +.Dd January 25, 2019 .Dt ATH 4 .Os .Sh NAME @@ -42,7 +42,6 @@ kernel configuration file: .Cd "device ath" .Cd "device ath_pci" .Cd "device ath_hal" -.Cd "options AH_SUPPORT_AR5416" .Cd "device ath_rate_sample" .Cd "device wlan" .Ed Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Fri Jan 25 11:46:07 2019 (r343426) +++ head/share/man/man4/ath_hal.4 Fri Jan 25 13:48:40 2019 (r343427) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd July 22, 2013 +.Dd January 25, 2019 .Dt ATH_HAL 4 .Os .Sh NAME @@ -36,7 +36,6 @@ .Nd "Atheros Hardware Access Layer (HAL)" .Sh SYNOPSIS .Cd "device ath_hal" -.Cd "options AH_SUPPORT_AR5416" or .Cd "device ath_ar5210" .Cd "device ath_ar5211" @@ -57,12 +56,11 @@ or .Cd "device ath_ar9285" .Cd "device ath_ar9287" .Cd "device ath_ar9300" -.Cd "options AH_SUPPORT_AR5416" .Sh DESCRIPTION The hal provides hardware support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425, -AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287, -AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 +AR5413, AR5416, AR5418, AR5424, AR9130, AR9160, AR9220, AR9280, AR9285, +AR9287, AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 chips (and companion RF/baseband parts). This code is part of the .Xr ath 4 @@ -71,11 +69,6 @@ over the set of chips supported. Selecting .Nm enables support for all PCI and Cardbus devices. -Note this includes AR5416, AR5418, AR9130, AR9160, AR9220, AR9280, AR9285 -and AR9287 devices and must be accompanied by the -AH_SUPPORT_AR5416 -option to enable the extended hardware descriptor format used by -AR5416 and later devices. .Pp Some devices come in Cardbus/MiniPCI/PCI format. Others (for example AR2413, AR2427, AR5418, AR9280, AR9285, AR9287) come in Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/amd64/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -293,7 +293,6 @@ device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/conf/NOTES Fri Jan 25 13:48:40 2019 (r343427) @@ -2121,7 +2121,6 @@ device ath_hal # pci/cardbus chip support #device ath_rf5112 #device ath_rf5413 #device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors # All of the AR5212 parts have a problem when paired with the AR71xx # CPUS. These parts have a bug that triggers a fatal bus error on the AR71xx # only. Details of the exact nature of the bug are sketchy, but some can be Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/conf/options Fri Jan 25 13:48:40 2019 (r343427) @@ -828,7 +828,6 @@ ATH_DEBUG_ALQ opt_ath.h ATH_KTR_INTR_DEBUG opt_ath.h # options for the Atheros hal -AH_SUPPORT_AR5416 opt_ah.h # XXX For now, this breaks non-AR9130 chipsets, so only use it # XXX when actually targeting AR9130. AH_SUPPORT_AR9130 opt_ah.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/i386/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -289,7 +289,6 @@ device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/ERL Fri Jan 25 13:48:40 2019 (r343427) @@ -144,7 +144,6 @@ device wlan_amrr # AMRR transmit rate control algorit #device ath # Atheros NIC's #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support -#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_rate_sample # SampleRate tx rate control for ath # Pseudo devices. Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/OCTEON1 Fri Jan 25 13:48:40 2019 (r343427) @@ -177,7 +177,6 @@ device wlan_amrr # AMRR transmit rate control algorit device ath # Atheros NIC's device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath device ral # Ralink Technology RT2500 wireless NICs. Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/PB92 Fri Jan 25 13:48:40 2019 (r343427) @@ -84,7 +84,6 @@ options ATH_ENABLE_11N options ATH_DIAGAPI # device ath_hal -options AH_SUPPORT_AR5416 options AH_DEBUG options AH_DEBUG_ALQ Modified: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- head/sys/mips/conf/std.AR_MIPS_BASE Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/std.AR_MIPS_BASE Fri Jan 25 13:48:40 2019 (r343427) @@ -55,7 +55,6 @@ options ATH_ENABLE_DFS options AH_DEBUG_ALQ options AH_DEBUG -options AH_SUPPORT_AR5416 options AH_AR5416_INTERRUPT_MITIGATION options AH_RXCFG_SDMAMW_4BYTES Modified: head/sys/modules/ath_hal_ar5416/Makefile ============================================================================== --- head/sys/modules/ath_hal_ar5416/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/modules/ath_hal_ar5416/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -40,9 +40,6 @@ SRCS= ah_osdep_ar5416.c # # AR5416, AR9130, AR9160, AR9220, AR9280, AR9285, AR9287 support. - -# Note enabling this support requires defining AH_SUPPORT_AR5416 -# in opt_ah.h so the 11n tx/rx descriptor format is handled. # # NB: 9160 depends on 5416 but 5416 does not require 9160 # Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/powerpc/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -200,7 +200,6 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 # Misc device iicbus # I2C bus code Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/powerpc/conf/GENERIC64 Fri Jan 25 13:48:40 2019 (r343427) @@ -214,7 +214,6 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 # FireWire support device firewire # FireWire bus code Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/sparc64/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -225,7 +225,6 @@ device wlan_amrr # AMRR transmit rate control algorit device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # Atheros HAL (Hardware Access Layer) -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath # Pseudo devices. Modified: head/tools/tools/ath/ath_ee_9300_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,7 +11,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athaggrstats/Makefile ============================================================================== --- head/tools/tools/ath/athaggrstats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athaggrstats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -18,7 +18,6 @@ LIBADD+= bsdstat opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athdecode/Makefile ============================================================================== --- head/tools/tools/ath/athdecode/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athdecode/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -17,7 +17,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athkey/Makefile ============================================================================== --- head/tools/tools/ath/athkey/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athkey/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -10,7 +10,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athpoke/Makefile ============================================================================== --- head/tools/tools/ath/athpoke/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athpoke/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -17,7 +17,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athprom/Makefile ============================================================================== --- head/tools/tools/ath/athprom/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athprom/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -14,7 +14,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h CFLAGS+=-DDIR_TEMPLATE='"${TEMPLATEDIR}"' Modified: head/tools/tools/ath/athradar/Makefile ============================================================================== --- head/tools/tools/ath/athradar/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athradar/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athratestats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -19,7 +19,6 @@ CFLAGS+=-DATH_SUPPORT_TDMA opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athregs/Makefile ============================================================================== --- head/tools/tools/ath/athregs/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athregs/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -19,7 +19,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athspectral/Makefile ============================================================================== --- head/tools/tools/ath/athspectral/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athspectral/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athstats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -30,7 +30,6 @@ LIBADD= bsdstat opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athsurvey/Makefile ============================================================================== --- head/tools/tools/ath/athsurvey/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athsurvey/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jan 25 13:48:40 2019 (r343427) @@ -62,7 +62,6 @@ device wlan_amrr device an device ath device ath_hal -options AH_SUPPORT_AR5416 device ath_rate_sample device wi device loop From owner-svn-src-all@freebsd.org Fri Jan 25 13:55:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE5B14B69F9; Fri, 25 Jan 2019 13:55:18 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9292984A03; Fri, 25 Jan 2019 13:55:17 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id v1-v6so8474053ljd.0; Fri, 25 Jan 2019 05:55:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BWAOJUdGRzA68AYFUaWyeHGnKWknI5G/2Af/Z5IE6v0=; b=KJ/U4RuBHNomT7FV4sf4heAfaPqvkSboLsZqSzILeSXOc9LSbYovNbACK0ATixoYry EXQ6Z1yu5l6lffPexUt8K3Vrx+bwHAa1D7YLZUHUN4L4R/ni48WyCUImPjwYeid5jqpR 8yxrMS6PcXp58gxwoxtB8Ds1q4QGSmofezacjUv9Yj41EkpJ982UWpxWCwo2B5zzbFRr AZRhytz0cEv53daGr/y70LLF5UPwdclEyIUupK9NOfqQBuCBjk0cYYa7rqwy7wRpcUJQ kpXWvbv+pyg9wiqYMYMofQS5oWjnHQ+VWLnspoGA1lDQYIOJhDyRcPlCBRsANEhU05IO uMCw== X-Gm-Message-State: AJcUukeLgZelVhKN/MdEzK3jF+VHbWkAo8yCR7Sa3ZRLqLiuumTOQqc1 Pu30eob4Qp06CrUmhy4VmcwuvQnq X-Google-Smtp-Source: ALg8bN4OrGU/Ju5xobMfkUuosSJLHGGz1OAOiS3VS/QGTyu1rYatcjhDWDwdBgvIuBdSQPO75dYDrA== X-Received: by 2002:a2e:20f:: with SMTP id 15-v6mr9290759ljc.172.1548424105885; Fri, 25 Jan 2019 05:48:25 -0800 (PST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id o5-v6sm1475533ljh.75.2019.01.25.05.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 05:48:25 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id q2-v6so8413851lji.10; Fri, 25 Jan 2019 05:48:24 -0800 (PST) X-Received: by 2002:a2e:710a:: with SMTP id m10-v6mr8836459ljc.66.1548424104712; Fri, 25 Jan 2019 05:48:24 -0800 (PST) MIME-Version: 1.0 References: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 25 Jan 2019 07:47:52 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc To: "Rodney W. Grimes" Cc: Ram Kishore Vegesna , Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9292984A03 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:55:18 -0000 On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes wrote: > > > Hi Rodney, > > > > I fixed many coverity tool warnings as part of this commit. Adding all the > > warnings and fix details seemed over kill. > > It seems like overkill when your commiting, but if you have > have to go digging through commit history trying to find > something it helps a great deal to have good information > present there. > > You do not need to include the output from coverty, > but some amount of detail is very helpful. > We do have a tendency to note CIDs in commit messages and that's pretty helpful -- I don't know that omitting them will generally ruffle any feathers, though. From owner-svn-src-all@freebsd.org Fri Jan 25 13:57:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A7F14B6B21; Fri, 25 Jan 2019 13:57:11 +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 1C12484C31; Fri, 25 Jan 2019 13:57:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B7039088; Fri, 25 Jan 2019 13:57:11 +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 x0PDvAAp094303; Fri, 25 Jan 2019 13:57:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PDvAJl094298; Fri, 25 Jan 2019 13:57:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251357.x0PDvAJl094298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 13:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343428 - in head/sys/netinet: . cc tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 343428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C12484C31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:57:11 -0000 Author: tuexen Date: Fri Jan 25 13:57:09 2019 New Revision: 343428 URL: https://svnweb.freebsd.org/changeset/base/343428 Log: Fix a bug in the restart window computation of TCP New Reno When implementing support for IW10, an update in the computation of the restart window used after an idle phase was missed. To minimize code duplication, implement the logic in tcp_compute_initwnd() and call it. This fixes a bug in NewReno, which was not aware of IW10. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18940 Modified: head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/cc/cc_newreno.c Fri Jan 25 13:57:09 2019 (r343428) @@ -199,7 +199,7 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type static void newreno_after_idle(struct cc_var *ccv) { - int rw; + uint32_t rw; /* * If we've been idle for more than one retransmit timeout the old @@ -214,11 +214,7 @@ newreno_after_idle(struct cc_var *ccv) * * See RFC5681 Section 4.1. "Restarting Idle Connections". */ - if (V_tcp_do_rfc3390) - rw = min(4 * CCV(ccv, t_maxseg), - max(2 * CCV(ccv, t_maxseg), 4380)); - else - rw = CCV(ccv, t_maxseg) * 2; + rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp)); CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_input.c Fri Jan 25 13:57:09 2019 (r343428) @@ -371,31 +371,14 @@ cc_conn_init(struct tcpcb *tp) /* * Set the initial slow-start flight size. * - * RFC5681 Section 3.1 specifies the default conservative values. - * RFC3390 specifies slightly more aggressive values. - * RFC6928 increases it to ten segments. - * Support for user specified value for initial flight size. - * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely * requiring us to be cautious. */ if (tp->snd_cwnd == 1) tp->snd_cwnd = maxseg; /* SYN(-ACK) lost */ - else if (V_tcp_initcwnd_segments) - tp->snd_cwnd = min(V_tcp_initcwnd_segments * maxseg, - max(2 * maxseg, V_tcp_initcwnd_segments * 1460)); - else if (V_tcp_do_rfc3390) - tp->snd_cwnd = min(4 * maxseg, max(2 * maxseg, 4380)); - else { - /* Per RFC5681 Section 3.1 */ - if (maxseg > 2190) - tp->snd_cwnd = 2 * maxseg; - else if (maxseg > 1095) - tp->snd_cwnd = 3 * maxseg; - else - tp->snd_cwnd = 4 * maxseg; - } + else + tp->snd_cwnd = tcp_compute_initwnd(maxseg); if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); @@ -3817,4 +3800,31 @@ tcp_compute_pipe(struct tcpcb *tp) return (tp->snd_max - tp->snd_una + tp->sackhint.sack_bytes_rexmit - tp->sackhint.sacked_bytes); +} + +uint32_t +tcp_compute_initwnd(uint32_t maxseg) +{ + /* + * Calculate the Initial Window, also used as Restart Window + * + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. + * RFC6928 increases it to ten segments. + * Support for user specified value for initial flight size. + */ + if (V_tcp_initcwnd_segments) + return min(V_tcp_initcwnd_segments * maxseg, + max(2 * maxseg, V_tcp_initcwnd_segments * 1460)); + else if (V_tcp_do_rfc3390) + return min(4 * maxseg, max(2 * maxseg, 4380)); + else { + /* Per RFC5681 Section 3.1 */ + if (maxseg > 2190) + return (2 * maxseg); + else if (maxseg > 1095) + return (3 * maxseg); + else + return (4 * maxseg); + } } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_stacks/rack.c Fri Jan 25 13:57:09 2019 (r343428) @@ -1425,21 +1425,9 @@ rack_cc_after_idle(struct tcpcb *tp, int reduce_larges if (tp->snd_cwnd == 1) i_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ - else if (V_tcp_initcwnd_segments) - i_cwnd = min((V_tcp_initcwnd_segments * tp->t_maxseg), - max(2 * tp->t_maxseg, V_tcp_initcwnd_segments * 1460)); - else if (V_tcp_do_rfc3390) - i_cwnd = min(4 * tp->t_maxseg, - max(2 * tp->t_maxseg, 4380)); - else { - /* Per RFC5681 Section 3.1 */ - if (tp->t_maxseg > 2190) - i_cwnd = 2 * tp->t_maxseg; - else if (tp->t_maxseg > 1095) - i_cwnd = 3 * tp->t_maxseg; - else - i_cwnd = 4 * tp->t_maxseg; - } + else + i_cwnd = tcp_compute_initwnd(tcp_maxseg(tp)); + if (reduce_largest) { /* * Do we reduce the largest cwnd to make Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_var.h Fri Jan 25 13:57:09 2019 (r343428) @@ -942,6 +942,7 @@ void tcp_sack_partialack(struct tcpcb *, struct tcphd void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); int tcp_compute_pipe(struct tcpcb *); +uint32_t tcp_compute_initwnd(uint32_t); void tcp_sndbuf_autoscale(struct tcpcb *, struct socket *, uint32_t); struct mbuf * tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, From owner-svn-src-all@freebsd.org Fri Jan 25 14:00:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3751314B6CD6; Fri, 25 Jan 2019 14:00:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2EAF84F45; Fri, 25 Jan 2019 14:00:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PE0lll088750; Fri, 25 Jan 2019 06:00:47 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PE0lrG088749; Fri, 25 Jan 2019 06:00:47 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251400.x0PE0lrG088749@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: To: Kyle Evans Date: Fri, 25 Jan 2019 06:00:47 -0800 (PST) CC: "Rodney W. Grimes" , Ram Kishore Vegesna , Ram Kishore Vegesna , src-committers , 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: A2EAF84F45 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 14:00:50 -0000 > On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes > wrote: > > > > > Hi Rodney, > > > > > > I fixed many coverity tool warnings as part of this commit. Adding all the > > > warnings and fix details seemed over kill. > > > > It seems like overkill when your commiting, but if you have > > have to go digging through commit history trying to find > > something it helps a great deal to have good information > > present there. > > > > You do not need to include the output from coverty, > > but some amount of detail is very helpful. > > > > We do have a tendency to note CIDs in commit messages and that's pretty > helpful -- I don't know that omitting them will generally ruffle any > feathers, though. yes, CIDs are fine, I should of clarified that, I would not want to see the full output from coverty in a commit message unless it was needed to express what was fixed and why in some way. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 14:46:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF4714B7D09; Fri, 25 Jan 2019 14:46:14 +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 20B9886AC9; Fri, 25 Jan 2019 14:46:14 +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 12C96995F; Fri, 25 Jan 2019 14:46:14 +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 x0PEkD8A020319; Fri, 25 Jan 2019 14:46:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PEkDKi020318; Fri, 25 Jan 2019 14:46:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901251446.x0PEkDKi020318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 25 Jan 2019 14:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343429 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Commit-Revision: 343429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20B9886AC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 14:46:14 -0000 Author: emaste Date: Fri Jan 25 14:46:13 2019 New Revision: 343429 URL: https://svnweb.freebsd.org/changeset/base/343429 Log: clang: default to DWARF 4 as of FreeBSD 13 FreeBSD previously defaulted to DWARF 2 because several tools (gdb, ctfconvert, etc.) did not support later versions. These have either been fixed or are deprecated. Note that gdb 6 still exists but has been moved out of $PATH into /usr/libexec and is intended only for use by crashinfo(8). The kernel build sets the DWARF version explicitly via -gdwarf2, so this should have no effect there. PR: 234887 [exp-run] Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17930 Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 25 13:57:09 2019 (r343428) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 25 14:46:13 2019 (r343429) @@ -357,6 +357,13 @@ ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibT return ToolChain::CST_Libstdcxx; } +unsigned FreeBSD::GetDefaultDwarfVersion() const { + // Default to use DWARF 2 before FreeBSD 13. + if (getTriple().getOSMajorVersion() < 13) + return 2; + return 4; +} + void FreeBSD::addLibStdCxxIncludePaths( const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const { Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Fri Jan 25 13:57:09 2019 (r343428) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Fri Jan 25 14:46:13 2019 (r343429) @@ -70,7 +70,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic const llvm::opt::ArgList &Args) const override; bool isPIEDefault() const override; SanitizerMask getSupportedSanitizers() const override; - unsigned GetDefaultDwarfVersion() const override { return 2; } + unsigned GetDefaultDwarfVersion() const override; // Until dtrace (via CTF) and LLDB can deal with distributed debug info, // FreeBSD defaults to standalone/full debug info. bool GetDefaultStandaloneDebug() const override { return true; } From owner-svn-src-all@freebsd.org Fri Jan 25 15:02:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163B714B87B0; Fri, 25 Jan 2019 15:02:20 +0000 (UTC) (envelope-from gallatin@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 7A10487A53; Fri, 25 Jan 2019 15:02:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 662459BA3; Fri, 25 Jan 2019 15:02:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PF2Jln030167; Fri, 25 Jan 2019 15:02:19 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PF2JJv030166; Fri, 25 Jan 2019 15:02:19 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901251502.x0PF2JJv030166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 25 Jan 2019 15:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343430 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A10487A53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:02:20 -0000 Author: gallatin Date: Fri Jan 25 15:02:18 2019 New Revision: 343430 URL: https://svnweb.freebsd.org/changeset/base/343430 Log: Fix an iflib driver unload panic introduced in r343085 The new loop to sync and unload descriptors was indexed by "i", rather than "j". The panic was caused by "i" being advanced rather than "j", and eventually becoming out of bounds. Reviewed by: kib MFC after: 3 days Sponsored by: Netflix Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Jan 25 14:46:13 2019 (r343429) +++ head/sys/net/iflib.c Fri Jan 25 15:02:18 2019 (r343430) @@ -2197,17 +2197,17 @@ iflib_rx_sds_free(iflib_rxq_t rxq) fl = &rxq->ifr_fl[i]; if (fl->ifl_desc_tag != NULL) { if (fl->ifl_sds.ifsd_map != NULL) { - for (j = 0; j < fl->ifl_size; i++) { - if (fl->ifl_sds.ifsd_map[i] == + for (j = 0; j < fl->ifl_size; j++) { + if (fl->ifl_sds.ifsd_map[j] == NULL) - continue; + continue; bus_dmamap_sync( fl->ifl_desc_tag, - fl->ifl_sds.ifsd_map[i], + fl->ifl_sds.ifsd_map[j], BUS_DMASYNC_POSTREAD); bus_dmamap_unload( fl->ifl_desc_tag, - fl->ifl_sds.ifsd_map[i]); + fl->ifl_sds.ifsd_map[j]); } } bus_dma_tag_destroy(fl->ifl_desc_tag); From owner-svn-src-all@freebsd.org Fri Jan 25 15:21:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA2A14B8E31; Fri, 25 Jan 2019 15:21:43 +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 77D9E888F9; Fri, 25 Jan 2019 15:21:43 +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 6B15F9FFD; Fri, 25 Jan 2019 15:21:43 +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 x0PFLhvb040512; Fri, 25 Jan 2019 15:21:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFLhnd040511; Fri, 25 Jan 2019 15:21:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251521.x0PFLhnd040511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343431 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 343431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77D9E888F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:21:44 -0000 Author: tuexen Date: Fri Jan 25 15:21:42 2019 New Revision: 343431 URL: https://svnweb.freebsd.org/changeset/base/343431 Log: MFC r338137: Fix the inheritance of IPv6 level socket options on TCP sockets. This was broken for IPv6 listening socket, which are not IPV6_ONLY, and the accepted TCP connection was using IPv4. Reviewed by: bz@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16792 Modified: stable/11/sys/netinet/tcp_syncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Fri Jan 25 15:02:18 2019 (r343430) +++ stable/11/sys/netinet/tcp_syncache.c Fri Jan 25 15:21:42 2019 (r343431) @@ -761,10 +761,9 @@ syncache_socket(struct syncache *sc, struct socket *ls goto abort; } #ifdef INET6 - if (sc->sc_inc.inc_flags & INC_ISIPV6) { + if (inp->inp_vflag & INP_IPV6PROTO) { struct inpcb *oinp = sotoinpcb(lso); - struct in6_addr laddr6; - struct sockaddr_in6 sin6; + /* * Inherit socket options from the listening socket. * Note that in6p_inputopts are not (and should not be) @@ -778,6 +777,11 @@ syncache_socket(struct syncache *sc, struct socket *ls if (oinp->in6p_outputopts) inp->in6p_outputopts = ip6_copypktopts(oinp->in6p_outputopts, M_NOWAIT); + } + + if (sc->sc_inc.inc_flags & INC_ISIPV6) { + struct in6_addr laddr6; + struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(sin6); From owner-svn-src-all@freebsd.org Fri Jan 25 15:25:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE82C14B904B; Fri, 25 Jan 2019 15:25:54 +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 367FD88B56; Fri, 25 Jan 2019 15:25:54 +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 11352A034; Fri, 25 Jan 2019 15:25:54 +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 x0PFPrir041484; Fri, 25 Jan 2019 15:25:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFPrIe041480; Fri, 25 Jan 2019 15:25:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251525.x0PFPrIe041480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343432 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 343432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 367FD88B56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:25:55 -0000 Author: tuexen Date: Fri Jan 25 15:25:53 2019 New Revision: 343432 URL: https://svnweb.freebsd.org/changeset/base/343432 Log: MFC r338138: Enabling the IPPROTO_IPV6 level socket option IPV6_USE_MIN_MTU on a TCP socket resulted in sending fragmented IPV6 packets. This is fixes by reducing the MSS to the appropriate value. In addtion, if the socket option is set before the handshake happens, announce this MSS to the peer. This is not stricly required, but done since TCP is conservative. PR: 173444 Reviewed by: bz@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16796 Modified: stable/11/sys/netinet/in_pcb.h stable/11/sys/netinet/tcp_input.c stable/11/sys/netinet/tcp_subr.c stable/11/sys/netinet/tcp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_pcb.h ============================================================================== --- stable/11/sys/netinet/in_pcb.h Fri Jan 25 15:21:42 2019 (r343431) +++ stable/11/sys/netinet/in_pcb.h Fri Jan 25 15:25:53 2019 (r343432) @@ -120,6 +120,7 @@ struct in_conninfo { * Flags for inc_flags. */ #define INC_ISIPV6 0x01 +#define INC_IPV6MINMTU 0x02 #define inc_isipv6 inc_flags /* temp compatibility */ #define inc_fport inc_ie.ie_fport Modified: stable/11/sys/netinet/tcp_input.c ============================================================================== --- stable/11/sys/netinet/tcp_input.c Fri Jan 25 15:21:42 2019 (r343431) +++ stable/11/sys/netinet/tcp_input.c Fri Jan 25 15:25:53 2019 (r343432) @@ -1080,6 +1080,8 @@ relocked: #ifdef INET6 if (isipv6) { inc.inc_flags |= INC_ISIPV6; + if (inp->inp_inc.inc_flags & INC_IPV6MINMTU) + inc.inc_flags |= INC_IPV6MINMTU; inc.inc6_faddr = ip6->ip6_src; inc.inc6_laddr = ip6->ip6_dst; } else Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Fri Jan 25 15:21:42 2019 (r343431) +++ stable/11/sys/netinet/tcp_subr.c Fri Jan 25 15:25:53 2019 (r343432) @@ -2429,6 +2429,9 @@ tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer")); + if (inc->inc_flags & INC_IPV6MINMTU) + return (IPV6_MMTU); + if (!IN6_IS_ADDR_UNSPECIFIED(&inc->inc6_faddr)) { in6_splitscope(&inc->inc6_faddr, &dst6, &scopeid); if (fib6_lookup_nh_ext(inc->inc_fibnum, &dst6, scopeid, 0, Modified: stable/11/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/11/sys/netinet/tcp_usrreq.c Fri Jan 25 15:21:42 2019 (r343431) +++ stable/11/sys/netinet/tcp_usrreq.c Fri Jan 25 15:25:53 2019 (r343432) @@ -1445,6 +1445,42 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt) if (inp->inp_vflag & INP_IPV6PROTO) { INP_WUNLOCK(inp); error = ip6_ctloutput(so, sopt); + /* + * In case of the IPV6_USE_MIN_MTU socket option, + * the INC_IPV6MINMTU flag to announce a corresponding + * MSS during the initial handshake. + * If the TCP connection is not in the front states, + * just reduce the MSS being used. + * This avoids the sending of TCP segments which will + * be fragmented at the IPv6 layer. + */ + if ((error == 0) && + (sopt->sopt_dir == SOPT_SET) && + (sopt->sopt_level == IPPROTO_IPV6) && + (sopt->sopt_name == IPV6_USE_MIN_MTU)) { + INP_WLOCK(inp); + if ((inp->inp_flags & + (INP_TIMEWAIT | INP_DROPPED))) { + INP_WUNLOCK(inp); + return (ECONNRESET); + } + inp->inp_inc.inc_flags |= INC_IPV6MINMTU; + tp = intotcpcb(inp); + if ((tp->t_state >= TCPS_SYN_SENT) && + (inp->inp_inc.inc_flags & INC_ISIPV6)) { + struct ip6_pktopts *opt; + + opt = inp->in6p_outputopts; + if ((opt != NULL) && + (opt->ip6po_minmtu == + IP6PO_MINMTU_ALL)) { + if (tp->t_maxseg > TCP6_MSS) { + tp->t_maxseg = TCP6_MSS; + } + } + } + INP_WUNLOCK(inp); + } } #endif /* INET6 */ #if defined(INET6) && defined(INET) From owner-svn-src-all@freebsd.org Fri Jan 25 15:39:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B4A14B94DE; Fri, 25 Jan 2019 15:39:34 +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 CC1EA89280; Fri, 25 Jan 2019 15:39:33 +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 BD836A1F3; Fri, 25 Jan 2019 15:39:33 +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 x0PFdXu9046732; Fri, 25 Jan 2019 15:39:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFdX6J046731; Fri, 25 Jan 2019 15:39:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251539.x0PFdX6J046731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343433 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 343433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC1EA89280 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:39:34 -0000 Author: tuexen Date: Fri Jan 25 15:39:33 2019 New Revision: 343433 URL: https://svnweb.freebsd.org/changeset/base/343433 Log: MFC r342857: Avoid overfow in vtruncbuf() Using daddr_t instead of int avoids trunclbn to become negative when it shouldn't. This isssue was found by running syzkaller. Reviewed by: mckusick, kib, markj Differential Revision: https://reviews.freebsd.org/D18763 Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Fri Jan 25 15:25:53 2019 (r343432) +++ stable/12/sys/kern/vfs_subr.c Fri Jan 25 15:39:33 2019 (r343433) @@ -1858,7 +1858,7 @@ vtruncbuf(struct vnode *vp, struct ucred *cred, off_t { struct buf *bp, *nbp; int anyfreed; - int trunclbn; + daddr_t trunclbn; struct bufobj *bo; CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__, From owner-svn-src-all@freebsd.org Fri Jan 25 15:40:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 453EB14B958E; Fri, 25 Jan 2019 15:40:52 +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 DD97689461; Fri, 25 Jan 2019 15:40:51 +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 B5407A20F; Fri, 25 Jan 2019 15:40:51 +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 x0PFepNT046987; Fri, 25 Jan 2019 15:40:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFept3046986; Fri, 25 Jan 2019 15:40:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251540.x0PFept3046986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343434 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 343434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD97689461 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:40:52 -0000 Author: tuexen Date: Fri Jan 25 15:40:51 2019 New Revision: 343434 URL: https://svnweb.freebsd.org/changeset/base/343434 Log: MFC r342857: Avoid overfow in vtruncbuf() Using daddr_t instead of int avoids trunclbn to become negative when it shouldn't. This isssue was found by running syzkaller. Reviewed by: mckusick, kib, markj Differential Revision: https://reviews.freebsd.org/D18763 Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Fri Jan 25 15:39:33 2019 (r343433) +++ stable/11/sys/kern/vfs_subr.c Fri Jan 25 15:40:51 2019 (r343434) @@ -1791,7 +1791,7 @@ vtruncbuf(struct vnode *vp, struct ucred *cred, off_t { struct buf *bp, *nbp; int anyfreed; - int trunclbn; + daddr_t trunclbn; struct bufobj *bo; CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__, From owner-svn-src-all@freebsd.org Fri Jan 25 15:44:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5F714B97FF; Fri, 25 Jan 2019 15:44:54 +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 C941989929; Fri, 25 Jan 2019 15:44:53 +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 B84F4A3AF; Fri, 25 Jan 2019 15:44:53 +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 x0PFir1v052127; Fri, 25 Jan 2019 15:44:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFirlL052126; Fri, 25 Jan 2019 15:44:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251544.x0PFirlL052126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343435 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 343435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C941989929 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:44:54 -0000 Author: tuexen Date: Fri Jan 25 15:44:53 2019 New Revision: 343435 URL: https://svnweb.freebsd.org/changeset/base/343435 Log: MFC r342879: Fix getsockopt() for IP_OPTIONS/IP_RETOPTS. r336616 copies inp->inp_options using the m_dup() function. However, this function expects an mbuf packet header at the beginning, which is not true in this case. Therefore, use m_copym() instead of m_dup(). This issue was found by syzkaller. Reviewed by: mmacy@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18753 Modified: stable/12/sys/netinet/ip_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_output.c ============================================================================== --- stable/12/sys/netinet/ip_output.c Fri Jan 25 15:40:51 2019 (r343434) +++ stable/12/sys/netinet/ip_output.c Fri Jan 25 15:44:53 2019 (r343435) @@ -1262,7 +1262,8 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) if (inp->inp_options) { struct mbuf *options; - options = m_dup(inp->inp_options, M_NOWAIT); + options = m_copym(inp->inp_options, 0, + M_COPYALL, M_NOWAIT); INP_RUNLOCK(inp); if (options != NULL) { error = sooptcopyout(sopt, From owner-svn-src-all@freebsd.org Fri Jan 25 15:46:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E97314B988A; Fri, 25 Jan 2019 15:46:31 +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 D954889A82; Fri, 25 Jan 2019 15:46: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 C6ACAA3B0; Fri, 25 Jan 2019 15:46: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 x0PFkUJx052253; Fri, 25 Jan 2019 15:46:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFkUHT052251; Fri, 25 Jan 2019 15:46:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251546.x0PFkUHT052251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343436 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 343436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D954889A82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:46:31 -0000 Author: tuexen Date: Fri Jan 25 15:46:30 2019 New Revision: 343436 URL: https://svnweb.freebsd.org/changeset/base/343436 Log: MFC r343089: Limit the user-controllable amount of memory the kernel allocates via IPPROTO_SCTP level socket options. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_constants.h stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_constants.h ============================================================================== --- stable/12/sys/netinet/sctp_constants.h Fri Jan 25 15:44:53 2019 (r343435) +++ stable/12/sys/netinet/sctp_constants.h Fri Jan 25 15:46:30 2019 (r343436) @@ -983,6 +983,9 @@ __FBSDID("$FreeBSD$"); ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ (((uint8_t *)&(a)->s_addr)[1] == 254)) +/* Maximum size of optval for IPPROTO_SCTP level socket options. */ +#define SCTP_SOCKET_OPTION_LIMIT (64 * 1024) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Fri Jan 25 15:44:53 2019 (r343435) +++ stable/12/sys/netinet/sctp_usrreq.c Fri Jan 25 15:46:30 2019 (r343436) @@ -6828,6 +6828,10 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt return (error); } optsize = sopt->sopt_valsize; + if (optsize > SCTP_SOCKET_OPTION_LIMIT) { + SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); + return (ENOBUFS); + } if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); if (optval == NULL) { From owner-svn-src-all@freebsd.org Fri Jan 25 15:48:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 876AA14B990F; Fri, 25 Jan 2019 15:48:01 +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 27A8B89BE8; Fri, 25 Jan 2019 15:48:01 +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 1A486A3B2; Fri, 25 Jan 2019 15:48:01 +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 x0PFm0uG052369; Fri, 25 Jan 2019 15:48:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PFm0Iq052368; Fri, 25 Jan 2019 15:48:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251548.x0PFm0Iq052368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 15:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343437 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 343437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27A8B89BE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:48:01 -0000 Author: tuexen Date: Fri Jan 25 15:48:00 2019 New Revision: 343437 URL: https://svnweb.freebsd.org/changeset/base/343437 Log: MFC r343089: Limit the user-controllable amount of memory the kernel allocates via IPPROTO_SCTP level socket options. This issue was found by running syzkaller. Modified: stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Fri Jan 25 15:46:30 2019 (r343436) +++ stable/11/sys/netinet/sctp_constants.h Fri Jan 25 15:48:00 2019 (r343437) @@ -977,6 +977,9 @@ __FBSDID("$FreeBSD$"); ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ (((uint8_t *)&(a)->s_addr)[1] == 254)) +/* Maximum size of optval for IPPROTO_SCTP level socket options. */ +#define SCTP_SOCKET_OPTION_LIMIT (64 * 1024) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Fri Jan 25 15:46:30 2019 (r343436) +++ stable/11/sys/netinet/sctp_usrreq.c Fri Jan 25 15:48:00 2019 (r343437) @@ -6812,6 +6812,10 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt return (error); } optsize = sopt->sopt_valsize; + if (optsize > SCTP_SOCKET_OPTION_LIMIT) { + SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); + return (ENOBUFS); + } if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); if (optval == NULL) { From owner-svn-src-all@freebsd.org Fri Jan 25 16:16:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CC5214BA88E; Fri, 25 Jan 2019 16:16:12 +0000 (UTC) (envelope-from takawata@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 E09EE8ADD8; Fri, 25 Jan 2019 16:16:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D3DACA8D6; Fri, 25 Jan 2019 16:16:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PGGBeD067755; Fri, 25 Jan 2019 16:16:11 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PGGBvL067751; Fri, 25 Jan 2019 16:16:11 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201901251616.x0PGGBvL067751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Fri, 25 Jan 2019 16:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343438 - in head: sys/dev/tpm usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: in head: sys/dev/tpm usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 343438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E09EE8ADD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 16:16:12 -0000 Author: takawata Date: Fri Jan 25 16:16:10 2019 New Revision: 343438 URL: https://svnweb.freebsd.org/changeset/base/343438 Log: Use ACPI TPM2 table to probe tpmtis and tpmcrb device. Differential Revision: https://reviews.freebsd.org/D18937 Modified: head/sys/dev/tpm/tpm20.h head/sys/dev/tpm/tpm_crb.c head/sys/dev/tpm/tpm_tis.c head/usr.sbin/acpi/acpidump/acpi.c Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm20.h Fri Jan 25 16:16:10 2019 (r343438) @@ -93,6 +93,12 @@ __FBSDID("$FreeBSD$"); #define TPM_CDEV_NAME "tpm0" #define TPM_CDEV_PERM_FLAG 0600 + +#define TPM2_START_METHOD_ACPI 2 +#define TPM2_START_METHOD_TIS 6 +#define TPM2_START_METHOD_CRB 7 +#define TPM2_START_METHOD_CRB_ACPI 8 + struct tpm_sc { device_t dev; Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm_crb.c Fri Jan 25 16:16:10 2019 (r343438) @@ -104,27 +104,20 @@ char *tpmcrb_ids[] = {"MSFT0101", NULL}; static int tpmcrb_acpi_probe(device_t dev) { - struct resource *res; - int err, rid = 0; - uint32_t caps; - + int err; + ACPI_TABLE_TPM23 *tbl; + ACPI_STATUS status; err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmcrb_ids, NULL); if (err > 0) return (err); + /*Find TPM2 Header*/ + status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) &tbl); + if(ACPI_FAILURE(status) || + tbl->StartMethod != TPM2_START_METHOD_CRB) + err = ENXIO; - /* Check if device is in CRB mode */ - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) - return (ENXIO); - - caps = bus_read_4(res, TPM_CRB_INTF_ID); - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - - if ((caps & TPM_CRB_INTF_ID_TYPE) != TPM_CRB_INTF_ID_TYPE_CRB) - return (ENXIO); - device_set_desc(dev, "Trusted Platform Module 2.0, CRB mode"); - return (BUS_PROBE_DEFAULT); + return (err); } static ACPI_STATUS Modified: head/sys/dev/tpm/tpm_tis.c ============================================================================== --- head/sys/dev/tpm/tpm_tis.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm_tis.c Fri Jan 25 16:16:10 2019 (r343438) @@ -100,26 +100,21 @@ char *tpmtis_ids[] = {"MSFT0101", NULL}; static int tpmtis_acpi_probe(device_t dev) { - struct resource *res; - int err, rid = 0; - uint32_t caps; + int err; + ACPI_TABLE_TPM23 *tbl; + ACPI_STATUS status; err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmtis_ids, NULL); if (err > 0) return (err); + /*Find TPM2 Header*/ + status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) &tbl); + if(ACPI_FAILURE(status) || + tbl->StartMethod != TPM2_START_METHOD_TIS) + err = ENXIO; - /* Check if device is in TPM 2.0 TIS mode */ - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) - return (ENXIO); - - caps = bus_read_4(res, TPM_INTF_CAPS); - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - if ((caps & TPM_INTF_CAPS_VERSION) != TPM_INTF_CAPS_TPM20) - return (ENXIO); - device_set_desc(dev, "Trusted Platform Module 2.0, FIFO mode"); - return (BUS_PROBE_DEFAULT); + return (err); } static int Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 16:16:10 2019 (r343438) @@ -970,7 +970,18 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } - +static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp) +{ + ACPI_TABLE_TPM2 *tpm2; + + printf (BEGIN_COMMENT); + acpi_print_sdt(sdp); + tpm2 = (ACPI_TABLE_TPM2 *) sdp; + printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress); + printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); + printf (END_COMMENT); +} + static const char * devscope_type2str(int type) { @@ -1769,6 +1780,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp) acpi_handle_wddt(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4)) acpi_handle_lpit(sdp); + else if (!memcmp(sdp->Signature, ACPI_SIG_TPM2, 4)) + acpi_handle_tpm2(sdp); else { printf(BEGIN_COMMENT); acpi_print_sdt(sdp); From owner-svn-src-all@freebsd.org Fri Jan 25 17:08:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA04F14BB75A; Fri, 25 Jan 2019 17:08:29 +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 58EFE8C70F; Fri, 25 Jan 2019 17:08:29 +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 483F9B172; Fri, 25 Jan 2019 17:08:29 +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 x0PH8T9H094166; Fri, 25 Jan 2019 17:08:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PH8Tqe094165; Fri, 25 Jan 2019 17:08:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251708.x0PH8Tqe094165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 17:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343439 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58EFE8C70F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:08:29 -0000 Author: tuexen Date: Fri Jan 25 17:08:28 2019 New Revision: 343439 URL: https://svnweb.freebsd.org/changeset/base/343439 Log: Don't include two header files when not needed. This allows the part of the rewrite of TCP reassembly in this files to be MFCed to stable/11 with manual change. MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Fri Jan 25 16:16:10 2019 (r343438) +++ head/sys/netinet/tcp_reass.c Fri Jan 25 17:08:28 2019 (r343439) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_tcpdebug.h" +/* For debugging we want counters and BB logging */ +/* #define TCP_REASS_COUNTERS 1 */ +/* #define TCP_REASS_LOGGING 1 */ + #include #include #include @@ -72,8 +76,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_REASS_LOGGING #include #include +#endif #include #include #ifdef TCPDEBUG @@ -91,10 +97,6 @@ __FBSDID("$FreeBSD$"); #define TCP_R_LOG_ZERO 9 #define TCP_R_LOG_DUMP 10 #define TCP_R_LOG_TRIM 11 - -/* For debugging we want counters and BB logging */ -/* #define TCP_REASS_COUNTERS 1 */ -/* #define TCP_REASS_LOGGING 1 */ static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); From owner-svn-src-all@freebsd.org Fri Jan 25 17:09:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32D914BB7D8; Fri, 25 Jan 2019 17:09:27 +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 728B28C886; Fri, 25 Jan 2019 17:09:27 +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 2CB2BB174; Fri, 25 Jan 2019 17:09:27 +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 x0PH9RUV094380; Fri, 25 Jan 2019 17:09:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PH9Rc4094379; Fri, 25 Jan 2019 17:09:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901251709.x0PH9Rc4094379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 17:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343440 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 728B28C886 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:09:28 -0000 Author: trasz Date: Fri Jan 25 17:09:26 2019 New Revision: 343440 URL: https://svnweb.freebsd.org/changeset/base/343440 Log: Comment out the default sh(1) aliases for root, introduced in r343416. The rest of this stuff is still to be discussed, but I think at this point we have the agreement that the aliases should go. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/sh/dot.shrc Modified: head/bin/sh/dot.shrc ============================================================================== --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) @@ -18,13 +18,13 @@ # set -o vi -# some useful aliases -alias h='fc -l' -alias j=jobs -alias m="$PAGER" -alias ll='ls -laFo' -alias l='ls -l' -alias g='egrep -i' +# # some useful aliases +# alias h='fc -l' +# alias j=jobs +# alias m="$PAGER" +# alias ll='ls -laFo' +# alias l='ls -l' +# alias g='egrep -i' # # be paranoid # alias cp='cp -ip' From owner-svn-src-all@freebsd.org Fri Jan 25 17:51:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A91CE14BCB94; Fri, 25 Jan 2019 17:51:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1848E5D3; Fri, 25 Jan 2019 17:51:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id r10so11194967wrs.10; Fri, 25 Jan 2019 09:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AbPSQOKc4fpbKBQbOI4GvE9uFwXNsA9+vNjnNoRmIVs=; b=HM5rHUCOWSRkTmQl+xVPoivpxt9G2PGFDt9oKd3VQ7mk3jScvpdT6CO+Ffvum+pRwf s5R5TFsBPEeFeqIIdQg9z3qtnOFZtJHvIpEzZj8ttBlZXv+pWyHBDSSwqUm04rGI3MEJ kHmkyt1aqYM+GNCaRahLc4RYCAkJ/qYcEZJ3ktg5aaZUmbreONYB4n7qAvMgtt+Jn7Rt 9rqn4t1LI+JKlSxRJ3FveoZ2sQViSYBXNbMqP49JyDbckvVFxxmKIn6cQUhDtecdTfu2 pQU5j+J19smvAogkLKxIxLedzS6itC4FscakFP37bBGMfv+bzHl/JNlmxQuHP5YyunXh YIGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=AbPSQOKc4fpbKBQbOI4GvE9uFwXNsA9+vNjnNoRmIVs=; b=D4YXYCm+329ucsB+oycQ8LWAVfvB9Wus1gkVblH/7oFMgMSWbxfYIBLxauk7koNAQt OP8ABtNTzhM1cXA30gfE7t7UeDHRB1C9iKZOxk2lnZ5xFh7T46HF2m0pz7Ur2gqEId9P k3HIKbknGlWRKHjSaPPWFQ1euKg1LNIGoZx1M8NvsfjFe9OlxdPSpdsXyNTFYol0OOgH uNtSHLeE0DiAw4EoxJmTztYOYyx8hdKQgKcZklPJVL3q6Q8yGg2lfqnZ10k4yV6btlXH wjmfskQcfUZnFUOVpIp1kyOcdZTbyRcFQ1r6l5RPwQ0m9S0FSWVPypAl7EVGQ/HhRhX1 NOcQ== X-Gm-Message-State: AJcUukeG2FmX8okQJSUyi7tSv2t0ZEhdSGGf3DovzMiqinVc/OaGS0jO OKd9k0phrGzZ0bQWdm1VLnPsFF+n X-Google-Smtp-Source: ALg8bN63mEap8rOPcMNSEXwoex4IfeLuw9X8Q0jEQFds4Ylg93FvmEeX/szJh4UZp6k8JWKsUkyaHQ== X-Received: by 2002:adf:b190:: with SMTP id q16mr12450018wra.95.1548438672305; Fri, 25 Jan 2019 09:51:12 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id t5sm72885599wmd.15.2019.01.25.09.51.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 09:51:11 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 06:02:58 +0000 From: Edward Napierala To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125060258.GA25351@v2> Mail-Followup-To: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 1D1848E5D3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:51:14 -0000 The aliases are gone, let's continue on the remaining bits below. On 0125T0539, Rodney W. Grimes wrote: > > pt., 25 sty 2019 o 11:24 Rodney W. Grimes > > napisa?(a): > > > > > > > On 0124T1555, Rodney W. Grimes wrote: > > > > > > Author: trasz > > > > > > Date: Thu Jan 24 23:34:51 2019 > > > > > > New Revision: 343416 [..] > > > People that want a Borne shell type interactive shell > > > invariable choose bash, ksh or some other shell, not > > > our /bin/sh which is lean mean and a fast machine > > > because the base system uses it so much. > > > > That's true. But we discourage using shells from ports/packages > > as root shell. > > I am not so sure on that, it use to be more so because /bin/sh > was statically linked and needed no lib's to run, well that > is gone out the window. There is also the issue that other > shells are installed into /usr/local/bin, which may or may > not be mounted (less likely now that zfs and be's are all > the rage.) Most of the reasons to discourage a pkg root > shell are now gone. Yeah. Still, the commit doesn't make it in any way harder, and provides a more familiar default. > > The easiest thing for a new user to do if they want > > a Bourne-compatible shell for root is to just use chsh(1). And > > here's what happens: you get greeted with an alien-looking > > (new folks usually come from Linux or OSX background) '$' > If that is alien looking then they need some education on > how the tool they are using works and how to use it. It is alien, because it's different from their experience from other systems they are used to. Sure, they will know it is _a_ prompt. It's just that they'll consider it quite weird and not very useful, in particular the lack of directory part. There's also the consistency argument - our tcsh doesn't use a plain '%'. > > prompt. Which is not a problem, of course, just define PS1, > > and perhaps some aliases, in a newly created /root/.shrc. > > Except... that doesn't work, despite the fact that it works just > > fine for accounts other than root, and that's also how you would > > fix it with bash. And then you end up having to read the sh(1) > > manual page to discover the ENV. > Or read the .profile of there user account and actually > understand some of these details. IMHO this is about user > education and rather than dumb the system down we should > try to raise the level of knowledge. I think this is the main point of disagreement. Sure, learning is good, but I'm a big fan of providing useful defaults if possible. Our default csh prompt - now also used by sh - is a pretty good, imho. And it's not just FreeBSD that's been using it (with csh) for years - Ubuntu comes with something pretty close. [..] > > > I am sure there are a few of us around that would actually > > > like to see the ones left go away and view them as contamination > > > to what should be the domain of a site administrator or > > > personal taste. > > > > > > Just as some of us would really rather have > > > cd home > > > return the proper error rather than doing some > > > magic when there is not a ./home to cd into. > > > And having ls .. ; cd ..; ls give 2 different outputs > > > is just.. well something that should confuse the > > > heck out of a new user, yet seems completely fine > > > to have in the system. Note the above becomes > > > a fatal mistake when the second ls is a rm > > > with wild cards. > > > > That's a historical mistake we can't really fix, I'm afraid, > > unless we want to break compatibility with other systems. > > I seriously doubt that are a lot of people depending > on cd home to do what it does, most would be lazy > like me and type cd ~. This is somewhat orthogonal to the main topic. But it's not about 'cd home' at all; it's the result of an architectural problem in Unix kernel that most shells try to work around. > > > Howerver I do understand the need to assist the new person > > > or less informed that do not pack an emacs size environment > > > with them that there are nifty things they can do > > > to make life easier. Perhaps making more extensive > > > comments in the skel files, or even adding pointers in them > > > to a set of /usr/share/example/ files? Perhaps pointers > > > in roots .files to the skel files as "for a better example > > > of what can be done in this file see foo". > > > > I'd expect pretty much every user new to FreeBSD to already > > know about what they can do with shell files. And there's > > plenty of advice for that too, including the sources mentioned > > by Cy. > > > > There are two things, however: first, they don't neccessarily > > know about things specific to FreeBSD sh(1), such as requiring > > the ENV to be set to actually read the ~/.shrc. > > Is that only the freebsd shell, I thought most shells need > special stuff done to get them to do much more than processes > .profile. Bash - which is what I'd expect most new users to have experience with - reads ~/.bashrc automatically, without the ENV. (Bash is somewhat weird, and so the ~/.bash_profile usually sources ~/.bashrc, but that's unrelated). Zsh reads ~/.zshrc automatically as well. So yeah, new users probably don't expect they have to set something in ~/.profile. > > And second, it's just nice to new users to make stuff just a tiny > > bit more familiar looking. This includes installing the file they can > > edit (/root/.shrc), and setting the prompt to something that > > resembles other systems. That's exactly what we do for csh(1). > > I am ok installing .shrc, I am ok putting a commented ENV in > /root/.profile to say uncomment this if you want .shrc to be > read for interactive shells. > > Document document document, but changing the existing very > long standing behavior in the name of "just nice to new users" > at the cost of agitating many of the current users is no > good. Can the change actually break anything for existing users? It doesn't affect existing installs. It doesn't affect people who run the default root shell (tcsh), nor folks who use shells from ports/packages. And it doesn't affect the ones who actually have their own /root/.shrc to copy over. My understanding is that the only ones affected are the current users who depend on _not_ having /root/.shrc despite using sh(1) as their root shell. And for folks who do have their own tree with their preferred /root/.shrc to "make distribution" from, it should actually make their diff to upstream smaller. > As to prompts, well, those are very personalized things > and vary more than the colors of bike sheds, best left > to the site or personal admin. Again, my arguments for doing this are being more familiar to newcomers and being consistent with ourselves in the remaining three cases (csh(1) for both root and non-root users, and sh(1) for non-root users). > > > > > This is really the domain of a systems administrator to > > > > > decide and making work for them to clean this out is > > > > > not going to make them happy. > > > > > > > > Problem is, we're in a strage situation where we ship with > > > > root shell which is just broken - basic shell syntax doesn't > > > > work - and the out-of-box alternative provides you with > > > > a VMS prompt. Not the best first impression to make, I'd say. > > > > > > Huh? Now I think you have gone off the other end, > > > would you please explain how some alias in .shrc fix anything > > > broken with /bin/sh or roots use of it? > > > > > > Can you expand on exactly what syntax this commit fixes please? > > > > The way this commit fixes syntax problems of the default root > > shell (which is csh(1)) is that you can easily change the root shell > > and end up with something that looks just like before, but this > > time accepting the Bourne syntax. That's how it works for non-root > > users; this commit makes the same apply to root. > > That is not a syntax problem. That is a difference of the fact that > roots environment is pretty sanitary and a users is not, and for good > reason on the former. It is a syntax problem: trasz@v2:~ % while :; do date; sleep 1; done while: Expression Syntax. do: Command not found. done: Command not found. Obviously I'm not recommending changing the default root shell, but this commit makes it easier for the user to change theirs. [..] From owner-svn-src-all@freebsd.org Fri Jan 25 18:13:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7235514BD1BF; Fri, 25 Jan 2019 18:13:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13C468F443; Fri, 25 Jan 2019 18:13:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D18DD17172; Fri, 25 Jan 2019 18:13:20 +0000 (UTC) Date: Fri, 25 Jan 2019 18:13:20 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125181320.GA5015@FreeBSD.org> References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190125060258.GA25351@v2> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 13C468F443 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.87)[-0.873,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:13:21 -0000 On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > The aliases are gone, let's continue on the remaining bits below. They are not gone, they were commented out; also, bogus double linefeeds are not gone. But most importantly, this whole file is useless and IMHO should just be removed. /bin/sh is not supposed to be one's interactive shell. > It is alien, because it's different from their experience > from other systems they are used to. This argument does not really hold because /bin/sh is not... see above. > It doesn't affect existing installs. It doesn't affect people > who run the default root shell (tcsh), nor folks who use shells AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who change the root shell should either pick another interactive shell, or if they want /bin/sh be ready to deal with sanitary environment. > And for folks who do have their own tree with their preferred > /root/.shrc to "make distribution" from, it should actually make > their diff to upstream smaller. I don't like extra files, esp. configuration files that look like they are for interactive shell while our /bin/sh is in fact not. This is confusing, and FreeBSD is not supposed to be confusing. > It is a syntax problem: > > trasz@v2:~ % while :; do date; sleep 1; done > while: Expression Syntax. > do: Command not found. > done: Command not found. Are you trying to use sh(1) loop in (t)csh? Why? And what does it have to do with the /usr/src/bin/sh/dot.shrc issue? ./danfe From owner-svn-src-all@freebsd.org Fri Jan 25 18:23:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DD114BD5E8 for ; Fri, 25 Jan 2019 18:23:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB9228FB4A for ; Fri, 25 Jan 2019 18:23:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb2c.google.com with SMTP id h81so4208410ybg.2 for ; Fri, 25 Jan 2019 10:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Objjj4un4U35y7rbuOftV4znjkTzyQQSM7KheT0gsZk=; b=WbAOQDNxIE6eAoFiHmvq2McFgWfclfg+1IDzfE45DMj8wFO68TxFy+zdAFTQqHb0lL Tb+l9nYlGx+625DfhFElzOIp5C9y6eQWC2SXlsvkcYClZ8wKT0LYRo7NDI4SlmUgJOcZ ytoPOln8WwwK2HxiSr4s80aeWImwX1h/b1d/Q1BhLqQXC4U44VL2z7VY3MNtCeySF/dU vLHoK8O+TdLeQpiIbHfRpHwIRPPJdU289rXe2QFnt3abDvqcxhBwcoQCm9QYd35L0Ojw EbGmcanxbQEDDRV8HxU2eXdIF+msna0srFeXcZ7oKbHDQbtqL1+pk7452/s+VTqHqm2Z pYUg== 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=Objjj4un4U35y7rbuOftV4znjkTzyQQSM7KheT0gsZk=; b=uICnQDwOFbGrCbbhc/+7GYjfDe+BfRj/YkXly7DIi3OLQ+xznhZN88/9z6hS881noZ /i+xSi7lRkqRRZnM02/Gg9tpbpE8YQ+o1lJYEaPMjQ1FfDpe2Ybmc6B96evdt245UcnD m8RmGA7jV8KR1oDoGLK0Wm9GmnXqQFhfq3K5UcuoBJhhUPRWbBaoBI5+H/q22lxPphCH OlOX31lSa9sTpXxheguDMn895Z4ZKV1e08k1q8aT3qmwBJkxICe5lsPHpPTD3TdZ3MQa Z2W7PxvUsBQsbduWf0p2JR7hb4csHQ9utDTGyGbOgeQqBsOm2a3lVuyyccjy3SDKcfLh uJDA== X-Gm-Message-State: AJcUukeQfBOAXcjo36NCXsiQ4AciTTTqiOxhK6obIIuQS8FyQrqr0siz pRI9IDOwrPDaaJzNcvV0iknLwcOOifB0spmKk8PB/A== X-Google-Smtp-Source: ALg8bN75mFjUSnq/dNeHISIjILIf0pUOIrl2S5LNaj0fcXs16VtWF5SQdM5D3GUs1V168lVI23364FsuI4fiY8sNwvs= X-Received: by 2002:a25:bd5:: with SMTP id 204mr11658825ybl.486.1548440594319; Fri, 25 Jan 2019 10:23:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5b:ec8:0:0:0:0:0 with HTTP; Fri, 25 Jan 2019 10:23:13 -0800 (PST) In-Reply-To: <20190125181320.GA5015@FreeBSD.org> References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> <20190125181320.GA5015@FreeBSD.org> From: Oliver Pinter Date: Fri, 25 Jan 2019 19:23:13 +0100 Message-ID: Subject: Re: svn commit: r343416 - head/bin/sh To: Alexey Dokuchaev Cc: "rgrimes@freebsd.org" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: EB9228FB4A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:23:15 -0000 On Friday, January 25, 2019, Alexey Dokuchaev wrote: > On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > > The aliases are gone, let's continue on the remaining bits below. > > They are not gone, they were commented out; also, bogus double linefeeds > are not gone. But most importantly, this whole file is useless and IMHO > should just be removed. /bin/sh is not supposed to be one's interactive > shell. False. Since the ability to install the system from pkg, and the ability to remove the tcsh package easily, someone really want to or try to use sh as their default interactive shell. >From other hand there are no clear communication about the fact that the /bin/sh isn't suitable for interactive in non-developer visible place - like in motd or in official documentations, fix me if I'm wrong. > > > It is alien, because it's different from their experience > > from other systems they are used to. > > This argument does not really hold because /bin/sh is not... see above. > > > It doesn't affect existing installs. It doesn't affect people > > who run the default root shell (tcsh), nor folks who use shells > > AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also > means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who > change the root shell should either pick another interactive shell, > or if they want /bin/sh be ready to deal with sanitary environment. > > > And for folks who do have their own tree with their preferred > > /root/.shrc to "make distribution" from, it should actually make > > their diff to upstream smaller. > > I don't like extra files, esp. configuration files that look like they > are for interactive shell while our /bin/sh is in fact not. This is > confusing, and FreeBSD is not supposed to be confusing. > > > It is a syntax problem: > > > > trasz@v2:~ % while :; do date; sleep 1; done > > while: Expression Syntax. > > do: Command not found. > > done: Command not found. > > Are you trying to use sh(1) loop in (t)csh? Why? And what does it have > to do with the /usr/src/bin/sh/dot.shrc issue? > > ./danfe > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Fri Jan 25 18:30:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B9D414BD94A; Fri, 25 Jan 2019 18:30:13 +0000 (UTC) (envelope-from shurd@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 305F68FF40; Fri, 25 Jan 2019 18:30:13 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 13C8DC119; Fri, 25 Jan 2019 18:30:13 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PIUCqM036874; Fri, 25 Jan 2019 18:30:12 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PIUC5K036873; Fri, 25 Jan 2019 18:30:12 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201901251830.x0PIUC5K036873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 25 Jan 2019 18:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343441 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 343441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 305F68FF40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:30:13 -0000 Author: shurd Date: Fri Jan 25 18:30:12 2019 New Revision: 343441 URL: https://svnweb.freebsd.org/changeset/base/343441 Log: MFC r343047: Fix window update issue when scaling disabled When the TCP window scale option is not used, and the window opens up enough in one soreceive, a window update will not be sent. For example, if recwin == 65535, so->so_rcv.sb_hiwat >= 262144, and so->so_rcv.sb_hiwat <= 524272, the window update will never be sent. This is because recwin and adv are clamped to TCP_MAXWIN << tp->rcv_scale, and so will never be >= so->so_rcv.sb_hiwat / 4 or <= so->so_rcv.sb_hiwat / 8. This patch ensures a window update is sent if the window opens by TCP_MAXWIN << tp->rcv_scale, which should only happen when the window size goes from zero to the max expressible. This issue looks like it was introduced in r306769 when recwin was clamped to TCP_MAXWIN << tp->rcv_scale. Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D18821 Modified: stable/12/sys/netinet/tcp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Fri Jan 25 17:09:26 2019 (r343440) +++ stable/12/sys/netinet/tcp_output.c Fri Jan 25 18:30:12 2019 (r343441) @@ -656,7 +656,8 @@ after_sack_rexmit: if (adv >= (int32_t)(2 * tp->t_maxseg) && (adv >= (int32_t)(so->so_rcv.sb_hiwat / 4) || recwin <= (so->so_rcv.sb_hiwat / 8) || - so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg || + adv >= TCP_MAXWIN << tp->rcv_scale)) goto send; if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat) goto send; From owner-svn-src-all@freebsd.org Fri Jan 25 18:40:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0E314BE38B; Fri, 25 Jan 2019 18:40:13 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C94469DDF; Fri, 25 Jan 2019 18:40:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x329.google.com with SMTP id y139so7645760wmc.5; Fri, 25 Jan 2019 10:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=F72dsnYucTEvLWFiMeZq782aDMFJuV0wADbrGL6ZDSg=; b=bDdixyN0ldIot7x7Qq59MR5R8Lxsh3orxHc/L4nEhC73vGNPOBDF6oqVitwXdHnIhn niqdcf7zoS9OQUYHHtl4OKDDa0wPE5mlGqSatlhEsFMk+NUvrnc1mBpdBZ19uESFZJ0r mSj5h/zUgOeoIHqU5oPJDw83JdGtqvNBWNacmk3tjZ+PAuULRGJclay5VVo8ngAkpcA9 b3/sLwdcCWTw1cZwD5LuUyU30tOPgn2oyT6Wzsc0IYkvFXhnwszJeC7Xtlli61EChV2P pWRO2sCH8PAIHjnpx79h3AY0lJFWxdyb9Xdp9fZjffCN5UEw4isl70HUDmZJkgqYoumB W5TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=F72dsnYucTEvLWFiMeZq782aDMFJuV0wADbrGL6ZDSg=; b=UdKwfZfCpXlg9VzbWyjPH426ldVywjD+ckviXOXDpLJzqKe9lJfKohwkJCg6SilP13 Ffh4dGewbwog8yH79DfItt75aoMRN4bpd3CqBK0JqdGdGOgWHmwO5FYOxVwxSqjLUJYe byKWq8yzgfx7aiwyikpY6OaJaDZlfl+l9DlwEBoeoZn7bxmJds845aOqHkh+xeY0fKg6 VybAXqAQKNvYVhtTYq3mjLKPjI9sjjG0l7hon0bixHZ96Egtu7Kif4F7xLP6IGOh4Kq8 dDnpcfW0W78eGy8vZW+6wxGHi5p8/9USinIrQy5PJlcDGuv6Mbzcxs8Pndms4SKad0Os tYgg== X-Gm-Message-State: AJcUukfxesmQp2uPV8grSMVdKw+m99+FcGmaIWEK2HIymqc7kmoI2neP eEoO4eDRMVsgov2LDzOl799pTMcG X-Google-Smtp-Source: ALg8bN4zhBwdam0x4vW04sqr3kgH5OqeCZbI9dYvXsxrsOyfXAcRlVPMgSUIdlFejhyr1MFWbTs0uA== X-Received: by 2002:a1c:13d1:: with SMTP id 200mr7738419wmt.4.1548441610752; Fri, 25 Jan 2019 10:40:10 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id v16sm87112016wrs.75.2019.01.25.10.40.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 10:40:09 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 06:51:56 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexey Dokuchaev Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125065156.GA25806@v2> Mail-Followup-To: Alexey Dokuchaev , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> <20190125181320.GA5015@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190125181320.GA5015@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 6C94469DDF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:40:13 -0000 On 0125T1813, Alexey Dokuchaev wrote: > On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > > The aliases are gone, let's continue on the remaining bits below. > > They are not gone, they were commented out; also, bogus double linefeeds > are not gone. Yeah, I've matched the existing comment style in that file. > But most importantly, this whole file is useless and IMHO > should just be removed. /bin/sh is not supposed to be one's interactive > shell. Of course it is an interactive shell. We've been using it as the default interactive shell for non-root accounts since... ages. > > It is alien, because it's different from their experience > > from other systems they are used to. > > This argument does not really hold because /bin/sh is not... see above. > > > It doesn't affect existing installs. It doesn't affect people > > who run the default root shell (tcsh), nor folks who use shells > > AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also Our csh _is_ tcsh. > means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who > change the root shell should either pick another interactive shell, > or if they want /bin/sh be ready to deal with sanitary environment. See above. > > And for folks who do have their own tree with their preferred > > /root/.shrc to "make distribution" from, it should actually make > > their diff to upstream smaller. > > I don't like extra files, esp. configuration files that look like they > are for interactive shell while our /bin/sh is in fact not. This is > confusing, and FreeBSD is not supposed to be confusing. Again, sh(1) is an interactive shell. > > It is a syntax problem: > > > > trasz@v2:~ % while :; do date; sleep 1; done > > while: Expression Syntax. > > do: Command not found. > > done: Command not found. > > Are you trying to use sh(1) loop in (t)csh? Why? And what does it have > to do with the /usr/src/bin/sh/dot.shrc issue? I'm trying to explain the basic problem with our default shell: it doesn't work, because it can't handle what people call the shell syntax. From owner-svn-src-all@freebsd.org Fri Jan 25 18:48:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1436214BE612; Fri, 25 Jan 2019 18:48:22 +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 AF5246A353; Fri, 25 Jan 2019 18:48:21 +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 9FAB9C494; Fri, 25 Jan 2019 18:48:21 +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 x0PImLpY047229; Fri, 25 Jan 2019 18:48:21 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PImL5F047228; Fri, 25 Jan 2019 18:48:21 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201901251848.x0PImL5F047228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 25 Jan 2019 18:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343442 - in head: contrib/netbsd-tests/lib/libm lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libm lib/msun/tests X-SVN-Commit-Revision: 343442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF5246A353 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:48:22 -0000 Author: lwhsu Date: Fri Jan 25 18:48:20 2019 New Revision: 343442 URL: https://svnweb.freebsd.org/changeset/base/343442 Log: Temporarily mark lib.msun.{cbrt_test.cbrtl_powl,trig_test.reduction} expected failure after clang700-import merge PR: 234040 Reviewed by: ngie, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18938 Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c head/lib/msun/tests/trig_test.c Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:30:12 2019 (r343441) +++ head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:48:20 2019 (r343442) @@ -268,6 +268,10 @@ ATF_TC_BODY(cbrtl_powl, tc) long double y, z; size_t i; +#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 + atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); +#endif + for (i = 0; i < __arraycount(x); i++) { y = cbrtl(x[i]); Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Fri Jan 25 18:30:12 2019 (r343441) +++ head/lib/msun/tests/trig_test.c Fri Jan 25 18:48:20 2019 (r343442) @@ -160,6 +160,10 @@ ATF_TC_BODY(reduction, tc) unsigned i; +#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 + atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); +#endif + for (i = 0; i < nitems(f_pi_odd); i++) { ATF_CHECK(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON); ATF_CHECK(cosf(f_pi_odd[i]) == -1.0); From owner-svn-src-all@freebsd.org Fri Jan 25 19:36:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA93D14BF85E; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@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 70D916C1D7; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F947CD4E; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJaLCD073231; Fri, 25 Jan 2019 19:36:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJaL8e073230; Fri, 25 Jan 2019 19:36:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901251936.x0PJaL8e073230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343443 - head/sys/mips/nlm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/nlm X-SVN-Commit-Revision: 343443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70D916C1D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:36:22 -0000 Author: gonzo Date: Fri Jan 25 19:36:20 2019 New Revision: 343443 URL: https://svnweb.freebsd.org/changeset/base/343443 Log: [mips] remove dublicate values in enable mask in nlm_usb_intr_en PR: 230572 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/nlm/usb_init.c Modified: head/sys/mips/nlm/usb_init.c ============================================================================== --- head/sys/mips/nlm/usb_init.c Fri Jan 25 18:48:20 2019 (r343442) +++ head/sys/mips/nlm/usb_init.c Fri Jan 25 19:36:20 2019 (r343443) @@ -52,8 +52,7 @@ nlm_usb_intr_en(int node, int port) port_addr = nlm_get_usb_regbase(node, port); val = nlm_read_usb_reg(port_addr, USB_INT_EN); val = USB_CTRL_INTERRUPT_EN | USB_OHCI_INTERRUPT_EN | - USB_OHCI_INTERRUPT1_EN | USB_CTRL_INTERRUPT_EN | - USB_OHCI_INTERRUPT_EN | USB_OHCI_INTERRUPT2_EN; + USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN; nlm_write_usb_reg(port_addr, USB_INT_EN, val); } From owner-svn-src-all@freebsd.org Fri Jan 25 19:56:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9725614C06EC; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@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 14C596D201; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0159CD0BE; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJu2lJ083445; Fri, 25 Jan 2019 19:56:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJu28l083444; Fri, 25 Jan 2019 19:56:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901251956.x0PJu28l083444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Fri, 25 Jan 2019 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343444 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 343444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14C596D201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:56:03 -0000 Author: ngie Date: Fri Jan 25 19:56:02 2019 New Revision: 343444 URL: https://svnweb.freebsd.org/changeset/base/343444 Log: Document that `sendfile` will return an invalid value for `sbytes` if provided an invalid address This is meant to clarify the fact that the system call will not fail with -1/EFAULT, as one might expect, when reading the sendfile(2) manpage today. While here, pet the mandoc linter, when dealing with the section that describes valid values for `flags`. PR: 232210 MFC after: 2 weeks Approved by: emaste (mentor) Reviewed by: glebius, 0mp Differential Revision: https://reviews.freebsd.org/D18949 Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Fri Jan 25 19:36:20 2019 (r343443) +++ head/lib/libc/sys/sendfile.2 Fri Jan 25 19:56:02 2019 (r343444) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2018 +.Dd January 25, 2019 .Dt SENDFILE 2 .Os .Sh NAME @@ -104,7 +104,7 @@ variable pointed to by The least significant 16 bits of .Fa flags argument is a bitmap of these values: -.Bl -tag -offset indent +.Bl -tag -offset indent -width "SF_USER_READAHEAD" .It Dv SF_NODISKIO This flag causes .Nm @@ -403,3 +403,14 @@ The .Fx 11 implementation was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . +.Sh BUGS +The +.Fn sendfile +system call will not fail, i.e., return +.Dv -1 +and set +.Va errno +to +.Er EFAULT , +if provided an invalid address for +.Fa sbytes . From owner-svn-src-all@freebsd.org Fri Jan 25 19:56:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB8914C070B; Fri, 25 Jan 2019 19:56:07 +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 411C06D20A; Fri, 25 Jan 2019 19:56:07 +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 3333AD0C0; Fri, 25 Jan 2019 19:56:07 +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 x0PJu7T6083508; Fri, 25 Jan 2019 19:56:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJu7Bh083507; Fri, 25 Jan 2019 19:56:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901251956.x0PJu7Bh083507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 25 Jan 2019 19:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343445 - stable/12/sys/dev/nvd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvd X-SVN-Commit-Revision: 343445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 411C06D20A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:56:07 -0000 Author: mav Date: Fri Jan 25 19:56:06 2019 New Revision: 343445 URL: https://svnweb.freebsd.org/changeset/base/343445 Log: MFC r342557, r342559: Reimplement nvd(4) detach handling. Previous code typically crashed in case of NVMe device unplug or even clean detach while some I/Os are still in flight. To fix this the new code calls disk_gone() and waits for confirmation of all references gone before calling disk_destroy(), freeing other resources and allowing controller detach. While there, fix disk lists locking and reimplement unit numbers assignment. Modified: stable/12/sys/dev/nvd/nvd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvd/nvd.c ============================================================================== --- stable/12/sys/dev/nvd/nvd.c Fri Jan 25 19:56:02 2019 (r343444) +++ stable/12/sys/dev/nvd/nvd.c Fri Jan 25 19:56:06 2019 (r343445) @@ -3,6 +3,7 @@ * * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. + * Copyright (C) 2018 Alexander Motin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -46,15 +49,16 @@ __FBSDID("$FreeBSD$"); #define NVD_STR "nvd" struct nvd_disk; +struct nvd_controller; static disk_ioctl_t nvd_ioctl; static disk_strategy_t nvd_strategy; static dumper_t nvd_dump; static void nvd_done(void *arg, const struct nvme_completion *cpl); +static void nvd_gone(struct nvd_disk *ndisk); static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr); -static void destroy_geom_disk(struct nvd_disk *ndisk); static void *nvd_new_controller(struct nvme_controller *ctrlr); static void nvd_controller_fail(void *ctrlr); @@ -67,6 +71,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); struct nvme_consumer *consumer_handle; struct nvd_disk { + struct nvd_controller *ctrlr; struct bio_queue_head bioq; struct task bioqtask; @@ -78,6 +83,7 @@ struct nvd_disk { uint32_t cur_depth; uint32_t ordered_in_flight; + u_int unit; TAILQ_ENTRY(nvd_disk) global_tailq; TAILQ_ENTRY(nvd_disk) ctrlr_tailq; @@ -89,6 +95,7 @@ struct nvd_controller { TAILQ_HEAD(, nvd_disk) disk_head; }; +static struct mtx nvd_lock; static TAILQ_HEAD(, nvd_controller) ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; @@ -139,6 +146,7 @@ nvd_load() if (!nvme_use_nvd) return 0; + mtx_init(&nvd_lock, "nvd_lock", NULL, MTX_DEF); TAILQ_INIT(&ctrlr_head); TAILQ_INIT(&disk_head); @@ -152,25 +160,25 @@ static void nvd_unload() { struct nvd_controller *ctrlr; - struct nvd_disk *disk; + struct nvd_disk *ndisk; if (!nvme_use_nvd) return; - while (!TAILQ_EMPTY(&ctrlr_head)) { - ctrlr = TAILQ_FIRST(&ctrlr_head); + mtx_lock(&nvd_lock); + while ((ctrlr = TAILQ_FIRST(&ctrlr_head)) != NULL) { TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_unload",0); free(ctrlr, M_NVD); } + mtx_unlock(&nvd_lock); - while (!TAILQ_EMPTY(&disk_head)) { - disk = TAILQ_FIRST(&disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - nvme_unregister_consumer(consumer_handle); + + mtx_destroy(&nvd_lock); } static int @@ -220,6 +228,42 @@ nvd_strategy(struct bio *bp) taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); } +static void +nvd_gone(struct nvd_disk *ndisk) +{ + struct bio *bp; + + printf(NVD_STR"%u: detached\n", ndisk->unit); + mtx_lock(&ndisk->bioqlock); + disk_gone(ndisk->disk); + while ((bp = bioq_takefirst(&ndisk->bioq)) != NULL) { + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, -1); + bp->bio_error = ENXIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + } + mtx_unlock(&ndisk->bioqlock); +} + +static void +nvd_gonecb(struct disk *dp) +{ + struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1; + + disk_destroy(ndisk->disk); + mtx_lock(&nvd_lock); + TAILQ_REMOVE(&disk_head, ndisk, global_tailq); + TAILQ_REMOVE(&ndisk->ctrlr->disk_head, ndisk, ctrlr_tailq); + if (TAILQ_EMPTY(&ndisk->ctrlr->disk_head)) + wakeup(&ndisk->ctrlr->disk_head); + mtx_unlock(&nvd_lock); + taskqueue_free(ndisk->tq); + mtx_destroy(&ndisk->bioqlock); + free(ndisk, M_NVD); +} + static int nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, struct thread *td) @@ -304,7 +348,9 @@ nvd_new_controller(struct nvme_controller *ctrlr) M_ZERO | M_WAITOK); TAILQ_INIT(&nvd_ctrlr->disk_head); + mtx_lock(&nvd_lock); TAILQ_INSERT_TAIL(&ctrlr_head, nvd_ctrlr, tailq); + mtx_unlock(&nvd_lock); return (nvd_ctrlr); } @@ -313,46 +359,61 @@ static void * nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) { uint8_t descr[NVME_MODEL_NUMBER_LENGTH+1]; - struct nvd_disk *ndisk; + struct nvd_disk *ndisk, *tnd; struct disk *disk; struct nvd_controller *ctrlr = ctrlr_arg; + int unit; ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_WAITOK); + ndisk->ctrlr = ctrlr; + ndisk->ns = ns; + ndisk->cur_depth = 0; + ndisk->ordered_in_flight = 0; + mtx_init(&ndisk->bioqlock, "nvd bioq lock", NULL, MTX_DEF); + bioq_init(&ndisk->bioq); + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - disk = disk_alloc(); + mtx_lock(&nvd_lock); + unit = 0; + TAILQ_FOREACH(tnd, &disk_head, global_tailq) { + if (tnd->unit > unit) + break; + unit = tnd->unit + 1; + } + ndisk->unit = unit; + if (tnd != NULL) + TAILQ_INSERT_BEFORE(tnd, ndisk, global_tailq); + else + TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); + TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); + mtx_unlock(&nvd_lock); + + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, + taskqueue_thread_enqueue, &ndisk->tq); + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); + + disk = ndisk->disk = disk_alloc(); disk->d_strategy = nvd_strategy; disk->d_ioctl = nvd_ioctl; disk->d_dump = nvd_dump; + disk->d_gone = nvd_gonecb; disk->d_name = NVD_STR; + disk->d_unit = ndisk->unit; disk->d_drv1 = ndisk; - disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); if (disk->d_delmaxsize > nvd_delete_max) disk->d_delmaxsize = nvd_delete_max; disk->d_stripesize = nvme_ns_get_stripesize(ns); - - if (TAILQ_EMPTY(&disk_head)) - disk->d_unit = 0; - else - disk->d_unit = - TAILQ_LAST(&disk_head, disk_list)->disk->d_unit + 1; - - disk->d_flags = DISKFLAG_DIRECT_COMPLETION; - + disk->d_flags = DISKFLAG_UNMAPPED_BIO | DISKFLAG_DIRECT_COMPLETION; if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) disk->d_flags |= DISKFLAG_CANDELETE; - if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; -/* ifdef used here to ease porting to stable branches at a later point. */ -#ifdef DISKFLAG_UNMAPPED_BIO - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; -#endif - /* * d_ident and d_descr are both far bigger than the length of either * the serial or model number strings. @@ -365,22 +426,6 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar disk->d_rotation_rate = DISK_RR_NON_ROTATING; - ndisk->ns = ns; - ndisk->disk = disk; - ndisk->cur_depth = 0; - ndisk->ordered_in_flight = 0; - - mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); - bioq_init(&ndisk->bioq); - - TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, - taskqueue_thread_enqueue, &ndisk->tq); - taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); - - TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); - TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); - disk_create(disk, DISK_VERSION); printf(NVD_STR"%u: <%s> NVMe namespace\n", disk->d_unit, descr); @@ -389,58 +434,22 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar (uintmax_t)disk->d_mediasize / disk->d_sectorsize, disk->d_sectorsize); - return (NULL); + return (ndisk); } static void -destroy_geom_disk(struct nvd_disk *ndisk) -{ - struct bio *bp; - struct disk *disk; - uint32_t unit; - int cnt = 0; - - disk = ndisk->disk; - unit = disk->d_unit; - taskqueue_free(ndisk->tq); - - disk_destroy(ndisk->disk); - - mtx_lock(&ndisk->bioqlock); - for (;;) { - bp = bioq_takefirst(&ndisk->bioq); - if (bp == NULL) - break; - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - cnt++; - biodone(bp); - } - - printf(NVD_STR"%u: lost device - %d outstanding\n", unit, cnt); - printf(NVD_STR"%u: removing device entry\n", unit); - - mtx_unlock(&ndisk->bioqlock); - - mtx_destroy(&ndisk->bioqlock); -} - -static void nvd_controller_fail(void *ctrlr_arg) { struct nvd_controller *ctrlr = ctrlr_arg; - struct nvd_disk *disk; + struct nvd_disk *ndisk; - while (!TAILQ_EMPTY(&ctrlr->disk_head)) { - disk = TAILQ_FIRST(&ctrlr->disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - TAILQ_REMOVE(&ctrlr->disk_head, disk, ctrlr_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - + mtx_lock(&nvd_lock); TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_fail", 0); + mtx_unlock(&nvd_lock); free(ctrlr, M_NVD); } From owner-svn-src-all@freebsd.org Fri Jan 25 19:57:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBB814C085F; Fri, 25 Jan 2019 19:57:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 937206D6E3; Fri, 25 Jan 2019 19:57:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PJvdmE089918; Fri, 25 Jan 2019 11:57:39 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PJvdTL089917; Fri, 25 Jan 2019 11:57:39 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <201901251709.x0PH9Rc4094379@repo.freebsd.org> To: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 11:57:39 -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: 937206D6E3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:57:42 -0000 > Author: trasz > Date: Fri Jan 25 17:09:26 2019 > New Revision: 343440 > URL: https://svnweb.freebsd.org/changeset/base/343440 > > Log: > Comment out the default sh(1) aliases for root, introduced in r343416. > The rest of this stuff is still to be discussed, but I think at this > point we have the agreement that the aliases should go. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL Please just revert this and the prior commit out, and when the path forward is clear commit it. I would not want any of this merged to 12/ or 11/ until the time that it is all settled. Rod > Modified: > head/bin/sh/dot.shrc > > Modified: head/bin/sh/dot.shrc > ============================================================================== > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) > @@ -18,13 +18,13 @@ > # set -o vi > > > -# some useful aliases > -alias h='fc -l' > -alias j=jobs > -alias m="$PAGER" > -alias ll='ls -laFo' > -alias l='ls -l' > -alias g='egrep -i' > +# # some useful aliases > +# alias h='fc -l' > +# alias j=jobs > +# alias m="$PAGER" > +# alias ll='ls -laFo' > +# alias l='ls -l' > +# alias g='egrep -i' > > # # be paranoid > # alias cp='cp -ip' > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 19:59:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE7214C0A1E; Fri, 25 Jan 2019 19:59:00 +0000 (UTC) (envelope-from gonzo@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 377296DC6C; Fri, 25 Jan 2019 19:59:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C7C8D0E0; Fri, 25 Jan 2019 19:58:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJwu15085073; Fri, 25 Jan 2019 19:58:56 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJwuIb085072; Fri, 25 Jan 2019 19:58:56 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901251958.x0PJwuIb085072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 19:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343446 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 343446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 377296DC6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:59:00 -0000 Author: gonzo Date: Fri Jan 25 19:58:56 2019 New Revision: 343446 URL: https://svnweb.freebsd.org/changeset/base/343446 Log: [mips] remove check that is always false (unsinged < 0) cpuid and local cpu variable are unsigned so checking if value is less than zero always yields false. PR: 211088 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/mips/tlb.c Modified: head/sys/mips/mips/tlb.c ============================================================================== --- head/sys/mips/mips/tlb.c Fri Jan 25 19:56:06 2019 (r343445) +++ head/sys/mips/mips/tlb.c Fri Jan 25 19:58:56 2019 (r343446) @@ -348,7 +348,7 @@ DB_SHOW_COMMAND(tlb, ddb_dump_tlb) else cpu = PCPU_GET(cpuid); - if (cpu < 0 || cpu >= mp_ncpus) { + if (cpu >= mp_ncpus) { db_printf("Invalid CPU %u\n", cpu); return; } From owner-svn-src-all@freebsd.org Fri Jan 25 20:01:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AB9E14C0E64; Fri, 25 Jan 2019 20:01:06 +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 DFE426EB1B; Fri, 25 Jan 2019 20:01:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D994D12D; Fri, 25 Jan 2019 20:01:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PK10Xu089246; Fri, 25 Jan 2019 20:01:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PK104w089245; Fri, 25 Jan 2019 20:01:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901252001.x0PK104w089245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 25 Jan 2019 20:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343447 - stable/11/sys/dev/nvd X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/nvd X-SVN-Commit-Revision: 343447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFE426EB1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:01:06 -0000 Author: mav Date: Fri Jan 25 20:00:59 2019 New Revision: 343447 URL: https://svnweb.freebsd.org/changeset/base/343447 Log: MFC r342557, r342559: Reimplement nvd(4) detach handling. Previous code typically crashed in case of NVMe device unplug or even clean detach while some I/Os are still in flight. To fix this the new code calls disk_gone() and waits for confirmation of all references gone before calling disk_destroy(), freeing other resources and allowing controller detach. While there, fix disk lists locking and reimplement unit numbers assignment. Modified: stable/11/sys/dev/nvd/nvd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvd/nvd.c ============================================================================== --- stable/11/sys/dev/nvd/nvd.c Fri Jan 25 19:58:56 2019 (r343446) +++ stable/11/sys/dev/nvd/nvd.c Fri Jan 25 20:00:59 2019 (r343447) @@ -1,6 +1,7 @@ /*- * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. + * Copyright (C) 2018 Alexander Motin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,9 +33,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -44,15 +47,16 @@ __FBSDID("$FreeBSD$"); #define NVD_STR "nvd" struct nvd_disk; +struct nvd_controller; static disk_ioctl_t nvd_ioctl; static disk_strategy_t nvd_strategy; static dumper_t nvd_dump; static void nvd_done(void *arg, const struct nvme_completion *cpl); +static void nvd_gone(struct nvd_disk *ndisk); static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr); -static void destroy_geom_disk(struct nvd_disk *ndisk); static void *nvd_new_controller(struct nvme_controller *ctrlr); static void nvd_controller_fail(void *ctrlr); @@ -65,6 +69,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); struct nvme_consumer *consumer_handle; struct nvd_disk { + struct nvd_controller *ctrlr; struct bio_queue_head bioq; struct task bioqtask; @@ -76,6 +81,7 @@ struct nvd_disk { uint32_t cur_depth; uint32_t ordered_in_flight; + u_int unit; TAILQ_ENTRY(nvd_disk) global_tailq; TAILQ_ENTRY(nvd_disk) ctrlr_tailq; @@ -87,6 +93,7 @@ struct nvd_controller { TAILQ_HEAD(, nvd_disk) disk_head; }; +static struct mtx nvd_lock; static TAILQ_HEAD(, nvd_controller) ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; @@ -137,6 +144,7 @@ nvd_load() if (!nvme_use_nvd) return 0; + mtx_init(&nvd_lock, "nvd_lock", NULL, MTX_DEF); TAILQ_INIT(&ctrlr_head); TAILQ_INIT(&disk_head); @@ -150,25 +158,25 @@ static void nvd_unload() { struct nvd_controller *ctrlr; - struct nvd_disk *disk; + struct nvd_disk *ndisk; if (!nvme_use_nvd) return; - while (!TAILQ_EMPTY(&ctrlr_head)) { - ctrlr = TAILQ_FIRST(&ctrlr_head); + mtx_lock(&nvd_lock); + while ((ctrlr = TAILQ_FIRST(&ctrlr_head)) != NULL) { TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_unload",0); free(ctrlr, M_NVD); } + mtx_unlock(&nvd_lock); - while (!TAILQ_EMPTY(&disk_head)) { - disk = TAILQ_FIRST(&disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - nvme_unregister_consumer(consumer_handle); + + mtx_destroy(&nvd_lock); } static int @@ -218,6 +226,42 @@ nvd_strategy(struct bio *bp) taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); } +static void +nvd_gone(struct nvd_disk *ndisk) +{ + struct bio *bp; + + printf(NVD_STR"%u: detached\n", ndisk->unit); + mtx_lock(&ndisk->bioqlock); + disk_gone(ndisk->disk); + while ((bp = bioq_takefirst(&ndisk->bioq)) != NULL) { + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, -1); + bp->bio_error = ENXIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + } + mtx_unlock(&ndisk->bioqlock); +} + +static void +nvd_gonecb(struct disk *dp) +{ + struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1; + + disk_destroy(ndisk->disk); + mtx_lock(&nvd_lock); + TAILQ_REMOVE(&disk_head, ndisk, global_tailq); + TAILQ_REMOVE(&ndisk->ctrlr->disk_head, ndisk, ctrlr_tailq); + if (TAILQ_EMPTY(&ndisk->ctrlr->disk_head)) + wakeup(&ndisk->ctrlr->disk_head); + mtx_unlock(&nvd_lock); + taskqueue_free(ndisk->tq); + mtx_destroy(&ndisk->bioqlock); + free(ndisk, M_NVD); +} + static int nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, struct thread *td) @@ -302,7 +346,9 @@ nvd_new_controller(struct nvme_controller *ctrlr) M_ZERO | M_WAITOK); TAILQ_INIT(&nvd_ctrlr->disk_head); + mtx_lock(&nvd_lock); TAILQ_INSERT_TAIL(&ctrlr_head, nvd_ctrlr, tailq); + mtx_unlock(&nvd_lock); return (nvd_ctrlr); } @@ -311,46 +357,61 @@ static void * nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) { uint8_t descr[NVME_MODEL_NUMBER_LENGTH+1]; - struct nvd_disk *ndisk; + struct nvd_disk *ndisk, *tnd; struct disk *disk; struct nvd_controller *ctrlr = ctrlr_arg; + int unit; ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_WAITOK); + ndisk->ctrlr = ctrlr; + ndisk->ns = ns; + ndisk->cur_depth = 0; + ndisk->ordered_in_flight = 0; + mtx_init(&ndisk->bioqlock, "nvd bioq lock", NULL, MTX_DEF); + bioq_init(&ndisk->bioq); + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - disk = disk_alloc(); + mtx_lock(&nvd_lock); + unit = 0; + TAILQ_FOREACH(tnd, &disk_head, global_tailq) { + if (tnd->unit > unit) + break; + unit = tnd->unit + 1; + } + ndisk->unit = unit; + if (tnd != NULL) + TAILQ_INSERT_BEFORE(tnd, ndisk, global_tailq); + else + TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); + TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); + mtx_unlock(&nvd_lock); + + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, + taskqueue_thread_enqueue, &ndisk->tq); + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); + + disk = ndisk->disk = disk_alloc(); disk->d_strategy = nvd_strategy; disk->d_ioctl = nvd_ioctl; disk->d_dump = nvd_dump; + disk->d_gone = nvd_gonecb; disk->d_name = NVD_STR; + disk->d_unit = ndisk->unit; disk->d_drv1 = ndisk; - disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); if (disk->d_delmaxsize > nvd_delete_max) disk->d_delmaxsize = nvd_delete_max; disk->d_stripesize = nvme_ns_get_stripesize(ns); - - if (TAILQ_EMPTY(&disk_head)) - disk->d_unit = 0; - else - disk->d_unit = - TAILQ_LAST(&disk_head, disk_list)->disk->d_unit + 1; - - disk->d_flags = DISKFLAG_DIRECT_COMPLETION; - + disk->d_flags = DISKFLAG_UNMAPPED_BIO | DISKFLAG_DIRECT_COMPLETION; if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) disk->d_flags |= DISKFLAG_CANDELETE; - if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; -/* ifdef used here to ease porting to stable branches at a later point. */ -#ifdef DISKFLAG_UNMAPPED_BIO - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; -#endif - /* * d_ident and d_descr are both far bigger than the length of either * the serial or model number strings. @@ -363,22 +424,6 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar disk->d_rotation_rate = DISK_RR_NON_ROTATING; - ndisk->ns = ns; - ndisk->disk = disk; - ndisk->cur_depth = 0; - ndisk->ordered_in_flight = 0; - - mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); - bioq_init(&ndisk->bioq); - - TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, - taskqueue_thread_enqueue, &ndisk->tq); - taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); - - TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); - TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); - disk_create(disk, DISK_VERSION); printf(NVD_STR"%u: <%s> NVMe namespace\n", disk->d_unit, descr); @@ -387,58 +432,22 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar (uintmax_t)disk->d_mediasize / disk->d_sectorsize, disk->d_sectorsize); - return (NULL); + return (ndisk); } static void -destroy_geom_disk(struct nvd_disk *ndisk) -{ - struct bio *bp; - struct disk *disk; - uint32_t unit; - int cnt = 0; - - disk = ndisk->disk; - unit = disk->d_unit; - taskqueue_free(ndisk->tq); - - disk_destroy(ndisk->disk); - - mtx_lock(&ndisk->bioqlock); - for (;;) { - bp = bioq_takefirst(&ndisk->bioq); - if (bp == NULL) - break; - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - cnt++; - biodone(bp); - } - - printf(NVD_STR"%u: lost device - %d outstanding\n", unit, cnt); - printf(NVD_STR"%u: removing device entry\n", unit); - - mtx_unlock(&ndisk->bioqlock); - - mtx_destroy(&ndisk->bioqlock); -} - -static void nvd_controller_fail(void *ctrlr_arg) { struct nvd_controller *ctrlr = ctrlr_arg; - struct nvd_disk *disk; + struct nvd_disk *ndisk; - while (!TAILQ_EMPTY(&ctrlr->disk_head)) { - disk = TAILQ_FIRST(&ctrlr->disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - TAILQ_REMOVE(&ctrlr->disk_head, disk, ctrlr_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - + mtx_lock(&nvd_lock); TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_fail", 0); + mtx_unlock(&nvd_lock); free(ctrlr, M_NVD); } From owner-svn-src-all@freebsd.org Fri Jan 25 20:02:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71AA814C1124; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@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 188A16F3C2; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ADF1D2AF; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PK2tev092534; Fri, 25 Jan 2019 20:02:55 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PK2tB2092533; Fri, 25 Jan 2019 20:02:55 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252002.x0PK2tB2092533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343448 - head/sys/mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/ingenic X-SVN-Commit-Revision: 343448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 188A16F3C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:02:56 -0000 Author: gonzo Date: Fri Jan 25 20:02:55 2019 New Revision: 343448 URL: https://svnweb.freebsd.org/changeset/base/343448 Log: [mips] Fix counter mask in jz4780 timer driver Fix dublicate value in what is apparent copypaste mistake. The last value in mask is supposed to be for counter 7, not counter 3. PR: 229790 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/ingenic/jz4780_timer.c Modified: head/sys/mips/ingenic/jz4780_timer.c ============================================================================== --- head/sys/mips/ingenic/jz4780_timer.c Fri Jan 25 20:00:59 2019 (r343447) +++ head/sys/mips/ingenic/jz4780_timer.c Fri Jan 25 20:02:55 2019 (r343448) @@ -185,7 +185,7 @@ jz4780_timer_attach(device_t dev) CSR_WRITE_4(sc, JZ_TC_TECR, TESR_OST); /* Stop all other channels as well */ CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 | - TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST3); + TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST7); /* Clear detect mask flags */ CSR_WRITE_4(sc, JZ_TC_TFCR, 0xFFFFFFFF); /* Mask all interrupts */ From owner-svn-src-all@freebsd.org Fri Jan 25 20:07:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F47D14C13B8; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@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 359BB6F91F; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 29771D2B9; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PK7J8j092928; Fri, 25 Jan 2019 20:07:19 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PK7IVr092925; Fri, 25 Jan 2019 20:07:18 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901252007.x0PK7IVr092925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 25 Jan 2019 20:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343449 - in head/sbin: newfs tunefs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: newfs tunefs X-SVN-Commit-Revision: 343449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 359BB6F91F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:07:19 -0000 Author: mckusick Date: Fri Jan 25 20:07:18 2019 New Revision: 343449 URL: https://svnweb.freebsd.org/changeset/base/343449 Log: Allow tunefs to include '_' as a legal character in label names to make it consistent with newfs. Document the legality of '_' in label names in both tunefs(8) and newfs(8). PR: 235182 Submitted by: darius@dons.net.au Reviewed by: Conrad Meyer MFC after: 3 days Sponsored by: Netflix Modified: head/sbin/newfs/newfs.8 head/sbin/tunefs/tunefs.8 head/sbin/tunefs/tunefs.c Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/newfs/newfs.8 Fri Jan 25 20:07:18 2019 (r343449) @@ -89,6 +89,7 @@ See for details. .It Fl L Ar volname Add a volume label to the new file system. +Legal characters are alphanumerics and underscores. .It Fl N Cause the file system parameters to be printed out without really creating the file system. Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/tunefs/tunefs.8 Fri Jan 25 20:07:18 2019 (r343449) @@ -112,6 +112,7 @@ By default sets it to half of the space reserved to minfree. .It Fl L Ar volname Add/modify an optional file system volume label. +Legal characters are alphanumerics and underscores. .It Fl l Cm enable | disable Turn on/off MAC multilabel flag. .It Fl m Ar minfree Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/tunefs/tunefs.c Fri Jan 25 20:07:18 2019 (r343449) @@ -189,7 +189,7 @@ main(int argc, char *argv[]) name = "volume label"; Lvalue = optarg; i = -1; - while (isalnum(Lvalue[++i])); + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); if (Lvalue[i] != '\0') { errx(10, "bad %s. Valid characters are alphanumerics.", From owner-svn-src-all@freebsd.org Fri Jan 25 20:10:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD66714C1583; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@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 54B246FBEC; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47635D2EA; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKAwIZ096120; Fri, 25 Jan 2019 20:10:58 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKAw7H096119; Fri, 25 Jan 2019 20:10:58 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252010.x0PKAw7H096119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343450 - head/sys/mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/ingenic X-SVN-Commit-Revision: 343450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54B246FBEC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:10:58 -0000 Author: gonzo Date: Fri Jan 25 20:10:57 2019 New Revision: 343450 URL: https://svnweb.freebsd.org/changeset/base/343450 Log: [mips] Unbreak kernel build for CI20 - Include header required for boot_parse_XXX functions - Use boot_parse_args when parsing argc/argv style arguments - Remove unused function Modified: head/sys/mips/ingenic/jz4780_machdep.c Modified: head/sys/mips/ingenic/jz4780_machdep.c ============================================================================== --- head/sys/mips/ingenic/jz4780_machdep.c Fri Jan 25 20:07:18 2019 (r343449) +++ head/sys/mips/ingenic/jz4780_machdep.c Fri Jan 25 20:10:57 2019 (r343450) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,20 +174,6 @@ mips_init(void) #endif } -#ifdef FDT -static void -_parse_bootargs(char *cmdline) -{ - char *v; - - while ((v = strsep(&cmdline, " \n")) != NULL) { - if (*v == '\0') - continue; - boothowto |= boot_parse_arg(v); - } -} -#endif - void platform_start(__register_t a0, __register_t a1, __register_t a2 __unused, __register_t a3 __unused) @@ -247,7 +234,7 @@ platform_start(__register_t a0, __register_t a1, /* Parse cmdline from U-Boot */ argc = a0; argv = (char **)a1; - boothowto |= boot_parse_cmdline(argc, argv); + boothowto |= boot_parse_args(argc, argv); mips_init(); } From owner-svn-src-all@freebsd.org Fri Jan 25 20:13:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36F0E14C1891; Fri, 25 Jan 2019 20:13:29 +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 D17FE70107; Fri, 25 Jan 2019 20:13:28 +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 BCFEBD47F; Fri, 25 Jan 2019 20:13:28 +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 x0PKDSek097908; Fri, 25 Jan 2019 20:13:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKDSGx097907; Fri, 25 Jan 2019 20:13:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901252013.x0PKDSGx097907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 25 Jan 2019 20:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343451 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 343451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D17FE70107 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:13:29 -0000 Author: hselasky Date: Fri Jan 25 20:13:28 2019 New Revision: 343451 URL: https://svnweb.freebsd.org/changeset/base/343451 Log: Add full support for PCI_ANY_ID when matching PCI IDs in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:10:57 2019 (r343450) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:13:28 2019 (r343451) @@ -71,7 +71,7 @@ struct pci_device_id { #define PCI_BASE_CLASS_BRIDGE 0x06 #define PCI_CLASS_BRIDGE_ISA 0x0601 -#define PCI_ANY_ID (-1) +#define PCI_ANY_ID -1U #define PCI_VENDOR_ID_APPLE 0x106b #define PCI_VENDOR_ID_ASUSTEK 0x1043 #define PCI_VENDOR_ID_ATI 0x1002 Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:10:57 2019 (r343450) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:13:28 2019 (r343451) @@ -82,14 +82,21 @@ linux_pci_find(device_t dev, const struct pci_device_i struct pci_driver *pdrv; uint16_t vendor; uint16_t device; + uint16_t subvendor; + uint16_t subdevice; vendor = pci_get_vendor(dev); device = pci_get_device(dev); + subvendor = pci_get_subvendor(dev); + subdevice = pci_get_subdevice(dev); spin_lock(&pci_lock); list_for_each_entry(pdrv, &pci_drivers, links) { for (id = pdrv->id_table; id->vendor != 0; id++) { - if (vendor == id->vendor && device == id->device) { + if (vendor == id->vendor && + (PCI_ANY_ID == id->device || device == id->device) && + (PCI_ANY_ID == id->subvendor || subvendor == id->subvendor) && + (PCI_ANY_ID == id->subdevice || subdevice == id->subdevice)) { *idp = id; spin_unlock(&pci_lock); return (pdrv); @@ -145,8 +152,8 @@ linux_pci_attach(device_t dev) pdev->dev.bsddev = dev; INIT_LIST_HEAD(&pdev->dev.irqents); pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); - pdev->device = id->device; - pdev->vendor = id->vendor; + pdev->device = dinfo->cfg.device; + pdev->vendor = dinfo->cfg.vendor; pdev->subsystem_vendor = dinfo->cfg.subvendor; pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); From owner-svn-src-all@freebsd.org Fri Jan 25 20:14:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC01314C1930; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@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 388677028F; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BF9AD480; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKESrR097989; Fri, 25 Jan 2019 20:14:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKESHP097988; Fri, 25 Jan 2019 20:14:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252014.x0PKESHP097988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343452 - head/sys/mips/nlm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/nlm X-SVN-Commit-Revision: 343452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 388677028F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:14:30 -0000 Author: gonzo Date: Fri Jan 25 20:14:28 2019 New Revision: 343452 URL: https://svnweb.freebsd.org/changeset/base/343452 Log: [mips] Fix error condition check that always evaluates to false Use proper logical operand when checking the value of srcid PR: 200988 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/nlm/cms.c Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Fri Jan 25 20:13:28 2019 (r343451) +++ head/sys/mips/nlm/cms.c Fri Jan 25 20:14:28 2019 (r343452) @@ -204,7 +204,7 @@ xlp_handle_msg_vc(u_int vcmask, int max_msgs) nlm_restore_flags(mflags); if (status != 0) /* no msg or error */ continue; - if (srcid < 0 && srcid >= 1024) { + if (srcid < 0 || srcid >= 1024) { printf("[%s]: bad src id %d\n", __func__, srcid); continue; From owner-svn-src-all@freebsd.org Fri Jan 25 20:15:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0020014C1A79; Fri, 25 Jan 2019 20:15:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4BA70564; Fri, 25 Jan 2019 20:15:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PKFjUq090039; Fri, 25 Jan 2019 12:15:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PKFjeT090038; Fri, 25 Jan 2019 12:15:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901252015.x0PKFjeT090038@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343449 - in head/sbin: newfs tunefs In-Reply-To: <201901252007.x0PK7IVr092925@repo.freebsd.org> To: Kirk McKusick Date: Fri, 25 Jan 2019 12:15:45 -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: 5B4BA70564 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:15:48 -0000 > Author: mckusick > Date: Fri Jan 25 20:07:18 2019 > New Revision: 343449 > URL: https://svnweb.freebsd.org/changeset/base/343449 > > Log: > Allow tunefs to include '_' as a legal character in label names > to make it consistent with newfs. Document the legality of '_' > in label names in both tunefs(8) and newfs(8). > > PR: 235182 > Submitted by: darius@dons.net.au > Reviewed by: Conrad Meyer > MFC after: 3 days > Sponsored by: Netflix > > Modified: > head/sbin/newfs/newfs.8 > head/sbin/tunefs/tunefs.8 > head/sbin/tunefs/tunefs.c > > Modified: head/sbin/newfs/newfs.8 > ============================================================================== > --- head/sbin/newfs/newfs.8 Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/newfs/newfs.8 Fri Jan 25 20:07:18 2019 (r343449) > @@ -89,6 +89,7 @@ See > for details. > .It Fl L Ar volname > Add a volume label to the new file system. > +Legal characters are alphanumerics and underscores. > .It Fl N > Cause the file system parameters to be printed out > without really creating the file system. > > Modified: head/sbin/tunefs/tunefs.8 > ============================================================================== > --- head/sbin/tunefs/tunefs.8 Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/tunefs/tunefs.8 Fri Jan 25 20:07:18 2019 (r343449) > @@ -112,6 +112,7 @@ By default > sets it to half of the space reserved to minfree. > .It Fl L Ar volname > Add/modify an optional file system volume label. > +Legal characters are alphanumerics and underscores. > .It Fl l Cm enable | disable > Turn on/off MAC multilabel flag. > .It Fl m Ar minfree > > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/tunefs/tunefs.c Fri Jan 25 20:07:18 2019 (r343449) > @@ -189,7 +189,7 @@ main(int argc, char *argv[]) > name = "volume label"; > Lvalue = optarg; > i = -1; > - while (isalnum(Lvalue[++i])); > + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); > if (Lvalue[i] != '\0') { > errx(10, > "bad %s. Valid characters are alphanumerics.", ^^^^^^^^^^^^ This message is now incorrect. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 20:20:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A0114C1CF1; Fri, 25 Jan 2019 20:20:28 +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 E024B70A37; Fri, 25 Jan 2019 20:20:27 +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 D3413D48E; Fri, 25 Jan 2019 20:20:27 +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 x0PKKR79098493; Fri, 25 Jan 2019 20:20:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKKRno098492; Fri, 25 Jan 2019 20:20:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901252020.x0PKKRno098492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 25 Jan 2019 20:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343453 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E024B70A37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:20:28 -0000 Author: hselasky Date: Fri Jan 25 20:20:27 2019 New Revision: 343453 URL: https://svnweb.freebsd.org/changeset/base/343453 Log: Add new USB quirk. PR: 235202 Differential Revision: https://reviews.freebsd.org/D18917 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 25 20:14:28 2019 (r343452) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 25 20:20:27 2019 (r343453) @@ -171,6 +171,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Jan 25 20:14:28 2019 (r343452) +++ head/sys/dev/usb/usbdevs Fri Jan 25 20:20:27 2019 (r343453) @@ -1583,7 +1583,8 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard -product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard +product CORSAIR STRAFE 0x1b15 Corsair STRAFE Gaming keyboard +product CORSAIR STRAFE2 0x1b44 Corsair STRAFE Gaming keyboard /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player From owner-svn-src-all@freebsd.org Fri Jan 25 20:24:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E121F14C20CC; Fri, 25 Jan 2019 20:24:54 +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 87B94711AF; Fri, 25 Jan 2019 20:24:54 +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 5B3B0D645; Fri, 25 Jan 2019 20:24:54 +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 x0PKOskv003353; Fri, 25 Jan 2019 20:24:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKOrYc003351; Fri, 25 Jan 2019 20:24:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901252024.x0PKOrYc003351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 25 Jan 2019 20:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343454 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 343454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87B94711AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:24:55 -0000 Author: markj Date: Fri Jan 25 20:24:53 2019 New Revision: 343454 URL: https://svnweb.freebsd.org/changeset/base/343454 Log: MFC r343363, r343364: Fix an LLE lookup race. PR: 234296 Modified: stable/12/sys/netinet/in.c stable/12/sys/netinet6/in6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in.c ============================================================================== --- stable/12/sys/netinet/in.c Fri Jan 25 20:20:27 2019 (r343453) +++ stable/12/sys/netinet/in.c Fri Jan 25 20:24:53 2019 (r343454) @@ -1378,15 +1378,13 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - lle = in_lltable_find_dst(llt, sin->sin_addr); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); + lle = in_lltable_find_dst(llt, sin->sin_addr); if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); @@ -1395,6 +1393,17 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co else LLE_RLOCK(lle); + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } Modified: stable/12/sys/netinet6/in6.c ============================================================================== --- stable/12/sys/netinet6/in6.c Fri Jan 25 20:20:27 2019 (r343453) +++ stable/12/sys/netinet6/in6.c Fri Jan 25 20:24:53 2019 (r343454) @@ -2315,16 +2315,13 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); - if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); @@ -2332,6 +2329,18 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, LLE_WLOCK(lle); else LLE_RLOCK(lle); + + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } From owner-svn-src-all@freebsd.org Fri Jan 25 20:53:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6718414C2EE6; Fri, 25 Jan 2019 20:53:30 +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 075C472497; Fri, 25 Jan 2019 20:53:30 +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 E7618DB79; Fri, 25 Jan 2019 20:53:29 +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 x0PKrTW8019003; Fri, 25 Jan 2019 20:53:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKrTwT019002; Fri, 25 Jan 2019 20:53:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901252053.x0PKrTwT019002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 25 Jan 2019 20:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343455 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 343455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 075C472497 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:53:30 -0000 Author: cy Date: Fri Jan 25 20:53:29 2019 New Revision: 343455 URL: https://svnweb.freebsd.org/changeset/base/343455 Log: Fix 32-bit buildworld broken by r343438. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 20:24:53 2019 (r343454) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 20:53:29 2019 (r343455) @@ -977,7 +977,7 @@ static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp) printf (BEGIN_COMMENT); acpi_print_sdt(sdp); tpm2 = (ACPI_TABLE_TPM2 *) sdp; - printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress); + printf ("\t\tControlArea=%jx\n", tpm2->ControlAddress); printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); printf (END_COMMENT); } From owner-svn-src-all@freebsd.org Fri Jan 25 20:54:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEACF14C2F38; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@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 774F272604; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3320EDB85; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKsIx8019081; Fri, 25 Jan 2019 20:54:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKsIBP019080; Fri, 25 Jan 2019 20:54:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901252054.x0PKsIBP019080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 25 Jan 2019 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343456 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 774F272604 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:54:20 -0000 Author: jhb Date: Fri Jan 25 20:54:18 2019 New Revision: 343456 URL: https://svnweb.freebsd.org/changeset/base/343456 Log: Fix a few more places to handle ofld tx queues for RATELIMIT. - Drain offload transmit queues when RATELIMIT is enabled but TCP_OFFLOAD is not. - Expose the per-VI nofldtxq and first_ofld_txq sysctls when RATELIMIT is enabled but TCP_OFFLOAD is not. - Clear offload transmit queue stats as part of a 'cxgbetool clearstats' request when RATELIMIT is enabled but TCP_OFFLOAD is not. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18966 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jan 25 20:53:29 2019 (r343455) +++ head/sys/dev/cxgbe/t4_main.c Fri Jan 25 20:54:18 2019 (r343456) @@ -5524,6 +5524,8 @@ vi_full_uninit(struct vi_info *vi) struct sge_txq *txq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) struct sge_wrq *ofld_txq; #endif @@ -5539,7 +5541,7 @@ vi_full_uninit(struct vi_info *vi) quiesce_txq(sc, txq); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { quiesce_wrq(sc, ofld_txq); } @@ -6327,15 +6329,9 @@ vi_sysctls(struct vi_info *vi) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD, &vi->nofldrxq, 0, "# of rx queues for offloaded TCP connections"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD, - &vi->nofldtxq, 0, - "# of tx queues for offloaded TCP connections"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_rxq", CTLFLAG_RD, &vi->first_ofld_rxq, 0, "index of first TOE rx queue"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq", - CTLFLAG_RD, &vi->first_ofld_txq, 0, - "index of first TOE tx queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld", CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_tmr_idx_ofld, "I", @@ -6346,6 +6342,16 @@ vi_sysctls(struct vi_info *vi) "holdoff packet counter index for TOE queues"); } #endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + if (vi->nofldtxq != 0) { + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD, + &vi->nofldtxq, 0, + "# of tx queues for TOE/ETHOFLD"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq", + CTLFLAG_RD, &vi->first_ofld_txq, 0, + "index of first TOE/ETHOFLD tx queue"); + } +#endif #ifdef DEV_NETMAP if (vi->nnmrxq != 0) { SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmrxq", CTLFLAG_RD, @@ -10011,7 +10017,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t mp_ring_reset_stats(txq->r); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) /* nothing to clear for each ofld_rxq */ for_each_ofld_txq(vi, i, wrq) { From owner-svn-src-all@freebsd.org Fri Jan 25 21:24:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F012B14C3852; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@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 8DF21736D2; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7BD96E0C9; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PLOAWn034859; Fri, 25 Jan 2019 21:24:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PLOAOE034857; Fri, 25 Jan 2019 21:24:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901252124.x0PLOAOE034857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 25 Jan 2019 21:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343457 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 343457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DF21736D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:24:11 -0000 Author: mckusick Date: Fri Jan 25 21:24:09 2019 New Revision: 343457 URL: https://svnweb.freebsd.org/changeset/base/343457 Log: Add printing of b_ioflags to DDB `show buffer' command. Sponsored by: Netflix Modified: head/sys/kern/vfs_bio.c head/sys/sys/bio.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jan 25 20:54:18 2019 (r343456) +++ head/sys/kern/vfs_bio.c Fri Jan 25 21:24:09 2019 (r343457) @@ -5329,9 +5329,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) } db_printf("buf at %p\n", bp); - db_printf("b_flags = 0x%b, b_xflags=0x%b, b_vflags=0x%b\n", - (u_int)bp->b_flags, PRINT_BUF_FLAGS, (u_int)bp->b_xflags, - PRINT_BUF_XFLAGS, (u_int)bp->b_vflags, PRINT_BUF_VFLAGS); + db_printf("b_flags = 0x%b, b_xflags=0x%b\n", + (u_int)bp->b_flags, PRINT_BUF_FLAGS, + (u_int)bp->b_xflags, PRINT_BUF_XFLAGS); + db_printf("b_vflags=0x%b b_ioflags0x%b\n", + (u_int)bp->b_vflags, PRINT_BUF_VFLAGS, + (u_int)bp->b_ioflags, PRINT_BIO_FLAGS); db_printf( "b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n" "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, " Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Fri Jan 25 20:54:18 2019 (r343456) +++ head/sys/sys/bio.h Fri Jan 25 21:24:09 2019 (r343457) @@ -67,6 +67,9 @@ #define BIO_TRANSIENT_MAPPING 0x20 #define BIO_VLIST 0x40 +#define PRINT_BIO_FLAGS "\20\7vlist\6transient_mapping\5unmapped" \ + "\4ordered\3onqueue\2done\1error" + #ifdef _KERNEL struct disk; struct bio; From owner-svn-src-all@freebsd.org Fri Jan 25 21:38:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA6214C3E03; Fri, 25 Jan 2019 21:38:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0600974472; Fri, 25 Jan 2019 21:38:07 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f47.google.com with SMTP id t5so9912146otk.1; Fri, 25 Jan 2019 13:38:07 -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:content-transfer-encoding; bh=4vVyULC4t3i26dKwAq9edILzA+WtsYH6/Yp3i1Ucq8o=; b=sJnbgWlu/WBsNg2jXgGxinmM6Bz9LUqhTz6jpmlkqRAiHR3uVjLRp+awDSYELldpIi aYqwWZPfUqwQoq5r+yRnFZaozWzlDZCr4MvcXJ9uW1MxaVaXwICxsprLopabCgi4tQPr g/y+lg1fswaIMfLVZQa4xgGXsnfj2xsh+4WrJmH8PBfkvj44z7yTtouBJ6D4efJvnfZ9 BJTRZ1J1f+5J9cca1dYJwd0mm0a5LzlXh9CIHDYi61id/SS1ra1e1kOV5FtMqGTEebxY XrRaL6bpdIGJNVp13+/R5EqvFUVfqII0VhXo+gLCe53OQCI1MNQ12ZSk1WDM/ZAY7ZI6 mWNA== X-Gm-Message-State: AJcUukdUsIHL0wWU3weeiPGt6+i7TiOo3Ksyc77uS/vovgHyBo7dVfvJ U9WBvUyqWCyEhb4JFMz6sbIm4CZqzubZ+j56KcAQEA== X-Google-Smtp-Source: ALg8bN4Rn0+mj8HC7CXPGeS5M4l3ZqqmsFAO0mnhnEzdg2ZOvGYk/kuv8cY9AH1m2Fp1kvk3tww3chCv8seyJYv55t0= X-Received: by 2002:a9d:7450:: with SMTP id p16mr8433257otk.247.1548452280892; Fri, 25 Jan 2019 13:38:00 -0800 (PST) MIME-Version: 1.0 References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Fri, 25 Jan 2019 21:37:49 +0000 Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0600974472 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.48 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.48)[-0.483,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:38:08 -0000 pt., 25 sty 2019 o 19:57 Rodney W. Grimes napisa=C5=82(a): > > > Author: trasz > > Date: Fri Jan 25 17:09:26 2019 > > New Revision: 343440 > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > Log: > > Comment out the default sh(1) aliases for root, introduced in r343416= . > > The rest of this stuff is still to be discussed, but I think at this > > point we have the agreement that the aliases should go. > > > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > Please just revert this and the prior commit out, and when > the path forward is clear commit it. I would not want any of this > merged to 12/ or 11/ until the time that it is all settled. Oops, my bad - neither this nor the previous commit is supposed to be MFC-ed; the "2 weeks" above comes from my default Subversion config. Regarding the backoff - just a few hours ago you said you don't have any problem with this, except for aliases and the default ENV. The aliases problem has been addressed, and you hadn't yet responded to my explanations regarding the ENV. Another committer asked for backoff, because "sh is not an interactive shell", while in fact sh(1) is FreeBSD's default interactive shell except for root. Finally, there's one person who asked for revert, but without giving any reasons whatsoever. So far nobody had proposed any scenario where this would break anything, or even affect existing users. It seems like a typical bikeshed situation. From owner-svn-src-all@freebsd.org Fri Jan 25 21:38:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A3814C3E3A; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@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 19694745AC; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 096D8E2B5; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PLcSIJ040224; Fri, 25 Jan 2019 21:38:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PLcSLl040223; Fri, 25 Jan 2019 21:38:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252138.x0PLcSLl040223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 21:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343458 - head/sys/dev/bhnd/cores/pmu X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/pmu X-SVN-Commit-Revision: 343458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19694745AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:38:29 -0000 Author: gonzo Date: Fri Jan 25 21:38:28 2019 New Revision: 343458 URL: https://svnweb.freebsd.org/changeset/base/343458 Log: Fix format/arg mismatch USe correct format for int arguments PR: 229549 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:24:09 2019 (r343457) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:38:28 2019 (r343458) @@ -1036,7 +1036,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc) return (error); } - PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_updn_timer\n", + PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_updn_timer\n", name, val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); @@ -1111,7 +1111,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc) return (error); } - PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_dep_mask\n", name, + PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_dep_mask\n", name, val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); From owner-svn-src-all@freebsd.org Fri Jan 25 22:22:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DABC114C5242; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@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 8181075FDF; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75E0AEB3D; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PMMTUO066089; Fri, 25 Jan 2019 22:22:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PMMT7T066088; Fri, 25 Jan 2019 22:22:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901252222.x0PMMT7T066088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 25 Jan 2019 22:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343459 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 343459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8181075FDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:22:30 -0000 Author: pfg Date: Fri Jan 25 22:22:29 2019 New Revision: 343459 URL: https://svnweb.freebsd.org/changeset/base/343459 Log: ext2fs: Add some extra consistency checks for the superblock. Maliciously formed, or badly corrupted, filesystems can cause kernel panics. In general, such acts of foot-shooting can only be accomplished by root, but in a world with VM images that is moving towards automated mounts it is important to have some form of prevention. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE. Incidentaly this should also fix a memory corruption issue reported by Dr Silvio Cesare of InfoSect. Huge thanks to all reseachers for making us aware of the issue. admbug: 872, 891 Reviewed by: fsu Obtained from: NetBSD (with minor changes) MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 25 21:38:28 2019 (r343458) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 25 22:22:29 2019 (r343459) @@ -416,7 +416,16 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es es->e3fs_desc_size); return (EINVAL); } + /* Check for block size = 1K|2K|4K */ + if (es->e2fs_log_bsize > 2) { + printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + return (EINVAL); + } /* Check for group size */ + if (fs->e2fs_bpg == 0) { + printf("ext2fs: zero blocks per group\n"); + return (EINVAL); + } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { printf("ext2fs: non-standard group size unsupported %d\n", fs->e2fs_bpg); @@ -424,7 +433,21 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); + if (fs->e2fs_ipg == 0) { + printf("ext2fs: zero inodes per group\n"); + return (EINVAL); + } fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; + /* Check for block consistency */ + if (es->e2fs_first_dblock >= fs->e2fs_bcount) { + printf("ext2fs: invalid first data block\n"); + return (EINVAL); + } + if (fs->e2fs_rbcount > fs->e2fs_bcount || + fs->e2fs_fbcount > fs->e2fs_bcount) { + printf("ext2fs: invalid block count\n"); + return (EINVAL); + } /* s_resuid / s_resgid ? */ fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); From owner-svn-src-all@freebsd.org Fri Jan 25 22:29:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B09A14C54FA; Fri, 25 Jan 2019 22:29:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D60F763A4; Fri, 25 Jan 2019 22:29:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PMTGhJ090515; Fri, 25 Jan 2019 14:29:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PMTGum090514; Fri, 25 Jan 2019 14:29:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901252229.x0PMTGum090514@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: To: Edward Napierala Date: Fri, 25 Jan 2019 14:29:16 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , 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: 4D60F763A4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:29:21 -0000 > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > napisa?(a): > > > > > Author: trasz > > > Date: Fri Jan 25 17:09:26 2019 > > > New Revision: 343440 > > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > > > Log: > > > Comment out the default sh(1) aliases for root, introduced in r343416. > > > The rest of this stuff is still to be discussed, but I think at this > > > point we have the agreement that the aliases should go. > > > > > > MFC after: 2 weeks > > > Sponsored by: DARPA, AFRL > > > > Please just revert this and the prior commit out, and when > > the path forward is clear commit it. I would not want any of this > > merged to 12/ or 11/ until the time that it is all settled. > > Oops, my bad - neither this nor the previous commit is supposed > to be MFC-ed; the "2 weeks" above comes from my default Subversion > config. > > Regarding the backoff - just a few hours ago you said you don't have > any problem with this, except for aliases and the default ENV. The > aliases problem has been addressed, and you hadn't yet responded > to my explanations regarding the ENV. Another committer asked for > backoff, because "sh is not an interactive shell", while in fact sh(1) > is FreeBSD's default interactive shell except for root. Finally, there's > one person who asked for revert, but without giving any reasons > whatsoever. > > So far nobody had proposed any scenario where this would break > anything, or even affect existing users. It seems like a typical bikeshed > situation. Within hours of your initial commit you had myself, ian and cy all in opposition to this change , devin asked for a revert, first privately to me which I encouraged a public posting of. Thats four people who want this removed. I have now asked publically for a revert. Thats 2 public request for revert. The hat was only about the MFC statement which you have retracted. Just back it out and we can come to a better solution. Especially dependent on the outcome of Bapts mksh proposal. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 25 22:41:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC93D14C590B; Fri, 25 Jan 2019 22:41:52 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 37A7B76AE3; Fri, 25 Jan 2019 22:41:52 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63444 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAAJ-000DzF-DV; Fri, 25 Jan 2019 14:41:35 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:41:47 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 37A7B76AE3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:41:53 -0000 > On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >=20 > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > napisa=C5=82(a): >>=20 >>> Author: trasz >>> Date: Fri Jan 25 17:09:26 2019 >>> New Revision: 343440 >>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>=20 >>> Log: >>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>> The rest of this stuff is still to be discussed, but I think at = this >>> point we have the agreement that the aliases should go. >>>=20 >>> MFC after: 2 weeks >>> Sponsored by: DARPA, AFRL >>=20 >> Please just revert this and the prior commit out, and when >> the path forward is clear commit it. I would not want any of this >> merged to 12/ or 11/ until the time that it is all settled. >=20 > Oops, my bad - neither this nor the previous commit is supposed > to be MFC-ed; the "2 weeks" above comes from my default Subversion > config. >=20 > Regarding the backoff - just a few hours ago you said you don't have > any problem with this, except for aliases and the default ENV. The > aliases problem has been addressed, and you hadn't yet responded > to my explanations regarding the ENV. Another committer asked for > backoff, because "sh is not an interactive shell", while in fact sh(1) > is FreeBSD's default interactive shell except for root. Finally, = there's > one person who asked for revert, but without giving any reasons > whatsoever. >=20 > So far nobody had proposed any scenario where this would break > anything, or even affect existing users. It seems like a typical = bikeshed > situation. It is not clear to me after reading r343416 and D18872 what this change = is trying to solve. PS1 should have a reasonable default. If that default is not reasonable, = then we should change the C code. Maybe I see things differently, but I'd rather see PS1 default change so = no profile/shrc change is necessary. I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. If you wanted your new shiny default PS1 to actually have an effect in = all modes (including privileged mode, where you probably want it), you = would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). So the solution is not even the right one for the desired result. --=20 Devin From owner-svn-src-all@freebsd.org Fri Jan 25 22:47:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C4414C59CE; Fri, 25 Jan 2019 22:47:07 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 A2EE976D05; Fri, 25 Jan 2019 22:47:06 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63454 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAFN-000E39-Vy; Fri, 25 Jan 2019 14:46:50 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:47:02 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: A2EE976D05 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:47:07 -0000 > On Jan 25, 2019, at 2:41 PM, Devin Teske wrote: >=20 >=20 >=20 >> On Jan 25, 2019, at 1:37 PM, Edward Napierala > wrote: >>=20 >> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >> > napisa=C5=82(a): >>>=20 >>>> Author: trasz >>>> Date: Fri Jan 25 17:09:26 2019 >>>> New Revision: 343440 >>>> URL: https://svnweb.freebsd.org/changeset/base/343440 = >>>>=20 >>>> Log: >>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>> The rest of this stuff is still to be discussed, but I think at = this >>>> point we have the agreement that the aliases should go. >>>>=20 >>>> MFC after: 2 weeks >>>> Sponsored by: DARPA, AFRL >>>=20 >>> Please just revert this and the prior commit out, and when >>> the path forward is clear commit it. I would not want any of this >>> merged to 12/ or 11/ until the time that it is all settled. >>=20 >> Oops, my bad - neither this nor the previous commit is supposed >> to be MFC-ed; the "2 weeks" above comes from my default Subversion >> config. >>=20 >> Regarding the backoff - just a few hours ago you said you don't have >> any problem with this, except for aliases and the default ENV. The >> aliases problem has been addressed, and you hadn't yet responded >> to my explanations regarding the ENV. Another committer asked for >> backoff, because "sh is not an interactive shell", while in fact = sh(1) >> is FreeBSD's default interactive shell except for root. Finally, = there's >> one person who asked for revert, but without giving any reasons >> whatsoever. >>=20 >> So far nobody had proposed any scenario where this would break >> anything, or even affect existing users. It seems like a typical = bikeshed >> situation. >=20 > It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >=20 > PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >=20 > Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >=20 > I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >=20 > Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >=20 > If you wanted your new shiny default PS1 to actually have an effect in = all modes (including privileged mode, where you probably want it), you = would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >=20 > So the solution is not even the right one for the desired result. I would also like to add, that the current default for PS1 is static for = a reason. Long ago, people used to write things in TCL/Expect. If PS1 is not = static, you either have to override it or account for the variance (# = for root, $ for others). This is an important distinction specifically because TCL/Expect is used = in the control of interactive shells. --=20 Devin= From owner-svn-src-all@freebsd.org Fri Jan 25 22:50:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA02214C5B23; Fri, 25 Jan 2019 22:50:40 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 81BE276F2E; Fri, 25 Jan 2019 22:50:40 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63469 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAJ4-000E5S-Lm; Fri, 25 Jan 2019 14:50:39 -0800 From: Devin Teske Message-Id: <7DDC8FBE-5381-47FC-AB49-8BE2849B37AD@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:50:37 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 81BE276F2E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:50:41 -0000 > On Jan 25, 2019, at 2:47 PM, Devin Teske wrote: >=20 >=20 >=20 >> On Jan 25, 2019, at 2:41 PM, Devin Teske > wrote: >>=20 >>=20 >>=20 >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala > wrote: >>>=20 >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>> > napisa=C5=82(a): >>>>=20 >>>>> Author: trasz >>>>> Date: Fri Jan 25 17:09:26 2019 >>>>> New Revision: 343440 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 = >>>>>=20 >>>>> Log: >>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>> point we have the agreement that the aliases should go. >>>>>=20 >>>>> MFC after: 2 weeks >>>>> Sponsored by: DARPA, AFRL >>>>=20 >>>> Please just revert this and the prior commit out, and when >>>> the path forward is clear commit it. I would not want any of this >>>> merged to 12/ or 11/ until the time that it is all settled. >>>=20 >>> Oops, my bad - neither this nor the previous commit is supposed >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>> config. >>>=20 >>> Regarding the backoff - just a few hours ago you said you don't have >>> any problem with this, except for aliases and the default ENV. The >>> aliases problem has been addressed, and you hadn't yet responded >>> to my explanations regarding the ENV. Another committer asked for >>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>> is FreeBSD's default interactive shell except for root. Finally, = there's >>> one person who asked for revert, but without giving any reasons >>> whatsoever. >>>=20 >>> So far nobody had proposed any scenario where this would break >>> anything, or even affect existing users. It seems like a typical = bikeshed >>> situation. >>=20 >> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >>=20 >> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>=20 >> Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >>=20 >> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >>=20 >> Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >>=20 >> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >>=20 >> So the solution is not even the right one for the desired result. >=20 > I would also like to add, that the current default for PS1 is static = for a reason. >=20 > Long ago, people used to write things in TCL/Expect. If PS1 is not = static, you either have to override it or account for the variance (# = for root, $ for others). >=20 > This is an important distinction specifically because TCL/Expect is = used in the control of interactive shells. And an aside: I still program in TCL/Expect. I have been known to customize PS2 and = PS4. I may have neglected to give reasons previously, but that's because I = was in a meeting and unable to expand on the particular technical = intricacies: 1. The relationship default PS1, PS2, and PS4 have with software like = TCL/Expect 2. The fact that ENV is wholly ignored in privileged mode 3. The fact that introducing ~/.shrc as a runnable file for interactive = sh globally and by-default is something that should be run by secteam --=20 Devin From owner-svn-src-all@freebsd.org Fri Jan 25 22:52:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5885F14C5D00; Fri, 25 Jan 2019 22:52:50 +0000 (UTC) (envelope-from jilles@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 EC4CA77317; Fri, 25 Jan 2019 22:52:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9661F054; Fri, 25 Jan 2019 22:52:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PMqnja081375; Fri, 25 Jan 2019 22:52:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PMqnQu081374; Fri, 25 Jan 2019 22:52:49 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901252252.x0PMqnQu081374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 25 Jan 2019 22:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343460 - stable/11/lib/libedit X-SVN-Group: stable-11 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/11/lib/libedit X-SVN-Commit-Revision: 343460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC4CA77317 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:52:50 -0000 Author: jilles Date: Fri Jan 25 22:52:49 2019 New Revision: 343460 URL: https://svnweb.freebsd.org/changeset/base/343460 Log: MFC r343105: libedit: Avoid out of bounds read in 'bind' command This is CVS revision 1.31 from NetBSD lib/libedit/chartype.c: Make sure that argv is NULL terminated since functions like tty_stty rely on it to be so (Gerry Swinslow) This broke when the wide-character support was enabled in libedit. The conversion from multibyte to wide-character did not supply the apparently expected terminating NULL in the new argv array. PR: 233343 Modified: stable/11/lib/libedit/chartype.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libedit/chartype.c ============================================================================== --- stable/11/lib/libedit/chartype.c Fri Jan 25 22:22:29 2019 (r343459) +++ stable/11/lib/libedit/chartype.c Fri Jan 25 22:52:49 2019 (r343460) @@ -157,7 +157,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) return NULL; - wargv = el_malloc((size_t)argc * sizeof(*wargv)); + wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv)); for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { /* don't pass null pointers to mbstowcs */ @@ -175,6 +175,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer bufspace -= (size_t)bytes; p += bytes; } + wargv[i] = NULL; return wargv; } From owner-svn-src-all@freebsd.org Fri Jan 25 23:01:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62F7F14C60AD; Fri, 25 Jan 2019 23:01:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C24117781F; Fri, 25 Jan 2019 23:01:36 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id t6so11919282wrr.12; Fri, 25 Jan 2019 15:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YAEwvYTS55Ru0KTZ6hgc3Tv6ahIa3dNKgJ4SpBhHIQs=; b=FndxRxWgdTlaebwvQ69dDbjlsPznKfcgVBRICaw+hO9kh4wtQuG3cWyVZy0F7uNaJA co/IczCtOjVnRWdXiwd2hFW3mZREVSJGc40BL1tHFtVmM55A/BnuEoF07bkSN8Bfhg8U wbLvy+LR1WpM1/Fza2Jih7cjiww9U1Ep0TI0cD9bbzQKg+VA2TTsI+GOzX/dcXRPn+rK jT9ZDk3CSJEMiBoWaXGcUIosDxNg+ws/8ugNgPKHi0/5JKBiVfIB1y+OEfUWdYOFu8fv edStSW+CMZSqgEyD+BUrXGAElXLem1oS3h2IotGBionsmWvmOD+B0hOYpIdptZcbCuZi 1b/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YAEwvYTS55Ru0KTZ6hgc3Tv6ahIa3dNKgJ4SpBhHIQs=; b=G8en1GoZkj+M5Tdb4hMIKPGaNuIne2gAubqbjwm/+a5YZ9IwGVqPQEdnxPMdm1aFNV 6D9o1HqQWhu2ShTYYNX96l22IGoDiA7g4gXfeTfxUHCg1sg1A5rqmtqSV2y94/97Q2Ed +M7c1rvwUyh5+gsAl7nyIqRa+idw22ClTN47j8lNJofWFaDPV7aBhVCNxNPWb3OKS/Bj thwi1QaJ9ceFBXN5JSV/Tb737vfb10Pao8JKNU1p4bx0wwMM81Hm61f8dKCxsA6ElOYf jnB55LHRajI7zo4Cpjwbo/SzasldB6outqWW+wXENZZai+7F81lbOhpLmpHM4oZ4sY08 Gcww== X-Gm-Message-State: AJcUukdBcABA7e61pxmHPaMK/UKjx8QTMk17vpKT+IhyLcIk+3DLKxYz Ih9PuO4sXFzpztB6QxzgbybSjCT1 X-Google-Smtp-Source: ALg8bN5GZ7DDgrY/VzFrAPXEc+oSGA+WuyD5P2uWogETmd2IrWQzZ7+dtJQwvpcQFbT1v2jJITekWA== X-Received: by 2002:adf:b307:: with SMTP id j7mr13821056wrd.46.1548457294761; Fri, 25 Jan 2019 15:01:34 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id t5sm45480370wmg.43.2019.01.25.15.01.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 15:01:33 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 08:28:51 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125082851.GA26199@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: C24117781F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:01:37 -0000 On 0125T1441, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > napisał(a): > >> > >>> Author: trasz > >>> Date: Fri Jan 25 17:09:26 2019 > >>> New Revision: 343440 > >>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>> > >>> Log: > >>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>> The rest of this stuff is still to be discussed, but I think at this > >>> point we have the agreement that the aliases should go. > >>> > >>> MFC after: 2 weeks > >>> Sponsored by: DARPA, AFRL > >> > >> Please just revert this and the prior commit out, and when > >> the path forward is clear commit it. I would not want any of this > >> merged to 12/ or 11/ until the time that it is all settled. > > > > Oops, my bad - neither this nor the previous commit is supposed > > to be MFC-ed; the "2 weeks" above comes from my default Subversion > > config. > > > > Regarding the backoff - just a few hours ago you said you don't have > > any problem with this, except for aliases and the default ENV. The > > aliases problem has been addressed, and you hadn't yet responded > > to my explanations regarding the ENV. Another committer asked for > > backoff, because "sh is not an interactive shell", while in fact sh(1) > > is FreeBSD's default interactive shell except for root. Finally, there's > > one person who asked for revert, but without giving any reasons > > whatsoever. > > > > So far nobody had proposed any scenario where this would break > > anything, or even affect existing users. It seems like a typical bikeshed > > situation. > > It is not clear to me after reading r343416 and D18872 what this change is trying to solve. The idea is to make it easy to replace the default root shell - which many people consider broken, due to not supporting basic shell syntax - with something that actually works. > PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > > Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. Thank you, that's actually a valid argument. I believe that's also what bash does. It would be more intrusive, though, and I kind of don't like the idea of hardcoding things that can easily be dealt with with in a more "high-level" way. > I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc different? > Further, it is documented that the contents of ENV may be ignored in privileged mode, negating these changes. True - so if someone finds the idea of having a suid shell useful - from what I undestand that's what the privileged mode boils down to - this change will be a no-op. I seriously hope nobody does, though. > If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > So the solution is not even the right one for the desired result. I would, if only it didn't break zsh, and perhaps others. The problem here is that zsh uses different syntax for PS1, _and_ it also parses /etc/profile. And no, I don't care at all about privileged mode, I can't imagine a situation when using it would be a good idea. From owner-svn-src-all@freebsd.org Fri Jan 25 23:30:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02F114C70DE; Fri, 25 Jan 2019 23:30:19 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 8E6F5808A5; Fri, 25 Jan 2019 23:30:19 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63858 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAvQ-000EX9-RP; Fri, 25 Jan 2019 15:30:16 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh From: Devin Teske In-Reply-To: <20190125082851.GA26199@v2> Date: Fri, 25 Jan 2019 15:30:15 -0800 Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> To: Edward Napierala X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 8E6F5808A5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:30:20 -0000 > On Jan 25, 2019, at 12:28 AM, Edward Napierala = wrote: >=20 > On 0125T1441, Devin Teske wrote: >>=20 >>=20 >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >>>=20 >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>> > napisa=C5=82(a): >>>>=20 >>>>> Author: trasz >>>>> Date: Fri Jan 25 17:09:26 2019 >>>>> New Revision: 343440 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>>>=20 >>>>> Log: >>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>> point we have the agreement that the aliases should go. >>>>>=20 >>>>> MFC after: 2 weeks >>>>> Sponsored by: DARPA, AFRL >>>>=20 >>>> Please just revert this and the prior commit out, and when >>>> the path forward is clear commit it. I would not want any of this >>>> merged to 12/ or 11/ until the time that it is all settled. >>>=20 >>> Oops, my bad - neither this nor the previous commit is supposed >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>> config. >>>=20 >>> Regarding the backoff - just a few hours ago you said you don't have >>> any problem with this, except for aliases and the default ENV. The >>> aliases problem has been addressed, and you hadn't yet responded >>> to my explanations regarding the ENV. Another committer asked for >>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>> is FreeBSD's default interactive shell except for root. Finally, = there's >>> one person who asked for revert, but without giving any reasons >>> whatsoever. >>>=20 >>> So far nobody had proposed any scenario where this would break >>> anything, or even affect existing users. It seems like a typical = bikeshed >>> situation. >>=20 >> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >=20 > The idea is to make it easy to replace the default root shell - which > many people consider broken, due to not supporting basic shell syntax = - with > something that actually works. How exactly does changing PS1 or adding 6 aliases fix the "basic shell = syntax" which you claim to be unsupported? If the number of aliases added to a shell are a measure of its = brokenness, then bash must be hella broken (I have 43 aliases in my = bash_profile). Also, the perhaps anecdotal consideration of brokenness is nearly = laughable -- these can largely be lumped into one of three categories: a. Considered broken because it doesn't support bashisms b. Considered broken because lack of syntactical knowledge c. Considered broken because (no reason given) Other languages might fit that description as well, and so we should = take this anecdote of "many people consider broken" with a grain of = salt. I personally have written more than 50,000 lines of shell for the = FreeBSD base OS -- all utilizing /bin/sh >=20 >> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>=20 >> Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >=20 > Thank you, that's actually a valid argument. I believe that's also = what > bash does. It would be more intrusive, though, and I kind of don't = like > the idea of hardcoding things that can easily be dealt with with in a = more > "high-level" way. >=20 >> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >=20 > Can you elaborate? It already reads $HOME/.profile; how is = $HOME/.shrc > different? If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the = importance of "one place to exploit versus two." (situation) Say you've been running FreeBSD for 20 years (it turned 25 years old = last year, so this is not only possible, but plausible). You know all the areas of interest where an attacker could inject code. You take care to lock down each one. But come to your surprise ... (hypothetical) 6 months after you upgraded from 11.2 to the latest 12.x, you find that = you didn't take into account that $HOME/.profile (which you perhaps = locked down with a "chflags" command) now branches out to a new file = which you've never taken steps to lock down, keep an eye on, or audit = (e.g., by using DTrace remote-logging, tripwire, or other means). You = only found out 6 months after the upgrade because someone exploited it. = At that point, the security event has already occurred. When I worked at "the banks" shit like this was always on our radar. = Changes like this were often cited for the reason why one bank moved to = BoKs for security. >=20 >> Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >=20 > True - so if someone finds the idea of having a suid shell useful - = from > what I undestand that's what the privileged mode boils down to - this > change will be a no-op. I seriously hope nobody does, though. >=20 =46rom the manual: -p privileged Turn on privileged mode. This mode is enabled on startup = if either the effective user or group ID is not equal to the = real user or group ID. Turning this mode off sets the effective = user and group IDs to the real user and group IDs. When this = mode is enabled for interactive shells, the file /etc/suid_profile = is sourced instead of ~/.profile after /etc/profile is = sourced, and the contents of the ENV variable are ignored. So as you can see, it's suid *or* sgid. I can think of plenty of places where sgid is common. >> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >> So the solution is not even the right one for the desired result. >=20 > I would, if only it didn't break zsh, and perhaps others. The > problem here is that zsh uses different syntax for PS1, _and_ > it also parses /etc/profile. >=20 > And no, I don't care at all about privileged mode, I can't imagine > a situation when using it would be a good idea. >=20 Rampant hand-waving. OK, that still leaves the fact that a non-static PS1 fucks with = TCL/Expect programmers. --=20 Devin= From owner-svn-src-all@freebsd.org Fri Jan 25 23:56:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55B114C78DD; Fri, 25 Jan 2019 23:56:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357B081682; Fri, 25 Jan 2019 23:56:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id s12so12049303wrt.4; Fri, 25 Jan 2019 15:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=atul9Yfi3yKf7eyTGj8Vd2mxlasM5Yrt4Um3vXBLTTA=; b=K2bNGNpeaKiZPnTPJiXn+bPbe9+t+y8jStZZdcQ3e/CW6Dn7ZvHbb0aqmkqdfvgJ9i UHDTfi+c6WlytYlm1cDzkLOi+d6330915ehFk0vCgX+bF1FyZC3rzI8CmPNw8zv8p51S hNGAvVovsTtRGkzWHS7ujuDO2gEfEKuVUvaZmFSkwsJxIi8OPuGxhlw30KDEGjwqo6tm zgcSbc0256lVWwMbbTHyBjaj2pObbSYxmUp29LqAce4BWoqTjTiM1zg934UJj7NVA8dH jEO1esGX6UzbHE38FS3gx6/H7h801yQBOAbYCI2v6HkYOv8m7BZnmbJKp/XBBs9VKV9A 7NrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=atul9Yfi3yKf7eyTGj8Vd2mxlasM5Yrt4Um3vXBLTTA=; b=auvja3N+hQLa7oec/betDF+0UcvNHtgffsOyPns9QhOD71JcTbhQba2ypsaSqYy3+T 036yJCDNDXwZOBye+msWoA+Huy/iKaZuKtI9ofZLDedLy9E/W7STnsFxA3lb/hXo9IJY aNdcxYhbTzdmPEA1g1Qsn+s6CggC4zSByZGUp+fw0YG0Dc9GO/iqCVq/z1e2ZPA7nZRq AzIm0sdBrWLa/BWRmxYZT2qhigVlbUDwL42bFsET4T1GmmA4bGJic2qBESh2oxxCM1cm OrQPzwxa6NOo2weBBqBqnSCFrYa+IzlIVI2aWxBWkMg7o5E8EazFcvFZvuRKWn0kQVro tvqA== X-Gm-Message-State: AJcUukcg7eUMELX2r/lOkTUtzG8TdZ+2tPt8qPGyw4pupjTGdFAN3gZe ZYAeUYLj2zPzY+RNfsAAHOCg6FQr X-Google-Smtp-Source: ALg8bN60Dx/tBGqad3TZZQ/TAyhtx014FBYRGhOCMFO01z5RSIpBKC8PlWOi3kkFuohrbkvRa5uvBw== X-Received: by 2002:adf:f091:: with SMTP id n17mr13210619wro.292.1548460594893; Fri, 25 Jan 2019 15:56:34 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id 10sm80041626wmy.40.2019.01.25.15.56.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 15:56:34 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:13:34 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125091334.GA26545@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 357B081682 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:56:37 -0000 On 0125T1530, Devin Teske wrote: > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > > > > On 0125T1441, Devin Teske wrote: > >> > >> > >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > >>> > >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > >>> > napisał(a): > >>>> > >>>>> Author: trasz > >>>>> Date: Fri Jan 25 17:09:26 2019 > >>>>> New Revision: 343440 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>>>> > >>>>> Log: > >>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>>>> The rest of this stuff is still to be discussed, but I think at this > >>>>> point we have the agreement that the aliases should go. > >>>>> > >>>>> MFC after: 2 weeks > >>>>> Sponsored by: DARPA, AFRL > >>>> > >>>> Please just revert this and the prior commit out, and when > >>>> the path forward is clear commit it. I would not want any of this > >>>> merged to 12/ or 11/ until the time that it is all settled. > >>> > >>> Oops, my bad - neither this nor the previous commit is supposed > >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > >>> config. > >>> > >>> Regarding the backoff - just a few hours ago you said you don't have > >>> any problem with this, except for aliases and the default ENV. The > >>> aliases problem has been addressed, and you hadn't yet responded > >>> to my explanations regarding the ENV. Another committer asked for > >>> backoff, because "sh is not an interactive shell", while in fact sh(1) > >>> is FreeBSD's default interactive shell except for root. Finally, there's > >>> one person who asked for revert, but without giving any reasons > >>> whatsoever. > >>> > >>> So far nobody had proposed any scenario where this would break > >>> anything, or even affect existing users. It seems like a typical bikeshed > >>> situation. > >> > >> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > > > > The idea is to make it easy to replace the default root shell - which > > many people consider broken, due to not supporting basic shell syntax - with > > something that actually works. > > How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > > If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). The aliases are gone. Human-friendly PS1 is considered a standard feature nowadays. But the way it fixes things is that it makes it easy to replace csh with a shell which actually groks shell syntax and is reasonably useful out of the box, with ~/.shrc you can customize etc. Think of it as a POLA, but horizontally, for folks coming from other systems, instead of the usual one. > Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- these can largely be lumped into one of three categories: > > a. Considered broken because it doesn't support bashisms > b. Considered broken because lack of syntactical knowledge > c. Considered broken because (no reason given) It's broken because it doesn't accept what people call the shell syntax. Sure, some folks do realize there used to be something called 'csh', and people kept using it even into the nineties. But most users aren't actually that much into computing history; they expect the system to just work like they expect. > Other languages might fit that description as well, and so we should take this anecdote of "many people consider broken" with a grain of salt. > > I personally have written more than 50,000 lines of shell for the FreeBSD base OS -- all utilizing /bin/sh And that's one of the reasons why I really apprieciate your response. > >> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >> > >> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > > > > Thank you, that's actually a valid argument. I believe that's also what > > bash does. It would be more intrusive, though, and I kind of don't like > > the idea of hardcoding things that can easily be dealt with with in a more > > "high-level" way. > > > >> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > > > > Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > > different? > > If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > > (situation) > > Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > You know all the areas of interest where an attacker could inject code. > You take care to lock down each one. > But come to your surprise ... > > (hypothetical) > > 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > > When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. The change we're discussing doesn't affect upgrades at all - it's only for new installs. And it only affects root, for whom the answer to 'where an attacker could inject code' question is 'literally everywhere, including the firmware'. And it doesn't affect root by default, you need to change their shell from csh(1) to sh(1). > >> Further, it is documented that the contents of ENV may be ignored in privileged mode, negating these changes. > > > > True - so if someone finds the idea of having a suid shell useful - from > > what I undestand that's what the privileged mode boils down to - this > > change will be a no-op. I seriously hope nobody does, though. > > > > From the manual: > > -p privileged > Turn on privileged mode. This mode is enabled on startup if > either the effective user or group ID is not equal to the real > user or group ID. Turning this mode off sets the effective user > and group IDs to the real user and group IDs. When this mode is > enabled for interactive shells, the file /etc/suid_profile is > sourced instead of ~/.profile after /etc/profile is sourced, and > the contents of the ENV variable are ignored. > > So as you can see, it's suid *or* sgid. > > I can think of plenty of places where sgid is common. Okay. I've never seen an sgid shell myself, but I believe you. Still, for that case the change we're discussing is a no-op. > >> If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > >> So the solution is not even the right one for the desired result. > > > > I would, if only it didn't break zsh, and perhaps others. The > > problem here is that zsh uses different syntax for PS1, _and_ > > it also parses /etc/profile. > > > > And no, I don't care at all about privileged mode, I can't imagine > > a situation when using it would be a good idea. > > > > Rampant hand-waving. > > OK, that still leaves the fact that a non-static PS1 fucks with TCL/Expect programmers. True, that's a valid argument. Question is, is the number of FreeBSD systems (others already use more complicated PS1 by default) to be deployed (the change doesn't affect existing installations) with root shell changed to sh(1) (the change doesn't affect situations when sh(1) is not your login shell) that have to interface with Expect scripts that can't handle more complicated prompts, large enough to actually care? From owner-svn-src-all@freebsd.org Sat Jan 26 00:47:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A626F14A79D8; Sat, 26 Jan 2019 00:47:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 2874D84144; Sat, 26 Jan 2019 00:47:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=64153 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnC80-000FQ3-GJ; Fri, 25 Jan 2019 16:47:20 -0800 From: Devin Teske Message-Id: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 16:47:27 -0800 In-Reply-To: <20190125091334.GA26545@v2> Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 2874D84144 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 00:47:33 -0000 > On Jan 25, 2019, at 1:13 AM, Edward Napierala = wrote: >=20 > On 0125T1530, Devin Teske wrote: >>=20 >>=20 >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala = wrote: >>>=20 >>> On 0125T1441, Devin Teske wrote: >>>>=20 >>>>=20 >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >>>>>=20 >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>>>> > napisa=C5=82(a): >>>>>>=20 >>>>>>> Author: trasz >>>>>>> Date: Fri Jan 25 17:09:26 2019 >>>>>>> New Revision: 343440 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>>>>>=20 >>>>>>> Log: >>>>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>>>> point we have the agreement that the aliases should go. >>>>>>>=20 >>>>>>> MFC after: 2 weeks >>>>>>> Sponsored by: DARPA, AFRL >>>>>>=20 >>>>>> Please just revert this and the prior commit out, and when >>>>>> the path forward is clear commit it. I would not want any of = this >>>>>> merged to 12/ or 11/ until the time that it is all settled. >>>>>=20 >>>>> Oops, my bad - neither this nor the previous commit is supposed >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>>>> config. >>>>>=20 >>>>> Regarding the backoff - just a few hours ago you said you don't = have >>>>> any problem with this, except for aliases and the default ENV. = The >>>>> aliases problem has been addressed, and you hadn't yet responded >>>>> to my explanations regarding the ENV. Another committer asked for >>>>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>>>> is FreeBSD's default interactive shell except for root. Finally, = there's >>>>> one person who asked for revert, but without giving any reasons >>>>> whatsoever. >>>>>=20 >>>>> So far nobody had proposed any scenario where this would break >>>>> anything, or even affect existing users. It seems like a typical = bikeshed >>>>> situation. >>>>=20 >>>> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >>>=20 >>> The idea is to make it easy to replace the default root shell - = which >>> many people consider broken, due to not supporting basic shell = syntax - with >>> something that actually works. >>=20 >> How exactly does changing PS1 or adding 6 aliases fix the "basic = shell syntax" which you claim to be unsupported? >>=20 >> If the number of aliases added to a shell are a measure of its = brokenness, then bash must be hella broken (I have 43 aliases in my = bash_profile). >=20 > The aliases are gone. Fair enough, albeit the topic was r343416 and D18872. > Human-friendly PS1 is considered a standard feature > nowadays. I fail to see how ''$ " is unfriendly. In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being = unfriendly to TCL/Expect. While it's certainly possible to use "expect -re" and formulate around = it, the change itself would break existing scripts. > But the way it fixes things is that it makes it easy to replace > csh with a shell which actually groks shell syntax and is reasonably = useful > out of the box, This sounds like you are claiming csh is broken. I see where you may be coming from: + /bin/sh supports a syntax + bash supports nearly all of /bin/sh + zsh supports nearly all of /bin/sh So [t]csh must seem broken to you because it doesn't fall inline. Being different doesn't mean you are broken. As I have stated = previously, I know lots of people that would and do set their login = shell to tcsh. I personally have both a .tcshrc and a .bash_profile because I use both. = I would never consider csh broken because it doesn't "grok shell syntax" = -- it in-fact groks its own shell syntax just fine and dandy. > with ~/.shrc you can customize etc. As can ~/.profile > Think of it as a POLA, > but horizontally, for folks coming from other systems, instead of the = usual > one. POLA can affect multiple people at the same time. Someone may be astonished that something is different when coming from = anther community, but what if addressing this difference causes a POLA = violation for long-standing users. >=20 >> Also, the perhaps anecdotal consideration of brokenness is nearly = laughable -- these can largely be lumped into one of three categories: >>=20 >> a. Considered broken because it doesn't support bashisms >> b. Considered broken because lack of syntactical knowledge >> c. Considered broken because (no reason given) >=20 > It's broken because it doesn't accept what people call the shell = syntax. people from Linux? people you know? people in articles? people on twitter? I don't have this experience. > Sure, some folks do realize there used to be something called 'csh', > and people kept using it even into the nineties. That's one perspective. I started using tcsh in 2007. I keep using it today. I even use it on my Mac. I also use it on Linux. I continue to grow my ~/.tcsh file (currently at 410 lines) When I use tcsh, I appreciate it for the features that do not exist in = any other shell ("repeat N cmd", "|&", etc.) > But most users aren't > actually that much into computing history; they expect the system to = just > work like they expect. >=20 You can ignore history, but it doesn't change the fact that we still = maintain it. https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=3Dlog = I'm not into neologisms, but that doesn't mean new things don't stop = being created. Is the end-goal to make sure that FreeBSD only has shells that are = compatible with Linux ones? What about the very important matter of offering choice? I will digress because this is no longer about .shrc anymore and we = should strive to stay on topic. >> Other languages might fit that description as well, and so we should = take this anecdote of "many people consider broken" with a grain of = salt. >>=20 >> I personally have written more than 50,000 lines of shell for the = FreeBSD base OS -- all utilizing /bin/sh >=20 > And that's one of the reasons why I really apprieciate your response. Why thank you. I'll give an honest data point that I feel may be illuminating: While I consider myself to be proficient in bourne shell (actively = rejecting bash, zsh, or other similar shell syntax), I have long been = envious of [t]csh's syntax which allows for far fewer lines of code to = achieve the same thing. Now, I will be the first to admit that csh has its warts (for example, = try to throw away stdout but keep stderr through a series of redirects = -- this is perhaps the only thing that /bin/sh makes easier than = [t]csh), but it is ultimately a shining star for anyone that wants to = script their system in a more friendly manner. CSH scripts that I have maintained, developed, and had shared with me = over the past 15 years have always evoked a sense of respect, = consternation, amazement, and humility from me. The difference, however, between /bin/sh and [t]csh is more like the = differences between perl 5 and perl 6. They are wholly incompatible with = each other and (csh being like perl 6) has features that really kick ass = (think "grammars" if you're familiar with some of the things that make = Perl 6 unique compared to Perl 5). >=20 >>>> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>>>=20 >>>> Maybe I see things differently, but I'd rather see PS1 default = change so no profile/shrc change is necessary. >>>=20 >>> Thank you, that's actually a valid argument. I believe that's also = what >>> bash does. It would be more intrusive, though, and I kind of don't = like >>> the idea of hardcoding things that can easily be dealt with with in = a more >>> "high-level" way. >>>=20 >>>> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >>>=20 >>> Can you elaborate? It already reads $HOME/.profile; how is = $HOME/.shrc >>> different? >>=20 >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand = the importance of "one place to exploit versus two." >>=20 >> (situation) >>=20 >> Say you've been running FreeBSD for 20 years (it turned 25 years old = last year, so this is not only possible, but plausible). >> You know all the areas of interest where an attacker could inject = code. >> You take care to lock down each one. >> But come to your surprise ... >>=20 >> (hypothetical) >>=20 >> 6 months after you upgraded from 11.2 to the latest 12.x, you find = that you didn't take into account that $HOME/.profile (which you perhaps = locked down with a "chflags" command) now branches out to a new file = which you've never taken steps to lock down, keep an eye on, or audit = (e.g., by using DTrace remote-logging, tripwire, or other means). You = only found out 6 months after the upgrade because someone exploited it. = At that point, the security event has already occurred. >>=20 >> When I worked at "the banks" shit like this was always on our radar. = Changes like this were often cited for the reason why one bank moved to = BoKs for security. >=20 > The change we're discussing doesn't affect upgrades at all - it's only > for new installs. mergemaster, iirc, will merge in changes to etc files after an upgrade. So this would effect anybody that goes through an upgrade and performs = mergemaster. > And it only affects root, for whom the answer to > 'where an attacker could inject code' question is 'literally = everywhere, > including the firmware'. This is not true in many situations. One being in a capsicum env or one = where the MAC (TrustedBSD Mandatory Access Control) framework sets = limitations. > And it doesn't affect root by default, you > need to change their shell from csh(1) to sh(1). By your own commit messages admission, this is for the toor account, so = it does affect a user (and as you were keen to point out, users with the = default shell). >=20 >>>> Further, it is documented that the contents of ENV may be ignored = in privileged mode, negating these changes. >>>=20 >>> True - so if someone finds the idea of having a suid shell useful - = from >>> what I undestand that's what the privileged mode boils down to - = this >>> change will be a no-op. I seriously hope nobody does, though. >>>=20 >>=20 >> =46rom the manual: >>=20 >> -p privileged >> Turn on privileged mode. This mode is enabled on startup = if >> either the effective user or group ID is not equal to the = real >> user or group ID. Turning this mode off sets the = effective user >> and group IDs to the real user and group IDs. When this = mode is >> enabled for interactive shells, the file = /etc/suid_profile is >> sourced instead of ~/.profile after /etc/profile is = sourced, and >> the contents of the ENV variable are ignored. >>=20 >> So as you can see, it's suid *or* sgid. >>=20 >> I can think of plenty of places where sgid is common. >=20 > Okay. I've never seen an sgid shell myself, but I believe you. = Still, > for that case the change we're discussing is a no-op. >=20 >>>> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >>>> So the solution is not even the right one for the desired result. >>>=20 >>> I would, if only it didn't break zsh, and perhaps others. The >>> problem here is that zsh uses different syntax for PS1, _and_ >>> it also parses /etc/profile. >>>=20 >>> And no, I don't care at all about privileged mode, I can't imagine >>> a situation when using it would be a good idea. >>>=20 >>=20 >> Rampant hand-waving. >>=20 >> OK, that still leaves the fact that a non-static PS1 fucks with = TCL/Expect programmers. >=20 > True, that's a valid argument. Question is, is the number of FreeBSD > systems (others already use more complicated PS1 by default) to be = deployed > (the change doesn't affect existing installations) with root shell = changed > to sh(1) (the change doesn't affect situations when sh(1) is not your = login > shell) that have to interface with Expect scripts that can't handle = more > complicated prompts, large enough to actually care? We started talking about toor because it has no shell specified in = /etc/passwd and therefore uses the default shell (/bin/sh). Also, upgrade/mergemaster to me seems like it would affect existing = installations. Now that I think about it, people using TCL/Expect against the root = account would be talking to csh and probably not be effected. Is it too late to change my vote? Let me sit on this for a few hours. The TCL/Expect argument may be = neutralized because -- as you correctly state -- is probably a minority = of situations. However, I am still concerned about upgrade/mergemaster. Maybe a simple UPDATING entry can be used to address the former concern = about corporate secteams needing to be kept informed of this nominal = [potential] change. --=20 Devin From owner-svn-src-all@freebsd.org Sat Jan 26 01:05:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B17A14A8072; Sat, 26 Jan 2019 01:05:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BC884A74; Sat, 26 Jan 2019 01:05:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0Q15YQZ091096; Fri, 25 Jan 2019 17:05:34 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0Q15YwH091095; Fri, 25 Jan 2019 17:05:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> To: Devin Teske Date: Fri, 25 Jan 2019 17:05:34 -0800 (PST) CC: Edward Napierala , rgrimes@FreeBSD.org, src-committers , 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: 73BC884A74 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.955,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:05:37 -0000 > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: Chop with the big axe most of this as I need to clarify a miss statement. ... > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. Correct, and to my knowledge there is no way to stop that effect. ... > > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). Further it effects root any time root types "sh" or "/bin/sh" and intentially invokes sh interactive for some reason, something I do more often than I care to admit simply cause I know what I want to do is much easier in that shell. It does not require root change there login shell for these changes to effect the root account usage. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jan 26 01:23:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE4014A9572; Sat, 26 Jan 2019 01:23:42 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 056F185A55; Sat, 26 Jan 2019 01:23:42 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x336.google.com with SMTP id d15so8455072wmb.3; Fri, 25 Jan 2019 17:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ft81Ft8sHbNIQ6uE4ckkrgDUcRbfBlly6hRTq7xttq4=; b=Z75mnV3riL7LmUKyOrpFAFv2IpAJfy/JgQzda0sim/B1WlDxEchcwJPRCQrSEEXVhz hRR8Imo/lNZgZE31XBYxdgheXo00e1/dExUR/6wdhacSjXu0ch7ygWUvc+eYhpd8C/dc klwPeiVPMlqRNJOI2duQZT8qX6juBEKXbo5Up26JN/dnXp5O3kJ6DlIPZdSakJHXnwKi vXFCyq7RgHxio6J1uyjUL7KtBD8AmwvB6K4CVIfNGuRLex5OFBsL+vkOqOf0ZAggMZy/ uQ6WmLhSipogVtHy9Dausmuy9Ob6QiTEdi4bJD9ss2T29yHeqW0UFSHrISHCDRqHfsJI yIIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ft81Ft8sHbNIQ6uE4ckkrgDUcRbfBlly6hRTq7xttq4=; b=tazgozO97lcEgO/sh06PJyNXKYsurdO7vgdprZeMxK+BhtpJb85XX19Ndc2yLjwYdX Ct4dSA9VEOeHim48ncu3wOARQ5LeLCMW0cZ7ut+peIrPhj9ghvBZekQkh97w6S3lgdf9 UJ+YWUVuzA1MFyOJdiGlcb/tlzzgJblEH+dVgVJOEJaSGpYEN7cL8yNjTKM1tdH1gE5q iIYnjUHkZKulXvSOdQVPZPM/JKuYLJZjN6h3vlND7VbQLZI/8r/aXOuxgnC02UlKN9Ro ZZv606zH1QPB1rkBJtgS7fwUJ8E0m4m6TqZB53AluWkow2XVjZ0oQ6vK5AumiP9B9hgN y03g== X-Gm-Message-State: AJcUukel04qi7Z2CpsMCJHAg0LWV+psWwzAkASciTkwmQK/WywC1H5ti zTu1aU7P+0NDjf6EPAnUkU7c7cn+ X-Google-Smtp-Source: ALg8bN4v+ffyyWSMiN5wU08VXIZw2k1fZeITF4ayiv4EaOMGTXc9sUOzbMiz63rTMlYE09qaO54DYw== X-Received: by 2002:a1c:494:: with SMTP id 142mr8636259wme.111.1548465819296; Fri, 25 Jan 2019 17:23:39 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id w125sm70138530wmb.45.2019.01.25.17.23.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 17:23:38 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:50:51 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125095051.GA26744@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 056F185A55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:23:42 -0000 Excuse my brevity; I'll address the rest after getting some sleep, but I'd like to clarify one crucial thing. I think that's actually _the_ point where I screwed up: I didn't expect people to actually care for what I considered a cosmetic change, and I didn't realize the need to explain what this commit does _not_ affect. (And I've been reminded by rgrimes@ more than once that I should pay more attention to my commit messages. Oh well. Perhaps I'll learn this time.) On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: [..] > >>>> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >>>> > >>>> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > >>> > >>> Thank you, that's actually a valid argument. I believe that's also what > >>> bash does. It would be more intrusive, though, and I kind of don't like > >>> the idea of hardcoding things that can easily be dealt with with in a more > >>> "high-level" way. > >>> > >>>> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > >>> > >>> Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > >>> different? > >> > >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > >> > >> (situation) > >> > >> Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > >> You know all the areas of interest where an attacker could inject code. > >> You take care to lock down each one. > >> But come to your surprise ... > >> > >> (hypothetical) > >> > >> 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > >> > >> When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. > > > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. No, it won't - it doesn't affect files in /etc at all. It doesn't affect stuff that's being installed by mergemaster(8), nor stuff installed by 'make install'. It only affects the default /root/.profile and /root/.shrc, as installed by bsdinstall(8) or shipped as VM or SD card images. [..] > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). Yes, but it only affects the toor account for new installs, and the account is locked by default. From owner-svn-src-all@freebsd.org Sat Jan 26 01:38:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF61E14AA5D8; Sat, 26 Jan 2019 01:38:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48AF6868CB; Sat, 26 Jan 2019 01:38:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0Q1bxTs091300; Fri, 25 Jan 2019 17:37:59 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0Q1bwDK091299; Fri, 25 Jan 2019 17:37:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <20190125095512.GB26744@v2> To: Edward Napierala Date: Fri, 25 Jan 2019 17:37:58 -0800 (PST) CC: rgrimes@freebsd.org, Devin Teske , src-committers , 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: 48AF6868CB X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.24 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.76)[0.761,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.15)[0.149,0]; NEURAL_SPAM_MEDIUM(0.45)[0.455,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)[]; IP_SCORE(-0.01)[ip: (0.02), ipnet: 69.59.192.0/19(0.01), asn: 13868(-0.02), country: US(-0.08)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:38:05 -0000 > On 0125T1705, Rodney W. Grimes wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > > Chop with the big axe most of this as I need to clarify a miss statement. > > ... > > > > The change we're discussing doesn't affect upgrades at all - it's only > > > > for new installs. > > > > > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > > > So this would effect anybody that goes through an upgrade and performs mergemaster. > > > > Correct, and to my knowledge there is no way to stop that effect. > > Won't happen in this case, this doesn't apply to files in /etc > at all; it only applies to the default /root/.shrc and /root/.profile > that get installed on fresh systems. mergemaster is the wrong term here, freebsd-update is going to want to merge this change. > > > > And it doesn't affect root by default, you > > > > need to change their shell from csh(1) to sh(1). > > > > > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). > > > > Further it effects root any time root types "sh" or "/bin/sh" > > and intentially invokes sh interactive for some reason, > > something I do more often than I care to admit simply > > cause I know what I want to do is much easier in that > > shell. > > It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) > you need to have ENV set; the default /root/.profile only sets > it when sh(1) is your login shell. I do not see any conditional logic in /root/.profile, what your mis stating is that /root/.profile is not run for a login shell, so ENV would not be set unless something else caused /root/.profile to be read, aka source ~/.profile > Which means, this doesn't > change the behaviour when you casually run "sh" or "/bin/sh" > as root; sh needs to be set up as login shell for this to take > effect. Again I do not see any conditional logic in /root/.profile that would make that true. A su - toor would be effected. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jan 26 01:28:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7974614A9C89; Sat, 26 Jan 2019 01:28:02 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3714860BE; Sat, 26 Jan 2019 01:28:01 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id x10so12155414wrs.8; Fri, 25 Jan 2019 17:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YskLptLkcDrX9KuckrGjVrmrWubScydxSZN7+jyrojc=; b=YsL+uRPgbSUKFsYwwyPAvuE408DBMooyPKBt3RlMz4U0N7BL1lYrnMyeYL6QyybGWn /hBjXFmxGNKR9kNAtmfA4qc/+0G5eZETxu42/kJY2e/ugbpg6qzmzIsXIpR0jm3sVjy5 UcWjP8DXRThiwbjAEkrdBrAZ3fKtFfIFNeU0MmRpSadoOg2vASJ8QDLe4kwFH4Wzthix lzcpSL1tgSGt1e2Te2WA+NgJ8oiBd5kLtde7G33bRFGeMBGfOxOTSV/Gxcds3wujvtTH znaNXhsmxPw6RTLY90s7+w7AttgRopVhtiFrTANCyK6Pn6DiY2VaQRlRS9jJRaXxpNTo 1LoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=YskLptLkcDrX9KuckrGjVrmrWubScydxSZN7+jyrojc=; b=eV9avnNWq2D0Jy0PZQw5sEp69ELVpAzKuXiA1TzPiQym+atUm10Zw9EtTj1xMbKWTd dw/wTqj/IvudOZFVe8uo0CSBJCt9JaIHSWYppYdc7TRCEeZlwW9xRbPIr/uTEiknwR+a ENYxzVhv9hq5+YEKKsje2yvcR5nZWGQR0PiMb1RL8WWMhGhCgQxdUPzKAgTwmGh0+zrq 2bU6noJCQjo3YSi9MBamtqfS1WtFfnE9+T6QOJtw25hlPeLgr0TK1tBnd+KHqXiIYKZh e2kMzVSqhzPzS4c2oV6A2KZaOapBq7CcNfkgUgt9z5ISOvJy0BVNg+RGxgjuJ8YThKBc oROw== X-Gm-Message-State: AJcUukfk40ULTJbXP18H10+ikM2DaeLYW7mdGgaGSjGgFqZ+p8OtxpRX OIyxVHK1VNz68RNj9M8s1ow1A/sL X-Google-Smtp-Source: ALg8bN75GKodutCZZ3rmUT9Fcn2JMQ1/zl0PPmm8FYwPmJ5K2fEppEo6lVw5+hOUz4XPEZPs+/8V8w== X-Received: by 2002:adf:f211:: with SMTP id p17mr13342219wro.293.1548466080506; Fri, 25 Jan 2019 17:28:00 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id z7sm91786883wrw.22.2019.01.25.17.27.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 17:27:59 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:55:12 +0000 From: Edward Napierala To: rgrimes@freebsd.org Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125095512.GB26744@v2> Mail-Followup-To: rgrimes@freebsd.org, Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: E3714860BE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:28:02 -0000 On 0125T1705, Rodney W. Grimes wrote: > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > Chop with the big axe most of this as I need to clarify a miss statement. > ... > > > The change we're discussing doesn't affect upgrades at all - it's only > > > for new installs. > > > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > > So this would effect anybody that goes through an upgrade and performs mergemaster. > > Correct, and to my knowledge there is no way to stop that effect. Won't happen in this case, this doesn't apply to files in /etc at all; it only applies to the default /root/.shrc and /root/.profile that get installed on fresh systems. > > > And it doesn't affect root by default, you > > > need to change their shell from csh(1) to sh(1). > > > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). > > Further it effects root any time root types "sh" or "/bin/sh" > and intentially invokes sh interactive for some reason, > something I do more often than I care to admit simply > cause I know what I want to do is much easier in that > shell. It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) you need to have ENV set; the default /root/.profile only sets it when sh(1) is your login shell. Which means, this doesn't change the behaviour when you casually run "sh" or "/bin/sh" as root; sh needs to be set up as login shell for this to take effect. From owner-svn-src-all@freebsd.org Sat Jan 26 03:43:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5115C14AE642; Sat, 26 Jan 2019 03:43:13 +0000 (UTC) (envelope-from ngie@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 E9AAD8A9A9; Sat, 26 Jan 2019 03:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCC8C1A54A; Sat, 26 Jan 2019 03:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0Q3hCqN034890; Sat, 26 Jan 2019 03:43:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0Q3hCje034889; Sat, 26 Jan 2019 03:43:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901260343.x0Q3hCje034889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 26 Jan 2019 03:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343461 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9AAD8A9A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 03:43:13 -0000 Author: ngie Date: Sat Jan 26 03:43:12 2019 New Revision: 343461 URL: https://svnweb.freebsd.org/changeset/base/343461 Log: Fix reporting errors with `gai_strerror(..)` The return value (`err`) should be checked; not the `errno` value. PR: 235200 Approved by: emaste (mentor) Reviewed by: asomers, lwhsu MFC after: 28 days MFC with: r343362, r343365, r343367-r343368 Differential Revision: https://reviews.freebsd.org/D18969 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Fri Jan 25 22:52:49 2019 (r343460) +++ head/lib/libc/tests/sys/sendfile_test.c Sat Jan 26 03:43:12 2019 (r343461) @@ -114,7 +114,7 @@ resolve_localhost(struct addrinfo **res, int domain, i error = getaddrinfo("localhost", serv, &hints, res); ATF_REQUIRE_EQ_MSG(error, 0, - "getaddrinfo failed: %s", gai_strerror(errno)); + "getaddrinfo failed: %s", gai_strerror(error)); free(serv); } From owner-svn-src-all@freebsd.org Sat Jan 26 05:35:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C58BB14B26B3; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@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 696148F447; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5B7951B8F5; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0Q5ZPuR094670; Sat, 26 Jan 2019 05:35:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0Q5ZPoS094669; Sat, 26 Jan 2019 05:35:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901260535.x0Q5ZPoS094669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 26 Jan 2019 05:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343462 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 343462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 696148F447 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 05:35:26 -0000 Author: mckusick Date: Sat Jan 26 05:35:24 2019 New Revision: 343462 URL: https://svnweb.freebsd.org/changeset/base/343462 Log: Expand DDB's set of printable soft dependency data structures. The set of known soft dependency data structures now includes: sd_worklist, sd_inodedep, sd_allocdirect, sd_allocindir, and sd_mkdir. DDB can also print lists of sd_allinodedeps, sd_mkdir_list, and sd_workhead. The sd_workhead script is useful for listing all the dependencies associated with a buffer, e.g. bp->b_dep. Prefix the soft dependency show names with sd_ so that they sort together when listed by DDB's "show help" and to distinguish them from other data structures printable by DDB. Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Jan 26 03:43:12 2019 (r343461) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Jan 26 05:35:24 2019 (r343462) @@ -14406,47 +14406,129 @@ softdep_error(func, error) #ifdef DDB +/* exported to ffs_vfsops.c */ +extern void db_print_ffs(struct ufsmount *ump); +void +db_print_ffs(struct ufsmount *ump) +{ + db_printf("mp %p (%s) devvp %p\n", ump->um_mountp, + ump->um_mountp->mnt_stat.f_mntonname, ump->um_devvp); + db_printf(" fs %p su_wl %d su_deps %d su_req %d\n", + ump->um_fs, ump->softdep_on_worklist, + ump->softdep_deps, ump->softdep_req); +} + static void +worklist_print(struct worklist *wk, int verbose) +{ + + if (!verbose) { + db_printf("%s: %p state 0x%b\n", TYPENAME(wk->wk_type), wk, + (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS); + return; + } + db_printf("worklist: %p type %s state 0x%b next %p\n ", wk, + TYPENAME(wk->wk_type), (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS, + LIST_NEXT(wk, wk_list)); + db_print_ffs(VFSTOUFS(wk->wk_mp)); +} + +static void inodedep_print(struct inodedep *inodedep, int verbose) { - db_printf("%p fs %p st %x ino %jd inoblk %jd delta %jd nlink %jd" - " saveino %p\n", - inodedep, inodedep->id_fs, inodedep->id_state, + + worklist_print(&inodedep->id_list, 0); + db_printf(" fs %p ino %jd inoblk %jd delta %jd nlink %jd\n", + inodedep->id_fs, (intmax_t)inodedep->id_ino, (intmax_t)fsbtodb(inodedep->id_fs, - ino_to_fsba(inodedep->id_fs, inodedep->id_ino)), + ino_to_fsba(inodedep->id_fs, inodedep->id_ino)), (intmax_t)inodedep->id_nlinkdelta, - (intmax_t)inodedep->id_savednlink, - inodedep->id_savedino1); + (intmax_t)inodedep->id_savednlink); if (verbose == 0) return; - db_printf("\tpendinghd %p, bufwait %p, inowait %p, inoreflst %p, " - "mkdiradd %p\n", + db_printf(" bmsafemap %p, mkdiradd %p, inoreflst %p\n", + inodedep->id_bmsafemap, + inodedep->id_mkdiradd, + TAILQ_FIRST(&inodedep->id_inoreflst)); + db_printf(" dirremhd %p, pendinghd %p, bufwait %p\n", + LIST_FIRST(&inodedep->id_dirremhd), LIST_FIRST(&inodedep->id_pendinghd), - LIST_FIRST(&inodedep->id_bufwait), + LIST_FIRST(&inodedep->id_bufwait)); + db_printf(" inowait %p, inoupdt %p, newinoupdt %p\n", LIST_FIRST(&inodedep->id_inowait), - TAILQ_FIRST(&inodedep->id_inoreflst), - inodedep->id_mkdiradd); - db_printf("\tinoupdt %p, newinoupdt %p, extupdt %p, newextupdt %p\n", TAILQ_FIRST(&inodedep->id_inoupdt), - TAILQ_FIRST(&inodedep->id_newinoupdt), + TAILQ_FIRST(&inodedep->id_newinoupdt)); + db_printf(" extupdt %p, newextupdt %p, freeblklst %p\n", TAILQ_FIRST(&inodedep->id_extupdt), - TAILQ_FIRST(&inodedep->id_newextupdt)); + TAILQ_FIRST(&inodedep->id_newextupdt), + TAILQ_FIRST(&inodedep->id_freeblklst)); + db_printf(" saveino %p, savedsize %jd, savedextsize %jd\n", + inodedep->id_savedino1, + (intmax_t)inodedep->id_savedsize, + (intmax_t)inodedep->id_savedextsize); } -DB_SHOW_COMMAND(inodedep, db_show_inodedep) +static void +newblk_print(struct newblk *nbp) { + worklist_print(&nbp->nb_list, 0); + db_printf(" newblkno %jd\n", (intmax_t)nbp->nb_newblkno); + db_printf(" jnewblk %p, bmsafemap %p, freefrag %p\n", + &nbp->nb_jnewblk, + &nbp->nb_bmsafemap, + &nbp->nb_freefrag); + db_printf(" indirdeps %p, newdirblk %p, jwork %p\n", + LIST_FIRST(&nbp->nb_indirdeps), + LIST_FIRST(&nbp->nb_newdirblk), + LIST_FIRST(&nbp->nb_jwork)); +} + +static void +allocdirect_print(struct allocdirect *adp) +{ + + newblk_print(&adp->ad_block); + db_printf(" oldblkno %jd, oldsize %ld, newsize %ld\n", + adp->ad_oldblkno, adp->ad_oldsize, adp->ad_newsize); + db_printf(" offset %d, inodedep %p\n", + adp->ad_offset, adp->ad_inodedep); +} + +static void +allocindir_print(struct allocindir *aip) +{ + + newblk_print(&aip->ai_block); + db_printf(" oldblkno %jd, lbn %jd\n", + (intmax_t)aip->ai_oldblkno, (intmax_t)aip->ai_lbn); + db_printf(" offset %d, indirdep %p\n", + aip->ai_offset, aip->ai_indirdep); +} + +static void +mkdir_print(struct mkdir *mkdir) +{ + + worklist_print(&mkdir->md_list, 0); + db_printf(" diradd %p, jaddref %p, buf %p\n", + mkdir->md_diradd, mkdir->md_jaddref, mkdir->md_buf); +} + +DB_SHOW_COMMAND(sd_inodedep, db_show_sd_inodedep) +{ + if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("inodedep address required\n"); return; } inodedep_print((struct inodedep*)addr, 1); } -DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) +DB_SHOW_COMMAND(sd_allinodedeps, db_show_sd_allinodedeps) { struct inodedep_hashhead *inodedephd; struct inodedep *inodedep; @@ -14454,7 +14536,7 @@ DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) int cnt; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("ufsmount address required\n"); return; } ump = (struct ufsmount *)addr; @@ -14466,72 +14548,108 @@ DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) } } -DB_SHOW_COMMAND(worklist, db_show_worklist) +DB_SHOW_COMMAND(sd_worklist, db_show_sd_worklist) { - struct worklist *wk; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("worklist address required\n"); return; } - wk = (struct worklist *)addr; - printf("worklist: %p type %s state 0x%X\n", - wk, TYPENAME(wk->wk_type), wk->wk_state); + worklist_print((struct worklist *)addr, 1); } -DB_SHOW_COMMAND(workhead, db_show_workhead) +DB_SHOW_COMMAND(sd_workhead, db_show_sd_workhead) { - struct workhead *wkhd; struct worklist *wk; - int i; + struct workhead *wkhd; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("worklist address required " + "(for example value in bp->b_dep)\n"); return; } - wkhd = (struct workhead *)addr; - wk = LIST_FIRST(wkhd); - for (i = 0; i < 100 && wk != NULL; i++, wk = LIST_NEXT(wk, wk_list)) - db_printf("worklist: %p type %s state 0x%X", - wk, TYPENAME(wk->wk_type), wk->wk_state); - if (i == 100) - db_printf("workhead overflow"); - printf("\n"); + /* + * We often do not have the address of the worklist head but + * instead a pointer to its first entry (e.g., we have the + * contents of bp->b_dep rather than &bp->b_dep). But the back + * pointer of bp->b_dep will point at the head of the list, so + * we cheat and use that instead. If we are in the middle of + * a list we will still get the same result, so nothing + * unexpected will result. + */ + wk = (struct worklist *)addr; + if (wk == NULL) + return; + wkhd = (struct workhead *)wk->wk_list.le_prev; + LIST_FOREACH(wk, wkhd, wk_list) { + switch(wk->wk_type) { + case D_INODEDEP: + inodedep_print(WK_INODEDEP(wk), 0); + continue; + case D_ALLOCDIRECT: + allocdirect_print(WK_ALLOCDIRECT(wk)); + continue; + case D_ALLOCINDIR: + allocindir_print(WK_ALLOCINDIR(wk)); + continue; + case D_MKDIR: + mkdir_print(WK_MKDIR(wk)); + continue; + default: + worklist_print(wk, 0); + continue; + } + } } +DB_SHOW_COMMAND(sd_mkdir, db_show_sd_mkdir) +{ + if (have_addr == 0) { + db_printf("mkdir address required\n"); + return; + } + mkdir_print((struct mkdir *)addr); +} -DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) +DB_SHOW_COMMAND(sd_mkdir_list, db_show_sd_mkdir_list) { struct mkdirlist *mkdirlisthd; - struct jaddref *jaddref; - struct diradd *diradd; struct mkdir *mkdir; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("mkdir listhead address required\n"); return; } mkdirlisthd = (struct mkdirlist *)addr; LIST_FOREACH(mkdir, mkdirlisthd, md_mkdirs) { - diradd = mkdir->md_diradd; - db_printf("mkdir: %p state 0x%X dap %p state 0x%X", - mkdir, mkdir->md_state, diradd, diradd->da_state); - if ((jaddref = mkdir->md_jaddref) != NULL) - db_printf(" jaddref %p jaddref state 0x%X", - jaddref, jaddref->ja_state); - db_printf("\n"); + mkdir_print(mkdir); + if (mkdir->md_diradd != NULL) { + db_printf(" "); + worklist_print(&mkdir->md_diradd->da_list, 0); + } + if (mkdir->md_jaddref != NULL) { + db_printf(" "); + worklist_print(&mkdir->md_jaddref->ja_list, 0); + } } } -/* exported to ffs_vfsops.c */ -extern void db_print_ffs(struct ufsmount *ump); -void -db_print_ffs(struct ufsmount *ump) +DB_SHOW_COMMAND(sd_allocdirect, db_show_sd_allocdirect) { - db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", - ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, - ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, - ump->softdep_deps, ump->softdep_req); + if (have_addr == 0) { + db_printf("allocdirect address required\n"); + return; + } + allocdirect_print((struct allocdirect *)addr); +} + +DB_SHOW_COMMAND(sd_allocindir, db_show_sd_allocindir) +{ + if (have_addr == 0) { + db_printf("allocindir address required\n"); + return; + } + allocindir_print((struct allocindir *)addr); } #endif /* DDB */ From owner-svn-src-all@freebsd.org Sat Jan 26 12:28:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5968E14C19B3; Sat, 26 Jan 2019 12:28:48 +0000 (UTC) (envelope-from avos@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 F14C877FE1; Sat, 26 Jan 2019 12:28:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E19A71FFDF; Sat, 26 Jan 2019 12:28:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QCSlul010678; Sat, 26 Jan 2019 12:28:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QCSlj3010677; Sat, 26 Jan 2019 12:28:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261228.x0QCSlj3010677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 12:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343463 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 343463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F14C877FE1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 12:28:48 -0000 Author: avos Date: Sat Jan 26 12:28:47 2019 New Revision: 343463 URL: https://svnweb.freebsd.org/changeset/base/343463 Log: MFC r343190: net80211: drop m_pullup call from ieee80211_crypto_decap. For most wireless drivers Rx mbuf is allocated as one contiguous chunk; only few are using chains for allocations - but even then at least MCLBYTES (minus Rx descriptor size) is available in the first mbuf. In addition to the above, m_pullup was never called here - otherwise, reallocation will break post-crypto_decap logic (ieee80211_decap, ieee80211_deliver_data...), so just remove it; length check is left in case if some truncated frame appears here. PR: 234241 Modified: stable/12/sys/net80211/ieee80211_crypto.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_crypto.c ============================================================================== --- stable/12/sys/net80211/ieee80211_crypto.c Sat Jan 26 05:35:24 2019 (r343462) +++ stable/12/sys/net80211/ieee80211_crypto.c Sat Jan 26 12:28:47 2019 (r343463) @@ -662,14 +662,15 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, stru k = &ni->ni_ucastkey; /* - * Insure crypto header is contiguous for all decap work. + * Insure crypto header is contiguous and long enough for all + * decap work. */ cip = k->wk_cipher; - if (m->m_len < hdrlen + cip->ic_header && - (m = m_pullup(m, hdrlen + cip->ic_header)) == NULL) { + if (m->m_len < hdrlen + cip->ic_header) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, - "unable to pullup %s header", cip->ic_name); - vap->iv_stats.is_rx_wepfail++; /* XXX */ + "frame is too short (%d < %u) for crypto decap", + cip->ic_name, m->m_len, hdrlen + cip->ic_header); + vap->iv_stats.is_rx_tooshort++; *key = NULL; return (0); } From owner-svn-src-all@freebsd.org Sat Jan 26 12:35:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5965414C1F27; Sat, 26 Jan 2019 12:35:07 +0000 (UTC) (envelope-from avos@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 A9D5580717; Sat, 26 Jan 2019 12:35:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94CA620187; Sat, 26 Jan 2019 12:35:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QCZ6Pk015644; Sat, 26 Jan 2019 12:35:06 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QCZ6X7015643; Sat, 26 Jan 2019 12:35:06 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261235.x0QCZ6X7015643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 12:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343464 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 343464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9D5580717 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 12:35:07 -0000 Author: avos Date: Sat Jan 26 12:35:06 2019 New Revision: 343464 URL: https://svnweb.freebsd.org/changeset/base/343464 Log: MFC r343190: net80211: drop m_pullup call from ieee80211_crypto_decap. For most wireless drivers Rx mbuf is allocated as one contiguous chunk; only few are using chains for allocations - but even then at least MCLBYTES (minus Rx descriptor size) is available in the first mbuf. In addition to the above, m_pullup was never called here - otherwise, reallocation will break post-crypto_decap logic (ieee80211_decap, ieee80211_deliver_data...), so just remove it; length check is left in case if some truncated frame appears here. PR: 234241 Modified: stable/11/sys/net80211/ieee80211_crypto.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_crypto.c ============================================================================== --- stable/11/sys/net80211/ieee80211_crypto.c Sat Jan 26 12:28:47 2019 (r343463) +++ stable/11/sys/net80211/ieee80211_crypto.c Sat Jan 26 12:35:06 2019 (r343464) @@ -617,14 +617,15 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, stru k = &ni->ni_ucastkey; /* - * Insure crypto header is contiguous for all decap work. + * Insure crypto header is contiguous and long enough for all + * decap work. */ cip = k->wk_cipher; - if (m->m_len < hdrlen + cip->ic_header && - (m = m_pullup(m, hdrlen + cip->ic_header)) == NULL) { + if (m->m_len < hdrlen + cip->ic_header) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, - "unable to pullup %s header", cip->ic_name); - vap->iv_stats.is_rx_wepfail++; /* XXX */ + "frame is too short (%d < %u) for crypto decap", + cip->ic_name, m->m_len, hdrlen + cip->ic_header); + vap->iv_stats.is_rx_tooshort++; return NULL; } From owner-svn-src-all@freebsd.org Sat Jan 26 12:41:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC6F14C222E; Sat, 26 Jan 2019 12:41:17 +0000 (UTC) (envelope-from avos@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 D875980D6D; Sat, 26 Jan 2019 12:41:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDCB8202F5; Sat, 26 Jan 2019 12:41:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QCfGrb019105; Sat, 26 Jan 2019 12:41:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QCfGLk019104; Sat, 26 Jan 2019 12:41:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261241.x0QCfGLk019104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 12:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r343465 - stable/10/sys/net80211 X-SVN-Group: stable-10 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/10/sys/net80211 X-SVN-Commit-Revision: 343465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D875980D6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 12:41:17 -0000 Author: avos Date: Sat Jan 26 12:41:16 2019 New Revision: 343465 URL: https://svnweb.freebsd.org/changeset/base/343465 Log: MFC r343190: net80211: drop m_pullup call from ieee80211_crypto_decap. For most wireless drivers Rx mbuf is allocated as one contiguous chunk; only few are using chains for allocations - but even then at least MCLBYTES (minus Rx descriptor size) is available in the first mbuf. In addition to the above, m_pullup was never called here - otherwise, reallocation will break post-crypto_decap logic (ieee80211_decap, ieee80211_deliver_data...), so just remove it; length check is left in case if some truncated frame appears here. PR: 234241 Modified: stable/10/sys/net80211/ieee80211_crypto.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_crypto.c ============================================================================== --- stable/10/sys/net80211/ieee80211_crypto.c Sat Jan 26 12:35:06 2019 (r343464) +++ stable/10/sys/net80211/ieee80211_crypto.c Sat Jan 26 12:41:16 2019 (r343465) @@ -601,14 +601,15 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, stru k = &ni->ni_ucastkey; /* - * Insure crypto header is contiguous for all decap work. + * Insure crypto header is contiguous and long enough for all + * decap work. */ cip = k->wk_cipher; - if (m->m_len < hdrlen + cip->ic_header && - (m = m_pullup(m, hdrlen + cip->ic_header)) == NULL) { + if (m->m_len < hdrlen + cip->ic_header) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, - "unable to pullup %s header", cip->ic_name); - vap->iv_stats.is_rx_wepfail++; /* XXX */ + "frame is too short (%d < %u) for crypto decap", + cip->ic_name, m->m_len, hdrlen + cip->ic_header); + vap->iv_stats.is_rx_tooshort++; return NULL; } From owner-svn-src-all@freebsd.org Sat Jan 26 12:55:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D1B514C2B75; Sat, 26 Jan 2019 12:55:46 +0000 (UTC) (envelope-from avos@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 0008A823E1; Sat, 26 Jan 2019 12:55:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E05BA20527; Sat, 26 Jan 2019 12:55:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QCtjJB028251; Sat, 26 Jan 2019 12:55:45 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QCtjOp028250; Sat, 26 Jan 2019 12:55:45 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261255.x0QCtjOp028250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 12:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343466 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 343466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0008A823E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 12:55:46 -0000 Author: avos Date: Sat Jan 26 12:55:45 2019 New Revision: 343466 URL: https://svnweb.freebsd.org/changeset/base/343466 Log: MFC r343244: devd.conf(5): add otus(4) into wifi-driver-regex Modified: stable/12/sbin/devd/devd.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf ============================================================================== --- stable/12/sbin/devd/devd.conf Sat Jan 26 12:41:16 2019 (r343465) +++ stable/12/sbin/devd/devd.conf Sat Jan 26 12:55:45 2019 (r343466) @@ -24,8 +24,8 @@ options { trm)\ [0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ - uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rtwn|rum|\ + run|uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-all@freebsd.org Sat Jan 26 13:03:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EC9214C2DE4; Sat, 26 Jan 2019 13:03:00 +0000 (UTC) (envelope-from avos@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 13EE982838; Sat, 26 Jan 2019 13:03:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 047F8206C8; Sat, 26 Jan 2019 13:03:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QD2xuw033713; Sat, 26 Jan 2019 13:02:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QD2xrb033712; Sat, 26 Jan 2019 13:02:59 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261302.x0QD2xrb033712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 13:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343467 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 343467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13EE982838 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:03:00 -0000 Author: avos Date: Sat Jan 26 13:02:59 2019 New Revision: 343467 URL: https://svnweb.freebsd.org/changeset/base/343467 Log: MFC r343244: devd.conf(5): add otus(4) into wifi-driver-regex Modified: stable/11/etc/devd.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/devd.conf ============================================================================== --- stable/11/etc/devd.conf Sat Jan 26 12:55:45 2019 (r343466) +++ stable/11/etc/devd.conf Sat Jan 26 13:02:59 2019 (r343467) @@ -23,8 +23,8 @@ options { esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|ncr|ncv|nsp|stg|sym|\ trm|wds)[0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ - upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rum|run|\ + uath|upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-all@freebsd.org Sat Jan 26 13:17:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C27BC14C3159; Sat, 26 Jan 2019 13:17:20 +0000 (UTC) (envelope-from avos@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 6370882D84; Sat, 26 Jan 2019 13:17:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55FEB20898; Sat, 26 Jan 2019 13:17:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QDHK8a038848; Sat, 26 Jan 2019 13:17:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QDHK9T038847; Sat, 26 Jan 2019 13:17:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261317.x0QDHK9T038847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 13:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343468 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 343468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6370882D84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:17:20 -0000 Author: avos Date: Sat Jan 26 13:17:19 2019 New Revision: 343468 URL: https://svnweb.freebsd.org/changeset/base/343468 Log: MFC r343249: Fix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8) Do not invoke 'wlan_up' function from devd(8) on interface creation event (an example to create such event: 'ifconfig wlan0 create wlandev rtwn0'); they're typically produced during 'service netif (re)start' and result in duplicate interface initialization. From the user side if WPA option is used, this result in messages like: - /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant or - wpa_supplicant already running? (pid=xxxx). (for HOSTAP interfaces this race may result in startup failure). As a side effect, wpa_supplicant(8) / hostapd(8) will not be invoked when new wlan(4) interface is created manually and corresponding configuration for it is present in rc.conf(5). This change does not affect device attach / removal events. Modified: stable/12/sbin/devd/devd.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf ============================================================================== --- stable/12/sbin/devd/devd.conf Sat Jan 26 13:02:59 2019 (r343467) +++ stable/12/sbin/devd/devd.conf Sat Jan 26 13:17:19 2019 (r343468) @@ -42,7 +42,7 @@ options { # notify 0 { match "system" "IFNET"; - match "subsystem" "!usbus[0-9]+"; + match "subsystem" "(?!usbus[0-9]+|?!wlan[0-9]+)"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; From owner-svn-src-all@freebsd.org Sat Jan 26 13:18:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7033814C31B1; Sat, 26 Jan 2019 13:18:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5F1282EAE; Sat, 26 Jan 2019 13:18:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id f7so13085810wrp.1; Sat, 26 Jan 2019 05:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VUiHcPLR3MCTc3GY6F9jVQIO5m/4GKSOLaYmhiJGOLo=; b=u303yaeIVlp7pTBbYeGX6rxiQuVI+D9sFLS7EuNvndz1pPhy/y5BW9GmtuaUNE7Lu/ 5EHWtMqzX16s6YXUxgyCXdBeeC5BtrgY6nNANj0e4UV0jCkaXIZeQBPkPPfJqffjIu4V BkhZlPMCYLMgTmsjEBybqGi3MzBEmlLBSQWya0IpX2nItyFmOCAcVf6jHQH6I7QHUGLQ Osk3Xlb6sqM+DZKDED9K0pytYVnrqT9NwpxZogpQxwmHFK5mUjWCc4F9PLngPtZoIUza 7+ciw/N0J6beB9ltq8CZafdLKCSXTfwVsrD7JkQkWINWf+rnSGbD5tZyIoucbUh8yyRo A+IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VUiHcPLR3MCTc3GY6F9jVQIO5m/4GKSOLaYmhiJGOLo=; b=ung4g11jSazI/3qWcx7wiCeGjuns58mhK23hR174Tf50a1QUKkTRxS6FL/AyiN3o5S qqSvzKA2o3J6VbB/jhK2iQ9Xlp5C8wrdTugRuE8K9xtlJpZCdeDtvJMHSsgogpOQUPQY 2wx4JwllscyINGbfLwbnmR3IkAoyY11BVPx7XN9CFV4Z34VzQ/T0HndO+ejzFbf5lzkI eh7WQhBBtkUnqT6p3GvHhrgQYs+PQnQYQS93iegOK0h9rWm+MH65JLGanwFiUrGPfYSm J35HhK/6f0jhMbQTThyJkEnXI/eefRLyvvdk6yLTLZq6XNRgxJqOPwMIY3sAHhGvDpfS ksLQ== X-Gm-Message-State: AJcUukfOB35vzq4kOUjwrA2E9f99couxash9CCQI32tjE6Yo3uPbBmQb OUqQfYzTUoo3QzaCOMpu72lgLCYI X-Google-Smtp-Source: ALg8bN5hNH/fycUfznvs37Qqe/xK3O7BTxYKHuKwBW71Bp8T8XxO6RKQb0A91oN+2o2S1ysLkjhAKQ== X-Received: by 2002:a5d:524b:: with SMTP id p11mr14492203wrv.147.1548508687050; Sat, 26 Jan 2019 05:18:07 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id 133sm73046719wme.9.2019.01.26.05.18.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:18:06 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sat, 26 Jan 2019 13:18:03 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190126131803.GA28061@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: D5F1282EAE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:18:09 -0000 On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > > On 0125T1530, Devin Teske wrote: > >> > >> > >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > >>> > >>> On 0125T1441, Devin Teske wrote: > >>>> > >>>> > >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > >>>>> > >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > >>>>> > napisał(a): > >>>>>> > >>>>>>> Author: trasz > >>>>>>> Date: Fri Jan 25 17:09:26 2019 > >>>>>>> New Revision: 343440 > >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>>>>>> > >>>>>>> Log: > >>>>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>>>>>> The rest of this stuff is still to be discussed, but I think at this > >>>>>>> point we have the agreement that the aliases should go. > >>>>>>> > >>>>>>> MFC after: 2 weeks > >>>>>>> Sponsored by: DARPA, AFRL > >>>>>> > >>>>>> Please just revert this and the prior commit out, and when > >>>>>> the path forward is clear commit it. I would not want any of this > >>>>>> merged to 12/ or 11/ until the time that it is all settled. > >>>>> > >>>>> Oops, my bad - neither this nor the previous commit is supposed > >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > >>>>> config. > >>>>> > >>>>> Regarding the backoff - just a few hours ago you said you don't have > >>>>> any problem with this, except for aliases and the default ENV. The > >>>>> aliases problem has been addressed, and you hadn't yet responded > >>>>> to my explanations regarding the ENV. Another committer asked for > >>>>> backoff, because "sh is not an interactive shell", while in fact sh(1) > >>>>> is FreeBSD's default interactive shell except for root. Finally, there's > >>>>> one person who asked for revert, but without giving any reasons > >>>>> whatsoever. > >>>>> > >>>>> So far nobody had proposed any scenario where this would break > >>>>> anything, or even affect existing users. It seems like a typical bikeshed > >>>>> situation. > >>>> > >>>> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > >>> > >>> The idea is to make it easy to replace the default root shell - which > >>> many people consider broken, due to not supporting basic shell syntax - with > >>> something that actually works. > >> > >> How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > >> > >> If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). > > > > The aliases are gone. > > Fair enough, albeit the topic was r343416 and D18872. > > > > Human-friendly PS1 is considered a standard feature > > nowadays. > > I fail to see how ''$ " is unfriendly. How many people you know use a plain '$' as a shell prompt, because they like it that way? > In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being unfriendly to TCL/Expect. > > While it's certainly possible to use "expect -re" and formulate around it, the change itself would break existing scripts. > > > > > But the way it fixes things is that it makes it easy to replace > > csh with a shell which actually groks shell syntax and is reasonably useful > > out of the box, > > This sounds like you are claiming csh is broken. > > I see where you may be coming from: > > + /bin/sh supports a syntax > + bash supports nearly all of /bin/sh > + zsh supports nearly all of /bin/sh > > So [t]csh must seem broken to you because it doesn't fall inline. > > Being different doesn't mean you are broken. As I have stated previously, I know lots of people that would and do set their login shell to tcsh. > > I personally have both a .tcshrc and a .bash_profile because I use both. I would never consider csh broken because it doesn't "grok shell syntax" -- it in-fact groks its own shell syntax just fine and dandy. I know people who use tcsh, too, but they are a minority of all users. However, this change doesn't do anything for them. > > with ~/.shrc you can customize etc. > > As can ~/.profile But ~/.profile won't work for aliases or the prompt; it's only run for login shells. And our sh(1) doesn't source ~/.shrc by itself, which is confusing to people coming from other systems. > > Think of it as a POLA, > > but horizontally, for folks coming from other systems, instead of the usual > > one. > > POLA can affect multiple people at the same time. > > Someone may be astonished that something is different when coming from anther community, but what if addressing this difference causes a POLA violation for long-standing users. That's true, but I don't think this change would violate POLA for the them. If they don't use sh, they are not affected. If they do, they already have their own config files, and so they are not affected either. > >> Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- these can largely be lumped into one of three categories: > >> > >> a. Considered broken because it doesn't support bashisms > >> b. Considered broken because lack of syntactical knowledge > >> c. Considered broken because (no reason given) > > > > It's broken because it doesn't accept what people call the shell syntax. > > people from Linux? > people you know? > people in articles? > people on twitter? > > I don't have this experience. Users coming from Linux and/or OSX, which I believe are the majority of new users. > > Sure, some folks do realize there used to be something called 'csh', > > and people kept using it even into the nineties. > > That's one perspective. > > I started using tcsh in 2007. > I keep using it today. > I even use it on my Mac. > I also use it on Linux. > I continue to grow my ~/.tcsh file (currently at 410 lines) > > When I use tcsh, I appreciate it for the features that do not exist in any other shell ("repeat N cmd", "|&", etc.) Which is fine. I'm not advocating removing tcsh(1) from base. I'm not even trying to change the default root shell. The change we're discussing does not affect tcsh(1) at all - it only makes it easier for novices to switch to sh(1). > > But most users aren't > > actually that much into computing history; they expect the system to just > > work like they expect. > > > > You can ignore history, but it doesn't change the fact that we still maintain it. > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log > > I'm not into neologisms, but that doesn't mean new things don't stop being created. > > Is the end-goal to make sure that FreeBSD only has shells that are compatible with Linux ones? > > What about the very important matter of offering choice? > > I will digress because this is no longer about .shrc anymore and we should strive to stay on topic. Agreed. > >> Other languages might fit that description as well, and so we should take this anecdote of "many people consider broken" with a grain of salt. > >> > >> I personally have written more than 50,000 lines of shell for the FreeBSD base OS -- all utilizing /bin/sh > > > > And that's one of the reasons why I really apprieciate your response. > > Why thank you. > > I'll give an honest data point that I feel may be illuminating: > > While I consider myself to be proficient in bourne shell (actively rejecting bash, zsh, or other similar shell syntax), I have long been envious of [t]csh's syntax which allows for far fewer lines of code to achieve the same thing. > > Now, I will be the first to admit that csh has its warts (for example, try to throw away stdout but keep stderr through a series of redirects -- this is perhaps the only thing that /bin/sh makes easier than [t]csh), but it is ultimately a shining star for anyone that wants to script their system in a more friendly manner. > > CSH scripts that I have maintained, developed, and had shared with me over the past 15 years have always evoked a sense of respect, consternation, amazement, and humility from me. > > The difference, however, between /bin/sh and [t]csh is more like the differences between perl 5 and perl 6. They are wholly incompatible with each other and (csh being like perl 6) has features that really kick ass (think "grammars" if you're familiar with some of the things that make Perl 6 unique compared to Perl 5). That makes sense - csh(1) was created quite a bit later than sh(1), and since its authors went with a different syntax, they must had a good reason to do so. But my point is - even if csh(1)'s syntax is superior, it didn't catch on. Nowadays the word 'shell' is mostly synonymous with 'Bourne-compatible shell'. > >>>> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >>>> > >>>> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > >>> > >>> Thank you, that's actually a valid argument. I believe that's also what > >>> bash does. It would be more intrusive, though, and I kind of don't like > >>> the idea of hardcoding things that can easily be dealt with with in a more > >>> "high-level" way. > >>> > >>>> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > >>> > >>> Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > >>> different? > >> > >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > >> > >> (situation) > >> > >> Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > >> You know all the areas of interest where an attacker could inject code. > >> You take care to lock down each one. > >> But come to your surprise ... > >> > >> (hypothetical) > >> > >> 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > >> > >> When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. > > > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. See the sibling mail. > > And it only affects root, for whom the answer to > > 'where an attacker could inject code' question is 'literally everywhere, > > including the firmware'. > > This is not true in many situations. One being in a capsicum env or one where the MAC (TrustedBSD Mandatory Access Control) framework sets limitations. With Capsicum you're not able to execute a shell at all. With MAC... it depends on the policy, but then we don't ship with MAC configured. > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). True, but the toor account is locked out by default. [..] > >>>> If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > >>>> So the solution is not even the right one for the desired result. > >>> > >>> I would, if only it didn't break zsh, and perhaps others. The > >>> problem here is that zsh uses different syntax for PS1, _and_ > >>> it also parses /etc/profile. > >>> > >>> And no, I don't care at all about privileged mode, I can't imagine > >>> a situation when using it would be a good idea. > >>> > >> > >> Rampant hand-waving. > >> > >> OK, that still leaves the fact that a non-static PS1 fucks with TCL/Expect programmers. > > > > True, that's a valid argument. Question is, is the number of FreeBSD > > systems (others already use more complicated PS1 by default) to be deployed > > (the change doesn't affect existing installations) with root shell changed > > to sh(1) (the change doesn't affect situations when sh(1) is not your login > > shell) that have to interface with Expect scripts that can't handle more > > complicated prompts, large enough to actually care? > > We started talking about toor because it has no shell specified in /etc/passwd and therefore uses the default shell (/bin/sh). > > Also, upgrade/mergemaster to me seems like it would affect existing installations. > > Now that I think about it, people using TCL/Expect against the root account would be talking to csh and probably not be effected. > > Is it too late to change my vote? Not at all - from my understanding _the_ contentious part were the aliases, which are now gone. Although I don't really consider it 'voting' - if the commit can actually break some reasonable use-case, it'll get reverted even if there's just a single person reporting it. > Let me sit on this for a few hours. The TCL/Expect argument may be neutralized because -- as you correctly state -- is probably a minority of situations. However, I am still concerned about upgrade/mergemaster. > > Maybe a simple UPDATING entry can be used to address the former concern about corporate secteams needing to be kept informed of this nominal [potential] change. It could work, although UPDATING is for... well, updates, and this is for new installs. From owner-svn-src-all@freebsd.org Sat Jan 26 13:36:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6335714C3A75; Sat, 26 Jan 2019 13:36:07 +0000 (UTC) (envelope-from avos@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 007878389E; Sat, 26 Jan 2019 13:36:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E61CA20BEF; Sat, 26 Jan 2019 13:36:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QDa6G6055947; Sat, 26 Jan 2019 13:36:06 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QDa6EJ055946; Sat, 26 Jan 2019 13:36:06 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261336.x0QDa6EJ055946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 13:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343469 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 343469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 007878389E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:36:07 -0000 Author: avos Date: Sat Jan 26 13:36:06 2019 New Revision: 343469 URL: https://svnweb.freebsd.org/changeset/base/343469 Log: MFC r343249: Fix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8) Do not invoke 'wlan_up' function from devd(8) on interface creation event (an example to create such event: 'ifconfig wlan0 create wlandev rtwn0'); they're typically produced during 'service netif (re)start' and result in duplicate interface initialization. From the user side if WPA option is used, this result in messages like: - /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant or - wpa_supplicant already running? (pid=xxxx). (for HOSTAP interfaces this race may result in startup failure). As a side effect, wpa_supplicant(8) / hostapd(8) will not be invoked when new wlan(4) interface is created manually and corresponding configuration for it is present in rc.conf(5). This change does not affect device attach / removal events. Modified: stable/11/etc/devd.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/devd.conf ============================================================================== --- stable/11/etc/devd.conf Sat Jan 26 13:17:19 2019 (r343468) +++ stable/11/etc/devd.conf Sat Jan 26 13:36:06 2019 (r343469) @@ -41,7 +41,7 @@ options { # notify 0 { match "system" "IFNET"; - match "subsystem" "!usbus[0-9]+"; + match "subsystem" "(?!usbus[0-9]+|?!wlan[0-9]+)"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; From owner-svn-src-all@freebsd.org Sat Jan 26 13:53:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0928514C4091; Sat, 26 Jan 2019 13:53:02 +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 8B4DC841CD; Sat, 26 Jan 2019 13:53:01 +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 74F3020F4A; Sat, 26 Jan 2019 13:53:01 +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 x0QDr1jV066360; Sat, 26 Jan 2019 13:53:01 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QDr1gK066359; Sat, 26 Jan 2019 13:53:01 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201901261353.x0QDr1gK066359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 26 Jan 2019 13:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343470 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 343470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B4DC841CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:53:02 -0000 Author: oshogbo Date: Sat Jan 26 13:53:00 2019 New Revision: 343470 URL: https://svnweb.freebsd.org/changeset/base/343470 Log: zfs: allow to change cache flush sysctl There is no reason for this variable to be tunable. This variable is used as a barrier in few places. Discussed with: pjd MFC after: 2 weeks Sponsored by: Fudo Security Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jan 26 13:36:06 2019 (r343469) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jan 26 13:53:00 2019 (r343470) @@ -103,7 +103,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTL * out-of-order write cache is enabled. */ boolean_t zfs_nocacheflush = B_FALSE; -SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN, &zfs_nocacheflush, 0, "Disable cache flush"); boolean_t zfs_trim_enabled = B_TRUE; SYSCTL_DECL(_vfs_zfs_trim); From owner-svn-src-all@freebsd.org Sat Jan 26 14:10:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8176D14C46FF; Sat, 26 Jan 2019 14:10:50 +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 295D384ABC; Sat, 26 Jan 2019 14:10:50 +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 1E0D421128; Sat, 26 Jan 2019 14:10:50 +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 x0QEAow4072729; Sat, 26 Jan 2019 14:10:50 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEAnuG072726; Sat, 26 Jan 2019 14:10:49 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201901261410.x0QEAnuG072726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 26 Jan 2019 14:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343471 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 343471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 295D384ABC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:10:50 -0000 Author: oshogbo Date: Sat Jan 26 14:10:49 2019 New Revision: 343471 URL: https://svnweb.freebsd.org/changeset/base/343471 Log: libcasper: do not run registered exit functions Casper library should not use exit(3) function because before setting it up applications may register it. Casper doesn't depend on any registered exit function, so it safe to change this. Reported by: jceel MFC after: 2 weeks Modified: head/lib/libcasper/libcasper/libcasper_service.c head/lib/libcasper/libcasper/service.c head/lib/libcasper/libcasper/zygote.c Modified: head/lib/libcasper/libcasper/libcasper_service.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/libcasper_service.c Sat Jan 26 14:10:49 2019 (r343471) @@ -148,20 +148,20 @@ service_execute(int chanfd) nvl = nvlist_recv(chanfd, 0); if (nvl == NULL) - exit(1); + _exit(1); if (!nvlist_exists_string(nvl, "service")) - exit(1); + _exit(1); servname = nvlist_get_string(nvl, "service"); casserv = service_find(servname); if (casserv == NULL) - exit(1); + _exit(1); service = casserv->cs_service; procfd = nvlist_take_descriptor(nvl, "procfd"); nvlist_destroy(nvl); service_start(service, chanfd, procfd); /* Not reached. */ - exit(1); + _exit(1); } static int @@ -231,7 +231,7 @@ casper_main_loop(int fd) int sock, maxfd, ret; if (zygote_init() < 0) - exit(1); + _exit(1); /* * Register core services. @@ -256,7 +256,7 @@ casper_main_loop(int fd) } if (maxfd == -1) { /* Nothing to do. */ - exit(0); + _exit(0); } maxfd++; @@ -267,7 +267,7 @@ casper_main_loop(int fd) if (ret == -1) { if (errno == EINTR) continue; - exit(1); + _exit(1); } TAILQ_FOREACH(casserv, &casper_services, cs_next) { Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/service.c Sat Jan 26 14:10:49 2019 (r343471) @@ -427,7 +427,7 @@ service_start(struct service *service, int sock, int p service_clean(sock, procfd, service->s_flags); if (service_connection_add(service, sock, NULL) == NULL) - exit(1); + _exit(1); for (;;) { FD_ZERO(&fds); @@ -443,7 +443,7 @@ service_start(struct service *service, int sock, int p nfds = select(maxfd + 1, &fds, NULL, NULL, NULL); if (nfds < 0) { if (errno != EINTR) - exit(1); + _exit(1); continue; } else if (nfds == 0) { /* Timeout. */ @@ -468,5 +468,5 @@ service_start(struct service *service, int sock, int p } } - exit(0); + _exit(0); } Modified: head/lib/libcasper/libcasper/zygote.c ============================================================================== --- head/lib/libcasper/libcasper/zygote.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/zygote.c Sat Jan 26 14:10:49 2019 (r343471) @@ -122,7 +122,7 @@ zygote_main(int sock) if (nvlin == NULL) { if (errno == ENOTCONN) { /* Casper exited. */ - exit(0); + _exit(0); } continue; } @@ -134,7 +134,7 @@ zygote_main(int sock) func = service_execute; break; default: - exit(0); + _exit(0); } /* @@ -161,7 +161,7 @@ zygote_main(int sock) close(chanfd[0]); func(chanfd[1]); /* NOTREACHED */ - exit(1); + _exit(1); default: /* Parent. */ close(chanfd[1]); From owner-svn-src-all@freebsd.org Sat Jan 26 14:14:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 828AB14C494B; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@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 235B884EA2; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1267D212B5; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QEEPgb076940; Sat, 26 Jan 2019 14:14:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEEPY3076939; Sat, 26 Jan 2019 14:14:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261414.x0QEEPY3076939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 14:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343472 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 343472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 235B884EA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:14:26 -0000 Author: avos Date: Sat Jan 26 14:14:25 2019 New Revision: 343472 URL: https://svnweb.freebsd.org/changeset/base/343472 Log: otus(4): fix a typo in man page (802.11 -> 802.11n) MFC after: 3 days Modified: head/share/man/man4/otus.4 Modified: head/share/man/man4/otus.4 ============================================================================== --- head/share/man/man4/otus.4 Sat Jan 26 14:10:49 2019 (r343471) +++ head/share/man/man4/otus.4 Sat Jan 26 14:14:25 2019 (r343472) @@ -166,4 +166,4 @@ and ported by The .Nm driver only supports 802.11a/b/g operations. -802.11 operation is not supported at this time. +802.11n operation is not supported at this time. From owner-svn-src-all@freebsd.org Sat Jan 26 14:32:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 794BD14C4F22; Sat, 26 Jan 2019 14:32:19 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18B5585920; Sat, 26 Jan 2019 14:32:18 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-oi1-f182.google.com with SMTP id i6so9809773oia.6; Sat, 26 Jan 2019 06:32:18 -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:content-transfer-encoding; bh=Wi0meghD/NkgnVpQ9y6h17LE9fKS8/3ChmkIF6NGxeM=; b=Z10iVlfe7ujz8UI+TWZnLevrkfqSIGSJPGXtnT/XrfuKxRc+CsUxJ7BiIqKPH4t9Mt O84fb3SDPdMYh3c+ml+ecXpzrIly4vY/EXakoKJmeK0masSoUibY1DVlLiRB2cwJ12S5 i2heT19GgKKvCbo+xW/zuJb9Frt3qCir4z/gM/mSTQWzznkA37M0lZ56tI7OTN34xLwp VN6P3IVpDuQcEp9Zcr7MbwVa89TeIlOJqkZciuQsbsum4Iai2R201ikUwxyTO4GyyDuz 6NKE4UATtAW5OFwahGM7EMWFG4V7REOK+H/kNKTFT1Mumz/PvzCQdyw+fNNxq/c6+51O QUAA== X-Gm-Message-State: AJcUukfT0dRe6Vr+DPu4+9PwNJZX/h7zkfT6dGYjYJUwWJcrx7wG5WI6 CsYU56PtEz93jmFoyyszJRwp7YRsd3HBpuAq9izr/Q== X-Google-Smtp-Source: AHgI3IbaOZzq6yUMrZJyRugdcgX3IxZbSuBESiBeVxEPfUHAsB9v8oWEolOFLclzBD+jAs96IISMxcAAJWGnPKq89po= X-Received: by 2002:aca:1a0b:: with SMTP id a11mr980506oia.154.1548506560960; Sat, 26 Jan 2019 04:42:40 -0800 (PST) MIME-Version: 1.0 References: <20190125095512.GB26744@v2> <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Sat, 26 Jan 2019 12:42:27 +0000 Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: rgrimes@freebsd.org Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 18B5585920 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:32:19 -0000 sob., 26 sty 2019 o 01:38 Rodney W. Grimes napisa=C5=82(a): > > > On 0125T1705, Rodney W. Grimes wrote: > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala = wrote: > > > > > > Chop with the big axe most of this as I need to clarify a miss statem= ent. > > > ... > > > > > The change we're discussing doesn't affect upgrades at all - it's= only > > > > > for new installs. > > > > > > > > mergemaster, iirc, will merge in changes to etc files after an upgr= ade. > > > > So this would effect anybody that goes through an upgrade and perfo= rms mergemaster. > > > > > > Correct, and to my knowledge there is no way to stop that effect. > > > > Won't happen in this case, this doesn't apply to files in /etc > > at all; it only applies to the default /root/.shrc and /root/.profile > > that get installed on fresh systems. > > mergemaster is the wrong term here, freebsd-update is > going to want to merge this change. Are you sure freebsd-update also updates root's private configuration files? I've never used it, but this seems somewhat surprising. > > > > > And it doesn't affect root by default, you > > > > > need to change their shell from csh(1) to sh(1). > > > > > > > > By your own commit messages admission, this is for the toor account= , so it does affect a user (and as you were keen to point out, users with t= he default shell). > > > > > > Further it effects root any time root types "sh" or "/bin/sh" > > > and intentially invokes sh interactive for some reason, > > > something I do more often than I care to admit simply > > > cause I know what I want to do is much easier in that > > > shell. > > > > It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) > > you need to have ENV set; the default /root/.profile only sets > > it when sh(1) is your login shell. > I do not see any conditional logic in /root/.profile, > what your mis stating is that /root/.profile is not > run for a login shell, so ENV would not be set unless > something else caused /root/.profile to be read, aka > source ~/.profile Correction: /root/.profile is not-run for non-login shell, so ENV wouldn't be set. Yeah, that's what I've meant. > > Which means, this doesn't > > change the behaviour when you casually run "sh" or "/bin/sh" > > as root; sh needs to be set up as login shell for this to take > > effect. > > Again I do not see any conditional logic in /root/.profile > that would make that true. A su - toor would be effected. As opposed to 'su - root' or plain '/bin/sh', right. From owner-svn-src-all@freebsd.org Sat Jan 26 14:54:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A530514C573D; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@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 48DF286390; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 372E52195A; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QEs7NW097957; Sat, 26 Jan 2019 14:54:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEs79G097956; Sat, 26 Jan 2019 14:54:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261454.x0QEs79G097956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 14:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343473 - head/sys/geom/uzip X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/geom/uzip X-SVN-Commit-Revision: 343473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48DF286390 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:54:07 -0000 Author: avos Date: Sat Jan 26 14:54:06 2019 New Revision: 343473 URL: https://svnweb.freebsd.org/changeset/base/343473 Log: geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced PR: 203499 Submitted by: MFC after: 5 days Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Jan 26 14:14:25 2019 (r343472) +++ head/sys/geom/uzip/g_uzip.c Sat Jan 26 14:54:06 2019 (r343473) @@ -889,13 +889,13 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); + KASSERT(gp != NULL, ("NULL geom")); if (gp->softc == NULL) { DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__, gp->name)); return (ENXIO); } - KASSERT(gp != NULL, ("NULL geom")); pp = LIST_FIRST(&gp->provider); KASSERT(pp != NULL, ("NULL provider")); if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) From owner-svn-src-all@freebsd.org Sat Jan 26 16:44:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5947414C8980 for ; Sat, 26 Jan 2019 16:44:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 690358A5D6 for ; Sat, 26 Jan 2019 16:44:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548520019; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=fXAZ2kWTaP/nMV5Z6hKk5y26wYPBLPmHQ5++78kWU9RKSLvGglblcsew9qx9kLJceV2tv0U+iMIsh J06w67rDaLZQ99TEbKU+seLkVEoJLamAoFNVZPR9Hkp+z+xHGuLlltrTjcDTrJ8UYHAnEl/bGV5q1Q Mzk3Ev9LDcMlY4Kfs0t9hgNjp86kIWhA1iiARi8uGEutJRwQsBptUkZh0GRMXbzSYIlhV7ixyubhi2 BYT72nx2dxC74rxcnYPt95W9q4vZsiQBtmxIwFC0I4N5Rth0rWsTGKUUyh2SFI0VefypgKupLZExpo Tb0RGFUGAyaA4ILXD0PF66cf/cJj6Qw== 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=yvgzqpBK9Xc1LqK/U+w4alis+vsS5Hof4Pa6/9SfoL0=; b=eYgIh0ruF0buTpj+/0YKv9d+MtyqVD2tM+hVXJHgH0QqbKhjcrwzaZgX4exphY2hfUTWg9iajh6CR lLN1in6Afd0aqvFEDSCaPTrFXukxUbZ0X2cYXeE/5mjvnR1leGbssA42an4SPkCCW3lTMfHTlEbrpj C6ScT1b7nsQIyy4EwB/pCPYM5s6SGheesI4xRCTWP57PUGmo+n4+qOorSm6AZH8ldbwgPTuJ6i6sbY NDkEEUUeCiT1iO3mLrZEUnn69MX9ZCTaGmf9TXWWHwwTKyGt8RB3Cn23t3L06YgUFZGUqb9wjhLb9F 7uWZuj5v5HGYsoc9wNyUOnrMFeB/Wwg== 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=yvgzqpBK9Xc1LqK/U+w4alis+vsS5Hof4Pa6/9SfoL0=; b=YcCZKNXuDadVuu3spsRuG9hWM/A0Yc4aZgMiSfT5tg7LIn0LVghg8MOW1WUDzdqmR4zAZIhe9Ochz EOLRcAPjRUvTWgQ1861ZduN0FPOJxFYfr6N2oztT+vpD+e77L9cEKALIDkAGVpvOkxhHijX7VNJsq7 +wVScgOvpXwWP4PJ50S7lrsJmWsced8f+VjEv/pctS26qKPuzOCI97eeQXKbyw2BoJfXy78w40Oa6p WaEQx8KmR+8cM3fV8cZU9VxWTh/gMPpQYYkKh9wRRFZvq87OwylO01Qx52/StgAaRAeaK9D1LysQZF aNKlmAxeqwMExX44ke54TkG8NCls8Qg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 32c496ac-2187-11e9-a59a-7b143e15dabc 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 32c496ac-2187-11e9-a59a-7b143e15dabc; Sat, 26 Jan 2019 16:26:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QGS4pb008606; Sat, 26 Jan 2019 09:28:04 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <311b99b491846d635076d2feb58cf568c15f4154.camel@freebsd.org> Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: Edward Napierala , Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 26 Jan 2019 09:28:04 -0700 In-Reply-To: <20190126131803.GA28061@v2> References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> <20190126131803.GA28061@v2> 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: 690358A5D6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 16:44:19 -0000 On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > On 0125T1647, Devin Teske wrote: > > > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala > > > wrote: > > > > > > On 0125T1530, Devin Teske wrote: > > > > > > > > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > trasz@freebsd.org> wrote: > > > > > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > > > > > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisał(a): > > > > > > > > > > > > > > > > > Author: trasz > > > > > > > > > Date: Fri Jan 25 17:09:26 2019 > > > > > > > > > New Revision: 343440 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > Comment out the default sh(1) aliases for root, > > > > > > > > > introduced in r343416. > > > > > > > > > The rest of this stuff is still to be discussed, but > > > > > > > > > I think at this > > > > > > > > > point we have the agreement that the aliases should > > > > > > > > > go. > > > > > > > > > > > > > > > > > > MFC after: 2 weeks > > > > > > > > > Sponsored by: DARPA, AFRL > > > > > > > > > > > > > > > > Please just revert this and the prior commit out, and > > > > > > > > when > > > > > > > > the path forward is clear commit it. I would not want > > > > > > > > any of this > > > > > > > > merged to 12/ or 11/ until the time that it is all > > > > > > > > settled. > > > > > > > > > > > > > > Oops, my bad - neither this nor the previous commit is > > > > > > > supposed > > > > > > > to be MFC-ed; the "2 weeks" above comes from my default > > > > > > > Subversion > > > > > > > config. > > > > > > > > > > > > > > Regarding the backoff - just a few hours ago you said you > > > > > > > don't have > > > > > > > any problem with this, except for aliases and the default > > > > > > > ENV. The > > > > > > > aliases problem has been addressed, and you hadn't yet > > > > > > > responded > > > > > > > to my explanations regarding the ENV. Another committer > > > > > > > asked for > > > > > > > backoff, because "sh is not an interactive shell", while > > > > > > > in fact sh(1) > > > > > > > is FreeBSD's default interactive shell except for > > > > > > > root. Finally, there's > > > > > > > one person who asked for revert, but without giving any > > > > > > > reasons > > > > > > > whatsoever. > > > > > > > > > > > > > > So far nobody had proposed any scenario where this would > > > > > > > break > > > > > > > anything, or even affect existing users. It seems like a > > > > > > > typical bikeshed > > > > > > > situation. > > > > > > > > > > > > It is not clear to me after reading r343416 and D18872 what > > > > > > this change is trying to solve. > > > > > > > > > > The idea is to make it easy to replace the default root shell > > > > > - which > > > > > many people consider broken, due to not supporting basic > > > > > shell syntax - with > > > > > something that actually works. > > > > > > > > How exactly does changing PS1 or adding 6 aliases fix the > > > > "basic shell syntax" which you claim to be unsupported? > > > > > > > > If the number of aliases added to a shell are a measure of its > > > > brokenness, then bash must be hella broken (I have 43 aliases > > > > in my bash_profile). > > > > > > The aliases are gone. > > > > Fair enough, albeit the topic was r343416 and D18872. > > > > > > > Human-friendly PS1 is considered a standard feature > > > nowadays. > > > > I fail to see how ''$ " is unfriendly. > > How many people you know use a plain '$' as a shell prompt, > because they like it that way? > > > In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as > > being unfriendly to TCL/Expect. > > > > While it's certainly possible to use "expect -re" and formulate > > around it, the change itself would break existing scripts. > > > > > > > > > But the way it fixes things is that it makes it easy to replace > > > csh with a shell which actually groks shell syntax and is > > > reasonably useful > > > out of the box, > > > > This sounds like you are claiming csh is broken. > > > > I see where you may be coming from: > > > > + /bin/sh supports a syntax > > + bash supports nearly all of /bin/sh > > + zsh supports nearly all of /bin/sh > > > > So [t]csh must seem broken to you because it doesn't fall inline. > > > > Being different doesn't mean you are broken. As I have stated > > previously, I know lots of people that would and do set their login > > shell to tcsh. > > > > I personally have both a .tcshrc and a .bash_profile because I use > > both. I would never consider csh broken because it doesn't "grok > > shell syntax" -- it in-fact groks its own shell syntax just fine > > and dandy. > > I know people who use tcsh, too, but they are a minority of all > users. > However, this change doesn't do anything for them. > > > > with ~/.shrc you can customize etc. > > > > As can ~/.profile > > But ~/.profile won't work for aliases or the prompt; it's only run > for login shells. And our sh(1) doesn't source ~/.shrc by itself, > which is confusing to people coming from other systems. > > > > Think of it as a POLA, > > > but horizontally, for folks coming from other systems, instead of > > > the usual > > > one. > > > > POLA can affect multiple people at the same time. > > > > Someone may be astonished that something is different when coming > > from anther community, but what if addressing this difference > > causes a POLA violation for long-standing users. > > That's true, but I don't think this change would violate POLA for the > them. > If they don't use sh, they are not affected. If they do, they > already have > their own config files, and so they are not affected either. > > > > > Also, the perhaps anecdotal consideration of brokenness is > > > > nearly laughable -- these can largely be lumped into one of > > > > three categories: > > > > > > > > a. Considered broken because it doesn't support bashisms > > > > b. Considered broken because lack of syntactical knowledge > > > > c. Considered broken because (no reason given) > > > > > > It's broken because it doesn't accept what people call the shell > > > syntax. > > > > people from Linux? > > people you know? > > people in articles? > > people on twitter? > > > > I don't have this experience. > > Users coming from Linux and/or OSX, which I believe are the majority > of new users. > > > > Sure, some folks do realize there used to be something called > > > 'csh', > > > and people kept using it even into the nineties. > > > > That's one perspective. > > > > I started using tcsh in 2007. > > I keep using it today. > > I even use it on my Mac. > > I also use it on Linux. > > I continue to grow my ~/.tcsh file (currently at 410 lines) > > > > When I use tcsh, I appreciate it for the features that do not exist > > in any other shell ("repeat N cmd", "|&", etc.) > > Which is fine. I'm not advocating removing tcsh(1) from base. I'm > not > even trying to change the default root shell. The change we're > discussing > does not affect tcsh(1) at all - it only makes it easier for novices > to > switch to sh(1). > > > > But most users aren't > > > actually that much into computing history; they expect the system > > > to just > > > work like they expect. > > > > > > > You can ignore history, but it doesn't change the fact that we > > still maintain it. > > > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log < > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log> > > > > I'm not into neologisms, but that doesn't mean new things don't > > stop being created. > > > > Is the end-goal to make sure that FreeBSD only has shells that are > > compatible with Linux ones? > > > > What about the very important matter of offering choice? > > > > I will digress because this is no longer about .shrc anymore and we > > should strive to stay on topic. > > Agreed. > > > > > Other languages might fit that description as well, and so we > > > > should take this anecdote of "many people consider broken" with > > > > a grain of salt. > > > > > > > > I personally have written more than 50,000 lines of shell for > > > > the FreeBSD base OS -- all utilizing /bin/sh > > > > > > And that's one of the reasons why I really apprieciate your > > > response. > > > > Why thank you. > > > > I'll give an honest data point that I feel may be illuminating: > > > > While I consider myself to be proficient in bourne shell (actively > > rejecting bash, zsh, or other similar shell syntax), I have long > > been envious of [t]csh's syntax which allows for far fewer lines of > > code to achieve the same thing. > > > > Now, I will be the first to admit that csh has its warts (for > > example, try to throw away stdout but keep stderr through a series > > of redirects -- this is perhaps the only thing that /bin/sh makes > > easier than [t]csh), but it is ultimately a shining star for anyone > > that wants to script their system in a more friendly manner. > > > > CSH scripts that I have maintained, developed, and had shared with > > me over the past 15 years have always evoked a sense of respect, > > consternation, amazement, and humility from me. > > > > The difference, however, between /bin/sh and [t]csh is more like > > the differences between perl 5 and perl 6. They are wholly > > incompatible with each other and (csh being like perl 6) has > > features that really kick ass (think "grammars" if you're familiar > > with some of the things that make Perl 6 unique compared to Perl > > 5). > > That makes sense - csh(1) was created quite a bit later than sh(1), > and since > its authors went with a different syntax, they must had a good reason > to do so. > > But my point is - even if csh(1)'s syntax is superior, it didn't > catch on. > Nowadays the word 'shell' is mostly synonymous with 'Bourne- > compatible shell'. > > > > > > > PS1 should have a reasonable default. If that default is > > > > > > not reasonable, then we should change the C code. > > > > > > > > > > > > Maybe I see things differently, but I'd rather see PS1 > > > > > > default change so no profile/shrc change is necessary. > > > > > > > > > > Thank you, that's actually a valid argument. I believe > > > > > that's also what > > > > > bash does. It would be more intrusive, though, and I kind of > > > > > don't like > > > > > the idea of hardcoding things that can easily be dealt with > > > > > with in a more > > > > > "high-level" way. > > > > > > > > > > > I prefer that sh, in its default configuration, not attempt > > > > > > to read $HOME/.shrc, for security reasons. > > > > > > > > > > Can you elaborate? It already reads $HOME/.profile; how is > > > > > $HOME/.shrc > > > > > different? > > > > > > > > If you read "The Cuckoo's Egg" by Clifford Stoll, you'll > > > > understand the importance of "one place to exploit versus two." > > > > > > > > (situation) > > > > > > > > Say you've been running FreeBSD for 20 years (it turned 25 > > > > years old last year, so this is not only possible, but > > > > plausible). > > > > You know all the areas of interest where an attacker could > > > > inject code. > > > > You take care to lock down each one. > > > > But come to your surprise ... > > > > > > > > (hypothetical) > > > > > > > > 6 months after you upgraded from 11.2 to the latest 12.x, you > > > > find that you didn't take into account that $HOME/.profile > > > > (which you perhaps locked down with a "chflags" command) now > > > > branches out to a new file which you've never taken steps to > > > > lock down, keep an eye on, or audit (e.g., by using DTrace > > > > remote-logging, tripwire, or other means). You only found out 6 > > > > months after the upgrade because someone exploited it. At that > > > > point, the security event has already occurred. > > > > > > > > When I worked at "the banks" shit like this was always on our > > > > radar. Changes like this were often cited for the reason why > > > > one bank moved to BoKs for security. > > > > > > The change we're discussing doesn't affect upgrades at all - it's > > > only > > > for new installs. > > > > mergemaster, iirc, will merge in changes to etc files after an > > upgrade. > > So this would effect anybody that goes through an upgrade and > > performs mergemaster. > > See the sibling mail. > > > > And it only affects root, for whom the answer to > > > 'where an attacker could inject code' question is 'literally > > > everywhere, > > > including the firmware'. > > > > This is not true in many situations. One being in a capsicum env or > > one where the MAC (TrustedBSD Mandatory Access Control) framework > > sets limitations. > > With Capsicum you're not able to execute a shell at all. With MAC... > it depends on the policy, but then we don't ship with MAC configured. > > > > And it doesn't affect root by default, you > > > need to change their shell from csh(1) to sh(1). > > > > By your own commit messages admission, this is for the toor > > account, so it does affect a user (and as you were keen to point > > out, users with the default shell). > > True, but the toor account is locked out by default. > > [..] > > > > > > > If you wanted your new shiny default PS1 to actually have > > > > > > an effect in all modes (including privileged mode, where > > > > > > you probably want it), you would have put it in > > > > > > /etc/profile and not in a file that is wholly ignored by > > > > > > some modes (e.g., privileged mode). > > > > > > So the solution is not even the right one for the desired > > > > > > result. > > > > > > > > > > I would, if only it didn't break zsh, and perhaps > > > > > others. The > > > > > problem here is that zsh uses different syntax for PS1, _and_ > > > > > it also parses /etc/profile. > > > > > > > > > > And no, I don't care at all about privileged mode, I can't > > > > > imagine > > > > > a situation when using it would be a good idea. > > > > > > > > > > > > > Rampant hand-waving. > > > > > > > > OK, that still leaves the fact that a non-static PS1 fucks with > > > > TCL/Expect programmers. > > > > > > True, that's a valid argument. Question is, is the number of > > > FreeBSD > > > systems (others already use more complicated PS1 by default) to > > > be deployed > > > (the change doesn't affect existing installations) with root > > > shell changed > > > to sh(1) (the change doesn't affect situations when sh(1) is not > > > your login > > > shell) that have to interface with Expect scripts that can't > > > handle more > > > complicated prompts, large enough to actually care? > > > > We started talking about toor because it has no shell specified in > > /etc/passwd and therefore uses the default shell (/bin/sh). > > > > Also, upgrade/mergemaster to me seems like it would affect existing > > installations. > > > > Now that I think about it, people using TCL/Expect against the root > > account would be talking to csh and probably not be effected. > > > > Is it too late to change my vote? > > Not at all - from my understanding _the_ contentious part were the > aliases, > which are now gone. Although I don't really consider it 'voting' - > if the > commit can actually break some reasonable use-case, it'll get > reverted even > if there's just a single person reporting it. > No, it's not just the aliases. The part that angers me the most is the changing of PS1. I still haven't seen anything that justifies any of these changes other than your opinion that you like your changes better than what was there before. -- Ian > > Let me sit on this for a few hours. The TCL/Expect argument may be > > neutralized because -- as you correctly state -- is probably a > > minority of situations. However, I am still concerned about > > upgrade/mergemaster. > > > > Maybe a simple UPDATING entry can be used to address the former > > concern about corporate secteams needing to be kept informed of > > this nominal [potential] change. > > It could work, although UPDATING is for... well, updates, and this is > for > new installs. > > From owner-svn-src-all@freebsd.org Sat Jan 26 17:00:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2E714A634B; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@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 31F858AFD6; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB3622E2B; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QH0weE063478; Sat, 26 Jan 2019 17:00:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QH0tJH063461; Sat, 26 Jan 2019 17:00:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261700.x0QH0tJH063461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343474 - in head/sys: dev/bwi dev/iwi dev/ral dev/rtwn dev/usb/wlan net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/bwi dev/iwi dev/ral dev/rtwn dev/usb/wlan net80211 X-SVN-Commit-Revision: 343474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31F858AFD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:00:59 -0000 Author: avos Date: Sat Jan 26 17:00:55 2019 New Revision: 343474 URL: https://svnweb.freebsd.org/changeset/base/343474 Log: Remove 2GHz channel list copies from wireless drivers. Wrap ieee80211_add_channel_list_2ghz into another function which supplies default (1-14) channel list to it and drop its copies from drivers. Checked with RTL8188EE, country US / JP / KR / UA. MFC after: 2 weeks Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/iwi/if_iwi.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/rtwn/if_rtwn.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/bwi/if_bwi.c Sat Jan 26 17:00:55 2019 (r343474) @@ -307,9 +307,6 @@ static const struct { [108] = { 7, 3 } }; -static const uint8_t bwi_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - #ifdef BWI_DEBUG #ifdef BWI_DEBUG_VERBOSE static uint32_t bwi_debug = BWI_DBG_ATTACH | BWI_DBG_INIT | BWI_DBG_TXPOWER; @@ -1715,8 +1712,7 @@ bwi_getradiocaps(struct ieee80211com *ic, panic("unknown phymode %d\n", phy->phy_mode); } - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - bwi_chan_2ghz, nitems(bwi_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/iwi/if_iwi.c Sat Jan 26 17:00:55 2019 (r343474) @@ -132,8 +132,6 @@ static const struct iwi_ident iwi_ident_table[] = { { 0, 0, NULL } }; -static const uint8_t def_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t def_chan_5ghz_band1[] = { 36, 40, 44, 48, 52, 56, 60, 64 }; static const uint8_t def_chan_5ghz_band2[] = @@ -3604,8 +3602,8 @@ iwi_getradiocaps(struct ieee80211com *ic, iwi_collect_bands(ic, bands, sizeof(bands)); *nchans = 0; if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G)) - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - def_chan_2ghz, nitems(def_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, 0); if (isset(bands, IEEE80211_MODE_11A)) { ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2560.c Sat Jan 26 17:00:55 2019 (r343474) @@ -189,9 +189,6 @@ static const uint32_t rt2560_rf2525e_r2[] = RT2560_R static const uint32_t rt2560_rf2526_r2[] = RT2560_RF2526_R2; static const uint32_t rt2560_rf2526_hi_r2[] = RT2560_RF2526_HI_R2; -static const uint8_t rt2560_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t rt2560_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -2137,8 +2134,7 @@ rt2560_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2560_chan_2ghz, nitems(rt2560_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2560_RF_5222) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2661.c Sat Jan 26 17:00:55 2019 (r343474) @@ -195,8 +195,6 @@ static const struct rfprog { RT2661_RF5225_2 }; -static const uint8_t rt2661_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t rt2661_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -2757,8 +2755,7 @@ rt2661_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2661_chan_2ghz, nitems(rt2661_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2860.c Sat Jan 26 17:00:55 2019 (r343474) @@ -228,8 +228,6 @@ static const struct { RT5392_DEF_RF }; -static const uint8_t rt2860_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t rt2860_chan_5ghz[] = { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, @@ -2310,8 +2308,7 @@ rt2860_getradiocaps(struct ieee80211com *ic, int maxch memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2860_chan_2ghz, nitems(rt2860_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/rtwn/if_rtwn.c Sat Jan 26 17:00:55 2019 (r343474) @@ -153,9 +153,6 @@ static void rtwn_stop(struct rtwn_softc *); MALLOC_DEFINE(M_RTWN_PRIV, "rtwn_priv", "rtwn driver private state"); -static const uint8_t rtwn_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint16_t wme2reg[] = { R92C_EDCA_BE_PARAM, R92C_EDCA_BK_PARAM, R92C_EDCA_VI_PARAM, R92C_EDCA_VO_PARAM }; @@ -1534,9 +1531,8 @@ rtwn_getradiocaps(struct ieee80211com *ic, setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); setbit(bands, IEEE80211_MODE_11NG); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rtwn_chan_2ghz, nitems(rtwn_chan_2ghz), bands, - !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); /* XXX workaround add_channel_list() limitations */ setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Jan 26 17:00:55 2019 (r343474) @@ -286,9 +286,6 @@ MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); USB_PNP_HOST_INFO(rsu_devs); -static const uint8_t rsu_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static uint8_t rsu_wme_ac_xfer_map[4] = { [WME_AC_BE] = RSU_BULK_TX_BE_BK, [WME_AC_BK] = RSU_BULK_TX_BE_BK, @@ -784,9 +781,8 @@ rsu_getradiocaps(struct ieee80211com *ic, setbit(bands, IEEE80211_MODE_11G); if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, - (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); } static void Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_rum.c Sat Jan 26 17:00:55 2019 (r343474) @@ -342,9 +342,6 @@ static const struct { { 107, 0x04 } }; -static const uint8_t rum_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t rum_chan_5ghz[] = { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -3220,8 +3217,7 @@ rum_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rum_chan_2ghz, nitems(rum_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_run.c Sat Jan 26 17:00:55 2019 (r343474) @@ -4859,8 +4859,7 @@ run_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - run_chan_2ghz, nitems(run_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT3593_RF_3053 || Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_runreg.h Sat Jan 26 17:00:55 2019 (r343474) @@ -1086,9 +1086,6 @@ struct rt2860_rxwi { /* * Channel map for run(4) driver; taken from the table below. */ -static const uint8_t run_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t run_chan_5ghz[] = { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_ural.c Sat Jan 26 17:00:55 2019 (r343474) @@ -361,9 +361,6 @@ static const struct { { 161, 0x08808, 0x0242f, 0x00281 } }; -static const uint8_t ural_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t ural_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -1591,8 +1588,7 @@ ural_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - ural_chan_2ghz, nitems(ural_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RAL_RF_5222) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Jan 26 17:00:55 2019 (r343474) @@ -215,9 +215,6 @@ static uint8_t urtw_8225z2_agc[] = { 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31 }; -static const uint8_t urtw_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static uint32_t urtw_8225_channel[] = { 0x0000, /* dummy channel 0 */ 0x085c, /* 1 */ @@ -1585,8 +1582,7 @@ urtw_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - urtw_chan_2ghz, nitems(urtw_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jan 26 17:00:55 2019 (r343474) @@ -2889,8 +2889,7 @@ zyd_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - zyd_chan_2ghz, nitems(zyd_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_zydreg.h Sat Jan 26 17:00:55 2019 (r343474) @@ -421,10 +421,6 @@ #define ZYD_CR254 0x93f8 #define ZYD_CR255 0x93fc -/* nitems(ZYD_*_CHANTABLE) */ -static const uint8_t zyd_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - /* copied nearly verbatim from the Linux driver rewrite */ #define ZYD_DEF_PHY \ { \ Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/net80211/ieee80211.c Sat Jan 26 17:00:55 2019 (r343474) @@ -1632,6 +1632,17 @@ ieee80211_add_channel_list_2ghz(struct ieee80211_chann } int +ieee80211_add_channels_default_2ghz(struct ieee80211_channel chans[], + int maxchans, int *nchans, const uint8_t bands[], int ht40) +{ + const uint8_t default_chan_list[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + + return (ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + default_chan_list, nitems(default_chan_list), bands, ht40)); +} + +int ieee80211_add_channel_list_5ghz(struct ieee80211_channel chans[], int maxchans, int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], int ht40) Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/net80211/ieee80211_var.h Sat Jan 26 17:00:55 2019 (r343474) @@ -734,6 +734,8 @@ uint32_t ieee80211_get_channel_center_freq1(const stru uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); +int ieee80211_add_channels_default_2ghz(struct ieee80211_channel[], int, + int *, const uint8_t[], int); int ieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *, From owner-svn-src-all@freebsd.org Sat Jan 26 17:17:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F22E14A70AD; Sat, 26 Jan 2019 17:17:26 +0000 (UTC) (envelope-from avos@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 DA4C98BB3F; Sat, 26 Jan 2019 17:17:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEFE923173; Sat, 26 Jan 2019 17:17:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QHHP6u072280; Sat, 26 Jan 2019 17:17:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHHPFd072279; Sat, 26 Jan 2019 17:17:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261717.x0QHHPFd072279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343475 - head/sys/geom/uzip X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/geom/uzip X-SVN-Commit-Revision: 343475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA4C98BB3F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:17:26 -0000 Author: avos Date: Sat Jan 26 17:17:25 2019 New Revision: 343475 URL: https://svnweb.freebsd.org/changeset/base/343475 Log: geom_uzip(4): set 'gp != NULL' assertion on top of the function There was yet another access to this variable in g_trace() few lines upper. PR: 203499 Reported by: cem MFC after: 5 days MFC with: 343473 Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Jan 26 17:00:55 2019 (r343474) +++ head/sys/geom/uzip/g_uzip.c Sat Jan 26 17:17:25 2019 (r343475) @@ -886,10 +886,10 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla { struct g_provider *pp; + KASSERT(gp != NULL, ("NULL geom")); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); - KASSERT(gp != NULL, ("NULL geom")); if (gp->softc == NULL) { DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__, gp->name)); From owner-svn-src-all@freebsd.org Sat Jan 26 17:17:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BC114A70DE; Sat, 26 Jan 2019 17:17:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08CB38BC2A; Sat, 26 Jan 2019 17:17:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QHHXme094484; Sat, 26 Jan 2019 09:17:33 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QHHXCC094483; Sat, 26 Jan 2019 09:17:33 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <311b99b491846d635076d2feb58cf568c15f4154.camel@freebsd.org> To: Ian Lepore Date: Sat, 26 Jan 2019 09:17:33 -0800 (PST) CC: Edward Napierala , Devin Teske , rgrimes@freebsd.org, src-committers , 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: 08CB38BC2A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:17:38 -0000 > On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > > On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala > > > > wrote: > > > > On 0125T1530, Devin Teske wrote: > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > > trasz@freebsd.org> wrote: > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): ... > > > > No, it's not just the aliases. The part that angers me the most is the > changing of PS1. I still haven't seen anything that justifies any of > these changes other than your opinion that you like your changes better > than what was there before. I have asked once in public, and once in private in not such a polite tone (Uncalled for, sorry Traz) that this be reverted. This discussion has gone on far too long on -committers and this change is clearly controversial. Ian, Please assert a request to revert as well, as it seems Traz is stuck in the "this is just a bikeshed" and is not going to move on my request alone, though it was also asserted by Devin. Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jan 26 17:23:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36CA014A74CA; Sat, 26 Jan 2019 17:23:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2B98C163; Sat, 26 Jan 2019 17:23:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QHNZmu094527; Sat, 26 Jan 2019 09:23:35 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QHNZur094526; Sat, 26 Jan 2019 09:23:35 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901261723.x0QHNZur094526@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <20190126131803.GA28061@v2> To: Edward Napierala Date: Sat, 26 Jan 2019 09:23:35 -0800 (PST) CC: Devin Teske , rgrimes@freebsd.org, src-committers , 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: 8C2B98C163 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:23:38 -0000 > On 0125T1647, Devin Teske wrote: > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > On 0125T1530, Devin Teske wrote: > > >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > > >>> On 0125T1441, Devin Teske wrote: > > >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > > >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > >>>>> > napisa?(a): > > >>>>>>> Author: trasz > > >>>>>>> Date: Fri Jan 25 17:09:26 2019 > > >>>>>>> New Revision: 343440 > > >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > > >>>>>>> > > >>>>>>> Log: > > >>>>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > > >>>>>>> The rest of this stuff is still to be discussed, but I think at this > > >>>>>>> point we have the agreement that the aliases should go. > > >>>>>>> > > >>>>>>> MFC after: 2 weeks > > >>>>>>> Sponsored by: DARPA, AFRL > > >>>>>> > > >>>>>> Please just revert this and the prior commit out, and when > > >>>>>> the path forward is clear commit it. I would not want any of this > > >>>>>> merged to 12/ or 11/ until the time that it is all settled. > > >>>>> > > >>>>> Oops, my bad - neither this nor the previous commit is supposed > > >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > > >>>>> config. > > >>>>> > > >>>>> Regarding the backoff - just a few hours ago you said you don't have > > >>>>> any problem with this, except for aliases and the default ENV. The > > >>>>> aliases problem has been addressed, and you hadn't yet responded > > >>>>> to my explanations regarding the ENV. Another committer asked for > > >>>>> backoff, because "sh is not an interactive shell", while in fact sh(1) > > >>>>> is FreeBSD's default interactive shell except for root. Finally, there's > > >>>>> one person who asked for revert, but without giving any reasons > > >>>>> whatsoever. > > >>>>> > > >>>>> So far nobody had proposed any scenario where this would break > > >>>>> anything, or even affect existing users. It seems like a typical bikeshed > > >>>>> situation. > > >>>> > > >>>> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > > >>> > > >>> The idea is to make it easy to replace the default root shell - which > > >>> many people consider broken, due to not supporting basic shell syntax - with > > >>> something that actually works. > > >> > > >> How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > > >> > > >> If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). > > > > > > The aliases are gone. > > > > Fair enough, albeit the topic was r343416 and D18872. > > > > > > > Human-friendly PS1 is considered a standard feature > > > nowadays. > > > > I fail to see how ''$ " is unfriendly. > > How many people you know use a plain '$' as a shell prompt, > because they like it that way? I am prefectly happy with any single character prompt on any OS I might happen to be working on, knowing that I can change it at my leasure. However I am NOT happy with a stringy long ass prompt that eats up half my command line when I am deep down a file hierarchy trying to fix some problem at a single user prompt on a hardwired conssole I had to jack into the box cause it wont come up. Yes I can change either at will, and so can anyone else who wants to, lets stop spoon feeding a new default and spoon feed up some docs on "you may want to tweak this" after you have installed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jan 26 17:27:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A9C14A7647; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@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 6B91E8C38B; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60D0523349; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QHRDBW077657; Sat, 26 Jan 2019 17:27:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHRDbR077656; Sat, 26 Jan 2019 17:27:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261727.x0QHRDbR077656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343476 - head X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 343476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B91E8C38B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:27:13 -0000 Author: avos Date: Sat Jan 26 17:27:12 2019 New Revision: 343476 URL: https://svnweb.freebsd.org/changeset/base/343476 Log: ObsoleteFiles.inc: remove adv(4) / adw(4) man pages after r339567 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jan 26 17:17:25 2019 (r343475) +++ head/ObsoleteFiles.inc Sat Jan 26 17:27:12 2019 (r343476) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190126: adv(4) / adw(4) removal +OLD_FILES+=usr/share/man/man4/adv.4.gz +OLD_FILES+=usr/share/man/man4/adw.4.gz # 20190114: old pbuf allocator removed OLD_FILES+=usr/share/man/man9/pbuf.9.gz # 20181219: ibcs removal From owner-svn-src-all@freebsd.org Sat Jan 26 17:52:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5F2314A820C; Sat, 26 Jan 2019 17:52:13 +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 5A5AD8D16A; Sat, 26 Jan 2019 17:52:13 +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 479AB2384B; Sat, 26 Jan 2019 17:52:13 +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 x0QHqDD1093074; Sat, 26 Jan 2019 17:52:13 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHqDDZ093073; Sat, 26 Jan 2019 17:52:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201901261752.x0QHqDDZ093073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 26 Jan 2019 17:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343477 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A5AD8D16A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:52:13 -0000 Author: bz Date: Sat Jan 26 17:52:12 2019 New Revision: 343477 URL: https://svnweb.freebsd.org/changeset/base/343477 Log: Fix logic errors in iwm_pcie_load_firmware_chunk introduced in r314065. * There's no reason to have a while() loop here, because: - if msleep returns 0, that means we were woken up by the interrupt handler, and we are going to exit immediately as sc_fw_chunk_done will now be 1 (there is nothing else that sleeps on sc_fw.) - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will exit immediately because of the if-test. So, just use a single msleep() and then check sc_fw_chunk_done as before. * The comment said we were sleeping for 5 seconds, but the msleep was only for 1. Before r314065, this was 1 second and so was the comment, and in that commit the comment was changed and the function call wasn't. Possibly fixes failures to initialize uCode on certain devices. Submitted by: Augustin Cavalier (waddlesplash gmail.com) Obtained from: Haiku 132990ecdcb072f2ce597b5d497ff3e5b1f09c20 MFC after: 10 days Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Jan 26 17:27:12 2019 (r343476) +++ head/sys/dev/iwm/if_iwm.c Sat Jan 26 17:52:12 2019 (r343477) @@ -2397,8 +2397,6 @@ static int iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uint32_t dst_addr, bus_addr_t phy_addr, uint32_t byte_cnt) { - int ret; - sc->sc_fw_chunk_done = 0; if (!iwm_nic_lock(sc)) @@ -2430,14 +2428,9 @@ iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uin iwm_nic_unlock(sc); /* wait up to 5s for this segment to load */ - ret = 0; - while (!sc->sc_fw_chunk_done) { - ret = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz); - if (ret) - break; - } + msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz * 5); - if (ret != 0) { + if (!sc->sc_fw_chunk_done) { device_printf(sc->sc_dev, "fw chunk addr 0x%x len %d failed to load\n", dst_addr, byte_cnt); From owner-svn-src-all@freebsd.org Sat Jan 26 17:55:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC92314A8472 for ; Sat, 26 Jan 2019 17:55:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 518148D46A for ; Sat, 26 Jan 2019 17:55:45 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548525336; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=HVDqsQ/eU+/UIylbIG3GReVaHeSIa1P5heiEoRbKmJ1+BMgIJJGaa9t1AwO1uOZrx3TX2uVpI1iw+ 7T93GBEmIqZkrUMyYraQkTOu9MXwTvFzkCsVi6x4McoHWonjDQ0LshVzAHnx6Fax7fcly93PfQlNC2 Kq8GQfMouc/WKF57UIeCZlg4B2tPV7LRsLTeV2zu0ic9I5ZZct10LpvNSUvo/tMWRHZwEyRSYy2lqk 4lCf1CRiX3uluA8CuAzXjXPTxBo0YpxHdp03TAf5VENLHjXlEFwMdKPY0ZLwT1SLwNHxd6EYESud3N LS3N4fvHMQ8H99p1JzA+zPNW2KM4bNQ== 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=yAGXFY9LgB7FOk/BsY7/L3KZg1AVL+h3nSZB/OEcaBk=; b=DkgSfbXlhRoBrOdqVCWUf0Myg/WeKBwXJzLG1T+qekpc7MDUJPTIQG4FWyz6dVBp/e06tUYhvOKsX xKAJIglcEhHiYT0aGEs0wDVvO58MQ6OG4iTur0FeTT+1ebtdwKIAm37od4R3hFwMWCdQgplNnjYKea hqGFJKO63mtDIHNOnBQBWuEWVPdgqEhWJJPPk4WMP7S5smtMpMaAkjsZsQCAP+s3xu694/MsHolh0r il8Iwv9LzBva0+f82iwXw/ZL7mG7TSboUPFgt/x2feXAdv5Tlhj79EPl2hxMreRdCLsqqk4CzuG+Ur 2UjNXV5LZRBN0qmLuOQg3mXW5Xmesnw== ARC-Authentication-Results: i=1; outbound3.eu.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=yAGXFY9LgB7FOk/BsY7/L3KZg1AVL+h3nSZB/OEcaBk=; b=qbr8x5wO/Fk0eACNEMd3PVWeiWQ1nVFgiFqH5EX5in3JdqxMLA1WLNkKVbXuosb9ECOYvSnc/X2Mh X9gkXySjEA7rix083pjhtWVasJUNXZHGKO3DjS8v+GpEd4EMdLSrYHM3RnZKTgTinzJW/gEO41Pdk4 BI1DIGx2WNfG8+5vi6o/0V+oRpMpQHp3hv7Iy4bXoX7MON4Zp9XueYA0YCr5dM/rV9zpsmWkuFyZ/t r81QXWR70REWka/6gXvwBs2C74ToBQH6E+wuKJB3FUfKjvnTWVGFJziw4llSf5qqzX9qwJcajAK0q5 ngVDpLZ7ThsqYODMK0WF6orfrXWywyA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 91257288-2193-11e9-8a28-a1efd8da9a94 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.eu.mailhop.org (Halon) with ESMTPSA id 91257288-2193-11e9-8a28-a1efd8da9a94; Sat, 26 Jan 2019 17:55:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QHtSf0008805; Sat, 26 Jan 2019 10:55:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: rgrimes@freebsd.org Cc: Edward Napierala , Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 26 Jan 2019 10:55:28 -0700 In-Reply-To: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> References: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> 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: 518148D46A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:55:46 -0000 On Sat, 2019-01-26 at 09:17 -0800, Rodney W. Grimes wrote: > > On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > > > On 0125T1647, Devin Teske wrote: > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala < > > > > > trasz@freebsd.org> > > > > > wrote: > > > > > On 0125T1530, Devin Teske wrote: > > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > > > trasz@freebsd.org> wrote: > > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): > > ... > > > > > > > No, it's not just the aliases. The part that angers me the most is > > the > > changing of PS1. I still haven't seen anything that justifies any > > of > > these changes other than your opinion that you like your changes > > better > > than what was there before. > > I have asked once in public, and once in private in not such a > polite tone (Uncalled for, sorry Traz) that this be reverted. > This discussion has gone on far too long on -committers and > this change is clearly controversial. > > Ian, Please assert a request to revert as well, as it seems > Traz is stuck in the "this is just a bikeshed" and is not > going to move on my request alone, though it was also asserted > by Devin. > > Thanks, Since informal discussion doesn't seem to be getting through, I will indeed add my name to the list of those calling for a revert. -- Ian From owner-svn-src-all@freebsd.org Sat Jan 26 18:15:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC4F14A9454; Sat, 26 Jan 2019 18:15:39 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 1F2BE8E298; Sat, 26 Jan 2019 18:15:39 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=51239 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnSUI-000Do0-Ca; Sat, 26 Jan 2019 10:15:26 -0800 From: Devin Teske Message-Id: <3C559A37-0802-471E-85D2-EC27ABB65658@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Sat, 26 Jan 2019 10:15:27 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, Edward Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 1F2BE8E298 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 18:15:39 -0000 > On Jan 26, 2019, at 9:55 AM, Ian Lepore wrote: > > On Sat, 2019-01-26 at 09:17 -0800, Rodney W. Grimes wrote: >>> On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: >>>> On 0125T1647, Devin Teske wrote: >>>>>> On Jan 25, 2019, at 1:13 AM, Edward Napierala < >>>>>> trasz@freebsd.org> >>>>>> wrote: >>>>>> On 0125T1530, Devin Teske wrote: >>>>>>>> On Jan 25, 2019, at 12:28 AM, Edward Napierala < >>>>>>>> trasz@freebsd.org> wrote: >>>>>>>> On 0125T1441, Devin Teske wrote: >>>>>>>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala < >>>>>>>>>> trasz@freebsd.org> wrote: >>>>>>>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>>>>>>>>> >>>>>>>>> freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): >> >> ... >>>> >>> >>> No, it's not just the aliases. The part that angers me the most is >>> the >>> changing of PS1. I still haven't seen anything that justifies any >>> of >>> these changes other than your opinion that you like your changes >>> better >>> than what was there before. >> >> I have asked once in public, and once in private in not such a >> polite tone (Uncalled for, sorry Traz) that this be reverted. >> This discussion has gone on far too long on -committers and >> this change is clearly controversial. >> >> Ian, Please assert a request to revert as well, as it seems >> Traz is stuck in the "this is just a bikeshed" and is not >> going to move on my request alone, though it was also asserted >> by Devin. >> >> Thanks, > > Since informal discussion doesn't seem to be getting through, I will > indeed add my name to the list of those calling for a revert. > I'm actually backing away slowly. -- Devin From owner-svn-src-all@freebsd.org Sat Jan 26 18:23:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CB714A9860; Sat, 26 Jan 2019 18:23:29 +0000 (UTC) (envelope-from netchild@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 CD49C8E870; Sat, 26 Jan 2019 18:23:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C154623D95; Sat, 26 Jan 2019 18:23:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QINSCm008867; Sat, 26 Jan 2019 18:23:28 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QINK2Z008821; Sat, 26 Jan 2019 18:23:20 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201901261823.x0QINK2Z008821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 26 Jan 2019 18:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343478 - head/tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/tools/kerneldoc/subsys X-SVN-Commit-Revision: 343478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD49C8E870 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 18:23:29 -0000 Author: netchild Date: Sat Jan 26 18:23:19 2019 New Revision: 343478 URL: https://svnweb.freebsd.org/changeset/base/343478 Log: Catch up with some years of driver development. Most impressive in terms of doxygen stuff are the isci and ocs_fc drivers. Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_alpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_altera (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_beri (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bvm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cadence (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dwc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_efidev (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ena (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_evdev (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_extres (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ffec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_filemon (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_intel (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_intpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ioat (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_isci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iser (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_isl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ismt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iwm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ixl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_jedec_dimm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_liquidio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mbox (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mdio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mlx4 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mlx5 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mmcnull (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mpr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mrsas (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mthca (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nand (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nctgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_neta (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_netfpga10g (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nfsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ntb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvdimm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_oce (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ocs_fc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_otus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ow (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pms (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_proto (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_psci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pwm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlnx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlxgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rccgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rtwn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_smartpqi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tcp_log (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_terasic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_veriexec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_viapm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_videomode (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vmware (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vnic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wbwd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xdma (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xilinx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-xen (contents, props changed) Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_advansys head/tools/kerneldoc/subsys/Doxyfile-dev_aha head/tools/kerneldoc/subsys/Doxyfile-dev_ahb head/tools/kerneldoc/subsys/Doxyfile-dev_aic head/tools/kerneldoc/subsys/Doxyfile-dev_asr head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic head/tools/kerneldoc/subsys/Doxyfile-dev_cm head/tools/kerneldoc/subsys/Doxyfile-dev_ct head/tools/kerneldoc/subsys/Doxyfile-dev_digi head/tools/kerneldoc/subsys/Doxyfile-dev_dpt head/tools/kerneldoc/subsys/Doxyfile-dev_en head/tools/kerneldoc/subsys/Doxyfile-dev_fatm head/tools/kerneldoc/subsys/Doxyfile-dev_hatm head/tools/kerneldoc/subsys/Doxyfile-dev_ie head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 head/tools/kerneldoc/subsys/Doxyfile-dev_ncv head/tools/kerneldoc/subsys/Doxyfile-dev_nsp head/tools/kerneldoc/subsys/Doxyfile-dev_nve head/tools/kerneldoc/subsys/Doxyfile-dev_patm head/tools/kerneldoc/subsys/Doxyfile-dev_pdq head/tools/kerneldoc/subsys/Doxyfile-dev_siba head/tools/kerneldoc/subsys/Doxyfile-dev_snc head/tools/kerneldoc/subsys/Doxyfile-dev_stg head/tools/kerneldoc/subsys/Doxyfile-dev_streams head/tools/kerneldoc/subsys/Doxyfile-dev_utopia Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel aacraid device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aacraid/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aacraid/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aacraid/dev_aacraid.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel al_eth device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_al_eth/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/al_eth/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_al_eth/dev_al_eth.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_alpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_alpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel alpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_alpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/alpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_alpm/dev_alpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_altera ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_altera Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel altera device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_altera/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/altera/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_altera/dev_altera.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amd_ecc_inject device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amd_ecc_inject/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amd_ecc_inject/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amd_ecc_inject/dev_amd_ecc_inject.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdgpio device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdgpio/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdgpio/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdgpio/dev_amdgpio.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdpm/dev_amdpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdsmb device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdsmb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsmb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdsmb/dev_amdsmb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdsmn device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdsmn/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsmn/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdsmn/dev_amdsmn.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel axgbe device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_axgbe/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/axgbe/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_axgbe/dev_axgbe.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_beri Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel beri device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_beri/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/beri/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_beri/dev_beri.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bhnd device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bhnd/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bhnd/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bhnd/dev_bhnd.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bnxt device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bnxt/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bnxt/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bnxt/dev_bnxt.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bvm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bvm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bvm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bvm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bvm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bvm/dev_bvm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cadence ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cadence Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel cadence device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cadence/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cadence/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cadence/dev_cadence.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel chromebook_platform device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_chromebook_platform/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/chromebook_platform/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_chromebook_platform/dev_chromebook_platform.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel cyapa device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cyapa/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cyapa/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cyapa/dev_cyapa.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dme ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dme Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dme device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dme/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dme/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dme/dev_dme.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dpaa device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dpaa/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dpaa/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dpaa/dev_dpaa.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel drm2 device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_drm2/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/drm2/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_drm2/dev_drm2.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dwc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dwc Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dwc device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dwc/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dwc/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dwc/dev_dwc.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_efidev ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_efidev Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel efidev device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_efidev/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/efidev/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_efidev/dev_efidev.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ena ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ena Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ena device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ena/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ena/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ena/dev_ena.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel etherswitch device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_etherswitch/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/etherswitch/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_etherswitch/dev_etherswitch.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_evdev ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_evdev Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel evdev device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_evdev/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/evdev/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_evdev/dev_evdev.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_extres ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_extres Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel extres device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_extres/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/extres/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_extres/dev_extres.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ffec ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ffec Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ffec device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ffec/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ffec/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ffec/dev_ffec.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_filemon ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_filemon Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel filemon device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_filemon/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/filemon/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_filemon/dev_filemon.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel gxemul device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_gxemul/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/gxemul/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_gxemul/dev_gxemul.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hdmi device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hdmi/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hdmi/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hdmi/dev_hdmi.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hptnr device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hptnr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hptnr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hptnr/dev_hptnr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hyperv device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hyperv/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hyperv/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hyperv/dev_hyperv.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ichiic device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ichiic/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ichiic/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ichiic/dev_ichiic.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel imcsmb device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_imcsmb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/imcsmb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_imcsmb/dev_imcsmb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_intel ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_intel Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel intel device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_intel/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/intel/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_intel/dev_intel.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_intpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_intpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel intpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_intpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/intpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_intpm/dev_intpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ioat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ioat Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ioat device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ioat/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ioat/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ioat/dev_ioat.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_isci ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_isci Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel isci device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_isci/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/isci/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_isci/dev_isci.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel iscsi_initiator device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_iscsi_initiator/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/iscsi_initiator/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_iscsi_initiator/dev_iscsi_initiator.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_iser ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_iser Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel iser device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_iser/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/iser/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_iser/dev_iser.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_isl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_isl Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel isl device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_isl/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/isl/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_isl/dev_isl.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ismt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ismt Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ismt device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ismt/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 26 19:11:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7232B14AAB6A; Sat, 26 Jan 2019 19:11:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65147684C0; Sat, 26 Jan 2019 19:11:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id t24so10393177ioi.0; Sat, 26 Jan 2019 11:11:26 -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=PMuL/e1hexQ6CqqKdReSMYwk1EyfeYy6Nvs2tN4w/pI=; b=f7bUWKRCIO8U6x/7T6m5ux/55uQutYdbYMqDg3CyxdZLvDzRgi2bwcixAUWKfr48jR wX0h9rnitFZPfxiza22UyhVzN9fq+edwF0CBU7j6+YIsbx+5s9dulKvqaSJLy+KHpyT1 78bMY8Wmssuq6a5xICOAPkQ98vri6bL6U+beVRV5z5H1st/q7yOZxfa7BNFOQJqWyCLl 3bjTWn2trU7kUc9haQVik1qoue0PhdSbCr8epohpcu82CBOeMi97yy0+yBTDh1sBh2a5 KxDqCj8O2R5yQN1dr8rw9RWb7wlMCLuVP+R02bYq+/hHstBE2dKR1nwTYyv9Pnfq+zWG Nf8A== X-Gm-Message-State: AHQUAuaDZYVGAraMxVaECyTU54bU/UaBwcmh6haMvSLwzyVg/WHoHuvh mbJUvWR+QxGL0Q+dycn82srFK15T X-Google-Smtp-Source: AHgI3IZ25k9MpYZuYT75/ggWIGBASZcZwMNjBebWEg1DcJQ1KZwjpEA71SDz84M7ylf2cvRsfGQ7QA== X-Received: by 2002:a5d:934a:: with SMTP id i10mr9124881ioo.162.1548529880046; Sat, 26 Jan 2019 11:11:20 -0800 (PST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id o192sm14823060itb.31.2019.01.26.11.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jan 2019 11:11:19 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id k7so10331137iob.6; Sat, 26 Jan 2019 11:11:19 -0800 (PST) X-Received: by 2002:a6b:ee16:: with SMTP id i22mr3417581ioh.124.1548529879611; Sat, 26 Jan 2019 11:11:19 -0800 (PST) MIME-Version: 1.0 References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> In-Reply-To: <201901251709.x0PH9Rc4094379@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 26 Jan 2019 11:11:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 65147684C0 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.55 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.842,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@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]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.69)[ip: (-7.76), ipnet: 209.85.128.0/17(-3.70), asn: 15169(-1.93), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[52.166.85.209.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 19:11:27 -0000 I didn't really feel the need to weigh in on this bikeshed thread previously, but apparently some folks are calling for a revert. Why? I don't really understand how this meets the high bar for summary revert, even if you disagree with the change made (and disagreement is fine, of course). So I'll raise my hand for "leave it in" and encourage talking out your bikeshed. It would be persuasive to come up with a specific list of complaints, ideally excluding ones that have been shown to be baseless. So far there has been a lot of mudslinging and it's difficult to sort out the preference complaints from the security complaints from the (well-intentioned, but ultimately inaccurate) fiction. I don't think a "heckler's veto" should be granted. If you don't use root/toor, that's fine! But I think that sort of (heavily) discounts how much weight your opinion of root/toor defaults should be given. If you use Expect, great. You should be setting a specific PS1 anyway (both before and after this change). After all, this is just the default. Users have been free to set a custom PS1 for root in .profile since time began. Has anyone verified the claim that freebsd-update will actually modify a user's home directory contents, or was that just speculation? I don't know one way or the other and I think it's still an open question. Best regards, Conrad On Fri, Jan 25, 2019 at 9:09 AM Edward Tomasz Napierala wrote: > > Author: trasz > Date: Fri Jan 25 17:09:26 2019 > New Revision: 343440 > URL: https://svnweb.freebsd.org/changeset/base/343440 > > Log: > Comment out the default sh(1) aliases for root, introduced in r343416. > The rest of this stuff is still to be discussed, but I think at this > point we have the agreement that the aliases should go. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/bin/sh/dot.shrc > > Modified: head/bin/sh/dot.shrc > ============================================================================== > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) > @@ -18,13 +18,13 @@ > # set -o vi > > > -# some useful aliases > -alias h='fc -l' > -alias j=jobs > -alias m="$PAGER" > -alias ll='ls -laFo' > -alias l='ls -l' > -alias g='egrep -i' > +# # some useful aliases > +# alias h='fc -l' > +# alias j=jobs > +# alias m="$PAGER" > +# alias ll='ls -laFo' > +# alias l='ls -l' > +# alias g='egrep -i' > > # # be paranoid > # alias cp='cp -ip' > From owner-svn-src-all@freebsd.org Sat Jan 26 20:35:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E7E114ADC11 for ; Sat, 26 Jan 2019 20:35:28 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09BCD6C8C3 for ; Sat, 26 Jan 2019 20:35:27 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548534863; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=KR3k+mbbeoWxwma9C5y6y9YZvsXkmgbr31ghte8XolcTVs/ge95gg1A8z3uEzZWg56ucYu9UQ7e59 Pwqml7++qjVGX3NKemACCAEYiCmmCX928a4dIjU4o0XvZxue6e6l857MuEP1W0qnoS4uvPiwVqqaed LJdSoQHofud+oP+c6NtHDY0TvIf8v1R2bHPWA2KhEcbyveMxQb5VUL6tPIikgzosddkd1aZUWxdbAu rbdm2y9ZUMPBHCowlCbsxrzNC9ivUNqxepeMrBcmJ9MX1BIs4/NeSokNBJFtat2p56tocBzAubIyzR ajaXdER+UbdSIZb8W5dDvUzJHBKRkAg== 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=dcPrGvCF2AX7zGjKI+YsJmoKrYt6k3I8rGW511yUsLg=; b=dgKbIlNRwAqMK46JSkFESvv4r6hvR/WROXZFqATiUpHPWlwLRkEmA6WeGMWG8ZPR+oT2r/nu46q5c V5erkNwDgPEWfnrNH+TY/pEugYzsjkcXa0s6jmrfm/vDijHOmqqpmzRxh4xbY5gv7VE3H2vSMoHjfH 98+dvpwJ88v/QiMyp4X66letmzh5sp+iphDe1eMtnB7R9319Yz1qq+NGZ5XW9D3yxgSNPZJoe9jhVM hjy3eefO7ApN86OWDIDFI1pX2VVKuJ69bZt6tBjYka/1s3vTb4UV5NwWcKiDCzceOBQX8XUUYTjRm9 Xflx7ucf4l6h3Ip7GCPpJaT++cM2l7Q== ARC-Authentication-Results: i=1; outbound4.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=dcPrGvCF2AX7zGjKI+YsJmoKrYt6k3I8rGW511yUsLg=; b=wxXBsNBWx6kAk7HQ4vF5UfjVtSN/CDs30f6Lev0XJ0lwv6QqNaTEH7Szfwsa821jMRns0UMS9Emaz +XewwBkLLsQc5Hs62YFJOhIeIDa0ptJZGNF4iJ//6uGWr81AQxXDhDNxcDoQ+qe/+7tvxj13u+OIk7 553S9ivEdqcrIy0H2b5Sz7Qs3G4t1UwPVWSkZFoXdqFcy0h6ID7MihovyE6Rs6Oh4xcc7GqJvM2hWZ 5X/nNiCn6aFcNaJK1n7IbQY0TcYxg6aY6ctAxULBBLGilnObAPdYmih1e4ZN8ZbyfKZd9NNQZOvuAQ e9AjIPJQFjeT9zguU5rQuSEZsujQigg== X-MHO-RoutePath: aGlwcGll X-MHO-User: c27b956f-21a9-11e9-befd-af03bedce89f 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 outbound4.ore.mailhop.org (Halon) with ESMTPSA id c27b956f-21a9-11e9-befd-af03bedce89f; Sat, 26 Jan 2019 20:34:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QKZIES009150; Sat, 26 Jan 2019 13:35:18 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <03987a1c3ad0c362d50dcefdfd653dec033d14ed.camel@freebsd.org> Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: cem@freebsd.org, svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Date: Sat, 26 Jan 2019 13:35:18 -0700 In-Reply-To: References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> 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: 09BCD6C8C3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 20:35:28 -0000 On Sat, 2019-01-26 at 11:11 -0800, Conrad Meyer wrote: > I didn't really feel the need to weigh in on this bikeshed thread > previously, but apparently some folks are calling for a revert. Why? > I don't really understand how this meets the high bar for summary > revert, even if you disagree with the change made (and disagreement > is > fine, of course). > > So I'll raise my hand for "leave it in" and encourage talking out > your > bikeshed. It would be persuasive to come up with a specific list of > complaints, ideally excluding ones that have been shown to be > baseless. So far there has been a lot of mudslinging and it's > difficult to sort out the preference complaints from the security > complaints from the (well-intentioned, but ultimately inaccurate) > fiction. I don't think a "heckler's veto" should be granted. > > If you don't use root/toor, that's fine! But I think that sort of > (heavily) discounts how much weight your opinion of root/toor > defaults > should be given. > > If you use Expect, great. You should be setting a specific PS1 > anyway > (both before and after this change). After all, this is just the > default. Users have been free to set a custom PS1 for root in > .profile since time began. > > Has anyone verified the claim that freebsd-update will actually > modify > a user's home directory contents, or was that just speculation? I > don't know one way or the other and I think it's still an open > question. > > Best regards, > Conrad > Wait a sec... something has been stable and working fine for 30 years, then it gets changed to reflect one man's personal preferences, and it's the people who object to that who have to jump through flaming hoops to justify themselves? Screw that. Don't bother to CC me in any replies, I'm out of this conversation. It's a pity the freebsd prject has turned into linux. -- ian > On Fri, Jan 25, 2019 at 9:09 AM Edward Tomasz Napierala > wrote: > > > > Author: trasz > > Date: Fri Jan 25 17:09:26 2019 > > New Revision: 343440 > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > Log: > > Comment out the default sh(1) aliases for root, introduced in > > r343416. > > The rest of this stuff is still to be discussed, but I think at > > this > > point we have the agreement that the aliases should go. > > > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > > > Modified: > > head/bin/sh/dot.shrc > > > > Modified: head/bin/sh/dot.shrc > > =================================================================== > > =========== > > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 > > 2019 (r343439) > > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 > > 2019 (r343440) > > @@ -18,13 +18,13 @@ > > # set -o vi > > > > > > -# some useful aliases > > -alias h='fc -l' > > -alias j=jobs > > -alias m="$PAGER" > > -alias ll='ls -laFo' > > -alias l='ls -l' > > -alias g='egrep -i' > > +# # some useful aliases > > +# alias h='fc -l' > > +# alias j=jobs > > +# alias m="$PAGER" > > +# alias ll='ls -laFo' > > +# alias l='ls -l' > > +# alias g='egrep -i' > > > > # # be paranoid > > # alias cp='cp -ip' > > > > From owner-svn-src-all@freebsd.org Sat Jan 26 20:43:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CAA214ADFFF; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@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 23FD76CD73; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 16F7925558; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QKhSKs081626; Sat, 26 Jan 2019 20:43:28 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QKhS2S081625; Sat, 26 Jan 2019 20:43:28 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262043.x0QKhS2S081625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 20:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343479 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 343479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23FD76CD73 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 20:43:29 -0000 Author: se Date: Sat Jan 26 20:43:28 2019 New Revision: 343479 URL: https://svnweb.freebsd.org/changeset/base/343479 Log: Fix potential buffer overflow and undefined behavior. The buffer allocated in read_chat() could be 1 element too short, if the chatstr parameter passed in is 1 or 3 charachters long (e.g. "a" or "a b"). The allocation of the pointer array does not account for the terminating NULL pointer in that case. Overlapping source and destination strings are undefined in strcpy(). Instead of moving a string to the left by one character just increment the char pointer before it is assigned to the results array. MFC after: 2 weeks Modified: head/libexec/getty/chat.c Modified: head/libexec/getty/chat.c ============================================================================== --- head/libexec/getty/chat.c Sat Jan 26 18:23:19 2019 (r343478) +++ head/libexec/getty/chat.c Sat Jan 26 20:43:28 2019 (r343479) @@ -141,7 +141,7 @@ read_chat(char **chatstr) int l; if ((l=strlen(str)) > 0 && (tmp=malloc(l + 1)) != NULL && - (res=malloc((l / 2 + 1) * sizeof(char *))) != NULL) { + (res=malloc(((l + 1) / 2 + 1) * sizeof(char *))) != NULL) { static char ws[] = " \t"; char * p; @@ -216,7 +216,7 @@ read_chat(char **chatstr) q = strrchr(p+1, *p); if (q != NULL && *q == *p && q[1] == '\0') { *q = '\0'; - strcpy(p, p+1); + p++; } } From owner-svn-src-all@freebsd.org Sat Jan 26 21:30:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D11614AEF5A; Sat, 26 Jan 2019 21:30:27 +0000 (UTC) (envelope-from se@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 B74516E0EC; Sat, 26 Jan 2019 21:30:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AB8F225C2C; Sat, 26 Jan 2019 21:30:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QLUQ2a002875; Sat, 26 Jan 2019 21:30:26 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QLUQnf002874; Sat, 26 Jan 2019 21:30:26 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262130.x0QLUQnf002874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 21:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343480 - head/lib/libfigpar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/lib/libfigpar X-SVN-Commit-Revision: 343480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B74516E0EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:30:27 -0000 Author: se Date: Sat Jan 26 21:30:26 2019 New Revision: 343480 URL: https://svnweb.freebsd.org/changeset/base/343480 Log: Silence Clang Scan warning about potentially unsafe use of strcpy. While this is a false positive, the use of strdup() simplifies the code. MFC after: 2 weeks Modified: head/lib/libfigpar/string_m.c Modified: head/lib/libfigpar/string_m.c ============================================================================== --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char /* If replace is longer than find, we'll need to create a temp copy */ if (rlen > flen) { - temp = malloc(slen + 1); - if (errno != 0) /* could not allocate memory */ + temp = strdup(source); + if (temp == NULL) /* could not allocate memory */ return (-1); - strcpy(temp, source); } else temp = source; From owner-svn-src-all@freebsd.org Sat Jan 26 21:35:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A86314AF1E0; Sat, 26 Jan 2019 21:35:52 +0000 (UTC) (envelope-from marius@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 F11076E576; Sat, 26 Jan 2019 21:35:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEC7725DFC; Sat, 26 Jan 2019 21:35:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QLZpKg008071; Sat, 26 Jan 2019 21:35:51 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QLZp6Y008070; Sat, 26 Jan 2019 21:35:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901262135.x0QLZp6Y008070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 26 Jan 2019 21:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343481 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F11076E576 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:35:52 -0000 Author: marius Date: Sat Jan 26 21:35:51 2019 New Revision: 343481 URL: https://svnweb.freebsd.org/changeset/base/343481 Log: - In _iflib_fl_refill(), don't mark an RX buffer as available in the corresponding bitmap before adding an mbuf has actually succeeded. Previously, m_gethdr(M_NOWAIT, ...) failing caused a "hole" in the RX ring but not in its bitmap. One implication of such a hole was that in a subsequent call to _iflib_fl_refill() with the RX buffer accounting still indicating another reclaimable buffer, bit_ffc(3) nevertheless returned -1 in frag_idx which in turn caused havoc when used as an index. Thus, additionally assert that frag_idx is 0 or greater. Another possible consequence of a hole in the RX ring was a NULL- dereference when trying to use the unallocated mbuf, for example in iflib_rxd_pkt_get(). While at it, make the variable declarations in _iflib_fl_refill() conform to style(9) and remove redundant checks already performed by bit_ffc{,_at}(3). - In iflib_queues_alloc(), don't pass redundant M_ZERO to bit_alloc(3). Reported and tested by: pho Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Jan 26 21:30:26 2019 (r343480) +++ head/sys/net/iflib.c Sat Jan 26 21:35:51 2019 (r343481) @@ -1921,27 +1921,27 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { + struct if_rxd_update iru; + struct rxq_refill_cb_arg cb_arg; struct mbuf *m; - int idx, frag_idx = fl->ifl_fragidx; - int pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; - struct if_rxd_update iru; - struct rxq_refill_cb_arg cb_arg; bus_dmamap_t *sd_map; - int n, i = 0; bus_addr_t bus_addr, *sd_ba; - int err; + int err, frag_idx, i, idx, n, pidx; qidx_t credits; sd_m = fl->ifl_sds.ifsd_m; sd_map = fl->ifl_sds.ifsd_map; sd_cl = fl->ifl_sds.ifsd_cl; sd_ba = fl->ifl_sds.ifsd_ba; + pidx = fl->ifl_pidx; idx = pidx; + frag_idx = fl->ifl_fragidx; credits = fl->ifl_credits; - n = count; + i = 0; + n = count; MPASS(n > 0); MPASS(credits + n <= fl->ifl_size); @@ -1963,9 +1963,11 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun * * If the cluster is still set then we know a minimum sized packet was received */ - bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, &frag_idx); - if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) - bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); + bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, + &frag_idx); + if (frag_idx < 0) + bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); + MPASS(frag_idx >= 0); if ((cl = sd_cl[frag_idx]) == NULL) { if ((cl = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; @@ -1995,12 +1997,12 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun bus_addr = sd_ba[frag_idx]; } - bit_set(fl->ifl_rx_bitmap, frag_idx); MPASS(sd_m[frag_idx] == NULL); if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { break; } sd_m[frag_idx] = m; + bit_set(fl->ifl_rx_bitmap, frag_idx); #if MEMORY_LOGGING fl->ifl_m_enqueued++; #endif @@ -2025,7 +2027,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun fl->ifl_pidx = idx; fl->ifl_credits = credits; } - } if (i) { @@ -4896,7 +4897,6 @@ iflib_device_deregister(if_ctx_t ctx) for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) free(fl->ifl_rx_bitmap, M_IFLIB); - } tqg = qgroup_if_config_tqg; if (ctx->ifc_admin_task.gt_uniq != NULL) @@ -5304,7 +5304,8 @@ iflib_queues_alloc(if_ctx_t ctx) } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) - fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, M_WAITOK|M_ZERO); + fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, + M_WAITOK); } /* TXQs */ From owner-svn-src-all@freebsd.org Sat Jan 26 21:36:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88FA14AF224; Sat, 26 Jan 2019 21:36:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67BE6E69E; Sat, 26 Jan 2019 21:36:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QLaAhr095519; Sat, 26 Jan 2019 13:36:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QLaAJv095518; Sat, 26 Jan 2019 13:36:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343480 - head/lib/libfigpar In-Reply-To: <201901262130.x0QLUQnf002874@repo.freebsd.org> To: Stefan Esser Date: Sat, 26 Jan 2019 13:36:10 -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: B67BE6E69E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:36:20 -0000 > Author: se > Date: Sat Jan 26 21:30:26 2019 > New Revision: 343480 > URL: https://svnweb.freebsd.org/changeset/base/343480 > > Log: > Silence Clang Scan warning about potentially unsafe use of strcpy. > > While this is a false positive, the use of strdup() simplifies the code. Though that might be true, it also has to recalculate the length of the string which was already known by slen. I am not sure how often this code is called, but that is wasted cycles in a library. > > MFC after: 2 weeks > > Modified: > head/lib/libfigpar/string_m.c > > Modified: head/lib/libfigpar/string_m.c > ============================================================================== > --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) > +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) > @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char > > /* If replace is longer than find, we'll need to create a temp copy */ > if (rlen > flen) { > - temp = malloc(slen + 1); > - if (errno != 0) /* could not allocate memory */ > + temp = strdup(source); > + if (temp == NULL) /* could not allocate memory */ > return (-1); > - strcpy(temp, source); > } else > temp = source; > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jan 26 22:02:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C39014B02AF for ; Sat, 26 Jan 2019 22:02:32 +0000 (UTC) (envelope-from 010001688c2cfbc4-d34e12a0-c113-4f96-8853-1543ea0b04cb-000000@amazonses.com) Received: from a8-52.smtp-out.amazonses.com (a8-52.smtp-out.amazonses.com [54.240.8.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107826F83D for ; Sat, 26 Jan 2019 22:02:31 +0000 (UTC) (envelope-from 010001688c2cfbc4-d34e12a0-c113-4f96-8853-1543ea0b04cb-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1548539984; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=IyONnK3KcNDAb/NMkPxFDPeRpbXHOzoujmuqOvon/xs=; b=GJIkpvQOSSzNw3jtYJioUFypjdjMSaNHQtM2wCLCLz9FGKIjIZWVo2VFJcaN4Oon VaT9MdLevms3TOLsU3ZvAPUBa5TfFq/S3+7/ERMJI1gkmABECZhkIprV4+MQmwgH3DA w0twxXdnpv9c/877F/6RFA8a/+zEz/4sbsYuQnQQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1548539984; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=IyONnK3KcNDAb/NMkPxFDPeRpbXHOzoujmuqOvon/xs=; b=aeyhvh1uUySxNT1LCH8gkdNBrNE6+4TKgr1FiqK7upGAqXKo5DUlkQz1/k466LuG WE2jlE7v/HYCYjpjfH6Uu2llbxUrfv+4J6bD5tdEdAyu6g23eKnwT3sOKlNy8lCRhMQ f4KCairqYY6AzGOzMeEhp/9LQFI3V5FaP5oPV8/0= Subject: Re: svn commit: r343480 - head/lib/libfigpar To: rgrimes@freebsd.org, Stefan Esser Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> From: Colin Percival Openpgp: preference=signencrypt Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <010001688c2cfbc4-d34e12a0-c113-4f96-8853-1543ea0b04cb-000000@email.amazonses.com> Date: Sat, 26 Jan 2019 21:59:44 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2019.01.26-54.240.8.52 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 107826F83D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:02:32 -0000 On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >> Author: se >> Date: Sat Jan 26 21:30:26 2019 >> New Revision: 343480 >> URL: https://svnweb.freebsd.org/changeset/base/343480 >> >> Log: >> Silence Clang Scan warning about potentially unsafe use of strcpy. >> >> While this is a false positive, the use of strdup() simplifies the code. > > Though that might be true, it also has to recalculate the > length of the string which was already known by slen. > > I am not sure how often this code is called, > but that is wasted cycles in a library. The length of the string was already being recalculated, by strcpy. It seems to me that this could be written as temp = malloc(slen + 1); if (temp == NULL) /* could not allocate memory */ return (-1); memcpy(temp, source, slen + 1); which avoids both recalculating the string length and using strcpy? >> Modified: head/lib/libfigpar/string_m.c >> ============================================================================== >> --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) >> +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) >> @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char >> >> /* If replace is longer than find, we'll need to create a temp copy */ >> if (rlen > flen) { >> - temp = malloc(slen + 1); >> - if (errno != 0) /* could not allocate memory */ >> + temp = strdup(source); >> + if (temp == NULL) /* could not allocate memory */ >> return (-1); >> - strcpy(temp, source); >> } else >> temp = source; -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sat Jan 26 22:24:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BD014B0AA8; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@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 8DD2B7021E; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7F4D926670; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QMOFe4034235; Sat, 26 Jan 2019 22:24:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QMOFca034234; Sat, 26 Jan 2019 22:24:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262224.x0QMOFca034234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 22:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343482 - head/lib/libfigpar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/lib/libfigpar X-SVN-Commit-Revision: 343482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DD2B7021E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:24:16 -0000 Author: se Date: Sat Jan 26 22:24:15 2019 New Revision: 343482 URL: https://svnweb.freebsd.org/changeset/base/343482 Log: Slightly improve previous commit that silenced a Clang Scan warning. The strdup() call does not take advantage of the known length of the source string. Replace by malloc() and memcpy() utilizimng the pre- calculated string length. Submitted by: cperciva Reported by: rgrimes MFC after: 2 weeks Modified: head/lib/libfigpar/string_m.c Modified: head/lib/libfigpar/string_m.c ============================================================================== --- head/lib/libfigpar/string_m.c Sat Jan 26 21:35:51 2019 (r343481) +++ head/lib/libfigpar/string_m.c Sat Jan 26 22:24:15 2019 (r343482) @@ -119,9 +119,10 @@ replaceall(char *source, const char *find, const char /* If replace is longer than find, we'll need to create a temp copy */ if (rlen > flen) { - temp = strdup(source); + temp = malloc(slen + 1); if (temp == NULL) /* could not allocate memory */ return (-1); + memcpy(temp, source, slen + 1); } else temp = source; From owner-svn-src-all@freebsd.org Sat Jan 26 22:26:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD1FF14B0B6F; Sat, 26 Jan 2019 22:26:26 +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 C75AA70394; Sat, 26 Jan 2019 22:26:25 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-402.fritz.box (p200300CD5F2FCF00641090E029F19200.dip0.t-ipconnect.de [IPv6:2003:cd:5f2f:cf00:6410:90e0:29f1:9200]) (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 E81B315306; Sat, 26 Jan 2019 22:26:24 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r343480 - head/lib/libfigpar To: Colin Percival , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> From: Stefan Esser Openpgp: preference=signencrypt Autocrypt: addr=se@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: Date: Sat, 26 Jan 2019 23:26:23 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C75AA70394 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:26:26 -0000 Am 26.01.19 um 22:59 schrieb Colin Percival: > On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >>> Author: se >>> Date: Sat Jan 26 21:30:26 2019 >>> New Revision: 343480 >>> URL: https://svnweb.freebsd.org/changeset/base/343480 >>> >>> Log: >>> Silence Clang Scan warning about potentially unsafe use of strcpy. >>> >>> While this is a false positive, the use of strdup() simplifies the code. >> >> Though that might be true, it also has to recalculate the >> length of the string which was already known by slen. >> >> I am not sure how often this code is called, >> but that is wasted cycles in a library. > > The length of the string was already being recalculated, by strcpy. > > It seems to me that this could be written as > > temp = malloc(slen + 1); > if (temp == NULL) /* could not allocate memory */ > return (-1); > memcpy(temp, source, slen + 1); > > which avoids both recalculating the string length and using strcpy? In principle you are right, there is a small run-time cost by not using the known length for the allocation. The Clang Scan checks are leading to lots (thousands) of false positives and a I have looked at quite a number and abstained from silencing them in the hope that the scan will be improved. It should learn that at least the trivial case of an allocation of the value of strlen()+1 followed by a strcpy (and no further strcat or the like) is safe. But I have seen cases where the assumption is that "i<0" followed by "i>=0" at the same location and then a warning about potential problem. I have committed the version you suggest in rev. 343482 ... Regards, STefan From owner-svn-src-all@freebsd.org Sat Jan 26 22:27:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4845014B0BD0; Sat, 26 Jan 2019 22:27:13 +0000 (UTC) (envelope-from mckusick@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 E2607704E0; Sat, 26 Jan 2019 22:27:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D3BA226673; Sat, 26 Jan 2019 22:27:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QMRCdm034410; Sat, 26 Jan 2019 22:27:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QMRCbv034408; Sat, 26 Jan 2019 22:27:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901262227.x0QMRCbv034408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 26 Jan 2019 22:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343483 - in head/sbin: newfs tunefs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: newfs tunefs X-SVN-Commit-Revision: 343483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2607704E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:27:13 -0000 Author: mckusick Date: Sat Jan 26 22:27:12 2019 New Revision: 343483 URL: https://svnweb.freebsd.org/changeset/base/343483 Log: Update tunefs and newfs error messages for the -L (volume label) option to note that underscores are valid. PR: 235182 Reported by: Rodney W. Grimes (rgrimes@) Sponsored by: Netflix Modified: head/sbin/newfs/newfs.c head/sbin/tunefs/tunefs.c Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Sat Jan 26 22:24:15 2019 (r343482) +++ head/sbin/newfs/newfs.c Sat Jan 26 22:27:12 2019 (r343483) @@ -155,7 +155,8 @@ main(int argc, char *argv[]) while (isalnum(volumelabel[++i]) || volumelabel[i] == '_'); if (volumelabel[i] != '\0') { - errx(1, "bad volume label. Valid characters are alphanumerics."); + errx(1, "bad volume label. Valid characters " + "are alphanumerics and underscores."); } if (strlen(volumelabel) >= MAXVOLLEN) { errx(1, "bad volume label. Length is longer than %d.", Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat Jan 26 22:24:15 2019 (r343482) +++ head/sbin/tunefs/tunefs.c Sat Jan 26 22:27:12 2019 (r343483) @@ -191,9 +191,8 @@ main(int argc, char *argv[]) i = -1; while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); if (Lvalue[i] != '\0') { - errx(10, - "bad %s. Valid characters are alphanumerics.", - name); + errx(10, "bad %s. Valid characters are " + "alphanumerics and underscores.", name); } if (strlen(Lvalue) >= MAXVOLLEN) { errx(10, "bad %s. Length is longer than %d.", From owner-svn-src-all@freebsd.org Sat Jan 26 23:09:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA6D14B1DF7; Sat, 26 Jan 2019 23:09:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (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 687EA7173D; Sat, 26 Jan 2019 23:09:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id x0QN92C5059454; Sun, 27 Jan 2019 02:09:02 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Sun, 27 Jan 2019 02:09:02 +0300 (MSK) From: Dmitry Morozovsky To: Kirk McKusick cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343483 - in head/sbin: newfs tunefs In-Reply-To: <201901262227.x0QMRCbv034408@repo.freebsd.org> Message-ID: References: <201901262227.x0QMRCbv034408@repo.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sun, 27 Jan 2019 02:09:02 +0300 (MSK) X-Rspamd-Queue-Id: 687EA7173D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 23:09:07 -0000 Kirk, On Sat, 26 Jan 2019, Kirk McKusick wrote: > Author: mckusick > Date: Sat Jan 26 22:27:12 2019 > New Revision: 343483 > URL: https://svnweb.freebsd.org/changeset/base/343483 > > Log: > Update tunefs and newfs error messages for the -L (volume label) option > to note that underscores are valid. while you're here -- most of FSes also allow dash as a valid symbol in FS name. I stepped on it several times, and even did some local patch, but was too lazy to sumbit it. could you please look into it? thanks! > > PR: 235182 > Reported by: Rodney W. Grimes (rgrimes@) > Sponsored by: Netflix > > Modified: > head/sbin/newfs/newfs.c > head/sbin/tunefs/tunefs.c > > Modified: head/sbin/newfs/newfs.c > ============================================================================== > --- head/sbin/newfs/newfs.c Sat Jan 26 22:24:15 2019 (r343482) > +++ head/sbin/newfs/newfs.c Sat Jan 26 22:27:12 2019 (r343483) > @@ -155,7 +155,8 @@ main(int argc, char *argv[]) > while (isalnum(volumelabel[++i]) || > volumelabel[i] == '_'); > if (volumelabel[i] != '\0') { > - errx(1, "bad volume label. Valid characters are alphanumerics."); > + errx(1, "bad volume label. Valid characters " > + "are alphanumerics and underscores."); > } > if (strlen(volumelabel) >= MAXVOLLEN) { > errx(1, "bad volume label. Length is longer than %d.", > > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Sat Jan 26 22:24:15 2019 (r343482) > +++ head/sbin/tunefs/tunefs.c Sat Jan 26 22:27:12 2019 (r343483) > @@ -191,9 +191,8 @@ main(int argc, char *argv[]) > i = -1; > while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); > if (Lvalue[i] != '\0') { > - errx(10, > - "bad %s. Valid characters are alphanumerics.", > - name); > + errx(10, "bad %s. Valid characters are " > + "alphanumerics and underscores.", name); > } > if (strlen(Lvalue) >= MAXVOLLEN) { > errx(10, "bad %s. Length is longer than %d.", > _______________________________________________ > 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" > -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@freebsd.org Sat Jan 26 23:28:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9807814B29F3; Sat, 26 Jan 2019 23:28:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 0068D72476; Sat, 26 Jan 2019 23:28:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=52601 helo=[192.168.86.32]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnWcE-000GoJ-Jl; Sat, 26 Jan 2019 14:39:54 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343480 - head/lib/libfigpar From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> Date: Sat, 26 Jan 2019 15:28:22 -0800 Cc: rgrimes@freebsd.org, Stefan Esser , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <75F63D9C-0EF2-40EB-BDC6-A2ADFD3C3A89@freebsd.org> References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> To: Colin Percival Sender: devin@shxd.cx X-Rspamd-Queue-Id: 0068D72476 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.62 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(0.21)[ip: (0.59), ipnet: 64.201.240.0/20(0.30), asn: 36734(0.24), country: US(-0.08)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.93)[0.928,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.83)[0.826,0]; MX_GOOD(-0.01)[cached: mail.shxd.cx]; NEURAL_SPAM_LONG(0.97)[0.970,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[dteske@freebsd.org,devin@shxd.cx]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36734, ipnet:64.201.240.0/20, country:US]; FROM_NEQ_ENVFROM(0.00)[dteske@freebsd.org,devin@shxd.cx]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 23:28:25 -0000 > On 26 Jan 2019, at 1:59 PM, Colin Percival wrote: >=20 > On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >>> Author: se >>> Date: Sat Jan 26 21:30:26 2019 >>> New Revision: 343480 >>> URL: https://svnweb.freebsd.org/changeset/base/343480 >>>=20 >>> Log: >>> Silence Clang Scan warning about potentially unsafe use of strcpy. >>>=20 >>> While this is a false positive, the use of strdup() simplifies the code= . >>=20 >> Though that might be true, it also has to recalculate the >> length of the string which was already known by slen. >>=20 >> I am not sure how often this code is called, >> but that is wasted cycles in a library. >=20 > The length of the string was already being recalculated, by strcpy. >=20 > It seems to me that this could be written as >=20 > temp =3D malloc(slen + 1); > if (temp =3D=3D NULL) /* could not allocate memory */ > return (-1); > memcpy(temp, source, slen + 1); >=20 > which avoids both recalculating the string length and using strcpy? >=20 Thanks for fixing that. =E2=80=94=20 Cheers, Devin >>> Modified: head/lib/libfigpar/string_m.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >>> --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r34347= 9) >>> +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r34348= 0) >>> @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const ch= ar=20 >>>=20 >>> /* If replace is longer than find, we'll need to create a temp copy *= / >>> if (rlen > flen) { >>> - temp =3D malloc(slen + 1); >>> - if (errno !=3D 0) /* could not allocate memory */ >>> + temp =3D strdup(source); >>> + if (temp =3D=3D NULL) /* could not allocate memory */ >>> return (-1); >>> - strcpy(temp, source); >>> } else >>> temp =3D source;